Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In this experiment, students have to modify the design of their pipelined processor implementation in experiment 9 to implement branch - if - greater -
In this experiment, students have to modify the design of their pipelined processor implementation in experiment to implement branchifgreaterthanorequal bge and loadupperimmediate lui instructions. Afterwards, you need to test your updated design using the program given in Table
For the implementation of the bge instruction, the instruction assembly is: bge rs rs immediate and the machine code is as follows:
imm imm: rs rs Funct imm: imm Opcode
The bge instruction is executed as follows:
if rsrs
PC target address PC of bge signextendimm
else
PC PC
For the implementation of the lui instruction, the instruction assembly is: lui rd immediate and the machine code is as follows:
imm: rd Opcode
The lui instruction is executed as follows:
rdimm:b
Take into consideration the following hints:
Similar to the beq instruction, the bge instruction should be resolved in the ID stage. Hence, if the bge instruction is taken then the instruction in the IF stage must be flushed.
Similar to the Rtype and Itype instructions, the result of lui instruction can be forwarded from the MEM or the WB stage. The tables below show examples of these cases:
Clock Cycle
LUI X
F D E M
W
ADD X X X
F D E M W
Clock Cycle
LUI X
F D E M W
ADD X X X F D E M W
ADDI X X
F D E M W
Unlike previous experiments, this is not a guided experiment, ie students are free to make decisions on how to modify all modules in their processor. However, you are not allowed to remove any of the old instructions or start a new implementation from scratch. Students are expected to extend their processor implementation in the lab. In addition, you are free to choose between structural or behavioral modeling for your modifications.
Step: In Table describe the changes you did for each file if any Note that there are some files where modifications are not needed.
Table : Verilog files
File Modified yesno Changes Description
Libraryv no
Exp FA and MUXv
Exp ALUs.v
Exp REG and MUXv no
Exp Decoders and RegFile.v no
Instructionmemory.v yes Loaded the program in Table
DataMem.v no
ControlUnit.v
Exp modules.v
Exp modules.v
Exp modules.v
Exp modules.v
PipliningProcssor.v
Step: In Table complete the new rows added for the bge and lui instructions. In case new control signals are needed, use the extra three columns given to show your changes to the control unit. Highlight your changes in yellow, bold color. You can also add new columns if needed.
Table: Truth Table for the Control Unit
instruction opcode func func aluop aluop aluop alusrc pcsrc pcsrc memtoreg memtoreg regwrite memread memwrite branch
OR
AND
XOR
ADD
SLT
SUB
ORI
ANDI
XORI
ADDI
SLTI
LW
SW x x
BEQ x x x x x x
BGE
JAL x x x x x
JALR x
LUI
Step: Table shows the Verilog program students are required to use for test. Fillin the machine codes for this program and also load the instruction memory with this program.
Table : The content of the instruction memory
Address Instruction Machine Code
LW XX
LW XX
LW XX
LUI X
ADD X X X
LUI X
ADDI X X
ADDI X X
BEQ X X
BGE X X
ADDI X X
SW XX
JALR XX
XOR X X X
BGE X X
LW X
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started