Computer Organization I, 2 ov, separate exam 17.8.2004

Write in each answer sheet: your name and signature, id-number, course name, and page nr/total nr of pages

There are 60 points available from the exam.

Please try to keep your answers relatively short.

  1. [15 p] Execution of machine instructions.
    1. [3 p] How is the machine instruction  "ADD  R5, T(R1)" represented in the memory?
    2. [6 p] What happens on the processor during the execution of the instruction "ADD  R5, T(R1)" during different phases of the cycle?
    3. [3 p] Define the term interrupt. What are the different kinds of interrupts? How are the interrupts handled on the processor?
    4. [3 p] What interrupts can happen during the execution of the instruction "ADD  R5, T(R1)" ?

  2.  
  3. [15 p] Integer representation and the error-correction.
    1. [2 p] What is the binary representation of integer 47?
    2. [4p] What is a sign-magnitude representation? What are the disadvantages of this representation?
    3. [4 p] What intergers are represented by binary values 00010101 and 10001010, when you use
      1. sign-magnitude representation
      2. twos complement representation
    4. [5p] let us assume, that we want to store 8 data bits 11000010 and to protect it against errors using Hamming code.
      1. [2 p] How many extra (parity) bits are needed? Where are they located and what are their values? Please give the full binary sequence with the parity bits.
      2. [3 p] How can the Hamming code correct an error where the data bits have changed to 11001010 and none of the parity bits have changed?

  4.  
  5. [15 p] Define the following terms
    1. [3 p] process control block
    2. [3 p] linking
    3. [3 p] supervisor state
    4. [3 p] symbolic table
    5. [3 p] Java virtual machine (JVM)

     
  6. [15p] TTK-91: Subroutines.
    1. [2 p] Define in TKK symbolic language the variables Weight and Height so that the initial value of Height will be 150 and the initial value of Weight 55.
    2. [6 p] Write a procedure Increment (X,A), which adds the value of A to the value of X and stores this new value to X. Please follow the guidelines given at the course about the parameter passing. The parameter X is a reference parameter and A is a value parameter.
    3. [5 p] Give the sequence of TKK-91 assembly language instructions, which increments the value of Weight by 20 using the procedure Increment. Print this new value of Weight. Then increment the value of Height by the value of Weight using the same procedure.
    4. [2 p] Please, draw the stack of activation records (or stack frames) before the procedure call and after the call during the procedure execution.

TTK-91 assembly language instructions are: NOP, STORE, LOAD, IN, OUT, ADD, SUB, MUL, DIV, MOD, AND, OR, XOR, SHL, SHR, NOT, COMP, JUMP, JNEG, JZER, JPOS, JNNEG, JNZER, JNPOS, JLES, JEQU, JGRE, JNLES, JNEQU, JNGRE, CALL, EXIT, PUSH, POP, PUSHR, POPR, SVC, IRET