Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hint: You have to add Ainvert, Binvert and Less in your enhanced full bit adder, your final Op should be a 4 bit input signal.

Hint: You have to add Ainvert, Binvert and Less in your enhanced full bit adder, your
final Op should be a 4 bit input signal. Op[0] will be Ainvert, Op[1] will be Bnegate,
Op[2:3] will be selection input to the Mux. We can also detect the overflow by checking
whether the CarryIn and CarryOut of the most significant bit are different, such as xoring
as C30 and Cout (e.g. assign Ov=C30C31. Taking xor of overflow and Result of the
most significant bit can give us LessThan (assign Set =Ov? Result[31]) which should be
connected to LESS input of the least significant bit of 32 bit ALU. An instance of 1-bit
ALU may look like full_adder_en FA2(A[1], B[1],1'b0, C0, Op[0], Op[1], Op[2:3],
Result[1], C1);. And Set can replace 1'b0 in LT position in case of the first 1-bit ALU.
full_adder_en FA1(A[0], B[0], Set, Op[1], Op[0], Op[1], Op[2:3], Result[0], C0);.
full_adder_en FA2(A[1], B[1],1'b0, C0, Op[0], Op[1], Op[2:3], Result[1], C1);.
module alu16(A,B,Cin,Op, Result, Cout); points =254 Design an 32 bit ALU in Verilog with OR, AND, NOR, ADD, SUB,
SLT logic as shown in the figure based on the given models. Attach screen-shots of
outputs, answers to the questions, verilog code. Moreover, submit your code as
separate files so that the grader can test it. Check the tutorial at the end.
a. Write your verilog program for the 32 bit ALU
b. Discuss what type of Verilog models (e.g. Structural, Dataflow, hierarchical etc.)
you have used and why? Also show your comments for all the parameters such
as input and output ports, connections, instances of other lower level modules
etc.
c. Write a testbench for the 32 bit ALU. Use the tutorial (at the end) for writing your
testbench. In the case of random ALUcontrol, use only five control signals that
can be tested
d. Compile and run your simulations in ModelSIm. Test whether your results are
correct.
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

Introduction To Data Mining

Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar

1st Edition

321321367, 978-0321321367

More Books

Students also viewed these Databases questions

Question

discuss different sources of numerical data;

Answered: 1 week ago

Question

design and evaluate an effective survey instrument;

Answered: 1 week ago

Question

administer a survey to an appropriate sample of respondents;

Answered: 1 week ago