Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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]]
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 19th International Conference Dexa 2008 Turin Italy September 2008 Proceedings Lncs 5181

Authors: Sourav S. Bhowmick ,Josef Kung ,Roland Wagner

2008th Edition

3540856536, 978-3540856535

More Books

Students also viewed these Databases questions