Computer Organization I, exam 12.6.2015                 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.
The exam is also the renewal exam for course exam for the Spring 2015 guided self study course.
  1. [9 p] IEEE floating point representation
    1. [1 p] How does a floating point numbers differ from real numbers. Give numeric example.
    2. [2 p] What does floating point normalization mean? What advantage does it give? When can you not use it?
    3. [2 p] What is the hidden bit and what do you gain with it? How do you use it?
    4. [2 p] Assume that floating point variables X and Y have been calculated already.
      Why is it not sensible to continue with conditional statement "if (X==Y) then .... else ...."?
      How would you avoid the problem?
    5. [2 p] Give the 32-bit IEEE floating point standard Big-Endian representation for floating point value -10.0.

  2. [9 p] Machine instruction execution. For each part, give an example relating to instruction "ADD R1, T(R2)" execution.
    1. [3 p] What is privileged (supervisor) execution mode, what is it needed for, and how is it implemented in instruction fetch-execute cycle?
      How do you return to normal execution mode?
    2. [3 p] What are interrrupts, what are they needed for, and how are they implemented in instruction fetch-execute cycle?
    3. [3 p] How does the operating system handle the interrupts?
      How do you return to the interrupted program once the interrupt has been processed.

  3. [9 p] Process execution in system
    1. [3 p] How do you implement process switch at machine instruction level? Assume that (i) process P is in execution and now suspends to wait for some event, and (ii) process Q will now get its turn to execute.
    2. [3 p] Give an example on a situation where executing process (P) realizes that it can not execute any more. How does it tell that to the operating system (OS)? What happens now in the system?
    3. [3 p] Give an example on a situation where the OS decides that the process (P) currently in execution must suspend and the turn to execute must be given to some other process (Q). How can the OS decide anything when P is in execution? What happens now in the system?
     
  4. [9 p] Titokone, TitoTrainer and ttk-91. Function ElmSum (T, n, m) returns as its value the sum of all elements in 2-dimensional n x m array (matrix) T. So, array T has n rows and m columns, where n and m are call-by-value parameters and T is call-by-reference parameter.
    2-dimensional array Salary is defined at main program level, and it has 20 rows and 12 columns.
    Pointer variable pPoints is defined at main program level, and it points to a 2-dimensional array with p rows and q columns.
    Variables SalSum, p and q are defined at main program level.
    1. [3 p] Use the symbolic ttk-91 assembly language (by calling function ElmSum) to assign SalSum the sum of all elements in Salary.
    2. [2 p] Use the symbolic ttk-91 assembly language (by calling function ElmSum) to assign r3 the sum of all elements in the 2-dimensional (p rows and q columns) array pointed by pPoints.
    3. [4 p] Use the symbolic ttk-91 assembly language to implement function ElmSum().

      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