Beetc321 Exp1
Beetc321 Exp1
Beetc321 Exp1
Experiment No.:1
Academic Year:2021- 2022 Year: BE (A,B, C) Semester:I Course: Lab practice II (VLSI
Design&Technology) Course Code: 404186
TITLE: Design of 4 bit ALU for add, subtract, AND, NAND, XOR, XNOR, OR & ALUpass.
1. Write VHDL code for 4 bit ALU using Xilinx ISE Design Suite 14.4 andsynthesize
2. Simulate the design writing test bench using ISimSimulator
3. Implement design on Digilent ATLYS board with Spartan6FPGA
REQUIREMENTS:
1. Xilinx ISE Design Suite 14.7 EDA tool for coding andsynthesis
2. ISim Simulator inbuilt in Xilinx forsimulation
3. Digilent ATLYS board with Spartan6 FPGA forimplementation
BLOCK DIAGRAM:
4
A 4
4-BIT ALU Y
4
B
SELECT LINES
DESCRIPTION:
The 4-bit ALU is a combinational design used to perform various arithmetic and logical operations.
The ALU accepts 4 bit data (operands) through its two input ports (A and B) and performs the desired
arithmetic or logical operation as chosen by user. User decides the operation with the help of select
lines (SELECT). The designed ALU has 3 select lines, so it can perform any one out of total eight
operations depending on the status of select lines. The 4 bit output is taken out from the outputport(Y)
of ALU. The designed 4-bit ALU performs a number of basic arithmetic and bitwise logic functions
includingadd,subtract,AND,NAND,XOR,XNORandOR.IncaseofALUpassoperation(alsocalled
Passthroughoperation),allbitsofA(orB)appearunmodifiedatY.Thisoperationistypicallyusedto determine
the parity of the operand or whether it is zero or negative, or to load the operand into a processor
register. If user selects any undesired value of select line, then the output bus goes into high
impedancestate.
1. Open ISE Design Suite 14.4 and ISE Project Navigator window would comeup.
2. Create a new Project, provide project name and select location for saving theproject.
3. In New Project Wizard Window, provide the followingdetails:
● Family- Spartan 6
● Device -XC6SLX45
● Package -CSG324
● Speed --3
● Synthesis Tool - XST(VHDL/Verilog)
● Simulator- ISim (VHDL/Verilog)
● Preferred Language - VHDL ClickFinish
4. Right Click on Project Name and select new source as VHDL module and write the VHDL
code for the intendeddesign.
5. Perform Check syntax operation under Synthesize process to verify that the code is
syntacticallycorrect.
6. View RTL schematic and observe the Block diagram and its detailedconnection.
7. Forperformingsimulation,writeclickonVHDLfileandselectnewsource.NowselectVHDL Test
Bench option, and in this window, write VHDL code for testbench.
8. Select Simulation Radio button at left hand top corner of Navigatorwindow.
9. In ISim simulator process, perform Behavioral Check Syntax followed by Simulate
Behavioral Model. Run the simulation and observe the output in ISimwindow.
10. Now for implementation, Select Implementation Radio button at left hand top corner of
Navigatorwindow.
11. Right click on VHDL file, go to New Source and select Implementation constraintfile.
12. In UCF file, assign pin numbers for inputs and outputs looking at the switches and LEDs on
Digilent ATLYS board. The template for the same is asunder:
QUESTIONS:
entity alu_lab2is
Port (A,B : in STD_LOGIC_VECTOR (3 downto 0);
sel : in STD_LOGIC_VECTOR (2 downto 0);
Y : out STD_LOGIC_VECTOR (3 downto 0)); end
alu_lab2;
RTL Schematic
Block Diagram of Design
Detailed Schematic
ENTITY alu IS
END alu;
COMPONENT alu_lab2
PORT(
A : IN std_logic_vector(3 downto 0);
B : IN std_logic_vector(3 downto 0);
sel : IN std_logic_vector(2 downto 0);
Y : OUT std_logic_vector(3 downto0)
);
END COMPONENT;
--Inputs signal A : std_logic_vector(3 downto 0) :=
(others => '0'); signal B : std_logic_vector(3 downto 0) :=
(others => '0'); signal sel : std_logic_vector(2 downto
0) := (others => '0'); --Outputs
signal Y : std_logic_vector(3 downto 0);
PCCOE-E & TC - VLSI Design & Technology
BEETC321 Manthan Choudhury
BEGIN
-- Instantiate the Unit Under Test (UUT)
uut: alu_lab2 PORT MAP (
A => A,
B =>B,
sel => sel,
Y =>Y
);
PROCESS
BEGIN
A<="0011";
B<="0100";
sel<="000";
wait for 20ns;
A<="1011";
B<="0001";
sel<="001";
wait for 20ns;
sel<="010";
wait for 20ns;
sel<="011";
wait for
20ns;
sel<="100";
wait for 20ns;
sel<="101";
wait for 20ns;
sel<="110";
wait for 20ns;
sel<="111";
wait;
end process; END;
Implementation on Spartan 6
2-bit ALU
library IEEE;
use IEEE.STD_LOGIC_1164.ALL; use
IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity Expt_1b is
Port ( A : in STD_LOGIC_VECTOR(1 downto 0);
B : in STD_LOGIC_VECTOR(1 downto 0);
sel : in STD_LOGIC_VECTOR(2 downto 0);
Y : out STD_LOGIC_VECTOR(1 downto0)); end
Expt_1b;
Implementation Successful