Answered step by step
Verified Expert Solution
Question
1 Approved Answer
A test bench should be created to thoroughly test the ALU. You will call that module ALU _ tb . v . 1 . Your
A test bench should be created to thoroughly test the ALU. You will call that module
ALUtbv
Your design should have module named ALU which you will write in Modelsim.
The module statement must look exactly like this:
module ALU input : aluina aluinb OPCODE, input Cin,
output reg : aluout, output reg Cout, output OF;
your code to implement this ALU goes here!
endmodule
hint : see lecture section and ResourcesDemos Port definitions and
underlying code
The toplevel module name should be named ALU as shown.
Inside this module you should instantiate a bit ripple adder which in turn
instantiates a bit full adders. Inputs to the bit adder can be chosen based on
OPCODES using a case statement.
bit subtraction can be implemented by taking the s complement of
aluinb prior to presenting it as an input to the adder module.
Boolean expressions may be used for logical operations
OPCODEs for the ALU: The VERILOG model you implement should be for a bit
arithmeticlogic unit ALU which has as inputs two bit vectors aluina and
aluinb as well as a bit carry in Cin. The output is a bit vector aluout. The ALU
should operate on the inputs depending on the bit OPCODE in the following table:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started