in English 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.

  1. [9 p] Data representation
    1. Name four different bit-level integer representations. Give 8-bit representation for number -10 in each of them.
    2. 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?
    3. What do the data representation concepts "Little Endian" and "Big Endian" mean? Give a concrete 32-bit example with number 0x56789ABC (hexadecimal).

  2. [9 p] Process.
    1. What is process? How is it represented in operating system?
    2. 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.
    3. 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?

  3. [9 p] Java
    1. Why is the usual representation of Java programs Java bytecode, and not the Java high level language?
    2. How is Java byte code executed by interpretation?
    3. How is Java byte code executed with compilation? How does the execution differ from the previous case?
    4. How is Java byte code executed with Java processors? How does the execution differ from the previous cases?
    5. How is Java byte code executed with JIT-compilation? How does the execution differ from the previous cases?
       
  4. [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.
    1. Give ttk-91 symbolic assembly language instructions that will print the value of array element TW[2,j].
    2. 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].
    3. 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