Lab #5
Arithmetic Logic Unit - ALU
Document the design of the ALU.
The Full Adder will have three inputs and two outputs.
Inputs:
The three inputs consist of one bit for number A, one bit for number B, and a Carry-In.
Outputs:
The outputs are the Sum and Carry-Out. The Sum is the addition of A, B, and Cin. The Carry-Out will be used as the input into another ALU when we implement a multi-bit ALU using cascading.
See the Verilog module creation tutorial for details on how to create a Verilog module in Project Navigator.
Specify your design as a Verilog Module using built-in logic primitives (and, not, pass) as building blocks. See the Verilog Tutorial and the Verilog presentation slides for details.
|
![]() |
![]() |
||||||||||||||||||||||||||||||||||||||||||||||||||
| Full Adder Truth Table | Full Adder Component Block | Full Adder Verilog | ||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The diagram below shows what a block diagram of the 1-bit ALU might look like. You will not be entering your design into Project Navigator as a schematic but rather you will be specifying your design as a Verilog module.
ALU Truth Table Control Function Select Result Cout C1 C0 0 0 PASS A 0 0 1 ADD A+B Carry from A+B 1 0 AND A • B 0 1 1 NOT A’ 0
See the Verilog module creation tutorial for details on how to create a Verilog module in Project Navigator.
| Signal | Assignment | Notes |
|---|---|---|
| Binary Number A | SW 7-4 | -- Make sure your bits are in the correct order! (SW 7 is the most significant bit) |
| Binary Number B | SW 3-0 | -- SW 3 is the most significant bit |
| Control Bit 1 | BTN 3 | |
| Control Bit 0 | BTN 2 | |
| Result | LD 3-0 | -- LD 3 is the most significant bit |
| Carry Out | LD 7 |