Académique Documents
Professionnel Documents
Culture Documents
ON
ES / VLSI LAB
IV B.TECH I SEMESTER ECE
(JNTUA-R13)
LIST OF EXPERIMENTS
VLSI LAB
Target Device Specifications, Simulation, Synthesis, Generating RTL Schematic, Technology Map,
Synthesis report & Design Summary of
# Test bench wave form summary window will appear as shown below.
# Assign clock and timing details.
# Dumping process:
EXP.NO: 1(A)
DESIGN AND IMPLEMENTATION OF
DATE: 01/07/2011 HALF ADDER USING VHDL & VERILOG
AIM: To write a VHDL & Verilog code for half adder and to generate synthesis report,
RTL schematic and to implement design using FPGA.
SOFTWARE REQIURED:
HARDWARE REQUIRED:
PROCEDURE:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity halfadder is
Port (a: in STD_LOGIC;
b: in STD_LOGIC;
sum: out STD_LOGIC;
carry: out STD_LOGIC);
end halfadder;
architecture Behavioral of halfadder is
begin
sum<= a xor b;
carry<= a and b;
end Behavioral;
BLOCK DIAGRAM:
TRUTH TABLE:
Inputs Outputs
a b sum carry
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
RTL SCHEMATIC:
TECHNOLOGY SCHEMATIC:
SOFTWARE REQIURED:
HARDWARE REQUIRED:
PROCEDURE:
entity halfsubtractor is
Port ( a : in STD_LOGIC;
b : in STD_LOGIC;
diff : out STD_LOGIC;
borr : out STD_LOGIC);
end halfsubtractor;
architecture Behavioral of halfsubtractor is
begin
diff <= a xor b;
borr <= (not a) and b;
end Behavioral;
output borrow;
xor (diff,a,b);
not(x1,a);
and(borrow,x1,b);
endmodule
BLOCK DIAGRAM:
TRUTH TABLE:
Inputs Outputs
a b diff borrow
0 0 0 0
0 1 1 1
1 0 1 0
1 1 0 0
RTL SCHEMATIC:
TECHNOLOGY SCHEMATIC:
EXP.NO: 2(A)
DESIGN AND IMPLEMENTATION OF
DATE: 08/07/2011 FULL ADDER USING VHDL & VERILOG
AIM: To write a VHDL/Verilog code for full adder and to generate synthesis report,
RTL schematic and to implement design using FPGA.
SOFTWARE REQIURED:
HARDWARE REQUIRED:
PROCEDURE:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
---- Uncomment the following library declaration if instantiating
---- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;
entity fulladder is
Port ( a : in STD_LOGIC;
b : in STD_LOGIC;
c : in STD_LOGIC;
sum : out STD_LOGIC;
carry : out STD_LOGIC);
end fulladder;
architecture Behavioral of fulladder is
begin
sum <= a xor b xor c;
carry <= (a and b) or (a and c) or (b and c);
end Behavioral;
input a;
input b;
input c;
inout x1;
inout x2;
inout x3;
output sum;
output carry;
xor(sum,a,b,c);
and(x1,a,b);
and(x2,b,c);
and(x3,a,c);
or(carry,x1,x2,x3);
endmodule
BLOCK DIAGRAM:
TRUTH TABLE:
Inputs Outputs
A B C SUM CARRY
0 0 0 0 0
0 0 1 1 0
0 1 0 1 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
RTL SCHEMATIC:
TECHNOLOGY SCHEMATIC:
SOFTWARE REQIURED:
HARDWARE REQUIRED:
PROCEDURE:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
---- Uncomment the following library declaration if instantiating
---- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;
entity fullsubtractor is
Port ( a : in STD_LOGIC;
b : in STD_LOGIC;
borrin : in STD_LOGIC;
borrout : out STD_LOGIC;
diff : out STD_LOGIC);
end fullsubtractor;
architecture Behavioral of fullsubtractor is
begin
diff <= a xor b xor borrin;
borrout <= ((not a) and (borrin or b)) or (b and borrin);
end Behavioral;
BLOCK DIAGRAM:
TRUTH TABLE:
INPUTS OUTPUTS
0 0 0 0 0
0 0 1 1 1
0 1 0 1 1
0 1 1 0 1
1 0 0 1 0
1 0 1 0 0
1 1 0 0 0
1 1 1 1 1
RTL SCHEMATIC:
TECHNOLOGY SCHEMATIC:
EXP.NO: 3(A)
DESIGN AND IMPLEMENTATION OF
DATE: 15/07/2011 ENCODER USING VHDL & VERILOG
AIM: To write a VHDL/Verilog code for 4:2 encoder and to generate synthesis report,
RTL schematic and to implement design using FPGA.
SOFTWARE REQIURED:
HARDWARE REQUIRED:
PROCEDURE:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
---- Uncomment the following library declaration if instantiating
---- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;
entity encode is
Port ( a : in STD_LOGIC;
b : in STD_LOGIC;
c : in STD_LOGIC;
d : in STD_LOGIC;
x : out STD_LOGIC;
y : out STD_LOGIC);
end encode;
architecture Behavioral of encode is
begin
x <= c or d;
y <= d or b;
end Behavioral;
BLOCK DIAGRAM:
TRUTH TABLE:
Inputs Outputs
A B C D X Y
1 0 0 0 0 0
0 1 0 0 0 1
0 0 1 0 1 0
0 0 0 1 1 1
RTL SCHEMATIC:
TECHNOLOGY SCHEMATIC:
SIMULATED OUTPUT WAVEFORMS:
RESULT: Thus the VHDL/Verilog code for 4:2 encoder is verified, synthesis report is
generated and the design is implemented using FPGA.
EXP.NO: 3(B)
DESIGN AND IMPLEMENTATION OF
DATE: 15/07/2011 DECODER USING VHDL & VERILOG
AIM: To write a VHDL/Verilog code for 2:4 decoder and to generate synthesis report,
RTL schematic and to implement design using FPGA.
SOFTWARE REQIURED:
HARDWARE REQUIRED:
PROCEDURE:
begin
process(a,b,e)
begin
if(e='1')then
if(a='0' and b='0')then
y<="1000";
elsif(a='1' and b='0')then
y<="0100";
elsif(a='0' and b='1')then
y<="0010";
elsif(a='1' and b='1')then
y<="0001";
end if;
else
y<="0000";
end if;
end process;
end Behavioral;
PROGRAM (IN VERILOG):
BLOCK DIAGRAM:
TRUTH TABLE:
Inputs Outputs
A B Y1 Y2 Y3 Y4
0 0 1 0 0 0
0 1 0 1 0 0
1 0 0 0 1 0
1 1 0 0 0 1
RTL SCHEMATIC:
TECHNOLOGY SCHEMATIC:
EXP.NO: 4(A)
DESIGN AND IMPLEMENTATION OF
DATE: 22/07/2011 MULTIPLEXER USING VHDL & VERILOG
AIM: To write a VHDL/Verilog code for 2:1 multiplexer and to generate synthesis
report, RTL schematic and to implement design using FPGA.
SOFTWARE REQIURED:
HARDWARE REQUIRED:
PROCEDURE:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity multiplexer is
Port ( a : in STD_LOGIC;
b : in STD_LOGIC;
s : in STD_LOGIC;
y : out STD_LOGIC);
end multiplexer;
architecture Behavioral of multiplexer is
begin
process(a,b,s)
begin
if(s='0')then
y<=a;
else
y<=b;
end if;
end process;
end Behavioral;
BLOCK DIAGRAM:
TRUTH TABLE:
Inputs Output
A B S Y
0 0 0 0
0 1 1 1
1 0 0 1
1 1 1 1
RTL SCHEMATIC:
TECHNOLOGY SCHEMATIC:
SIMULATED OUTPUT WAVEFORMS:
RESULT: Thus the VHDL/Verilog code for 2:1 multiplexer is verified, synthesis report
is generated and the design is implemented using FPGA.
AIM: To write a VHDL/Verilog code for 1:2 demultiplexer and to generate synthesis
report, RTL schematic and to implement design using FPGA.
SOFTWARE REQIURED:
HARDWARE REQUIRED:
PROCEDURE:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity demux is
Port ( a : in STD_LOGIC;
s : in STD_LOGIC;
y1 : out STD_LOGIC;
y2 : out STD_LOGIC);
end demux;
begin
y1<=(a and (not s));
y2<= (a and s);
end Behavioral;
BLOCK DIAGRAM:
TRUTH TABLE:
Inputs Outputs
A S Y1 Y2
0 0 1 0
0 1 0 1
TECHNOLOGY SCHEMATIC:
EXP.NO: 5(A)
DESIGN AND IMPLEMENTATION OF
DATE: 29/07/2011 D – FLIP FLOP USING VHDL & VERILOG
AIM: To write a VHDL/Verilog code for D-flip flop and to generate synthesis report,
RTL schematic and to implement design using FPGA.
SOFTWARE REQIURED:
HARDWARE REQUIRED:
PROCEDURE:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity dflipflop is
Port ( d : in STD_LOGIC;
clk : in STD_LOGIC;
q : inout STD_LOGIC:='0';
qbar : inout STD_LOGIC:='1');
end dflipflop;
architecture Behavioral of dflipflop is
begin
process(d,clk,q,qbar)
begin
if(clk='1' and clk'event)then
if d='1' then
q<='1';
qbar<='0';
else
q<='0';
qbar<='1';
end if;
else
q<=q;
qbar<=qbar;
end if;
end process;
end Behavioral;
BLOCK DIAGRAM:
TRUTH TABLE:
Inputs Outputs
State
clk D Q
0 X Q0 No change
1 0 0 RESET
1 1 1 SET
DEVICE UTILIZATION SUMMARY:
RTL SCHEMATIC:
TECHNOLOGY SCHEMATIC:
SIMULATED OUTPUT WAVEFORMS:
RESULT: Thus the VHDL/Verilog code for D-flipflop is verified, synthesis report is
generated and the design is implemented using FPGA.
EXP.NO: 5(B)
DESIGN AND IMPLEMENTATION OF
DATE: 29/07/2011 RS – FLIP FLOP USING VHDL & VERILOG
AIM: To write a VHDL/Verilog code for RS-flip flop and to generate synthesis report,
RTL schematic and to implement design using FPGA.
SOFTWARE REQIURED:
HARDWARE REQUIRED:
PROCEDURE:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
---- Uncomment the following library declaration if instantiating
---- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;
entity rsflipflop is
Port ( s : in STD_LOGIC;
r : in STD_LOGIC;
clk : in STD_LOGIC;
q : inout STD_LOGIC:='0';
qbar : inout STD_LOGIC:='1');
end rsflipflop;
architecture Behavioral of rsflipflop is
begin
process(r,s,clk,q,qbar)
begin
if(clk='1' and clk'event)then
if(r='0' and s='0')then
q<=q;
qbar<=qbar;
elsif(r='0' and s='1')then
q<='1';
qbar<='0';
elsif(r='1' and s='0')then
q<='0';
qbar<='1';
elsif(r='1' and s='1')then
q<='X';
qbar<='X';
end if;
end if;
end process;
end Behavioral;
PROGRAM (IN VERILOG):
begin
q=1'b1;
qbar=1'b0;
end
else
begin
q=1'b0;
qbar=1'b1;
end
endmodule
BLOCK DIAGRAM:
TRUTH TABLE:
Inputs Outputs
DEVICE State UTILIZATION
SUMMARY: R S Q Q’
RTL SCHEMATIC:
TECHNOLOGY SCHEMATIC:
SIMULATED OUTPUT WAVEFORMS:
RESULT: Thus the VHDL/Verilog code for RS-flipflop is verified, synthesis report is
generated and the design is implemented using FPGA.
EXP.NO: 6(A)
DESIGN AND IMPLEMENTATION OF
DATE: 05/08/2011 UP COUNTER USING VHDL & VERILOG
AIM: To write a VHDL/Verilog code for up counter and to generate synthesis report,
RTL schematic and to implement design using FPGA.
SOFTWARE REQIURED:
HARDWARE REQUIRED:
PROCEDURE:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity upcounter is
Port ( clk : in STD_LOGIC;
q : inout STD_LOGIC_VECTOR (3 downto 0):="0000");
end upcounter;
architecture Behavioral of upcounter is
begin
process(clk,q)
begin
if(clk='1'and clk'event)then
if(q="1111")then
q<="0000";
else
q<= q+1;
end if;
end if;
end process;
end Behavioral;
2 0 0 1 0
3 0 0 1 1
4 0 1 0 0
TRUTH TABLE:
5 0 1 0 1
6 0 1 1 0
7 0 1 1 1
8 1 0 0 0
9 1 0 0 1
10 1 0 1 0
11 1 0 1 1
12 1 1 0 0
13 1 1 0 1
14 1 1 1 0
15 1 1 1 1
RTL SCHEMATIC:
TECHNOLOGY SCHEMATIC:
AIM: To write a VHDL/Verilog code for down counter and to generate synthesis
report, RTL schematic and to implement design using FPGA.
SOFTWARE REQIURED:
HARDWARE REQUIRED:
PROCEDURE:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity douncounter is
Port ( clk : in STD_LOGIC;
q : inout STD_LOGIC_VECTOR (3 downto 0):="1111");
end douncounter;
architecture Behavioral of douncounter is
begin
process(clk,q)
begin
if(clk='1' and clk'event)then
if(q="0000")then
q<="1111";
else
q<=q-1;
end if;
end if;
end process;
end Behavioral;
output [3:0] q;
output [3:0] tmp;
reg [3:0] tmp;
always @ (posedge c)
begin
if(s)
tmp=4'b1111;
else
tmp=tmp-1'b1;
end
assign q=tmp;
endmodule
BLOCK DIAGRAM:
TRUTH TABLE:
RTL SCHEMATIC:
TECHNOLOGY SCHEMATIC:
AIM: To write a VHDL/Verilog code for serial in serial out shift register and to
generate synthesis report, RTL schematic and to implement design using FPGA.
SOFTWARE REQIURED:
HARDWARE REQUIRED:
PROCEDURE:
1. Open Xilinx ISE 9.1i.
2. Create a new source file in a new project with suitable name.
3. Create the file in VHDL/Verilog module.
4. Select the appropriate input and output ports according to the
requirements.
5. Type the program and save it.
6. Select Synthesize XST, check for syntax errors and generate report and
RTL schematic.
7. In the process window, go to ‘user constraints’ and select ‘assign package
pins’ and after that double click on ‘implement design’.
8. Select properties by right clicking on ‘generate programming file’. Select
‘JTAG’ clock in startup options.
9. Select boundary scan in ‘impact window’ after double clicking on ‘configure
device’.
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity sisoregister is
Port ( d : in STD_LOGIC;
clk : in STD_LOGIC;
reset : in STD_LOGIC;
q4 : out STD_LOGIC);
end sisoregister;
architecture Behavioral of sisoregister is
signal q1,q2,q3:std_logic;
component dff
port(d,clk,reset:std_logic;
q:out std_logic);
end component;
begin
y1:dff port map (d,clk,reset,q1);
y2:dff port map (q1,clk,reset,q2);
y3:dff port map (q2,clk,reset,q3);
y4:dff port map (q3,clk,reset,q4);
end Behavioral;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity dff is
port(d:in std_logic;
clk:in std_logic;
reset:in std_logic;
q:out std_logic);
end dff;
c<=0;
d<=0;
end
else
begin
a<=b;
b<=c;
c<=d;
d<=e;
end
endmodule
BLOCK DIAGRAM:
RTL SCHEMATIC:
TECHNOLOGY SCHEMATIC:
SIMULATED OUTPUT WAVEFORMS:
RESULT: Thus the VHDL/Verilog code for serial in serial out shift register is verified,
synthesis report is generated and the design is implemented using FPGA.
AIM: To write a VHDL/Verilog code for parallel in parallel out shift register and to
generate synthesis report, RTL schematic and to implement design using FPGA.
SOFTWARE REQIURED:
HARDWARE REQUIRED:
PROCEDURE:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity piporegister is
Port ( d : in STD_LOGIC_VECTOR (3 downto 0);
clk : in STD_LOGIC;
rst : in STD_LOGIC;
q : out STD_LOGIC_VECTOR (3 downto 0));
end piporegister;
entity dff is
port (d:in std_logic;
clk:in std_logic;
rst:in std_logic;
q:out std_logic);
end dff;
architecture behavioral of dff is
begin
process(d,clk,rst)
begin
if(rst='1')then
q<='0';
elsif(clk='1' and clk'event)then
q<=d;
end if;
end process;
end Behavioral;
begin
dout<=4'b0;
end
else
begin
dout<=din;
end
end
endmodule
BLOCK DIAGRAM:
RTL SCHEMATIC:
TECHNOLOGY SCHEMATIC: