Computer Organization I, exam 4.4.2014   

Write in each answer sheat your name and signature, student id number, course name and page nr.
It is sufficient to give 1-2 page answer to each question.
  1. [9 p] Data representation.
    1. [3 p] Give three different 8-bit representations in memory for integer -11. Name the representations and show how -11 is given with them.
    2. [4 p] How are floating point values represented in memory? What is the normalized 32-bit representation for floating points? How do you represent floating point 4.0 in memory?.
    3. [1 p] What do concepts "Little Endian" and "Big Endian", relating to storing data in memory. When do they matter?
      Give a concrete 32-bit example with integer value 0x1122AABB.

  2. [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 and what data is included in it?
    2. [3 p] When and how do you create processes in the system? When and how are they removed from the system? As an example, use program P written in some high level language (e.g., Java or C).
    3. [3 p] What is the processor context? Why is it needed for and what data is included in it? What is a process switch and how is it implemented at machine language level?

     
  3. [9 p] Jave
    1. [1 p] what is Java virtual machine (Java Vm, JVM)?
    2. [2 p] P is a small program written in Java. How do you execute P with interpretation? What is P's representation at execution time, and how was that representation obtained? When and why would interpretation be better that the three other ways of execution?
    3. [2 p] P is a small program written in Java. How do you execute P with compilation? What is P's representation at execution time, and how was that representation obtained? When and why would compilation be better that the three other ways of execution?
    4. [2 p] P is a small program written in Java. How do you execute P with JIT-compilation? What is P's representation at execution time, and how was that representation obtained? When and why would JIT-compilation be better that the three other ways of execution?
    5. [2 p] P is a small program written in Java. How do you execute P with Java-processor? What is P's representation at execution time, and how was that representation obtained? When and why would Java-processor be better that the three other ways of execution?
       
  4. [9 p] Titokone, TitoTrainer and ttk-91. Integer function ffunny(x, y, z) returns as its value the value for expression y+z/x. x and y are call-by-value parameters and z is a call-by-reference parameter. Integer variables a, b and c have been defined at main program level.
    1. Implement (using symbolic ttk-91 assembly language), with a call to function ffunny, the statement a = ffunny(123, b, c)
    2. Implement, with a call to function ffunny, the statement a = ffunny(a+1, 5554444, a+1)
    3. Implement integer function ffunny(x, y, z).
      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