Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
21 views5 pages

CCEE 222 - 2015 - 2016 - 2 - 2016 04 18 Exam 2

Uploaded by

clans2806
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views5 pages

CCEE 222 - 2015 - 2016 - 2 - 2016 04 18 Exam 2

Uploaded by

clans2806
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Rafik Hariri University

College of Engineering
Electrical And Computer engineering Department
CCEE 222 Computer Architecture

Exam 2

Monday, April 18th, 2016


Name ________________________________________

ID _________________________
Duration: 75 minutes.

Instructions:
 Check to insure that you have a
complete copy of the examination.
There are 4 Questions, and a total
of 5 pages. There should be no
blank pages in your set.
Question 1
30  This examination is open book and
open notes/slides. You should not
Question 2 access anything outside your
30 computer via internet or intranet.
 Questions are NOT allowed
Question 3 during the exam.
30
 No use of scratch paper is
Question 4 allowed. You should work your
30 Questions directly on the Question
statement sheet in the appropriate
Total Grade space only. You may use the
120 backside of the exam sheets as
appropriate.
 It is recommended that you read
the whole exam before attempting
any one Question.
 Include all steps and calculations
as appropriate for maximum
credit. Be clear, brief, and
specific in your answers.
Good Luck!
Question 1: (30 points)
Consider the following single cycle Datapath. Set the values of those control signals
to show how the following instructions are supported by the Datapath. Fill in the
values on the figure which are marked ? for the instruction slt $29, $22, $23. Add any
missing hardware connections/blocks.

MemtoReg
MemWrite

MemRead
RegWrite
RegDest

ALUSrc

ALUOp

PCSrc
Instruction

lw $29,-12($20)

addi $29, $30, 100

j 1996

bne $29,$28, 1996

or $29, $23, $22

Slt $29, $22, $23

CCEE 222 Computer Architecture – Exam 2 Spring 2015-2016 18-Apr-2016 2


Question 2: (30 points)
Consider the following section of code. Write in the table provided the actions taking
place at each cycle of a multicycle Datapath (5-step Datapath).

lw $t3, 4($t4)
add $t2, $t3, $t3
bne $t2, $t3, Label
add $t5, $t2, $t3
Label: ...

Instruction Step name Actions

CCEE 222 Computer Architecture – Exam 2 Spring 2015-2016 18-Apr-2016 3


Question 3: (30 points)
The following instruction is currently executing in the single-cycle datapath:
sw $29, 16($29)
The single-cycle datapath diagram below shows the execution of this instruction.
Several of the datapath values are filled in already. You are to provide values in
decimal for the twelve remaining signals in the diagram, which are marked with a ?
symbol. Assume register $29 initially contains the number 129. If a value cannot be
determined, mark it as ‘X’. Also write down below the figure the values for all 8
control signals.

CCEE 222 Computer Architecture – Exam 2 Spring 2015-2016 18-Apr-2016 4


Question 4: (30 points)
We would like to add the following instruction to the MIPS multi-cycle datapath:
ji $t1,$t2,imm, # PC $t2+$t1+imm
where the jump address is now the addition of $t1, $t2 and the immediate 16-bit
number “imm”. Fill in the correct signals to implement the ji instruction in the table
below. Implement any necessary changes to the hardware in the figure below. Assume
ALUOp = 100 performs an integer subtraction, and 010 performs an addition.

Control Cycle
Signal 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
PCwrite

IorD

MemRead

MemWrite

IRWrite

RegDst

MemToReg

RegWrite

ALUSrcA

ALUSrcB

ALUOp

PCSrc

CCEE 222 Computer Architecture – Exam 2 Spring 2015-2016 18-Apr-2016 5

You might also like