Computer Organization I, 5 cr, exam 6.9.2016   suomeksiToisella puolella suomeksi  

Write in each answer sheat your name and signature, student id number, and course name.
It is sufficient to give 1-2 page answer to each question. This is an ordinary separate exam and covers the whole course. Exam grading is done only after 18.9.2016.
  1. [9 p] Data representation.
    1. [3 p] Give three different 16-bit representations in memory for integer -13. Name the representations and show how -13 is represented with them.
    2. [3 p] What is the IEEE 32-bit representation for floating points? How do you represent 32-bit IEEE floating point +2.5 in memory?
    3. [3 p] What do concepts Little Endian and Big Endian, mean relating to storing data in memory. When is one better than the other? Give a concrete 32-bit example with integer value 0x00000012.

  2. [9 p] Machine instruction execution.
    1. [4 p] When exactly are registers PC, IR, SR, MAR, R1 and R7 written new values during machine instruction execution?
    2. [5 p] Assume that an I/O interrupt occurs during the instruction execution. What could cause this interrupt? How is this observed at the processor? How does the operating system get control, and how does it handle the situation? What happens next? How and when does the interrupted process continue execution? Give a concrete machine language level example for the situation where interrupt occurs during the execution of instruction "DIV R1, X" at memory location 100, and in memory location 101 there is instruction "SUB R1, =300".

  3. [9 p] Program execution in system.
    1. [3 p] What is a process and what is its representation in the system? Why is it needed for, what data is included in it, and where is it stored?
    2. [3 p] How do you get a process from program P written in some high level language (e.g., Java or C)?
    3. [3 p] How is process switch implemented (from process P to process Q)? Give three different example situations where execution turn is switched from process P to process Q.
     
  4. [9 p]  Titokone, TitoTrainer and ttk-91. Function F(a, b, c) returns as its value the value for expression 4a-3b+c. For example, after the statement x = F(1,2,3) is executed, the variable x will have value 1. Parameters a and c are call-by-value parameters and parameter b is a call-by-reference parameter. Variables x and y have been defined at main program level.
    1. [3 p] Use the symbolic ttk-91 assembly language (with a call to function F) to implement statement x = F(x, y, y).
    2. [3 p] Use the symbolic ttk-91 assembly language (with a call to function F) to implement statement x = F(x+1, y-2, 2345678).
    3. [3 p] Use the symbolic ttk-91 assembly language to implement function F.
    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