Toisella puolella suomeksi
581305-6 Computer Organization I, 4 cr, final exam 6.11.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 representation for number -10 in each of them.
- How are floating point falues stored in computer? What is the IEEE floating point standard? How is 0.5 represented in 32-bit IEEE floating point standard?
- What do the data representation concepts "Little Endian" and "Big Endian" mean? Give a concrete 32-bit example with number 0x56789ABC (hexadecimal).
- [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 a practical example, where process P transits from "in execution" state to another. Especially mention, what event caused the transition and what happens in the system at register level because of this event?
- [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[5,3] is a 2-dimensional integer-valued array, that contains 5 rows (rows 0-4) and 3 columns (columns 0-2). 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[2,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[2,j].
- Give ttk-91 symbolic assembly language instructions that will use subroutine MinMax to locate and print the smallest value 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