581305-6 Computer Organization I, 2 ov, final exam 26.1.2001     (toisella puolella suomeksi in English)

Write in each answer sheet: your name and signature, id-number, course name, and page nr/total nr of pages
  1. [15 p] Interrupts (trap, exception, ...)
    1. Give four different types of interrupts? Explain what is special in each type?
    2. How is an interrupt visible to the program in execution?
    3. How is an interrupt visible to the processor?
    4. How are interrupts processed?
    5. Why can one disable interrupts? Give an example.
    6. If an interrupt occurs when interrupts are disabled, how is such interrupt handled?

  2. [15 p] Data representation
    1. [5 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. [5 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. [5 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')?

  3. [15 p] Memory hierarchy
    1. Which problem does the cache memory solve? How is the solution implemented? How can application programmer best influence the proper operation of this solution? What do the words "hit" and "miss" mean in this context and what is the cost of a miss?
    2. Which problem does the virtual memory solve? How is the solution implemented? How can application programmer best influence the proper operation of this solution? What do the words "hit" and "miss" mean in this context and what is the cost of a miss?
    3. Which problem does the Translation Lookaside Buffer (TLB) solve? How is the solution implemented? How can application programmer best influence the proper operation of this solution? What do the words "hit" and "miss" mean in this context and what is the cost of a miss?

  4. [15 p] Assembly language programming
    We need an integer valued function int FindMin (var int Arr, int N). Function FindMin has two parameters: integer array Arr and the number of elements N in that array. Function returns the value of smallest element in array Arr. Parameter N is call-by-value and parameter Arr is call-by-reference. Function is implemented with customary subroutine (function) implementation and call mechanism.

    1. [6 p] Using ttk-91 symbolic assembly language implement the function FindMin described above.
    2. [5 p] Give ttk-91 symbolic assembly language instructions to print the value of smallest element in 35 element array Speed.
    3. [4 p] How should one modify function FindMin, if one would want it to return the address of the smallest element instead of its value?


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