You are on page 1of 3

Nama: Limas Baginta

NPM: 1306368690
Jurusan: Teknik Komputer
HW 01 Organisasi Arsitektur Komputer
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 have discussed in class). This
processor has 3 basic instructions:
1.
2.
3.

AR
Ra,Rb
ADD N,Ra
MOV Ra,Rb

[Ra] + [Rb] result in Ra; a and b are register numbers


ADD content of Ra to content of memory location N, result in N

move content of Rb to Ra, result in Ra

If processors clock is 2 GHz (2x109 hertz), and memory cycle time is 20 nano second
= (20. 10-9 second), please answer the following questions:
a. How much is the CPI (clock per instruction) of instruction number 1 (AR)?
b. How much is the CPI of instruction number 2 (ADD)?
c. And how much is the CPI of instruction number 3?
d. Finally, what is the average CPI of all these 4 instructions?
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 instruction. It is assumed that the instruction is already present in the IR.
Problem #2
A small program in assembly language consists of 10 instructions, including the branch
instruction for program loop. If this program is executed, the composition of the
instruction mix could be seen in the table below :
No
1
2
3

Instruction Type
Memory reference
Arithmetic
Branch
Total

Clock/instruction
6
2
10

Percent of Execution
20
60
20
100

a. Calculate the CPI of this program


b. If 20 % of the above mentioned program could be run in parallel, calculate the speed
up if we use 4 (four) processors.

Answer:
1.
Jawaban bagian a.
AR Ra, Rb
ALU1 [Ra]
ALU2 [Rb]
ADD
Ra
[ALU3]
Maka total CPI : 3 CPI
Jawaban bagian b.
ADD N, Ra
MAR [add. Op. N]
READ
WAIT
ALU2 [MBR]
ALU1 [Ra]
ADD
[M]
[ALU3]

Maka total CPI : 46 CPI


Jawaban bagian c.
MOV Ra,Rb
MBR [Rb]
MAR [Ra]
WRITE

Maka total CPI : 3 CPI


Jawaban bagian a.
Maka didapat rata-rata CPI :
CPI = (602)+(1846)+(123) /100= = 984100 = 9.84

2.

Perhitungan CPI untuk program ini :


CPI = (620)+(260)+(1020) / 100 = 440100=4.4
Untuk Amdahl Law :
Speedup
= ((T(1-f)+Tf)/(T(1-f)+Tf/N))
=((1)/((1-f)+f/N))
=((1)/((1-0.2)+0.2/8))
=1.212

You might also like