Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

ECC 3201 COMPUTER ARCHITECTURE

SEMESTER 2 2019/2020

Question 1

Figure 1 shows a single-cycle datapath which combines R-type instruction datapath and
memory instruction datapath. This datapath executes instructions in a single clock
cycle.

(a) What is a memory instruction?

(b) List two examples of a memory instruction.

(c) Explain why the second input of ADD 1 is fixed to a decimal number with a value
of 4?

(d) Explain the function of the DATA MEMORY.

Question 2

(a) Consider a segment of a C program which contained three variables, a, b and c.

a = b + c;

The C compiler may assign the variables, a, b and c to the registers $9, $10 and
$11 respectivley. Explain how this C program is executed in this datapath starting
from the INSTRUCTION MEMORY block. Show the flow of instruction / data in
the datapath.

(b) Consider a MIPS assembly language load word, lw $1, 100($2) which moves
data from the memory to a register. Show the execution of this assembly
language in the datapath starting from the INSTRUCTION MEMORY block.
Show the flow of instruction / data in the datapath.

1
MUX
ADD ADD 2
1 2

REGISTERS DATA MEMORY


INSTRUCTION READ READ
REGISTER 1 READ ALU ADDRESS
MEMORY A
READ DATA 1 RESULTS
READ REGISTER 2 WRITE READ
PC
ADDRESS INSTRUCTION WRITE
ALU ADDRESS DATA
READ
REGISTER DATA 2 ALU MUX
B
WRITE MUX FLAGS WRITE 3
DATA 1 DATA

Figure 1: A single-cycle datapath

You might also like