Problem Set B
1
.
Rosetta Code is an archive of computing tasks and source code written in many different languages that accomplish the same task. Explore the page about converting numbers into Roman numerals and study the source code written in 8080 assembly (low-level), C (middle-level), and JavaScript (high-level). Compare and contrast the following aspects of the code:
- Length
- Readability: how easy is it to understand how the code works?
- Level of abstraction
- Structured or unstructured
2
.
Research x86, ARM, and PowerPC architectures—specifically, how each of them has different assembly language features and syntax. Then research and explain how high-level languages can be compiled on different computer architectures.
3
.
Provide a real-life example of abstraction and explain how it is similar to abstraction in computing.
4
.
Research Java Abstract classes. After researching, provide a detailed usage of abstract classes and explain why abstraction is useful in software development.
5
.
Let a and b denote object modules or static libraries in the current directory, and let a->b denote that a depends on b, in the sense that b defines a symbol that is referenced by a. For each of the following scenarios, show the minimal command line (i.e., one with the least number of object file and library arguments) that will allow the static linker to resolve all symbol references:
p.o -> libx.a -> p.op.o -> libx.a -> liby.a and liby.a -> libx.ap.o -> libx.a -> liby.a -> libz.a and liby.a -> libx.a -> libz.a
6
.
Write a program that utilizes parallel computing, then has a safety-critical section of code that only allows one thread, and then the remainder of the program can use the same number of threads the first section used.