Toisella puolella suomeksi
581305-6 Computer Organization I, 4 cr, final exam 2.2.2007
Write in each answer sheat your name and signature, (student) id number, course name, and page nr.
- [9 p] Data representation
- Name four different bit-level integer representations. Give 8-bit number -5 in each of them.
- How are floating point falues stored in computer? What is the IEEE floating point standard? How is 1.0 represented in 32-bit IEEE floating point standard?
- What does the concept "Little Endian" representation mean? When does it matter? Give a concrete 32-bit example.
- [9 p] Process.
- What is process? How is it represented in operating system?
- Draw a state diagram of the five execution time states of a process. Tell the names of the states. Draw and explain state transitions between these states.
- Give two (2) esentially different cases, where process P transits from one "in execution" state to another. Especially mention, who (which process) caused the transition and what happens in the system at each transition?
- [9 p] Java
- Why is the usual representation of Java programs Java bytecode, and not the Java high level language?
- How is Java byte code executed by interpretation?
- How is Java byte code executed with compilation? How does the execution differ from the previous case?
- How is Java byte code executed with Java processors? How does the execution differ from the previous cases?
- How is Java byte code executed with JIT-compilation?
How does the execution differ from the previous cases?
- [9 p] Arrays and subroutines. Array TW[3,5] is a 2-dimensional integer-valued array, that contains 3 rows (rows 0-2) and 5 columns (columns 0-4). Integer valued variables i and j have been defined at the main program level. For now, assume that TW is stored in the normal row-wise order.
Assume also, that we have already defined and implemented subroutine MinMax( T, n, m, min, max), which will return the minimum and maximum values of input array T[n,m] in output parameters min and max. Parameter array T has n rows and m columns. Parameters n and m are call-by-value parameters and all the rest are call-by-reference parameters. Please note that you do not need to implement subroutine MinMax, because it is given.
- Give ttk-91 symbolic assembly language instructions that will print the value of array element TW[i,j].
- Assume now, that array TW is stored column-wise. Give ttk-91 symbolic assembly language instructions that will print the value of array element TW[i,j].
- Give ttk-91 symbolic assembly language instructions that will use subroutine MinMax to locate and print the smallest and largest values in array TW.
Follow the recommended subroutine (function) call mechanism.
TTK-91 assembly language instructions are:
NOP, STORE, LOAD, IN, OUT,
ADD, SUB, MUL, DIV, MOD,
AND, IR, XOR, SHL, SHR, COMP,
JUMP,
JNEG, JZER, JPOS, JNNEG, JNZER, JNPOS,
JLES, JEQU, JGRE, JNLES, JNEQU, JNGRE,
CALL, EXIT, PUSH, POP, PUSHR, POPR,
SVC