Sunteți pe pagina 1din 2

Utama Prillianto Putra 1006683255 Computer Organization and Architecture Homework Problem #1 Suppose we have a simple processor, single

bus, 4 general-purpose registers (R0 through R3) and of course other functional registers like IR, PC, as well as ALU with two inputs and one output latches (the same as we discussed in class). This processor has 2 basic instructionss: 1. 2. AR Ra,Rb; where a and b are the register numbers LDA Ra,M ; Load content of memory location M to Ra

If processors clock is 1 GHz (109 hertz), and memory cycle time is 30 nano second = (30. 10-9 second), please answer the following questions: a. How much is the CPI (clock per instructions) of instructions number 1 (AR)? b. How much is the CPI of instructions number 2 (LDA)? In answering the above mentioned questions, we assumed that in calculating the CPI, the fetch cycle is ignored, meaning we do not have to calculate the number of clocks to fetch an instructions from memory to IR. It is assumed that the instructions is already present in the IR. Answer #1 a. In point a, total CPI of add register operation between register a and register b (this two register had been instructionsed)are being questioned. Therefore, analyzation of processor micro-execution is a must. If fetch time in the processor are being ruled off, the processor are a single bus, and the time needed for construction in the processor are 1 nanosecond. Therefore, the total clock cycle that are needed in the processor for doing the microexecution are : Time (Clock Cycle) 1 1 1 1 Micro Execution Data Ra moved to ALU1 Data Rb moved to ALU2 ALU1 dand ALU2 being added Data ALU3 moved to Ra

[ALU1] Ra [ALU2] Rb ADD Ra [ALU3]

Clock cycle for execution 1 are 1+1+1+1 = 4 Clock Cycle And the total CPI are

Utama Prillianto Putra 1006683255 b. In point b, total CPI to move the data from memory M to register Ra are being questioned. Memory cycle rate that are slower than the processor can cause the processor to wait for the data can be transmitted by MAR. If fetch time in the processor are being ruled off, and the processor are a single bus. Therefore, the time CPI needed are : Time (Clock Cycle) 1 Micro Execution Program Control put the next instructionss from the memory M into the MAR (Memory Address Register) [MAR] PC 30 Memory data in the MAR are being read / accessed by MBR READ 1 Instructionss in the memory are being executioned by the processor Clock cycle for instructionss execution 1 are 1+30+1 = 32 Clock Cycle The the total CPI are :

Problem #2 A small program in assembly language consists of 10 instructionss, including the branch instructions for program loop. If this program is executed, the composition of the instructions mix could be seen in the table below : No 1 2 3 Instructions Type Memory reference Arithmetic Branch Total Clock/instructions 8 2 12 Percent of Execution 20 65 15 100

Calculate the CPI of this program

Answer #2 Average CPI : = [(8*20)+(2*65)+(12*15)]/100 = [160 +130 + 180]/100 = 470/100 = 4.7 cycle per instructions

S-ar putea să vă placă și