in English Toisella puolella suomeksi

Computer Organization I, exam 1.2.2013   

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. [4 p] Name four different bit-level representations for integer numbers. Give a 32-bit representation for value -4 for each of them.
    2. [4 p] How are values 8.0 and 3,14159 26535 89793 23846 26433 83279 (pi) stored in memory? Give an example with value 8,0.
    3. [1 p] What danger is there when subtracting 0,444444 - 0.444443? Why would you want to avoid doing it?

  2. [9 p] Machine instruction execution.
    1. [3 p] Define the concept "instruction execution cycle".
      What are its phases and what happens in each phase?
    2. [3 p] What is priviledged instruction execution mode, why is it needed and how is it implemented in the instruction execution cycle?
      How is it entered and how does one resume normal instruction execution mode?
    3. [3 p] What are interrupts, why are they needed and how are they implemented in instruction execution cycle?
      How does one resume execution of the interrupted program once the interrupt is handled?
      Give three examples on inherently different types of interrupts and explain what they mean?
       
  3. [9 p] I/O implementation.
    1. [3 p] Which three methods can be used to implement I/O and how do the I/O devices involved differ from each other?
    2. [3 p] What advantages/disadvantages do I/O implementation methods have as compared to each other?
    3. [3 p] Which method is usually used with disk I/O and why?
       
  4. [9 p] Titokone, TitoTrainer and ttk-91. Subroutine Minmax(T, n, min, max) returns in output parameters min and max the values of smallest and largest elements in n-element array T. Parameter n is a call-by-value parameter and the other parameters are a call-by-reference parameters. Variables minA and maxA have been defined at main program level, as well as a 300 element array Age.
    1. Use the symbolic ttk-91 assembly language (with a call to subroutine Minmax) to assign variables minA and maxA with the smallest and largest values in Age.
    2. Use the symbolic ttk-91 assembly language to implement subroutine Minmax.
       
    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