Professional Documents
Culture Documents
SINGRAYAKONDA
Ex. No:
Date:
_____________________________________________________________________________________
LOGIC GATES
AIM:
a. Write a program for digital circuit using VHDL.
b. Verify the functionality of designed circuit.
c. Give the Timing simulation for critical path time calculation & also
synthesis for Digital Circuit.
d. Implement the place & route technique for major FPGA vendor i.e., XILINX
e. Implement the designed digital circuit using FPGA &CPLD devices.
APPARATUS:
1. Computer system
2. Xilinx 7.0 software tool
PROCEDURE:
Double click on XILINX ISE ICON.
Click on file and new project.
Enter the project name and location click on next.
Choose the settings & click on next & finally click on finish.
Ex. No:
Date:
_____________________________________________________________________________________
Choose VHDL module & enter the file name click o next.
Enter the post name & Select the direction & click on next & finish finally.
Click ont ICON of synthesis-xst then double click on the check syntax option.
Choose sources for behavioral simulation and click on the program name you will
get model sim simulator option on the process window.
Change the value from U to either 0 or 1 and click OK and click on run icon &
similarly vary the inputs value for all possible options and observe the output.
2
Ex. No:
Date:
_____________________________________________________________________________________
Close the model sim simulator and come back to implementation in the source
for options.
Click on + icon of user constraints and double click on floor plan ID preSynthesis.
Click on Yes and enter the pin numbers in the LOC column and click on save
icon and click on OK.
Two devices will get identified click on bypass when devices XCF02S is selected.
Click on the .bit file & select open when device XC3S400 is selected and click
OK.
Right click on device XC3S400 and choose program option by clicking of right
click and click on OK.
Ex. No:
Date:
_____________________________________________________________________________________
Once you got the program succeeded message ,you can test the output on
board.
VHDL PROGRAM:
ANDGATE:
Behavioral Model:
Library IEEE;
Use IEEE. STD_LOGIC_1164.all;
Entity and_gate is
Port (
in
STD_LOGIC;
in
STD_LOGIC;
out
STD_LOGIC);
end and_gate;
Ex. No:
Date:
_____________________________________________________________________________________
Architecture and_gate_beh of and_gate is
Begin
process(a, b)
begin
if a = '1' and b = '1' then c <= '1';
else c <= '0';
end if;
end process;
end and_gate_beh;
Dataflow Model:
Library IEEE;
Use IEEE. STD_LOGIC_1164.all;
Entity and_gate is
Port (
in
STD_LOGIC;
in
STD_LOGIC;
out
STD_LOGIC);
end and_gate;
Architecture and_gate_df of and_gate is
Begin
c <= a and b;
end and_gate_df;
Structural Model:
5
Ex. No:
Date:
_____________________________________________________________________________________
Library IEEE;
Use IEEE. STD_LOGIC_1164.all;
Entity and_gate is
Port (
in
STD_LOGIC;
in
STD_LOGIC;
out
STD_LOGIC);
end and_gate;
Architecture and_str of and_gate is
component and_gate
Port (
in
STD_LOGIC;
in
STD_LOGIC;
out
STD_LOGIC);
end component;
begin
U1
end and_str;
Ex. No:
Date:
_____________________________________________________________________________________
Ex. No:
Date:
_____________________________________________________________________________________
SIMULATION RESULTS:
Ex. No:
Date:
_____________________________________________________________________________________
OR GATE:
Behavioral Model:
Library IEEE;
Use IEEE. STD_LOGIC_1164.all;
Entity or_gate is
Port (
in
STD_LOGIC;
in
STD_LOGIC;
out
STD_LOGIC);
end or_gate;
Architecture or_gate_beh of or_gate is
Begin
process(a, b)
begin
if a = '0' and b = '0' then c <= '0';
else c <= '1';
9
Ex. No:
Date:
_____________________________________________________________________________________
end if;
end process;
end or_gate_beh;
Dataflow Model:
Library IEEE;
Use IEEE. STD_LOGIC_1164.all;
Entity or_gate is
Port (
in
STD_LOGIC;
in
STD_LOGIC;
out
STD_LOGIC);
end or_gate;
Architecture or_gate_df of or_gate is
Begin
c <= a or b;
end or_gate_df;
Structural Model:
Library IEEE;
10
Ex. No:
Date:
_____________________________________________________________________________________
Use IEEE. STD_LOGIC_1164.all;
Entity or_gate is
Port (
in
STD_LOGIC;
in
STD_LOGIC;
out
STD_LOGIC);
end or_gate;
Architecture or_str of or_gate is
component or_gate
Port (
in
STD_LOGIC;
in
STD_LOGIC;
out
STD_LOGIC);
end component;
begin
U1
end or_str;
11
Ex. No:
Date:
_____________________________________________________________________________________
12
Ex. No:
Date:
_____________________________________________________________________________________
SIMULATION RESULTS:
ORGATE:-
13
Ex. No:
Date:
_____________________________________________________________________________________
NOT GATE:
Behavioral Model:
Library IEEE;
Use IEEE. STD_LOGIC_1164.all;
Entity not_gate is
Port (
in
STD_LOGIC;
out
STD_LOGIC);
end not_gate;
Architecture not_gate_beh of not_gate is
Begin
Process (a)
begin
if a = '0' then
c <= '1';
else
c <= '0';
end if;
end process;
14
Ex. No:
Date:
_____________________________________________________________________________________
end not_gate_beh;
Dataflow Model:
Library IEEE;
Use IEEE. STD_LOGIC_1164.all;
Entity not_gate is
Port (
in
STD_LOGIC;
out
STD_LOGIC);
end not_gate;
Architecture not_gate_df of not_gate is
Begin
c <= not a;
end not_gate_df;
Structural Model:
Library IEEE;
Use IEEE. STD_LOGIC_1164.all;
Entity not_gate is
Port (
in
STD_LOGIC;
15
Ex. No:
Date:
_____________________________________________________________________________________
c
out
STD_LOGIC);
end not_gate;
in
STD_LOGIC;
out
STD_LOGIC);
end component;
begin
U1
end not_str;
16
Ex. No:
Date:
_____________________________________________________________________________________
17
Ex. No:
Date:
_____________________________________________________________________________________
SIMULATION RESULTS:
NOT GATE:-
18
Ex. No:
Date:
_____________________________________________________________________________________
NAND GATE:
Behavioral Model:
Library IEEE;
Use IEEE. STD_LOGIC_1164.all;
Entity nand_gate is
Port (
b
a
:
in
c
in
STD_LOGIC;
STD_LOGIC;
:
out
STD_LOGIC);
end nand_gate;
Architecture nand_gate_beh of nand_gate is
Begin
process(a, b)
begin
if a = '1' and b = '1' then c <= '0';
else c <= '1';
end if;
end process;
end nand_gate_beh;
19
Ex. No:
Date:
_____________________________________________________________________________________
Dataflow Model:
Library IEEE;
Use IEEE. STD_LOGIC_1164.all;
Entity nand_gate is
Port (
in
STD_LOGIC;
in
STD_LOGIC;
out
STD_LOGIC);
end nand_gate;
Architecture nand_gate_df of nand_gate is
Begin
c <= a nand b;
end nand_gate_df;
Structural Model:
Library IEEE;
Use IEEE. STD_LOGIC_1164.all;
Entity nand_gate is
Port (
in
STD_LOGIC;
in
STD_LOGIC;
out
STD_LOGIC);
20
Ex. No:
Date:
_____________________________________________________________________________________
end nand_gate;
in
STD_LOGIC;
in
STD_LOGIC;
out
STD_LOGIC);
end component;
begin
U1
end nand_str;
21
Ex. No:
Date:
_____________________________________________________________________________________
TRUTH TABLE
22
Ex. No:
Date:
_____________________________________________________________________________________
SIMULATION RESULTS:
NANDGATE:-
23
Ex. No:
Date:
_____________________________________________________________________________________
NOR GATE:
Behavioral Model:
Library IEEE;
Use IEEE. STD_LOGIC_1164.all;
Entity nor_gate is
Port (
b
a
:
in
c
in
STD_LOGIC;
STD_LOGIC;
:
out
STD_LOGIC);
end nor_gate;
Architecture nor_gate_beh of nor_gate is
Begin
process(a, b)
begin
if a = '0' and b = '0' then c <= '1';
else c <= '0';
end if;
end process;
end nor_gate_beh;
24
Ex. No:
Date:
_____________________________________________________________________________________
Dataflow Model:
Library IEEE;
Use IEEE. STD_LOGIC_1164.all;
Entity nor_gate is
Port (
in
STD_LOGIC;
in
STD_LOGIC;
out
STD_LOGIC);
end nor_gate;
Architecture nor_gate_df of nor_gate is
Begin
c <= a nor b;
end nor_gate_df;
Structural Model:
Library IEEE;
Use IEEE. STD_LOGIC_1164.all;
Entity nor_gate is
Port (
in
STD_LOGIC;
in
STD_LOGIC;
out
STD_LOGIC);
end nor_gate;
25
Ex. No:
Date:
_____________________________________________________________________________________
in
STD_LOGIC;
in
STD_LOGIC;
out
STD_LOGIC);
end component;
begin
U1
end nor_str;
Ex. No:
Date:
_____________________________________________________________________________________
NOR GATE
TRUTH TABLE
27
Ex. No:
Date:
_____________________________________________________________________________________
SIMULATION RESULTS:
NORGATE:
28
Ex. No:
Date:
_____________________________________________________________________________________
XOR GATE:
Behavioral Model:
Library IEEE;
Use IEEE. STD_LOGIC_1164.all;
Entity xor_gate is
Port (
b
a
:
in
c
in
STD_LOGIC;
STD_LOGIC;
:
out
STD_LOGIC);
end xor_gate;
Architecture xor_gate_beh of xor_gate is
Begin
process(a, b)
begin
if a = b then c <= '0';
else c <= '1';
end if;
end process;
end xor_gate_beh;
29
Ex. No:
Date:
_____________________________________________________________________________________
Dataflow MOdel:
Library IEEE;
Use IEEE. STD_LOGIC_1164.all;
Entity xor_gate is
Port (
in
STD_LOGIC;
in
STD_LOGIC;
out
STD_LOGIC);
end xor_gate;
Architecture xor_gate_df of xor_gate is
Begin
c <= a xor b;
end xor_gate_df;
Structural Model:
30
Ex. No:
Date:
_____________________________________________________________________________________
Library IEEE;
Use IEEE. STD_LOGIC_1164.all;
Entity xor_gate is
Port (
in
STD_LOGIC;
in
STD_LOGIC;
out
STD_LOGIC);
end xor_gate;
Architecture xor_str of xor_gate is
component xor_gate
Port (
in
STD_LOGIC;
in
STD_LOGIC;
out
STD_LOGIC);
end component;
begin
U1
end xor_str;
31
Ex. No:
Date:
_____________________________________________________________________________________
XOR GATE
TRUTH TABLE
32
Ex. No:
Date:
_____________________________________________________________________________________
SIMULATION RESULTS:
Xorgate:
33
Ex. No:
Date:
_____________________________________________________________________________________
XNOR GATE:
Behavioral Model:
Library IEEE;
Use IEEE. STD_LOGIC_1164.all;
Entity xnor_gate is
Port (
in
STD_LOGIC;
in
STD_LOGIC;
out
STD_LOGIC);
end xnor_gate;
Architecture xnor_gate_beh of xnor_gate is
Begin
process(a, b)
begin
if a = b then c <= '1';
else c <= '0';
end if;
end process;
end xnor_gate_beh;
34
Ex. No:
Date:
_____________________________________________________________________________________
Dataflow Model:
Library IEEE;
Use IEEE. STD_LOGIC_1164.all;
Entity xnor_gate is
Port (
in
STD_LOGIC;
in
STD_LOGIC;
out
STD_LOGIC);
end xnor_gate;
Architecture xnor_gate_df of xnor_gate is
Begin
c <= a xnor b;
end xnor_gate_df;
Structural Model:
Library IEEE;
Use IEEE. STD_LOGIC_1164.all;
Entity xnor_gate is
Port (
in
STD_LOGIC;
in
STD_LOGIC;
out
STD_LOGIC);
end xnor_gate;
35
Ex. No:
Date:
_____________________________________________________________________________________
in
STD_LOGIC;
in
STD_LOGIC;
out
STD_LOGIC);
end component;
begin
U1
end xnor_str;
36
Ex. No:
Date:
_____________________________________________________________________________________
37
Ex. No:
Date:
_____________________________________________________________________________________
SIMULATION RESULTS:
Xnorgate:
RESULT:
38
Ex. No:
Date:
_____________________________________________________________________________________
3 8 DECODER
AIM:
To write VHDL and verilog program for 3 8 Decoder simulate the program and verify the
results.
APPARATUS:
Computer system
Xilinx 7.1 software tool
PROCEDURE:
Double click on XILINX ISE ICON.
Click on file and new project.
Enter the project name and location click on next.
Choose the settings & click on next & finally click on finish.
39
Ex. No:
Date:
_____________________________________________________________________________________
Choose VHDL module & enter the file name click o next.
Enter the post name & Select the direction & click on next & finish finally.
Click ont ICON of synthesis-xst then double click on the check syntax option.
Choose sources for behavioral simulation and click on the program name you will
get model sim simulator option on the process window.
Change the value from U to either 0 or 1 and click OK and click on run icon &
similarly vary the inputs value for all possible options and observe the output.
40
Ex. No:
Date:
_____________________________________________________________________________________
Close the model sim simulator and come back to implementation in the source
for options.
Click on + icon of user constraints and double click on floor plan ID preSynthesis.
Click on Yes and enter the pin numbers in the LOC column and click on save
icon and click on OK.
Two devices will get identified click on bypass when devices XCF02S is selected.
Click on the .bit file & select open when device XC3S400 is selected and click
OK.
Right click on device XC3S400 and choose program option by clicking of right
click and click on OK.
41
Ex. No:
Date:
_____________________________________________________________________________________
Once you got the program succeeded message ,you can test the output on
board.
VHDL PROGRAM:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity decoder is
Port ( g1,g2,g3 : in std_logic;
A : in std_logic_vector(2 downto 0);
Y : out std_logic_vector(0 to 7));
end decoder;
architecture Behavioral of decoder is
signal Y1:std_logic_vector(0 to 7 );
42
Ex. No:
Date:
_____________________________________________________________________________________
begin
end Behavioral;
VERILOG PROGRAM:
43
Ex. No:
Date:
_____________________________________________________________________________________
and(z[0],en,abar,bbar,cbar);
and(z[1],en,abar,bbar,c);
and(z[2],en,abar,b,cbar);
and(z[3],en,abar,b,c);
and(z[4],en,a,bbar,cbar);
and(z[5],en,a,bbar,c);
and(z[6],en,a,b,cbar);
and(z[7],en,a,b,c);
endmodule
44
Ex. No:
Date:
_____________________________________________________________________________________
G1
O
G2A
Y0
UT
OUT
G2B
Y1
O1
1
1
OUT
OU
Y2
T1
1
T1
OU
Y3
Y4
T1
OU
OU
Y5
T1
T1
OU
Y6
A (0)
Y7
OU
T1
A
(1)
OUT
OU
T1
OUT
A
(2)
1
T1
1
OUT
1
TRUTH TABLE
INPUTS
OUTPUTS
G1
G2A_L
G2B_L
Y7_L
Y6_L
Y5_L
Y4_L
Y3_L
Y2_L
Y1_L
Y0_L
RTL SCHEMATIC:
45
Ex. No:
Date:
_____________________________________________________________________________________
SYNTHESIS REPORT:
46
Ex. No:
Date:
_____________________________________________________________________________________
=========================================================================
*
Final Report
=========================================================================
Final Results
RTL Top Level Output File Name
Top Level Output File Name
Output Format
: decodervhdl.ngr
: decodervhdl
: NGC
Optimization Goal
: Speed
Keep Hierarchy
: NO
Design Statistics
# IOs
: 14
Macro Statistics :
# Decoders
#
:1
1-of-8 decoder
:1
Cell Usage :
# BELS
: 10
INV
:1
LUT2
:1
LUT3
:8
# FlipFlops/Latches
#
LDE
# IO Buffers
#
IBUF
OBUF
:8
:8
: 14
:6
:8
=========================================================================
Device utilization summary:
--------------------------Selected Device : xa2s50etq144-6
47
Ex. No:
Date:
_____________________________________________________________________________________
Number of Slices:
5 out of
768
0%
8 out of 1536
0%
9 out of 1536
0%
14 out of
13%
102
=========================================================================
TIMING REPORT
NOTE: THESE TIMING NUMBERS ARE ONLY A SYNTHESIS ESTIMATE.
FOR ACCURATE TIMING INFORMATION PLEASE REFER TO THE TRACE REPORT
GENERATED AFTER PLACE-and-ROUTE.
Clock Information:
----------------------------------------------------+------------------------+-------+
Clock Signal
-----------------------------------+------------------------+-------+
_n0000(_n00001:O)
| NONE(*)(z_7)
|8
-----------------------------------+------------------------+-------+
(*) This 1 clock signal(s) are generated by combinatorial logic,
and XST is not able to identify which are the primary clock signals.
Please use the CLOCK_SIGNAL constraint to specify the clock signal(s) generated by combinatorial
logic.
INFO:Xst:2169 - HDL ADVISOR - Some clock signals were not automatically buffered by XST with
BUFG/BUFR resources. Please use the buffer_type constraint in order to insert these buffers to the clock
signals to help prevent skew problems.
Timing Summary:
--------------Speed Grade: -6
Minimum period: No path found
Minimum input arrival time before clock: 4.922ns
Maximum output required time after clock: 6.613ns
48
Ex. No:
Date:
_____________________________________________________________________________________
Maximum combinational path delay: No path found
Timing Detail:
-------------All values displayed in nanoseconds (ns)
=========================================================================
Timing constraint: Default OFFSET IN BEFORE for Clock '_n00001:O'
Total number of paths / destination ports: 32 / 16
------------------------------------------------------------------------Offset:
Source:
Destination:
Net
---------------------------------------- -----------IBUF:I->O
INV:I->O
LDE:GE
0.687
z_0
---------------------------------------Total
=========================================================================
Timing constraint: Default OFFSET OUT AFTER for Clock '_n00001:O'
Total number of paths / destination ports: 8 / 8
------------------------------------------------------------------------Offset:
Source:
Destination:
Ex. No:
Date:
_____________________________________________________________________________________
Source Clock:
_n00001:O falling
Net
---------------------------------------- -----------LDE:G->Q
OBUF:I->O
4.602
z_7_OBUF (z<7>)
---------------------------------------Total
=========================================================================
CPU : 3.48 / 4.31 s | Elapsed : 4.00 / 4.00 s
-->
Total memory usage is 84452 kilobytes
Number of errors : 0 ( 0 filtered)
Number of warnings :
Number of infos
1 ( 0 filtered)
: 1 ( 0 filtered)
50
Ex. No:
Date:
_____________________________________________________________________________________
SIMULATION RESULTS:
51
Ex. No:
Date:
_____________________________________________________________________________________
2x4 DE MULTIPLEXER
AIM:
To write VHDL & verilog program for demultiplexer , simulate the program and verify the
results
APPARATUS:
Computer system
Xilinx 7.1 software tool
PROCEDURE:
Double click on XILINX ISE ICON.
Click on file and new project.
Enter the project name and location click on next.
Choose the settings & click on next & finally click on finish.
52
Ex. No:
Date:
_____________________________________________________________________________________
Choose VHDL module & enter the file name click o next.
Enter the post name & Select the direction & click on next & finish finally.
Click ont ICON of synthesis-xst then double click on the check syntax option.
Choose sources for behavioral simulation and click on the program name you will
get model sim simulator option on the process window.
Change the value from U to either 0 or 1 and click OK and click on run icon &
similarly vary the inputs value for all possible options and observe the output.
53
Ex. No:
Date:
_____________________________________________________________________________________
Close the model sim simulator and come back to implementation in the source
for options.
Click on + icon of user constraints and double click on floor plan ID preSynthesis.
Click on Yes and enter the pin numbers in the LOC column and click on save
icon and click on OK.
Two devices will get identified click on bypass when devices XCF02S is selected.
Click on the .bit file & select open when device XC3S400 is selected and click
OK.
Right click on device XC3S400 and choose program option by clicking of right
click and click on OK.
Ex. No:
Date:
_____________________________________________________________________________________
Once you got the program succeeded message ,you can test the output on
board.
VHDL PROGRAM:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
55
Ex. No:
Date:
_____________________________________________________________________________________
entity demultiplexer is
Port ( s1 : in std_logic;
sel : in std_logic_vector ( 1 downto 0);
q : out std_logic_vector ( 3 downto 0));
end demultiplexer;
architecture Behavioral of demultiplexer is
signal q1 : std_logic_vector ( 3 downto 0);
begin
with sel select q1<= "1110" when "00",
"1101" when "01",
"1011" when "10",
"0111" when "11",
"1111" when others;
q<= q1 when s1= '0'
else "1111";
end Behavioral;
verilog program :
module demuxverilog(d,en, s, y);
input d,en;
input [2:0] s;
output [7:0] y;
wire s2bar,s1bar,s0bar;
56
Ex. No:
Date:
_____________________________________________________________________________________
not(s2bar,s[2]);
not(s1bar,s[1]);
not(s0bar,s[0]);
and(y[0],d,en,s2bar,s1bar,s0bar);
and(y[1],d,en,s2bar,s1bar,s[0]);
and(y[2],d,en,s2bar,s[1],s0bar);
and(y[3],d,en,s2bar,s[1],s[0]);
and(y[4],d,en,s[2],s1bar,s0bar);
and(y[5],d,en,s[2],s1bar,s[0]);
and(y[6],d,en,s[2],s[1],s0bar);
and(y[7],d,en,s[2],s[1],s[0]);
endmodule
TRUTH TABLE
57
Ex. No:
Date:
_____________________________________________________________________________________
EN
A
S0
OU
S1
T1
OU
T1
Y0
OU
Y1
T1
OU
Y2
T1
OU
Y3
T1
OU
T1
INPUTS
S0
S1
DATA
Y0
Y1
Y2
Y3
RTL SCHEMATIC:
58
OUTPUT
EN
Ex. No:
Date:
_____________________________________________________________________________________
59
Ex. No:
Date:
_____________________________________________________________________________________
SYNTHESIS REPORT:
=========================================================================
*
Final Report
=========================================================================
Final Results
RTL Top Level Output File Name
Top Level Output File Name
Output Format
: vhdldemux.ngr
: vhdldemux
: NGC
Optimization Goal
: Speed
Keep Hierarchy
: NO
Design Statistics
# IOs
:8
Cell Usage :
# BELS
:4
:4
LUT4
# IO Buffers
#
IBUF
OBUF
:8
:4
:4
=========================================================================
Device utilization summary:
--------------------------Selected Device : xa2s50etq144-6
Number of Slices:
2 out of
768
0%
60
Ex. No:
Date:
_____________________________________________________________________________________
Number of 4 input LUTs:
4 out of 1536
0%
8 out of
7%
102
=========================================================================
TIMING REPORT
NOTE: THESE TIMING NUMBERS ARE ONLY A SYNTHESIS ESTIMATE.
FOR ACCURATE TIMING INFORMATION PLEASE REFER TO THE TRACE REPORT
GENERATED AFTER PLACE-and-ROUTE.
Clock Information:
-----------------No clock signals found in this design
Timing Summary:
--------------Speed Grade: -6
Minimum period: No path found
Minimum input arrival time before clock: No path found
Maximum output required time after clock: No path found
Maximum combinational path delay: 8.307ns
Timing Detail:
-------------All values displayed in nanoseconds (ns)
=========================================================================
61
Ex. No:
Date:
_____________________________________________________________________________________
Timing constraint: Default path analysis
Total number of paths / destination ports: 16 / 4
------------------------------------------------------------------------Delay:
Source:
d (PAD)
Destination:
y<3> (PAD)
Net
---------------------------------------- -----------IBUF:I->O
LUT4:I0->O
OBUF:I->O
4.602
y_2_OBUF (y<2>)
---------------------------------------Total
=========================================================================
CPU : 3.95 / 4.83 s | Elapsed : 4.00 / 4.00 s
-->
Total memory usage is 84452 kilobytes
Number of errors : 0 ( 0 filtered)
Number of warnings :
Number of infos
0 ( 0 filtered)
: 0 ( 0 filtered)
62
Ex. No:
Date:
_____________________________________________________________________________________
SIMULATION RESULTS
63
Ex. No:
Date:
_____________________________________________________________________________________
8_3 ENCODER
AIM:
To write VHDL & verilog program for encoder ,simulate the program and verify the results.
APPARATUS:
Computer system
Xilinx 7.1 software tool
PROCEDURE:
Double click on XILINX ISE ICON.
Click on file and new project.
Enter the project name and location click on next.
Choose the settings & click on next & finally click on finish.
64
Ex. No:
Date:
_____________________________________________________________________________________
Choose VHDL module & enter the file name click o next.
Enter the post name & Select the direction & click on next & finish finally.
Click ont ICON of synthesis-xst then double click on the check syntax option.
Choose sources for behavioral simulation and click on the program name you will
get model sim simulator option on the process window.
Change the value from U to either 0 or 1 and click OK and click on run icon &
similarly vary the inputs value for all possible options and observe the output.
65
Ex. No:
Date:
_____________________________________________________________________________________
Close the model sim simulator and come back to implementation in the source
for options.
Click on + icon of user constraints and double click on floor plan ID preSynthesis.
Click on Yes and enter the pin numbers in the LOC column and click on save
icon and click on OK.
Two devices will get identified click on bypass when devices XCF02S is selected.
Click on the .bit file & select open when device XC3S400 is selected and click
OK.
Right click on device XC3S400 and choose program option by clicking of right
click and click on OK.
66
Ex. No:
Date:
_____________________________________________________________________________________
Once you got the program succeeded message ,you can test the output on
board.
VHDL CODE :
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity encoder is
Port ( d : in std_logic_vector(7 downto 0);
b : out std_logic_vector(2 downto 0));
end encoder;
architecture Behavioral of encoder is
begin
process(d)
begin
67
Ex. No:
Date:
_____________________________________________________________________________________
case d is
when "00000001"=>b<="000";
when "00000010"=>b<="001";
when "00000100"=>b<="010";
when "00001000"=>b<="011";
when "00010000"=>b<="100";
when "00100000"=>b<="101";
when "01000000"=>b<="110";
when "10000000"=>b<="111";
when others =>null;
end case;
end process;
end Behavioral;
VERILOG CODE:
module encoder(d, en, y);
input [7:0] d;
input en;
output [2:0] y;
wire a,b,c;
or(a,d[1],d[3],d[5],d[7]);
or(b,d[2],d[3],d[4],d[7]);
or(c,d[4],d[5],d[6],d[7]);
and(y[0],a,en);
and(y[1],b,en);
68
Ex. No:
Date:
_____________________________________________________________________________________
and(y[2],c,en);
endmodule
RTL SCHEMATIC:
69
Ex. No:
Date:
_____________________________________________________________________________________
SYNTHESIS REPORT:
=========================================================================
*
Final Report
=========================================================================
Final Results
RTL Top Level Output File Name
Top Level Output File Name
Output Format
: encoder.ngr
: encoder
: NGC
70
Ex. No:
Date:
_____________________________________________________________________________________
Optimization Goal
: Speed
Keep Hierarchy
: NO
Design Statistics
# IOs
: 11
Cell Usage :
# BELS
: 11
LUT2
:2
LUT3
:1
LUT4
:8
# FlipFlops/Latches
#
LD
:3
:3
# IO Buffers
#
IBUF
OBUF
: 11
:8
:3
=========================================================================
Device utilization summary:
--------------------------Selected Device : xa2s50etq144-6
Number of Slices:
6 out of
768
0%
3 out of 1536
0%
11 out of 1536
0%
11 out of
102
71
10%
Ex. No:
Date:
_____________________________________________________________________________________
=========================================================================
TIMING REPORT
NOTE: THESE TIMING NUMBERS ARE ONLY A SYNTHESIS ESTIMATE.
FOR ACCURATE TIMING INFORMATION PLEASE REFER TO THE TRACE REPORT
GENERATED AFTER PLACE-and-ROUTE.
Clock Information:
----------------------------------------------------+------------------------+-------+
Clock Signal
-----------------------------------+------------------------+-------+
N167(_n0040148:O)
| NONE(*)(b_2)
|3
-----------------------------------+------------------------+-------+
(*) This 1 clock signal(s) are generated by combinatorial logic,
and XST is not able to identify which are the primary clock signals.
Please use the CLOCK_SIGNAL constraint to specify the clock signal(s) generated by combinatorial
logic.
INFO:Xst:2169 - HDL ADVISOR - Some clock signals were not automatically buffered by XST with
BUFG/BUFR resources. Please use the buffer_type constraint in order to insert these buffers to the clock
signals to help prevent skew problems.
Timing Summary:
--------------Speed Grade: -6
Minimum period: No path found
Minimum input arrival time before clock: 4.927ns
Maximum output required time after clock: 6.613ns
72
Ex. No:
Date:
_____________________________________________________________________________________
Maximum combinational path delay: No path found
Timing Detail:
-------------All values displayed in nanoseconds (ns)
=========================================================================
Timing constraint: Default OFFSET IN BEFORE for Clock '_n0040148:O'
Total number of paths / destination ports: 24 / 3
------------------------------------------------------------------------Offset:
Source:
Destination:
d<2> (PAD)
b_0 (LATCH)
Net
---------------------------------------- -----------IBUF:I->O
LUT2:I0->O
LUT4:I1->O
LD:D
0.724
b_0
---------------------------------------Total
=========================================================================
Timing constraint: Default OFFSET OUT AFTER for Clock '_n0040148:O'
73
Ex. No:
Date:
_____________________________________________________________________________________
Total number of paths / destination ports: 3 / 3
------------------------------------------------------------------------Offset:
Source:
Destination:
Source Clock:
b<2> (PAD)
_n0040148:O falling
Net
---------------------------------------- -----------LD:G->Q
OBUF:I->O
4.602
b_2_OBUF (b<2>)
---------------------------------------Total
=========================================================================
CPU : 2.70 / 2.97 s | Elapsed : 2.00 / 3.00 s
-->
Total memory usage is 84452 kilobytes
Number of errors : 0 ( 0 filtered)
Number of warnings :
Number of infos
1 ( 0 filtered)
: 1 ( 0 filtered)
74
Ex. No:
Date:
_____________________________________________________________________________________
SIMULATION RESULTS
75
Ex. No:
Date:
_____________________________________________________________________________________
MOD-53 COUNTER
76
Ex. No:
Date:
_____________________________________________________________________________________
AIM:
To write VHDL & verilog program for mod 53 counter ,simulate the program and verify the
results.
APPARATUS:
Computer system
Xilinx 7.1 software tool
PROCEDURE:
Double click on XILINX ISE ICON.
Click on file and new project.
Enter the project name and location click on next.
Choose the settings & click on next & finally click on finish.
Choose VHDL module & enter the file name click o next.
Enter the post name & Select the direction & click on next & finish finally.
77
Ex. No:
Date:
_____________________________________________________________________________________
Write the program & click on program name in source window.
Click ont ICON of synthesis-xst then double click on the check syntax option.
Choose sources for behavioral simulation and click on the program name you will
get model sim simulator option on the process window.
Change the value from U to either 0 or 1 and click OK and click on run icon &
similarly vary the inputs value for all possible options and observe the output.
Close the model sim simulator and come back to implementation in the source
for options.
Click on + icon of user constraints and double click on floor plan ID preSynthesis.
78
Ex. No:
Date:
_____________________________________________________________________________________
Click on Yes and enter the pin numbers in the LOC column and click on save
icon and click on OK.
Two devices will get identified click on bypass when devices XCF02S is selected.
Click on the .bit file & select open when device XC3S400 is selected and click
OK.
Right click on device XC3S400 and choose program option by clicking of right
click and click on OK.
Once you got the program succeeded message ,you can test the output on
board.
79
Ex. No:
Date:
_____________________________________________________________________________________
VHDL PROGRAM :
Library ieee;
Use iee.std_logic_1164.all;
Use iee.numeric_std_all;
Entity modul is
Generic (n bits:positive:=4;gpto positive:=12);
Port(clk,reset:in std_logic;
Q:out std_logic_vector(0 to nbits-1);
Qn:out std_logic_vector(0to n bits-1));
End module;
Architecture behavior of modul is
Begin
Process(clk)
Variable enter_value :unsigned(nbits-1 downto 0);
Begin
If(clk and clkevent==1)then
If(reset=1)then
80
Ex. No:
Date:
_____________________________________________________________________________________
Enter_value:=(other=>0);
Else
Enter_value:=(enter_value+1)modupto;
End if;
End if;
Q<=std_logic_vector(enter_value);
Qn<=std_logic_vector(enter_value);
End process;
End behaviour;
RTL SCHEMATIC
81
Ex. No:
Date:
_____________________________________________________________________________________
SYNTHESIS REPORT:
=========================================================================
*
Final Report
=========================================================================
Final Results
RTL Top Level Output File Name
Top Level Output File Name
Output Format
: module.ngr
: module
: NGC
Optimization Goal
: Speed
Keep Hierarchy
: NO
Design Statistics
# IOs
: 20
Macro Statistics :
# Counters
#
7-bit up counter
:1
:1
Cell Usage :
82
Ex. No:
Date:
_____________________________________________________________________________________
# BELS
: 29
GND
:1
INV
LUT1
:1
LUT2
:1
LUT3
:1
LUT3_L
LUT4
MUXCY
VCC
XORCY
:1
:7
:2
:7
:1
:7
# FlipFlops/Latches
#
:7
FDRSE
:7
# Clock Buffers
#
:1
BUFGP
:1
# IO Buffers
: 19
IBUF
: 11
OBUF
:8
=========================================================================
Device utilization summary:
--------------------------Selected Device : 2s50eft256-6
Number of Slices:
6 out of
768
0%
7 out of 1536
0%
12 out of 1536
0%
20 out of
Number of GCLKs:
1 out of
182
4
10%
25%
=========================================================================
TIMING REPORT
83
Ex. No:
Date:
_____________________________________________________________________________________
NOTE: THESE TIMING NUMBERS ARE ONLY A SYNTHESIS ESTIMATE.
FOR ACCURATE TIMING INFORMATION PLEASE REFER TO THE TRACE REPORT
GENERATED AFTER PLACE-and-ROUTE.
Clock Information:
----------------------------------------------------+------------------------+-------+
Clock Signal
-----------------------------------+------------------------+-------+
clk
| BUFGP
|7
-----------------------------------+------------------------+-------+
Timing Summary:
--------------Speed Grade: -6
Minimum period: 4.957ns (Maximum Frequency: 201.735MHz)
Minimum input arrival time before clock: 6.052ns
Maximum output required time after clock: 9.690ns
Maximum combinational path delay: 9.325ns
Timing Detail:
-------------All values displayed in nanoseconds (ns)
=========================================================================
Timing constraint: Default period analysis for Clock 'clk'
Clock period: 4.957ns (frequency: 201.735MHz)
Total number of paths / destination ports: 28 / 7
------------------------------------------------------------------------Delay:
Source:
Destination:
Source Clock:
Ex. No:
Date:
_____________________________________________________________________________________
Destination Clock: clk rising
Data Path: iq_0 to iq_6
Gate
Cell:in->out
Net
---------------------------------------- -----------FDRSE:C->Q
LUT3_L:I2->LO
MUXCY:S->O
MUXCY:CI->O
MUXCY:CI->O
MUXCY:CI->O
MUXCY:CI->O
MUXCY:CI->O
XORCY:CI->O
FDRSE:D
0.724
iq_6
---------------------------------------Total
=========================================================================
Timing constraint: Default OFFSET IN BEFORE for Clock 'clk'
Total number of paths / destination ports: 91 / 21
------------------------------------------------------------------------Offset:
Source:
Destination:
Net
Ex. No:
Date:
_____________________________________________________________________________________
---------------------------------------- -----------IBUF:I->O
LUT3:I0->O
FDRSE:CE
0.687
iq_0
---------------------------------------Total
=========================================================================
Timing constraint: Default OFFSET OUT AFTER for Clock 'clk'
Total number of paths / destination ports: 14 / 8
------------------------------------------------------------------------Offset:
Source:
iq_2 (FF)
Destination:
Source Clock:
rc0 (PAD)
clk rising
Net
---------------------------------------- -----------FDRSE:C->Q
LUT4:I0->O
LUT2:I0->O
OBUF:I->O
4.602
rc0_OBUF (rc0)
---------------------------------------Total
=========================================================================
Timing constraint: Default path analysis
Total number of paths / destination ports: 1 / 1
86
Ex. No:
Date:
_____________________________________________________________________________________
------------------------------------------------------------------------Delay:
Source:
ent (PAD)
Destination:
rc0 (PAD)
Net
---------------------------------------- -----------IBUF:I->O
LUT4:I2->O
LUT2:I0->O
OBUF:I->O
4.602
rc0_OBUF (rc0)
---------------------------------------Total
=========================================================================
CPU : 4.34 / 6.34 s | Elapsed : 5.00 / 6.00 s
-->
Total memory usage is 84452 kilobytes
Number of errors : 0 ( 0 filtered)
Number of warnings :
Number of infos
0 ( 0 filtered)
: 0 ( 0 filtered)
87
Ex. No:
Date:
_____________________________________________________________________________________
SIMULATION RESULTS
88
Ex. No:
Date:
_____________________________________________________________________________________
8x1 MULTIPLEXER
89
Ex. No:
Date:
_____________________________________________________________________________________
AIM:
To write VHDL & verilog program for Multiplexer, simulate the program and verify the results
APPARATUS:
Computer system
Xilinx 7.1 software tool
PROCEDURE:
Double click on XILINX ISE ICON.
Click on file and new project.
Enter the project name and location click on next.
Choose the settings & click on next & finally click on finish.
Choose VHDL module & enter the file name click o next.
Enter the post name & Select the direction & click on next & finish finally.
90
Ex. No:
Date:
_____________________________________________________________________________________
Click ont ICON of synthesis-xst then double click on the check syntax option.
Choose sources for behavioral simulation and click on the program name you will
get model sim simulator option on the process window.
Change the value from U to either 0 or 1 and click OK and click on run icon &
similarly vary the inputs value for all possible options and observe the output.
Close the model sim simulator and come back to implementation in the source
for options.
Click on + icon of user constraints and double click on floor plan ID preSynthesis.
91
Ex. No:
Date:
_____________________________________________________________________________________
Click on Yes and enter the pin numbers in the LOC column and click on save
icon and click on OK.
Two devices will get identified click on bypass when devices XCF02S is selected.
Click on the .bit file & select open when device XC3S400 is selected and click
OK.
Right click on device XC3S400 and choose program option by clicking of right
click and click on OK.
Once you got the program succeeded message ,you can test the output on
board.
92
Ex. No:
Date:
_____________________________________________________________________________________
VHDL CODE
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity multiplexer is
Port ( s : in std_logic_vector(2 downto 0);
d : in std_logic_vector(7 downto 0);
y,y1 : out std_logic);
end multiplexer;
architecture Behavioral of multiplexer is
begin
process ( s,d)
begin
case s is
Ex. No:
Date:
_____________________________________________________________________________________
when "100" => y<= d(4) ;y1 <= not d(4);
when "101" => y<= d(5) ;y1 <= not d(5);
when "110" => y<= d(6) ;y1 <= not d(6);
when "111" => y<= d(7) ;y1 <= not d(7);
when others => y<='1';
end case;
end process;
end Behavioral;
VERILOG CODE:
module amuxverilog(a, s, y);
input [7:0] a;
input [2:0] s;
output y;
wire k,l,m,n,o,p,q,r,g,h,i;
not(g,s[2]);
not(g,s[1]);
not(i,s[0]);
and(k,a[0],g,h,i);
and(l,a[1],g,h,s[0]);
and(m,a[2],g,s[1],i);
and(n,a[3],g,s[1],s[0]);
and(o,a[4],s[2],h,i);
and(p,a[5],s[2],h,s[0]);
and(q,a[6],s[2],s[1],i);
and(r,a[7],s[2],s[1],s[0]);
or(y,k,l,m,n,o,p,q,r);
endmodule
94
Ex. No:
Date:
_____________________________________________________________________________________
95
Ex. No:
Date:
_____________________________________________________________________________________
TRUTH TABLE
INPUTS
OUTPUT
EN
S0
S1
S2
DATA
A0
A0
A1
A1
A2
A2
A3
A3
A4
A4
A5
A5
A6
A6
A7
A7
RTL SCHEMATIC
96
Ex. No:
Date:
_____________________________________________________________________________________
SYNTHESIS REPORT:
=========================================================================
*
Final Report
=========================================================================
Final Results
RTL Top Level Output File Name
Top Level Output File Name
Output Format
: mux.ngr
: mux
: NGC
Optimization Goal
: Speed
Keep Hierarchy
: NO
Design Statistics
# IOs
: 13
97
Ex. No:
Date:
_____________________________________________________________________________________
Cell Usage :
# BELS
:7
LUT2
:1
LUT4
:5
MUXF5
:1
# IO Buffers
: 13
IBUF
: 12
OBUF
:1
=========================================================================
Device utilization summary:
--------------------------Selected Device : xa2s50etq144-6
Number of Slices:
3 out of
768
0%
6 out of 1536
0%
13 out of
12%
102
=========================================================================
TIMING REPORT
NOTE: THESE TIMING NUMBERS ARE ONLY A SYNTHESIS ESTIMATE.
FOR ACCURATE TIMING INFORMATION PLEASE REFER TO THE TRACE REPORT
GENERATED AFTER PLACE-and-ROUTE.
Clock Information:
-----------------98
Ex. No:
Date:
_____________________________________________________________________________________
No clock signals found in this design
Timing Summary:
--------------Speed Grade: -6
Minimum period: No path found
Minimum input arrival time before clock: No path found
Maximum output required time after clock: No path found
Maximum combinational path delay: 11.505ns
Timing Detail:
-------------All values displayed in nanoseconds (ns)
=========================================================================
Timing constraint: Default path analysis
Total number of paths / destination ports: 19 / 1
------------------------------------------------------------------------Delay:
Source:
Destination:
s<2> (PAD)
y (PAD)
Net
---------------------------------------- -----------IBUF:I->O
LUT4:I0->O
Ex. No:
Date:
_____________________________________________________________________________________
MUXF5:I0->O
LUT4:I2->O
LUT2:I0->O
OBUF:I->O
4.602
y_OBUF (y)
---------------------------------------Total
=========================================================================
CPU : 2.44 / 2.73 s | Elapsed : 3.00 / 3.00 s
Total memory usage is 84452 kilobytes
Number of errors : 0 ( 0 filtered)
Number of warnings :
Number of infos
0 ( 0 filtered)
: 1 ( 0 filtered)
SIMULATION RESULTS
100
Ex. No:
Date:
_____________________________________________________________________________________
Ex. No:
Date:
_____________________________________________________________________________________
AIM:
To write VHDL & verilog program for ripple carry adder , simulate the program and verify the
results
APPARATUS:
Computer system
Xilinx 7.1 software tool
PROCEDURE:
Double click on XILINX ISE ICON.
Click on file and new project.
Enter the project name and location click on next.
Choose the settings & click on next & finally click on finish.
Choose VHDL module & enter the file name click o next.
Enter the post name & Select the direction & click on next & finish finally.
Ex. No:
Date:
_____________________________________________________________________________________
Click ont ICON of synthesis-xst then double click on the check syntax option.
Choose sources for behavioral simulation and click on the program name you will
get model sim simulator option on the process window.
Change the value from U to either 0 or 1 and click OK and click on run icon &
similarly vary the inputs value for all possible options and observe the output.
Close the model sim simulator and come back to implementation in the source
for options.
Click on + icon of user constraints and double click on floor plan ID preSynthesis.
103
Ex. No:
Date:
_____________________________________________________________________________________
Click on Yes and enter the pin numbers in the LOC column and click on save
icon and click on OK.
Two devices will get identified click on bypass when devices XCF02S is selected.
Click on the .bit file & select open when device XC3S400 is selected and click
OK.
Right click on device XC3S400 and choose program option by clicking of right
click and click on OK.
Once you got the program succeeded message ,you can test the output on
board.
104
Ex. No:
Date:
_____________________________________________________________________________________
VHDL CODE:
entity rca is
port(a:in std_logic _vector(3 downto 0);
b:in std_logic_vector(3 downto 0);
cin:in std_logic;
sum:out std_logic _vector(3 downto 0);
cout:out std_logic);
end rca;
architecture rca of rca is
component fulladder is
port( a,b,c:in std_logic;
sum,carry:out std_logic);
end component;
sgnal c:std_logic_vector(2 downto 0);
begin
f1:fulladder portmap(a(0),b(0),cin,sum1(0),c(0));
f2:fulladder portmap(a(1),b(1),c(0),sum1(1),c(1));
f3:fulladder portmap(a(2),b(2),c(1),sum1(2),c(2));
f4:fulladder portmap(a(3),b(3),c(2),sum1(3),cout);
105
Ex. No:
Date:
_____________________________________________________________________________________
end rca;
106
Ex. No:
Date:
_____________________________________________________________________________________
VERILOG CODE:
Module rca(a,b,cin,sum,carry);
Input[3:0]a;
Input[3:0]b;
Input cin;
Ouput[3:0]sum;
Output carry;
Wire x,y,z;
F1(cin,a[0],b[0],sum[0],x);
F2(x,a[1],b[1],sum[1],y);
F3(y,a[2],b[2],sum[2],z);
F4(z,a[3],b[3],sum[3],carry);
End module
-------------sub program for ripple carry adder-------------Module fulladder(a,b,cin,sum,carry);
Input a,b,cin;
Output sum,carry;
107
Ex. No:
Date:
_____________________________________________________________________________________
Reg p,q,t2,t3;
Always @(a or b or c)
Begin
Sum=a^b^c;
Ps1=a^b;
Qt1=a&b;
Rt2=b&c;
St3=a&c;
Carry=(a&b/(b&c)/(a&c));
End
End module
RTL SCHEMATIC
108
Ex. No:
Date:
_____________________________________________________________________________________
SYNTHESIS REPORT:
=========================================================================
*
Final Report
=========================================================================
Final Results
RTL Top Level Output File Name
Top Level Output File Name
Output Format
Optimization Goal
Keep Hierarchy
: rc_adder.ngr
: rc_adder
: NGC
: Speed
: NO
Design Statistics
109
Ex. No:
Date:
_____________________________________________________________________________________
# IOs
: 13
Macro Statistics :
# Xors
#
:3
1-bit xor3
:3
Cell Usage :
# BELS
:7
LUT2
:1
LUT3
:4
LUT4
:2
# IO Buffers
#
IBUF
OBUF
: 13
:8
:5
=========================================================================
Device utilization summary:
--------------------------Selected Device : xa2s50etq144-6
Number of Slices:
4 out of
768
0%
7 out of 1536
0%
13 out of
12%
102
=========================================================================
TIMING REPORT
110
Ex. No:
Date:
_____________________________________________________________________________________
NOTE: THESE TIMING NUMBERS ARE ONLY A SYNTHESIS ESTIMATE.
FOR ACCURATE TIMING INFORMATION PLEASE REFER TO THE TRACE REPORT
GENERATED AFTER PLACE-and-ROUTE.
Clock Information:
-----------------No clock signals found in this design
Timing Summary:
--------------Speed Grade: -6
Minimum period: No path found
Minimum input arrival time before clock: No path found
Maximum output required time after clock: No path found
Maximum combinational path delay: 11.343ns
Timing Detail:
-------------All values displayed in nanoseconds (ns)
=========================================================================
Timing constraint: Default path analysis
Total number of paths / destination ports: 28 / 5
------------------------------------------------------------------------Delay:
Source:
Destination:
111
Ex. No:
Date:
_____________________________________________________________________________________
Data Path: num1<0> to carry
Gate
Cell:in->out
Net
---------------------------------------- -----------IBUF:I->O
LUT4:I1->O
LUT3:I2->O
LUT3:I0->O
OBUF:I->O
4.602
sum_3_OBUF (sum<3>)
---------------------------------------Total
=========================================================================
CPU : 2.80 / 3.19 s | Elapsed : 3.00 / 4.00 s
Total memory usage is 84452 kilobytes
Number of errors : 0 ( 0 filtered)
Number of warnings :
Number of infos
0 ( 0 filtered)
: 0 ( 0 filtered)
SIMULATION RESULTS
112
Ex. No:
Date:
_____________________________________________________________________________________
UNIVERSAL COUNTER
113
Ex. No:
Date:
_____________________________________________________________________________________
AIM:
To write VHDL & verilog program for universal counter, simulate the program and verify the
results
APPARATUS:
Computer system
Xilinx 7.1 software tool
PROCEDURE:
Double click on XILINX ISE ICON.
Click on file and new project.
Enter the project name and location click on next.
Choose the settings & click on next & finally click on finish.
Choose VHDL module & enter the file name click o next.
Enter the post name & Select the direction & click on next & finish finally.
114
Ex. No:
Date:
_____________________________________________________________________________________
Click ont ICON of synthesis-xst then double click on the check syntax option.
Choose sources for behavioral simulation and click on the program name you will
get model sim simulator option on the process window.
Change the value from U to either 0 or 1 and click OK and click on run icon &
similarly vary the inputs value for all possible options and observe the output.
Close the model sim simulator and come back to implementation in the source
for options.
Click on + icon of user constraints and double click on floor plan ID preSynthesis.
115
Ex. No:
Date:
_____________________________________________________________________________________
Click on Yes and enter the pin numbers in the LOC column and click on save
icon and click on OK.
Two devices will get identified click on bypass when devices XCF02S is selected.
Click on the .bit file & select open when device XC3S400 is selected and click
OK.
Right click on device XC3S400 and choose program option by clicking of right
click and click on OK.
Once you got the program succeeded message ,you can test the output on
board.
116
Ex. No:
Date:
_____________________________________________________________________________________
Vhdl code:
entity counter is
generic(n:integer:=8);
Port ( clk,reset,load,ud : in std_logic; din: in std_logic_vector(n-1 downto 0); q: out
std_logic_vector(n-1 downto 0));
end counter;
architecture Behavioral of counter is
signal count :std_logic_vector(n-1 downto 0);
begin
process(clk,reset,load,ud)
begin
if(clk='1' and clk'event )then
if(reset='1')then
count<="00000000";
else if(load='1')then
count<=din;
else
if(ud='1')then
117
Ex. No:
Date:
_____________________________________________________________________________________
count<=count+1;
else
count<=count-1;
end if;
end if;
end if;
end if;
q<=count;
end process;
end Behavioral;
VERILOG CODE:
module count(clk, reset, up_down, q);
input clk;
input reset;
input up_down;
output [7:0]q;
reg[7:0]count;
always@(posedge clk or posedge reset)
begin
if(reset==1)
count=0;
else
if(up_down==1)
count=count-1;
else
count=count+1;
end
assign q=count;
118
Ex. No:
Date:
_____________________________________________________________________________________
endmodule
RTL SCHEMATIC
119
Ex. No:
Date:
_____________________________________________________________________________________
SYNTHESIS REPORT:
=========================================================================
*
Final Report
=========================================================================
Final Results
RTL Top Level Output File Name
Top Level Output File Name
Output Format
: counter.ngr
: counter
: NGC
Optimization Goal
: Speed
Keep Hierarchy
: NO
Design Statistics
# IOs
: 20
Macro Statistics :
# Counters
:1
120
Ex. No:
Date:
_____________________________________________________________________________________
#
:1
Cell Usage :
# BELS
: 35
GND
:1
INV
LUT2
LUT4_L
MULT_AND
MUXCY
VCC
XORCY
:1
:1
:8
:7
:8
:1
:8
# FlipFlops/Latches
#
:8
FDRSE
:8
# Clock Buffers
#
:1
BUFGP
:1
# IO Buffers
: 19
IBUF
: 11
OBUF
:8
=========================================================================
Device utilization summary:
--------------------------Selected Device : xa2s50etq144-6
Number of Slices:
5 out of
768
0%
8 out of 1536
0%
9 out of 1536
0%
121
Ex. No:
Date:
_____________________________________________________________________________________
Number of bonded IOBs:
20 out of
Number of GCLKs:
1 out of
102
4
19%
25%
=========================================================================
TIMING REPORT
NOTE: THESE TIMING NUMBERS ARE ONLY A SYNTHESIS ESTIMATE.
FOR ACCURATE TIMING INFORMATION PLEASE REFER TO THE TRACE REPORT
GENERATED AFTER PLACE-and-ROUTE.
Clock Information:
----------------------------------------------------+------------------------+-------+
Clock Signal
-----------------------------------+------------------------+-------+
clk
| BUFGP
|8
-----------------------------------+------------------------+-------+
Timing Summary:
--------------Speed Grade: -6
Minimum period: 4.845ns (Maximum Frequency: 206.398MHz)
Minimum input arrival time before clock: 7.168ns
Maximum output required time after clock: 6.744ns
Maximum combinational path delay: No path found
Timing Detail:
122
Ex. No:
Date:
_____________________________________________________________________________________
-------------All values displayed in nanoseconds (ns)
=========================================================================
Timing constraint: Default period analysis for Clock 'clk'
Clock period: 4.845ns (frequency: 206.398MHz)
Total number of paths / destination ports: 64 / 8
------------------------------------------------------------------------Delay:
Source:
Destination:
count_7 (FF)
Source Clock:
clk rising
Net
---------------------------------------- -----------FDRSE:C->Q
LUT4_L:I1->LO
MUXCY:S->O
MUXCY:CI->O
MUXCY:CI->O
MUXCY:CI->O
MUXCY:CI->O
MUXCY:CI->O
MUXCY:CI->O
XORCY:CI->O
FDRSE:D
0.724
count_7
123
Ex. No:
Date:
_____________________________________________________________________________________
---------------------------------------Total
=========================================================================
Timing constraint: Default OFFSET IN BEFORE for Clock 'clk'
Total number of paths / destination ports: 160 / 16
------------------------------------------------------------------------Offset:
Source:
Destination:
Net
---------------------------------------- -----------IBUF:I->O
INV:I->O
LUT4_L:I0->LO
MUXCY:S->O
MUXCY:CI->O
MUXCY:CI->O
MUXCY:CI->O
MUXCY:CI->O
MUXCY:CI->O
MUXCY:CI->O
XORCY:CI->O
FDRSE:D
0.724
count_7
124
Ex. No:
Date:
_____________________________________________________________________________________
---------------------------------------Total
=========================================================================
Timing constraint: Default OFFSET OUT AFTER for Clock 'clk'
Total number of paths / destination ports: 8 / 8
------------------------------------------------------------------------Offset:
Source:
Destination:
Source Clock:
q<7> (PAD)
clk rising
Net
---------------------------------------- -----------FDRSE:C->Q
OBUF:I->O
q_7_OBUF (q<7>)
---------------------------------------Total
=========================================================================
CPU : 3.39 / 3.77 s | Elapsed : 4.00 / 4.00 s
-->
Total memory usage is 84452 kilobytes
125
Ex. No:
Date:
_____________________________________________________________________________________
1 ( 0 filtered)
: 0 ( 0 filtered)
SIMULATION RESULTS
126
Ex. No:
Date:
_____________________________________________________________________________________
127
Ex. No:
Date:
_____________________________________________________________________________________
AIM:
To write VHDL & verilog program for universal shift register , simulate the program and verify
the results
APPARATUS:
Computer system
Xilinx 7.1 software tool
PROCEDURE:
Double click on XILINX ISE ICON.
Click on file and new project.
Enter the project name and location click on next.
Choose the settings & click on next & finally click on finish.
Choose VHDL module & enter the file name click o next.
Enter the post name & Select the direction & click on next & finish finally.
128
Ex. No:
Date:
_____________________________________________________________________________________
Click ont ICON of synthesis-xst then double click on the check syntax option.
Choose sources for behavioral simulation and click on the program name you will
get model sim simulator option on the process window.
Change the value from U to either 0 or 1 and click OK and click on run icon &
similarly vary the inputs value for all possible options and observe the output.
Close the model sim simulator and come back to implementation in the source
for options.
Click on + icon of user constraints and double click on floor plan ID preSynthesis.
129
Ex. No:
Date:
_____________________________________________________________________________________
Click on Yes and enter the pin numbers in the LOC column and click on save
icon and click on OK.
Two devices will get identified click on bypass when devices XCF02S is selected.
Click on the .bit file & select open when device XC3S400 is selected and click
OK.
Right click on device XC3S400 and choose program option by clicking of right
click and click on OK.
Once you got the program succeeded message ,you can test the output on
board.
130
Ex. No:
Date:
_____________________________________________________________________________________
VHDL CODE:
entity shiftreg is
Port ( clk : in std_logic;
dsr : in std_logic;
drl : in std_logic;
clr_l : in std_logic;
Ex. No:
Date:
_____________________________________________________________________________________
when others=>null;
end case;
end if;
end if;
end process;
end Behavioral;
VERILOG CODE:
module shift (C, SI, SO);
input C,SI;
output SO;
reg [7:0] tmp;
always @(posedge C)
begin
tmp <= tmp << 1;
tmp[0] <= SI;
end
assign SO = tmp[7];
endmodule
port(
C, SI, CLR : in std_logic;
SO : out std_logic);
end shift;
132
Ex. No:
Date:
_____________________________________________________________________________________
RTL SCHEMATIC
133
Ex. No:
Date:
_____________________________________________________________________________________
SYNTHESIS REPORT:
=========================================================================
*
Final Report
=========================================================================
Final Results
RTL Top Level Output File Name
Top Level Output File Name
Output Format
: shift.ngr
: shift
: NGC
Optimization Goal
: Speed
Keep Hierarchy
: NO
Design Statistics
# IOs
:3
Macro Statistics :
134
Ex. No:
Date:
_____________________________________________________________________________________
# Shift Registers
:1
:1
Cell Usage :
# BELS
:2
GND
:1
VCC
:1
# FlipFlops/Latches
#
:1
FDE
:1
# Shifters
:1
SRL16E
:1
# Clock Buffers
#
:1
BUFGP
:1
# IO Buffers
:2
IBUF
OBUF
:1
:1
=========================================================================
Device utilization summary:
--------------------------Selected Device : 2s50eft256-6
Number of Slices:
1 out of
768
0%
1 out of 1536
0%
1 out of 1536
0%
3 out of
1%
Number of GCLKs:
1 out of
182
4
25%
135
Ex. No:
Date:
_____________________________________________________________________________________
=========================================================================
TIMING REPORT
NOTE: THESE TIMING NUMBERS ARE ONLY A SYNTHESIS ESTIMATE.
FOR ACCURATE TIMING INFORMATION PLEASE REFER TO THE TRACE REPORT
GENERATED AFTER PLACE-and-ROUTE.
Clock Information:
----------------------------------------------------+------------------------+-------+
Clock Signal
-----------------------------------+------------------------+-------+
C
| BUFGP
|2
-----------------------------------+------------------------+-------+
Timing Summary:
--------------Speed Grade: -6
Minimum period: 4.712ns (Maximum Frequency: 212.224MHz)
Minimum input arrival time before clock: 2.300ns
Maximum output required time after clock: 6.514ns
Maximum combinational path delay: No path found
Timing Detail:
-------------All values displayed in nanoseconds (ns)
136
Ex. No:
Date:
_____________________________________________________________________________________
=========================================================================
Timing constraint: Default period analysis for Clock 'C'
Clock period: 4.712ns (frequency: 212.224MHz)
Total number of paths / destination ports: 1 / 1
------------------------------------------------------------------------Delay:
Source:
Destination:
Source Clock:
Net
---------------------------------------- -----------SRL16E:CLK->Q
FDE:D
Mshreg_tmp<7>_0
---------------------------------------Total
=========================================================================
Timing constraint: Default OFFSET IN BEFORE for Clock 'C'
Total number of paths / destination ports: 1 / 1
------------------------------------------------------------------------Offset:
Source:
Destination:
Ex. No:
Date:
_____________________________________________________________________________________
Net
---------------------------------------- -----------IBUF:I->O
SRL16E:D
0.583
Mshreg_tmp<7>_srl_0
---------------------------------------Total
=========================================================================
Timing constraint: Default OFFSET OUT AFTER for Clock 'C'
Total number of paths / destination ports: 1 / 1
------------------------------------------------------------------------Offset:
Source:
Destination:
Source Clock:
Net
---------------------------------------- -----------FDE:C->Q
OBUF:I->O
SO_OBUF (SO)
---------------------------------------Total
Ex. No:
Date:
_____________________________________________________________________________________
=========================================================================
CPU : 3.38 / 5.47 s | Elapsed : 3.00 / 5.00 s
-->
Total memory usage is 84452 kilobytes
Number of errors : 0 ( 0 filtered)
Number of warnings :
Number of infos
0 ( 0 filtered)
: 0 ( 0 filtered)
SIMULATION RESULTS
139
Ex. No:
Date:
_____________________________________________________________________________________
COMPARATOR
140
Ex. No:
Date:
_____________________________________________________________________________________
AIM:
a. Write a program for digital circuit using VHDL.
b. Verify the functionality of designed circuit.
c. Give the Timing simulation for critical path time calculation & also
synthesis for digital Circuit.
d. Implement the place & route technique for major FPGA vendori.e. XILINX
e. Implement the designed digital circuit using FPGA &CPLD devices.
APPARATUS:
1. System
2. Xilinx Software
3. Sparton-3 FPGA devices
PROCEDURE:
Double click on XILINX ISE ICON.
Click on file and new project.
Enter the project name and location click on next.
Choose the settings & click on next & finally click on finish.
Ex. No:
Date:
_____________________________________________________________________________________
Choose VHDL module & enter the file name click o next.
Enter the post name & Select the direction & click on next & finish finally.
Click ont ICON of synthesis-xst then double click on the check syntax option.
Choose sources for behavioral simulation and click on the program name you will
get model sim simulator option on the process window.
Change the value from U to either 0 or 1 and click OK and click on run icon &
similarly vary the inputs value for all possible options and observe the output.
142
Ex. No:
Date:
_____________________________________________________________________________________
Close the model sim simulator and come back to implementation in the source
for options.
Click on + icon of user constraints and double click on floor plan ID preSynthesis.
Click on Yes and enter the pin numbers in the LOC column and click on save
icon and click on OK.
Two devices will get identified click on bypass when devices XCF02S is selected.
Click on the .bit file & select open when device XC3S400 is selected and click
OK.
Right click on device XC3S400 and choose program option by clicking of right
click and click on OK.
143
Ex. No:
Date:
_____________________________________________________________________________________
Once you got the program succeeded message ,you can test the output on
board.
PROGRAM:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity comparator is
Generic(N:integer :=3);
port(a,b:in std_logic_vector(n downto 0); alb,aeb,agb: out std_logic);
end comparator;
architecture Behavioral of comparator is
begin
process(a,b)
144
Ex. No:
Date:
_____________________________________________________________________________________
begin
if(a<b) then alb<='1';
else alb<='0';
end if;
if(a>b)
then agb<='1';else agb<='0';
end if;
if(a=b)then aeb<='1';else aeb<='0';
end if;
end process;
end Behavioral;
145
Ex. No:
Date:
_____________________________________________________________________________________
RTL Schematic:
146
Ex. No:
Date:
_____________________________________________________________________________________
147
Ex. No:
Date:
_____________________________________________________________________________________
148
Ex. No:
Date:
_____________________________________________________________________________________
==================================================
==============================
*
==================================================
===============================
Final Results
RTL Top Level Output File Name
: comparator.ngr
: comparator
Output Format
: NGC
Optimization Goal
: Speed
Keep Hierarchy
: NO
Design Statistics
# IOs
: 11
Cell Usage :
# BELS
#
LUT2
LUT4
MUXF5
: 11
:1
:8
:2
# IO Buffers
: 11
149
Ex. No:
Date:
_____________________________________________________________________________________
#
IBUF
:8
OBUF
==================================================
=============
Timing Report for Comparator:
==================================================
============
Timing constraint: Default path analysis
Total number of paths / destination ports: 38 / 3
---------------------------------------------------------------------------------------------------Delay
Source
Destination :
a<1> (PAD)
agb (PAD)
Net
---------------------------------------- --------------------------------------------------------IBUF:I->O
LUT4:I0->O
LUT4:I0->O
Ex. No:
Date:
_____________________________________________________________________________________
MUXF5:I0->O
OBUF:I->O
agb_OBUF (agb)
-------------------------------------------------------------------------------------------------Total
PRECAUTIONS:
Note down the results without parallax error.
Avoid the loose connections while designs the circuit.
Observe the waveforms carefully.
151
Ex. No:
Date:
_____________________________________________________________________________________
152
Ex. No:
Date:
_____________________________________________________________________________________
DFLIPFLOP
AIM:
a. Write a program for digital circuit using VHDL.
b. Verify the functionality of designed circuit.
c. Give the Timing simulation for critical path time calculation & also
synthesis for digital circuit.
d. Implement the place & route technique for major FPGA vendor i.e., XILINX
e. Implement the designed digital circuit using FPGA &CPLD devices.
APPARATUS:
1. System
2. Xilinx Software
3. Sparton-3 FPGA devices
PROCEDURE:
Double click on XILINX ISE ICON.
Click on file and new project.
153
Ex. No:
Date:
_____________________________________________________________________________________
Enter the project name and location click on next.
Choose the settings & click on next & finally click on finish.
Choose VHDL module & enter the file name click o next.
Enter the post name & Select the direction & click on next & finish finally.
Click ont ICON of synthesis-xst then double click on the check syntax option.
Choose sources for behavioral simulation and click on the program name you will
get model sim simulator option on the process window.
154
Ex. No:
Date:
_____________________________________________________________________________________
Click on + (ZOOM) icon to maximize the window of waveform.
Right click on the signal and select the force value.
Change the value from U to either 0 or 1 and click OK and click on run icon &
similarly vary the inputs value for all possible options and observe the output.
Close the model sim simulator and come back to implementation in the source
for options.
Click on + icon of user constraints and double click on floor plan ID preSynthesis.
Click on Yes and enter the pin numbers in the LOC column and click on save
icon and click on OK.
Two devices will get identified click on bypass when devices XCF02S is selected.
Click on the .bit file & select open when device XC3S400 is selected and click
OK.
155
Ex. No:
Date:
_____________________________________________________________________________________
Right click on device XC3S400 and choose program option by clicking of right
click and click on OK.
Once you got the program succeeded message ,you can test the output on
board.
PROGRAM:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity dflipflop is
Port ( clk : in STD_LOGIC;
d : in STD_LOGIC;
q : out STD_LOGIC);
156
Ex. No:
Date:
_____________________________________________________________________________________
end dflipflop;
architecture Behavioral of dflipflopf is
begin
process(clk)
begin
if(clk'event and clk='1')then
q<=d;
end if;
end process;
end Behavioral;
RTL SCHEMATIC:
157
Ex. No:
Date:
_____________________________________________________________________________________
SYNTHESIS:
==================================================
==============*
Final Report
==================================================
=============
Final Results
RTL Top Level Output File Name
Top Level Output File Name
Output Format
: dflipflop.ngr
: dflip-flop
: NGC
158
Ex. No:
Date:
_____________________________________________________________________________________
Optimization Goal
: Speed
Keep Hierarchy
: NO
Design Statistics
# IOs
:3
Macro Statistics:
# Registers
:1
:1
1-bit register
Cell Usage:
# Flip-flops/Latches
#
FD
:1
:1
# Clock Buffers
#
:1
BUFGP
:1
# IO Buffers
:2
IBUF
OBUF
:1
:1
==================================================
==============Timing constraint: Default OFFSET IN BEFORE for Clock 'clk'
Total number of paths / destination ports: 1 / 1
---------------------------------------------------------------------------------------------------------
159
Ex. No:
Date:
_____________________________________________________________________________________
Offset:
Source:
Destination:
q (FF)
Net
---------------------------------------------------------------------------------------- ------IBUF:I->O
FD:D
-------------------------------------------------------------------------------------------------Total
PRECAUTIONS:
Note down the results without parallax error.
Avoid the loose connections while designs the circuit.
Observe the waveforms carefully.
160
Ex. No:
Date:
_____________________________________________________________________________________
SIMULATION:
161
Ex. No:
Date:
_____________________________________________________________________________________
JK FLIPFLOP
162
Ex. No:
Date:
_____________________________________________________________________________________
AIM:
a. Write a program for digital circuit using VHDL.
b. Verify the functionality of designed circuit.
c. Give the Timing simulation for critical path time calculation & also
Synthesis for digital circuit.
d. Implement the place & route technique for major FPGA vendor i.e., XILINX
e. Implement the designed digital circuit using FPGA &CPLD devices.
APPARATUS:
1. System
2. Xilinx Software
3. Sparton-3 FPGA devices
PROCEDURE:
Double click on XILINX ISE ICON.
Click on file and new project.
Enter the project name and location click on next.
Choose the settings & click on next & finally click on finish.
Ex. No:
Date:
_____________________________________________________________________________________
Choose VHDL module & enter the file name click o next.
Enter the post name & Select the direction & click on next & finish finally.
Click ont ICON of synthesis-xst then double click on the check syntax option.
Choose sources for behavioral simulation and click on the program name you will
get model sim simulator option on the process window.
Change the value from U to either 0 or 1 and click OK and click on run icon &
similarly vary the inputs value for all possible options and observe the output.
164
Ex. No:
Date:
_____________________________________________________________________________________
Close the model sim simulator and come back to implementation in the source
for options.
Click on + icon of user constraints and double click on floor plan ID preSynthesis.
Click on Yes and enter the pin numbers in the LOC column and click on save
icon and click on OK.
Two devices will get identified click on bypass when devices XCF02S is selected.
Click on the .bit file & select open when device XC3S400 is selected and click
OK.
Right click on device XC3S400 and choose program option by clicking of right
click and click on OK.
Ex. No:
Date:
_____________________________________________________________________________________
Once you got the program succeeded message ,you can test the output on
board.
PROGRAM:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity jkff is
Port ( clk : in bit;
j : in bit;
k : in bit;
reset : in bit;
q : buffer bit);
end jkff;
166
Ex. No:
Date:
_____________________________________________________________________________________
architecture Behavioral of jkff is
begin
process(clk,reset)
begin
if(reset='1') then
q <='0';
elsif(clk'event and clk='1') then
if(j='0' and k='0') then
q<=q;
elsif(j='0' and k='1') then
q<='0';
elsif(j='1' and k='0') then
q<='1';
elsif(j='1' and k='1') then
q<= not q;
end if;
end if;
end process;
end Behavioral;
167
Ex. No:
Date:
_____________________________________________________________________________________
RTL SCHEMATIC:
168
Ex. No:
Date:
_____________________________________________________________________________________
169
Ex. No:
Date:
_____________________________________________________________________________________
SYNTHESIS:
==================================================
=============
*
Final Report
==================================================
=============
Final Results
RTL Top Level Output File Name
Top Level Output File Name
Output Format
: jkff.ngr
: jkff
: NGC
170
Ex. No:
Date:
_____________________________________________________________________________________
Optimization Goal
: Speed
Keep Hierarchy
: NO
Design Statistics
# IOs
:5
Macro Statistics :
# Registers
:1
:1
1-bit register
# Multiplexers
#
:1
:1
Cell Usage :
# BELS
:2
LUT2
:1
LUT3_L
:1
# FlipFlops/Latches
#
FDCE
:1
:1
# Clock Buffers
#
:1
BUFGP
:1
# IO Buffers
:4
IBUF
:3
171
Ex. No:
Date:
_____________________________________________________________________________________
#
OBUF
:1
==================================================
===========
Timing constraint: Default period analysis for Clock 'clk'
Clock period: 3.334ns (frequency: 299.940MHz)
Total number of paths / destination ports: 1 / 1
----------------------------------------------------------------------------------------------------Delay:
Source:
Destination:
q (FF)
Source Clock:
clk rising
Gate
Net
---------------------------------------- ------------------------------------------------------FDCE:C->Q
LUT3_L:I2->LO
FDCE:D
0.724
-------------------------------------------------------------------------------------------------
172
Ex. No:
Date:
_____________________________________________________________________________________
Total
PRECAUTIONS:
Note down the results without parallax error.
Avoid the loose connections while designs the circuit.
Observe the waveforms carefully.
SIMULATION:
173
Ex. No:
Date:
_____________________________________________________________________________________
SR FLIPFLOP
174
Ex. No:
Date:
_____________________________________________________________________________________
AIM:
a. Write a program for digital circuit using VHDL.
b. Verify the functionality of designed circuit.
c. Give the Timing simulation for critical path time calculation & also
Synthesis for digital circuit.
d. Implement the place & route technique for major FPGA vendor i.e., XILINX
e. Implement the designed digital circuit using FPGA &CPLD devices.
APPARATUS:
1. System
2. Xilinx Software
3. Sparton-3 FPGA devices
PROCEDURE:
Double click on XILINX ISE ICON.
Click on file and new project.
Enter the project name and location click on next.
Choose the settings & click on next & finally click on finish.
Ex. No:
Date:
_____________________________________________________________________________________
Choose VHDL module & enter the file name click o next.
Enter the post name & Select the direction & click on next & finish finally.
Click ont ICON of synthesis-xst then double click on the check syntax option.
Choose sources for behavioral simulation and click on the program name you will
get model sim simulator option on the process window.
Change the value from U to either 0 or 1 and click OK and click on run icon &
similarly vary the inputs value for all possible options and observe the output.
176
Ex. No:
Date:
_____________________________________________________________________________________
Close the model sim simulator and come back to implementation in the source
for options.
Click on + icon of user constraints and double click on floor plan ID preSynthesis.
Click on Yes and enter the pin numbers in the LOC column and click on save
icon and click on OK.
Two devices will get identified click on bypass when devices XCF02S is selected.
Click on the .bit file & select open when device XC3S400 is selected and click
OK.
Right click on device XC3S400 and choose program option by clicking of right
click and click on OK.
Ex. No:
Date:
_____________________________________________________________________________________
Once you got the program succeeded message ,you can test the output on
board.
PROGRAM:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL
entity srff is
Port ( s : in bit;
r : in bit;
clk : in bit;
q : buffer std_logic);
end srff;
architecture Behavioral of srff is
begin
178
Ex. No:
Date:
_____________________________________________________________________________________
process(clk)
begin
if clk='1' and clk'event then
if(s='0' and r='0') then q<=q;
elsif(s='0' and r='1') then q<='0';
elsif(s='1' and r='0') then q<='1';
elsif(s='1' and r='1') then q<='Z';
end if;
end if;
end process;
end Behavioral;
179
Ex. No:
Date:
_____________________________________________________________________________________
RTL SCHEMATIC:
180
Ex. No:
Date:
_____________________________________________________________________________________
181
Ex. No:
Date:
_____________________________________________________________________________________
SYNTHESIS:
==================================================
==============
*
Final Report
==================================================
==============
Final Results
RTL Top Level Output File Name
Top Level Output File Name
Output Format
: srff.ngr
: srff
: NGC
Optimization Goal
: Speed
Keep Hierarchy
: NO
Design Statistics
# IOs
:4
Macro Statistics :
# Registers
:2
:2
1-bit register
182
Ex. No:
Date:
_____________________________________________________________________________________
# Multiplexers
#
# Tristates
#
:1
:1
:1
:1
Cell Usage :
# BELS
:3
:3
LUT2
# FlipFlops/Latches
#
FDE
:2
:2
# Clock Buffers
#
:1
BUFGP
:1
# IO Buffers
:3
IBUF
OBUFT
:2
:1
==================================================
==============Device utilization summary:
-------------------------------------------------------------------------------------------------------Selected Device : 2s50eft256-6
Number of Slices:
2 out of
768
183
0%
Ex. No:
Date:
_____________________________________________________________________________________
Number of Slice Flip Flops:
2 out of 1536
0%
3 out of 1536
0%
4 out of
Number of GCLKs:
1 out of
182
4
2%
25%
==================================================
==============Timing constraint: Default OFFSET IN BEFORE for Clock 'clk'
Total number of paths / destination ports: 8 / 4
------------------------------------------------------------------------------------------------------Offset:
Source:
Destination:
Net
---------------------------------------- ------------------------------------------------IBUF:I->O
LUT2:I0->O
FDE:CE
Mtrien_q
184
Ex. No:
Date:
_____________________________________________________________________________________
----------------------------------------------------------------------------------------------Total
PRECAUTIONS:
Note down the results without parallax error.
Avoid the loose connections while designs the circuit.
Observe the waveforms carefully.
185
Ex. No:
Date:
_____________________________________________________________________________________
SIMULATION
186
Ex. No:
Date:
_____________________________________________________________________________________
187