in English Toisella puolella suomeksi

Computer Organization I, course exam 27.4.2009   

Write in each answer sheat your name and signature, student id number, course name, and page nr.
  1. [9 p] Executing machine instructions
    1. When and how does the control change to an interrupt handler in practice? Give a machine language level example.
    2. When and how does the control return from interrupt handler to the program that was interrupted? Give a machine language level example.
    3. What does the concept privileged execution mode mean? Why do you need it?
    4. When and how is the execution mode changed from user mode to privileged mode? When and how is the execution mode changed from privileged mode to user mode? Give machine language level examples.

  2.  
  3. [9 p] Data presentation and error correction. Integer -5 is stored into byte address 0x1230. Floating point 4.5 is stored into byte address 0x1234.
    1. What is the contents of bytes 0x1230-0x1233 when data representation for -5 is 32-bit Big-Endian two's complement?
    2. What is the contents of bytes 0x1230-0x1233 when data representation for -5 is 32-bit Little-Endian two's complement?
    3. What is the contents of bytes 0x1230-0x1233 when data representation for 4.5 is 32-bit Big-Endian IEEE floating point standard?
    4. Show how error correcting Hamming code detects and corrects the one-bit error in 7-bit data item "001 0100". The data item has 4 bits actual data and 3 parity bits. Bits are numbered from right to left and parity bits follow even parity. Which bit was wrong and how was it corrected?
       
  4. [9 p] Program execution
    1. What is a process and what is its representation in the system?
    2. What happens in the system at machine language level during a process switch. Use the example case, where executing process P needs to wait for I/O to complete and process Q will be executed next.
    3. When and how will the process P in previous case (b) get to execute again? How do you quarantee that P's execution will resume at exactly the correct position and that P's execution environment is exactly the same as it was when P's execution was suspended earlier?
       
  5. [9 p] Titokone, TitoTrainer and ttk-91. Function F(a, b, c) returns as its value the value for expression 7a+5b-324c+321. For example, after executing the statement x = F(1,2,0) variable x will have value 338. Parameters a and c are call-by-value parameters and parameter b is a call-by-reference parameter. Variables x, y and z have been defined at main program level. 10-element array T and variable i have been defined at main program level.
    1. Use the symbolic ttk-91 assembly language (with a call to function F) to implement statement X = F(x, y, 20)
    2. Use the symbolic ttk-91 assembly language to implement function F.
    3. Use the symbolic ttk-91 assembly language to print the value and the address of array T element T[i]. You may assume that i's value in in range 0-9.

    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