-
(a)The area of a specific object is calculated by . Assume that the input values for L and W are stored in memory locations 60 and 61 respectively.
(i)Write a program in LMC assembly code that will accept inputs and compute A. [4 marks]
(ii)When the code in (i) is loaded into a 10 by 10 main memory, sketch and fill only the content of the used memory. [3 marks]
(iii)At the end of each fetch-decode-execution cycle of the code, write the content of PC, AC, IR and AR respectively for the first 15 cycles. [Assume inputs are L = 2, W = 3.] [3 marks]
(b)Evaluate in:
(i)3-address instructions [2 marks]
(ii)2-address instructions [2 marks]
(iii)1-address instructions [2 marks]
(iv)Sketch and explain the two main operations of a stack. [4 marks]
(c)A processor has a 6-stage pipeline (FI, DI, CO, FO, EI, WO), each stage taking 1 cycle. For a program with 12 sequential instructions, calculate the total cycles required for:
(i)Non-pipelined execution [2 marks]
(ii)6-stage pipelined execution [2 marks]
(iii)Sketch the timing diagram for the pipelined case. [2 marks]
(iv)A telecom company advertised a "mega bonus" data plan to your dad. After subscribing to the usual 10GB plan, all his data balance is 10,124 MB. Analyse the claim and offer advice accordingly. [4 marks]
-
(i)Machine X and machine Y execute a given program in 1 minute and 43 seconds respectively. Which of the machines has a better performance, and by how many times faster? [5 marks]
(ii)Time can be defined in different ways depending on what is being measured. Explain three of these time measurements. [5 marks]
(iii)Compute the CPU time of a program with instruction count running on a machine of 5 CPI and clock cycle time of 5 ns. [5 marks]
(iv)With the aid of a diagram, explain any 5 addressing modes. [5 marks]
-
(i)Explain the stored-program concept in the context of von Neumann Architecture. [5 marks]
(ii)Sketch a well labelled diagram of von Neumann Architecture showing all special purpose registers and other components. [5 marks]
(iii)Explain the function of each component and each special purpose register of von Neumann Architecture. [10 marks]
-
(i)Explain the relationship between size, speed and cost using the memory hierarchy. [5 marks]
(ii)Differentiate between Processor and CPU, and cite examples. [5 marks]
(iii)Explain the operations that take place while using two-level memory. [5 marks]
(iv)State and explain the main requirements placed on a processor. [5 marks]
-
(a)Explain in order the four steps in a fetch-decode-execution cycle. [5 marks]
(b)(i)Write an LMC program to calculate P = L + W + H. The program must read the three values, store L in address 50, W in 51, and H in 52, then compute and output P. [5 marks]
(ii)Show the memory layout in a 10×10 grid when the program is loaded in the RAM. [5 marks]
(iii)Trace the program's execution with the inputs 10, 15, and 20. List the contents of the PC, AC, IR, and AR after each step. [5 marks]

