Starting from:
$35

$29

Project 2 ALU with Structural Verilog Solution

Write a structural Verilog on Altera Quartus II tool to implement a 32-bit ALU.




Only structural Verilog is allowed, dataflow and behavioral Verilog is not allowed.




This means you cannot use assign, if-else, always, ?: and etc.




Use hierarchy in your project. For instance, you can design a 2X1 MUX and using three 2X1 MUXes you can design a 4X1 MUX etc.




The primitive gates that you can use in structural Verilog are listed below:




The ALU will get two 32-bit numbers A and B, and a 3-bit S (select) signal as inputs and a 32-bit R signal as output. The ALU perform the following operations:




ALU select (S)
Operation




000
R=AANDB




001
R=AORB




010
R=A+B




011
R=AXORB




100
R=A–B




101
R=AB
(arithmetic shift right)






110
R=A<<B
(shift left)






111
R=ANORB







You should also write a Verilog test bench to simulate your design with Modelsim. In your tests, you should test all eight scenarios shown by the above table for three different (A, B) input pairs. So you will test 3 X 8 = 24 different cases.




You should write a report (25%) including:

Your schematic designs for all modules.



Your Verilog modules and their description.
Modelsim Simulation results.



If not compiling or partial working the explanation of which parts work which parts do not.



You will submit your report, your full project as a zip file to Moodle.




Rules:




Behavioral or Dataflow Verilog are not allowed.
Not compiling or not simulating solutions can at most get 25pts.
You have to use Quartus II tool referred in Moodle.
Each day of late submission will get 25 point loss.
Write 32-bit adder and shifters as modules.



The name of your top module should be alu32.



Implementation of Zero and Overflow bit gets you extra 15pts only if all your design is working perfectly.



Hint: Start with drawing schematic on paper for each module. Do not hesitate to write 32 lines of logic expressions for each bit of one or two 32-bit numbers whenever required.

Honor code: It is not a group project. Do not take any code from Internet. Any cheating means at least -100 for both sides. Do not share your codes and design to any one in any circumstance. Be honest and uncorrupt not to win but because it is RIGHT!

More products