MIME-Version: 1.0 Content-Location: file:///C:/B133AB16/HW6.htm Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="us-ascii"
EE3755  = ; = = Homework 6= Due= : TBA=
///
Estimated
time to finish:
Prob.1
: 10Mins.
Prob.2
: 10Mins.
Prob.3:
30Mins.
Total 50 Mins.
Read below and answer problem 1.
Pipe L= ined Machine.
Similar to Fig 5.42(Class Notes : MIPS DATA PATH DESIGN HTML Notes) (but every instruction has same number of state.
Execut= ion of each state takes same clock cycle (1 clock cycle).
For example: MIPS.
Every instruction has = these five states.
IF ID EX MEM&nbs= p; WB.(refer to the class note for the functionality)
The beauty of this machine is overl= apping of execution of instructions.
For Example.
And $1,$2,$3
Or= $4,$5,$6
Add $7,$8,$9
Sub $10,$11,$12.
Case1) if every instru= ction takes 5ns.
= It needs 4(instructions)* 5(ns)(=3D20ns= span>) to finish above 4 instructions without overlapping of execut= ions.
=
Case2) if each stage t= akes 1ns then every instruction still takes 5 ns(5 st= ages for each instruction) to finish.
= But the overall time to finish those 4 instructions is shorter than = case 1.
= &nb= sp;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
and |
|
|
|
|
|
|
|
|
|
|
|
|
or |
|
|
|
|
|
|
|
|
|
|
|
|
add |
|
|
|
|
|
|
|
|
|
|
|
|
sub |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(Case 2. althoug= h each instruction takes 5ns, overall execution time is only 8 ns.)<= /span>
Problem 1.<= /b> Because of some difficulties, not every instruction can be overlapped just like above.
= But let’s assume we = can overlap every instruction.
1-1.
How much time will it take to finish 1 million instructions at=
case
1( without overlapping).(simple math.).
1-2.
How much time wi=
ll it
take to finish 1 million instructions at case 2( with overlapping)
(Hint: a little bi=
t longer
than 1millon ns)
Pro=
blem 2. Answer the questions wit=
hout
looking anything.(you may look after answer thes=
e and
correct the answers)
For MIPS instructions.
0x400000 =
add r1,r2,r3=
=
=
span> addi r1, r2,0x20
=
<=
/span> beq
r0,r0, LOOP
2-1)Write Machine code for the first 2
instructions(add r1,r2,r3).
(Hexadecimal form=
at)
Hint :
opcode for add is 0 and func field is 0x20.
opcode for addi is 8 and
think about rt and =
rs
fields.
2-2) when the third instruction is converted to machine cod=
e,
wh=
at
will be the value for “LOOP
Problem 3. Using MIPS simulator, Write this v=
ery
simple program.
MIPS program to print “EE3755”
and Exit from the program.(C=
opy
the text from the screen and submit with program)