in English Toisella puolella suomeksi

Computer Organization I, exam 3.5.2010   

Write in each answer sheat your name and signature, student id number, course name and page nr. It is sufficient to give approximately one page answer to each question.
  1. [10 p] Data representation
    1. [6 p] A byte has bit contents 1111 0000. What is the integer value of this byte if integer representation is
      1. signed
      2. two's complement
      3. biased by 127 (Note that 127=27-1)
    2. [4 p] Four-byte word has bit-contents 0x40900000. What is the decimal value of this word, if it is interpreted as a 32-bit IEEE floating point number?
       
  2. [10 p] Machine instruction execution.
    1. [6 p] Define the concept "instruction execution cycle". What are its phases and what happens in each phase? Give a concrete example for machine instruction "ADD R4, 4(R1)" .
    2. [4 p] Assume that some error happens during the instruction execution. How is this observed? How does the operating system get control, and how does it handle the situation? What happens next? Give a concrete example for machine instruction "ADD R4, 4(R1)" when the addition result is too large for register R4.


  3. [10 p] Java, JVM, byte code
    1. [1 p] What kinds of registers does JVM have and how are they referenced to in byte code?
    2. [3 p] How is Java byte code executed by interpretation?
    3. [3 p] How is Java byte code executed with JIT-compilation? How does the execution differ from the previous cases?
    4. [3 p] Which Java program execution method (interpetation, compilation, JIT-compilation, Java-processor) does the Titokone execution of ttk-91 programs mostly relate to? Why? Why not the others?
       
  4. [10 p]  Ttk-91, Titokone and TitoTrainer. Subroutine SmaLrg(T, n, small, large) returns the smallest and largest values in given n-element array T in output parameters small and large. T, small and large are call-by-reference parameters and n is a call-by-value parameter.
    1. [5 p] Use symbolic ttk-91 assembly language to implement subroutine call SmaLrg(Salar, 300, min, max), where Salar in a 300-element array defined at main program level and min and max are variables defined at main program level.
    2. [5 p] Use symbolic ttk-91 assembly language to implement subroutine SmaLrg().
    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