in English Toisella puolella suomeksi

Computer Organization I, course exam 1.3.2007   

Write in each answer sheat your name and signature, (student) id number, course name, and page nr.

  1. [6 p] Integer value -13 is in memory in byte address 200. Give bit-level presentation for it, when it is stored as
    1. 32-bit (4 bytes) Big Endian signed integer
    2. 32-bit (4 byte) Big Endian twos complement integer (normal representation in ttk-91)
    3. 8-bit (1 byte) Big Endian biased with 127
    4. 32-bit (4 bytes) Little Endian signed integer
    5. Write an algorithm (with ttk-91 symbolic assembly language, or with some high level algorithmic language), that will change a 32-bit Big Endian twos complement integer in register R1 into a 32-bit Big Endian signed integer representation. You may assume the value to be in range [-1000000, 1000000].
      Note
      : do this part of the problem only at the end if you have time.
    Make very clear each bit and byte contents in memory.
     
  2. [6 p] Machine instruction representation and execution. The next instruction to execute is "MUL R0, T(R1)" in memory location 200, the operation code for MUL-operation is decimal 19, array T is stored in memory starting at address 500, register R0 has value 33 and register R1 has value 55.
    1. What is the instruction structure of ttk-91 and what information is stored in each field? Give the representation of instruction "MUL R0, T(R1)" in memory. Give the lengths and contents (in decimal) of each field.
    2. What happens in the processor at various instruction execution cycle phases when instruction "MUL R0, T(R1)" is executed? How many memory references occur, when do they occur, what memory address they refer to, and are they memory read or write operations?
       
  3. [6 p] Exceptions (interrupt) and processes. Process P is in execution and the instruction to execute is "MUL R0, T(R1)".
    1. What is an exception and how are they implemented at machine instruction execution cycle level?
    2. What exception may cause process P to be transferred to "exit or killed" state after the execution of this instruction? Who caused that exception and what happens in the system next?
    3. What exception may cause process P to be transferred to "ready" (ready-to-run) state after the execution of this instruction? Who caused that exception and what happens in the system next?
       
  4. [6 p] Titokone, TitoTrainer and ttk-91. Using the ttk-91 symbolic assembly language, implement
    1. Integer function ffunny(x,y,z), that returns the value of expression x*y+z/x. All parameters (x, y, and z) are call-by-reference.
    2. The code to compute and print the value of expression 5+ffunny(a, 8, b+c). Function ffunny() is defined above and the value of expression (a*8 + (b+c)/a) must be computed by invoking this function. variables a, b and c are defined at main program level.

    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