58123-3 Computer Systems Organisation (Open University) Exam 27.8.1999 1. Answer shortly the following questions. a) What is a cache? Why is it used? Where is it used? (3 p) b) What is a semaphore used for? What connection does the semaphore have to processes? Give an example of the use of the semaphore. (3 p) c) For what purpose is a compiler used? How and for what purposes do compilers use the symbol table? (2 p) d) For what purpose is a device controller used? What tasks has a device driver? (2 p) e) What factors make RISC machines fast and effective? (3 p) 2. In memory and especially in data transfer there will be errors and the stored or transferred data can become corrupted. What different means are used to certain the correctness of data? The decimal number 113, when moved to a peripheral device, is changed to number 81 because of transfer error disturbance. Show how the sender and the receiver should behave in order that the receiver could detect the received number as corrupted. Is it possible that the receiver could even correct the received number? (7 p) 3. Explain in processor and register level detail how the CPU of the TTK-91, the example machine used in the course, acts when running the following series of instructions (10 p): .... ADD R1, 200 JUMP 100 .... 100 SVC SP,=11 ; service request HALT 4. The life cycle of a process can be described by a state transition graph. Draw the state transition graph of the process. Explain the meaning of the different states and state transitions, that is when a process is in which state and what makes the process to move from one state to another. How are the data related to a process saved especially when the process is not running? (10 p) 5. Write, using the TTK-91 assembly language, a function Pow(X, n) that calculates the value of X^n (X to the power n). Use stack to pass the parameters and the return value. Write also a main program that calls the subprogram Pow and prints out the value returned by the subprogram. The main program reads the values of X and n from the keyboard and checks that the exponent n is positive. Draw the content of the stack just after the subprogram call and before the subprogram has started to execute its first instruction. (10 p) The results of the course will be ready by 15.9.1999. The course home page will give more information how the checking of the exam is progressing. The results, using shortened names of the participants, will also be shown in the course page.