Professional Documents
Culture Documents
SEMESTER 2 2019/2020
Question 1
Figure 1 shows a datapath for R-type instructions which consits of a register file and an
arithmetic logic unit (ALU). These instructions are also known as aritmetic-logical-
instructions since they perform aritmetic or logical operations.
The register file contains all the registers and provides two read ports and one write
port. The register file always provides the contents of the registers corresponding to the
read register inputs on the outputs, while the writes must be explicitly controlled with the
write control signal. The inputs carrying the register number to the register file are all 5
bits wide, whereas the lines carrying data values are 32 bits wide.
The operation to be performed by the ALU is controlled with the ALU operation signal
(ALU_OP), which will be 3 bits wide.
ALU_OP
REGISTERS
READ
REGISTER 1 READ ALU
A
READ DATA 1 RESULTS
INSTRUCTION REGISTER 2
WRITE
ALU
REGISTER READ ALU
B
WRITE DATA 2 FLAGS
DATA
WRITE
1
(a) Explain the function of the register file.
(b) Explain the function of the arithmetic logic unit (ALU).
(c) Determine the number of registers inside the register file.
(d) Determine the maximum number of operations can be performed by the ALU.
Question 2
a = b + c;
add a, b, c