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 1 ns /1 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 2, we can design the Controller.
The MemtoReg signal is '0' for all instructions except for the "Load" instruction
The MemWrite signal is '0' for all instructions except for the "Store" instruction
The MemRead is also '0' for all instructions except for the "Load" instruction
The ALUSrc is '1' when the opcode is "0010011" or "0000011" or "0100011". For these instructions, source B operand comes from the imm_Gen. For other instructions with opcode "0110011", ALUSrc is '0' Because both of the Source operands of the ALU come from the register file.
RegWrite is '1' 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(1 downto 0) is "10" when the opcode is "0110011" and "00" when the opcode is "0010011". It is also "01" for the "Load" and "Store" instructions with opcodes "0000011" and "0100011" respectively.
Table 2 : Control Signals.
\table[[,Opcode,],[,,0110011,0010011,0000011,0100011],[,,\table[[AND, OR, ADD,],[SUB, SLT, NOR]],\table[[ANDI, ORI, ADDI,],[SLTI, NORI]],LW,SW],[\table[[-]],MemtoReg,0,0,1,0],[MemWrite,0,0,0,1],[MemRead,0,0,1,0],[ALUSrc,0,1,1,1],[Regwrite,1,1,1,0],[ALUOp,10,00,01,01]]
 Please help me write a controller module in verilog that follows

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!