Question: Please help me write a controller module in verilog that follows the behavior of the table and utilizes the module defintion of the skeleton code
Please help me write a controller module in verilog that follows the behavior of the table and utilizes the module defintion of the skeleton code given below. Thank you!
timescale ns ps
Module definition
module Controller
Opcode
ALUSrc MemtoReg RegWrite MemRead MemWrite
ALUOp
;
Define the input and output signals
Define the Controller modules behavior
endmodule Controller
With the information in Table we can design the Controller.
The MemtoReg signal is for all instructions except for the "Load" instruction
The MemWrite signal is for all instructions except for the "Store" instruction
The MemRead is also for all instructions except for the "Load" instruction
The ALUSrc is when the opcode is or or For these instructions, source B operand comes from the immGen. For other instructions with opcode ALUSrc is Because both of the Source operands of the ALU come from the register file.
RegWrite is except for the "Store" instructions. This is because for all of these instructions we want to write back the result to the register file.
The ALUOp downto is when the opcode is and when the opcode is It is also for the "Load" and "Store" instructions with opcodes and respectively.
Table : Control Signals.
tableOpcode,tableAND OR ADD,SUB SLT NORtableANDI ORI, ADDI,SLTI NORILWSWtableMemtoReg,MemWriteMemReadALUSrcRegwriteALUOp
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
