Experiment No.: 1: Aim of The Experiment
Experiment No.: 1: Aim of The Experiment
: 1
Aim of the experiment:
To write VHDL code for 4 bit ALU to perform following operations: add, subtract, AND,
NAND, XOR, XNOR, OR, & ALU pass and simulate, synthesis and implement on PLD
Objectives:
1. Model 4-bit ALU in VHDL
2. Simulation using proper inputs
3. Synthesis and implementation of ALU in PLD
4. Verify the result on PLD
Theory:
An arithmetic logic unit (ALU) is a digital circuit that performs arithmetic and bitwise
logical operations on integer binary numbers. It is a fundamental building block of the central
processing unit (CPU) found in many computers. Powerful and complex ALUs are often used in
modern, high performance CPUs, FPUs and graphics processing units (GPUs).
The inputs to an ALU are the data to be operated on (called operands) and a code (select
line) indicating the operation to be performed. The ALU's output is the result of the performed
operation.
A basic ALU has four parallel data buses consisting of two input operands (A and B),
select line and a result output (Y) as shown in figure 1. Each data bus is a group of signals that
conveys one binary integer number. Typically, the A, B and Y bus widths (the number of signals
comprising each bus) are identical and match the native word size of the encapsulating CPU.
The select input is a parallel bus that conveys to the ALU an operation selection code,
which is an enumerated value that specifies the desired arithmetic or logic operation to be
performed by the ALU, as shown in table 1.
The select size (its bus width) is related to the number of different operations the ALU
can perform; for example, a three-bit select line can perform eight different ALU operations.
Figure 1 : ALU Top Module
001 Substation
110 Logical OR
Procedure:
VHDL Code:
RTL Schematic:
UCF:
Test bench:
Waveforms:
Observations:
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
Conclusion:
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------