581305-6 Computer Organization I, 2 cu, exam 12.5.2000          (toisella puolella suomeksi in English)

  1. [12 p] Prosess and processor
    1. [8 p] What is a process and how is a process represented in the system? What are execution time states for a process? When and how does this state change? Handle each state change separately.
    2. [4 p] What are execution time states for a processor? How and when does this state change? Handle each state change separately.

  2. [12 p] Memory hierarchy
    1. [6 p] Data referenced in machine instructions can be physically located in many memory hierachy levels (physical device or system). Give four examples of different speeds. What are these speeds roughly? For each level, give an example where data on that level is referenced.
    2. [3 p] Which of the memory hierarchy levels above are used by virtual memory? How is virtual memory implemented with these levels?
    3. [3 p] Compare the address translation buffer (TLB) to the memory hierarchy levels above. On which level does TLB belong and why?

  3. [12 p] Data representation.
    1. [4 p] How does the system know whether some memory location contains an integer number, floating point number or a machine instruction? What happens, if during an integer add instruction one encounters a floating point value in one of the argument registers?
    2. [4 p] Assume that the processor has no representation for truth values (boolean), I.e., it has no machine instructions using boolean data types. However, Java language has a boolean data type with domain {true, false}, and it is especially stated that Java's boolean is not Java's integer and Java's integer is not Java's boolean. Can this processor be used to execute Java programs? If the answer is yes, then how? If the answer is no, then why not?
    3. [4 p] Assume that Hamming code (even parity) is used to secure 8-bit internal data path. How many parity bits are needed (in addition to 8 data bits) for error correcting Hamming code? Give an example for parity bit locations and their values when one transfers 8-bit byte 0111 0101 ('u'). What would happen in the system, if the 4th bit from left in this byte would flip on the way and the byte would arrive as 0110 0101 ('e')?

  4. [12 p] Use ttk-91 symbolic assembly language to implement function MaxInd(Arr, N) which returns the index for the largest element in N-element array Arr. For example, if array T[0..4] has values {7, 3, 24, 5, 9}, then MaxInd(T, 5) returns index value 2. Use the customary subroutine (function) implementation and call mechanism.

  5. [12 p] Assume that the ttk-91 subroutine return instruction (EXIT) has somehow got "broken", and one can not use it any more. (For example, there is a bug in the microchip circuitry and the bug causes sometimes serious problems in the system.)

    However, we still want to be able to use subroutines. We need a ttk-91 symbolic machine langugage code sequence that does the same things functionally as symbolic machine language instruction "EXIT SP, =2".

    1. [4 p] Describe verbally everything that this code sequence would do.
    2. [4 p] Easier implementation: give the above mentioned code sequence and use indirect addressing mode to jump to the return address stored in the activation record stack.
    3. [4 p] Only a little bit more difficult implementation: give the above mentioned code sequence and use self-modifying code to jump to the return address stored in the activation record stack.


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, LEGU, JGRE, LNLES, LNEQU, NGRE, CALL, EXIT, PUSH, POP, PUSHR, POPR, SVC