Answered step by step
Verified Expert Solution
Link Copied!

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
ALU_tb.v .
1. Your design should have module named ALU which you will write in Modelsim.
The module statement must look exactly like this:
module ALU (input [3:0] aluin_a, aluin_b, OPCODE, input Cin,
output reg [3:0] alu_out, output reg Cout, output OF);
// your code to implement this ALU goes here!
endmodule
(hint : see lecture 5 section 4 and Resources/Demos Port definitions and
underlying code)
The top-level module name should be named ALU as shown.
2. Inside this module you should instantiate a 4-bit ripple adder which in turn
instantiates a 1-bit full adders. Inputs to the 4-bit adder can be chosen based on
OPCODES using a case statement.
3.4-bit subtraction can be implemented by taking the 2s complement of
aluin_b prior to presenting it as an input to the adder module.
4. Boolean expressions may be used for logical operations
OPCODEs for the ALU: The VERILOG model you implement should be for a 4-bit
arithmetic/logic unit (ALU) which has as inputs two 4-bit vectors aluin_a and
aluin_b as well as a 1-bit carry in, Cin. The output is a 4-bit vector alu_out. The ALU
should operate on the inputs depending on the 4-bit OPCODE in the following table:

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_2

Step: 3

blur-text-image_3

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

SQL Instant Reference

Authors: Gruber, Martin Gruber

2nd Edition

0782125395, 9780782125399

More Books

Students also viewed these Databases questions

Question

=+ how might this lead to faster growth in productivity?

Answered: 1 week ago