Computer Organization I, 2 ov, course exam 11.5.2004
Write in each answer sheet: your name and signature, id-number, course
name, and page nr/total nr of pages
There are 46 points available from the exam. (The maximum points from
the exercise activity was 12 and total of 5 points were given based on
the before-exercises-returned questions.)
Please try to keep your answers relatively short.
- [12p] Execution of machine instruction and the structure of the computer
- [4 p] What are the different phases of the execution cycle?
- [1 p] How can the processor know, which machine instruction
to execute next?
- [3 p] Define the concept interrupt (exception). What types of interrupts
are there? How are interrupts handled in the processor?
- [4 p] What happens in the computer systen from the moment
when program P, while being executed by the processor, wants to save a
some data to a disk, up to the moment when P continues its execution
after the I/O is finished? Please identify the I/O model used in your
answer.
- [12p] Location of the data
Please describe all locations, from where the machine instruction can fetch
the data it needs. Give examples (one per location) using ttk-91 assembler
language instructions that refer to the specific locations.
Explain also briefly in which phase the reference is done and how the
data is found based on the information in the instruction.
What are the speed differences roughly?
(NOTICE: Omit the cache in your consideration, although it is quite
often the
location of the accessed data.)
- [10 p] Hamming code
Let us assume that there is a need to store 4 data bits 1011 (0xB)
to the memory. The data bits will be protected using Hamming code with
even parity.
- [2 p] How many parity (check) bits do you need to protect
the 4 data bits?
- [4 p] Create the Hamming coded bit sequence to store the 4 data bits.
- [2 p] What would happen in the system, when the third bit of
the Hamming-coded sequence flips and is, thus, changed.
Bits are counted from right to left.
Can you detect this error in the coded sequence? Can you fix it?
Why and how? Give all necessary details.
- [2 p] What would happen in the system, when both the second and third bit of
the Hamming-coded sequence flips and is, thus, changed.
Bits are counted from right to left.
Can you detect this error in the coded sequence? Can you fix it?
Why and how? Give all necessary details.
- [12p] Subprograms, functions
- [2 p] How are subroutines implemented at machine language
level? What aspects are important in subroutine implementation?
- [2 p] What are the differences at machine language level in
the usage of call-by-value parameters compared with call-by-reference parameters?
- [4 p] Function Apua(A, B, C) returns as its value the result
of A*B+C. The parameters are all call-by-value parameters. Give in
ttk-91 symbolic assembly language a program, that (i) reads three
interger values, (ii) computes the secret apua-value using the
function Apua, and (iii) finally prints out the average.
- [4 p] Implement the function Apua(A, B, C) given in part
(c) with ttk-91 symbolic assembly language.
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