Professional Documents
Culture Documents
AIM:
To design implement the combinational circuit using Verilog HDL
APPARATUS REQUIRED:
1) PC
2) Xilinx ISE Design Suite 13.1
PROCEDURE:
1) Open Xilinx ISE Design Suite 13.1
2) Click on File🡪New Project for opening an project file
3) Enter the Project Name🡪Click Next
4) Enter the device details as Spartan3, speed as -4 and device as XC3S50
5) Click on New Source tab🡪 Verilog Module to Enter the name of the Project and click
Next\
6) Define the input and output port for the module being designed and type the program
code
7) Check Syntax and if successful click on Synthesize XST
8) RTL Schematic and Technological Schematic can be obtained by selecting the
Implementation tab
9) Repeat the same procedure for creating New Source🡪 Verilog Text Fixture
10) The output graph can be obtained by simulation of the Verilog Text Fixture
PROGRAMS:
1)FULL ADDER:
STRUCTURAL MODEL:
module fulladdr(
input a,
input b,
input c,
output sum,
output carry
);
wire x,y,z;
xor(x,a,b);
and(y,a,b);
xor(sum,x,c);
and(z,x,c);
or(carry,z,y);
endmodule
#100;a=3'b1;b=3'b1;c=3'b1;
// Add stimulus here
end
endmodule
SYNTHESIZE REPORT:
Synthesis report
Release 13.1 - xst O.40d (nt)
Copyright (c) 1995-2011 Xilinx, Inc. All rights reserved.
--> Parameter TMPDIR set to xst/projnav.tmp
TABLE OF CONTENTS
1) Synthesis Options Summary
2) HDL Compilation
3) Design Hierarchy Analysis
4) HDL Analysis
5) HDL Synthesis
5.1) HDL Synthesis Report
6) Advanced HDL Synthesis
6.1) Advanced HDL Synthesis Report
7) Low Level Synthesis
8) Partition Report
9) Final Report
9.1) Device utilization summary
9.2) Partition Resource Summary
9.3) TIMING REPORT
=====================================================================
====
* Synthesis Options Summary *
=====================================================================
====
---- Source Parameters
Optimization Effort :1
Keep Hierarchy : No
Netlist Hierarchy : As_Optimized
RTL Output : Yes
Global Optimization : AllClockNets
Read Cores : YES
Write Timing Constraints : NO
Cross Clock Analysis : NO
Hierarchy Separator :/
Bus Delimiter : <>
Case Specifier : Maintain
Slice Utilization Ratio : 100
BRAM Utilization Ratio : 100
Verilog 2001 : YES
Auto BRAM Packing : NO
Slice Utilization Ratio Delta : 5
=====================================================================
====
=====================================================================
====
* HDL Compilation *
=====================================================================
====
Compiling verilog file "fulladdrfpga.v" in library work
Module <fulladdrfpga> compiled
No errors in compilation
Analysis of file <"fulladdrfpga.prj"> succeeded.
=====================================================================
====
* Design Hierarchy Analysis *
=====================================================================
====
Analyzing hierarchy for module <fulladdrfpga> in library <work>.
=====================================================================
====
* HDL Analysis *
=====================================================================
====
Analyzing top module <fulladdrfpga>.
=====================================================================
====
* HDL Synthesis *
=====================================================================
====
=====================================================================
====
HDL Synthesis Report
Macro Statistics
# Xors :2
1-bit xor2 :2
=====================================================================
====
=====================================================================
====
* Advanced HDL Synthesis *
=====================================================================
====
=====================================================================
====
Advanced HDL Synthesis Report
Macro Statistics
# Xors :2
1-bit xor2 :2
=====================================================================
====
=====================================================================
====
* Low Level Synthesis *
=====================================================================
====
=====================================================================
====
Final Register Report
Found no macro
=====================================================================
====
=====================================================================
====
* Partition Report *
=====================================================================
====
-------------------------------
=====================================================================
====
* Final Report *
=====================================================================
====
Final Results
RTL Top Level Output File Name : fulladdrfpga.ngr
Top Level Output File Name : fulladdrfpga
Output Format : NGC
Optimization Goal : Speed
Keep Hierarchy : No
Design Statistics
# IOs :5
Cell Usage :
# BELS :2
# LUT3 :2
# IO Buffers :5
# IBUF :3
# OBUF :2
=====================================================================
====
---------------------------
Partition Resource Summary:
---------------------------
---------------------------
=====================================================================
====
TIMING REPORT
Clock Information:
------------------
No clock signals found in this design
----------------------------------------
No asynchronous control signals found in this design
Timing Summary:
---------------
Speed Grade: -4
Timing Detail:
--------------
All values displayed in nanoseconds (ns)
BLOCK DIAGRAM:
RTL SCHEMATIC:
TECHNOLOGY SCHEMATIC:
OUTPUT:
2)HALF ADDER:
STRUCTURAL MODEL:
module halfadder(
input a,
input b,
output sum,
output carry
);
xor r1(sum,a,b);
and p1(carry,a,b);
endmodule
BLOCK DIAGRAM:
RTL SCHEMATIC:
TECHNOLOGICAL SCHEMATIC:
OUTPUT:
3) FULL SUBTRACTOR:
STRUCTURAL MODEL:
module fullsubtr(
input a,
input b,
input c,
output diff,
output borrow
);
wire x,y,z,l,m;
xor r1(x,a,b);
xor r2(diff,x,c);
not n1(l,a);
not n2(m,x);
and p1(y,l,b);
and p2(z,m,c);
or s1(borrow,z,y);
endmodule
#100;a=3'b0;b=3'b0;c=3'b1;
#100;a=3'b0;b=3'b1;c=3'b0;
#100;a=3'b0;b=3'b1;c=3'b1;
#100;a=3'b1;b=3'b0;c=3'b0;
#100;a=3'b1;b=3'b0;c=3'b1;
#100;a=3'b1;b=3'b1;c=3'b0;
#100;a=3'b1;b=3'b1;c=3'b1;
// Add stimulus here
end
endmodule
BLOCK DIAGRAM:
RTL SCHEMATIC:
TECHNOLOGY SCHEMATIC:
OUTPUT:
4)HALF SUBTRACTOR:
DATAFLOW MODEL:
module halfsubtr(
input a,
input b,
output diff,
output borrow
);
assign diff=a^b;
assign l=~a;
assign borrow=l&b;
endmodule
BLOCK DIAGRAM:
RTL SCHEMATIC:
TECHNOLOGY SCHEMATIC:
OUTPUT:
5) 8X3 ENCODER:
STRUCTURAL MODEL:
module encod(
input [0:7] E,
output X,
output Y,
output Z
);
assign X=E[0]+E[4]+E[5]+E[6]+E[7];
assign Y=E[2]+E[3]+E[6]+E[7];
assign Z=E[1]+E[3]+E[5]+E[7];
endmodule
BLOCK DIAGRAM:
RTL SCHEMATIC:
TECHNOLOGY SCHEMATIC:
OUTPUT:
6) 3X8 DECODER:
module decode3_8(
input [0:2]x,
output [0:7]d
);
wire [0:2]a;
assign a[0]=~x[0];
assign a[1]=~x[1];
assign a[2]=~x[2];
assign d[0]=a[0]&a[1]&a[2];
assign d[1]=a[0]&a[1]&x[2];
assign d[2]=a[0]&x[1]&a[2];
assign d[3]=a[0]&x[1]&x[2];
assign d[4]=x[0]&a[1]&a[2];
assign d[5]=x[0]&a[1]&x[2];
assign d[6]=x[0]&x[1]&a[2];
assign d[7]=x[0]&x[1]&x[2];
endmodule
module decode3_8test;
// Inputs
reg [0:2] x;
// Outputs
wire [0:7] d;
end
endmodule
SYNTHESIS REPORT:
TABLE OF CONTENTS
1) Synthesis Options Summary
2) HDL Compilation
3) Design Hierarchy Analysis
4) HDL Analysis
5) HDL Synthesis
5.1) HDL Synthesis Report
6) Advanced HDL Synthesis
6.1) Advanced HDL Synthesis Report
7) Low Level Synthesis
8) Partition Report
9) Final Report
9.1) Device utilization summary
9.2) Partition Resource Summary
9.3) TIMING REPORT
=====================================================================
====
* Synthesis Options Summary *
=====================================================================
====
---- Source Parameters
Input File Name : "decode3_8.prj"
Input Format : mixed
Ignore Synthesis Constraint File : NO
=====================================================================
====
* Design Hierarchy Analysis *
=====================================================================
====
Analyzing hierarchy for module <decode3_8> in library <work>.
=====================================================================
====
* HDL Analysis *
=====================================================================
====
Analyzing top module <decode3_8>.
Module <decode3_8> is correct for synthesis.
=====================================================================
====
* HDL Synthesis *
=====================================================================
====
=====================================================================
====
HDL Synthesis Report
Found no macro
=====================================================================
====
=====================================================================
====
* Advanced HDL Synthesis *
=====================================================================
====
=====================================================================
====
Advanced HDL Synthesis Report
Found no macro
=====================================================================
====
=====================================================================
====
* Low Level Synthesis *
=====================================================================
====
Found no macro
=====================================================================
====
=====================================================================
====
* Partition Report *
=====================================================================
====
Design Statistics
# IOs : 11
Cell Usage :
# BELS :8
# LUT3 :8
# IO Buffers : 11
# IBUF :3
# OBUF :8
=====================================================================
====
---------------------------
Partition Resource Summary:
---------------------------
=====================================================================
====
TIMING REPORT
Timing Summary:
---------------
Speed Grade: -4
-->
BLOCK DIAGRAM:
RTL SCHEMATIC:
TECHNOLOGY SCHEMATIC:
OUTPUT:
MULTIPLEXER:
);
initial begin
// Initialize Inputs
x = 0;
y = 0;
z = 0;
// Wait 100 ns for global reset to finish
#100 x=1'b0;y=1'b0;z=1'b0;
#100 x=1'b0;y=1'b0;z=1'b1;
#100 x=1'b0;y=1'b1;z=1'b0;
#100 x=1'b0;y=1'b1;z=1'b1;
#100 x=1'b1;y=1'b0;z=1'b0;
#100 x=1'b1;y=1'b0;z=1'b1;
#100 x=1'b1;y=1'b1;z=1'b0;
#100 x=1'b1;y=1'b1;z=1'b1;
// Add stimulus here
end
endmodule
BLOCK DIAGRAM:
RTL SCHEMATIC:
TECHNOLOGY SCHEMATIC:
OUTPUT:
DEMULTIPLEXER:
TEST BENCH:
module demux1_8test;
// Inputs
reg [0:2] s;
// Outputs
wire [0:7] o;
// Instantiate the Unit Under Test (UUT)
demux1_8 uut (
.s(s),
.o(o)
);
initial begin
// Initialize Inputs
s = 0;
// Wait 100 ns for global reset to finish
#100 s[2]=1'b0;s[1]=1'b0;s[0]=1'b0;
#100 s[2]=1'b0;s[1]=1'b0;s[0]=1'b1;
#100 s[2]=1'b0;s[1]=1'b1;s[0]=1'b0;
#100 s[2]=1'b0;s[1]=1'b1;s[0]=1'b1;
#100 s[2]=1'b1;s[1]=1'b0;s[0]=1'b0;
#100 s[2]=1'b1;s[1]=1'b0;s[0]=1'b1;
#100 s[2]=1'b1;s[1]=1'b1;s[0]=1'b0;
#100 s[2]=1'b1;s[1]=1'b1;s[0]=1'b1;
// Add stimulus here
end
endmodule
SYNTHESIZE REPORT:
TABLE OF CONTENTS
1) Synthesis Options Summary
2) HDL Compilation
3) Design Hierarchy Analysis
4) HDL Analysis
5) HDL Synthesis
5.1) HDL Synthesis Report
6) Advanced HDL Synthesis
6.1) Advanced HDL Synthesis Report
7) Low Level Synthesis
8) Partition Report
9) Final Report
9.1) Device utilization summary
9.2) Partition Resource Summary
9.3) TIMING REPORT
=====================================================================
====
* Synthesis Options Summary *
=====================================================================
====
---- Source Parameters
Input File Name : "demux1_8.prj"
Input Format : mixed
Ignore Synthesis Constraint File : NO
=====================================================================
====
=====================================================================
====
* HDL Compilation *
=====================================================================
====
Compiling verilog file "demux1_8.v" in library work
Module <demux1_8> compiled
No errors in compilation
Analysis of file <"demux1_8.prj"> succeeded.
=====================================================================
====
* Design Hierarchy Analysis *
=====================================================================
====
Analyzing hierarchy for module <demux1_8> in library <work>.
=====================================================================
====
* HDL Analysis *
=====================================================================
====
Analyzing top module <demux1_8>.
Module <demux1_8> is correct for synthesis.
=====================================================================
====
* HDL Synthesis *
=====================================================================
====
=====================================================================
====
HDL Synthesis Report
Found no macro
=====================================================================
====
=====================================================================
====
* Advanced HDL Synthesis *
=====================================================================
====
=====================================================================
====
Advanced HDL Synthesis Report
Found no macro
=====================================================================
====
=====================================================================
====
* Low Level Synthesis *
=====================================================================
====
=====================================================================
====
Final Register Report
Found no macro
=====================================================================
====
=====================================================================
====
* Partition Report *
=====================================================================
====
-------------------------------
=====================================================================
====
* Final Report *
=====================================================================
====
Final Results
RTL Top Level Output File Name : demux1_8.ngr
Top Level Output File Name : demux1_8
Output Format : NGC
Optimization Goal : Speed
Keep Hierarchy : No
Design Statistics
# IOs : 11
Cell Usage :
# BELS :8
# LUT3 :8
# IO Buffers : 11
# IBUF :3
# OBUF :8
=====================================================================
====
---------------------------
Partition Resource Summary:
---------------------------
---------------------------
=====================================================================
====
TIMING REPORT
Clock Information:
------------------
No clock signals found in this design
Timing Summary:
---------------
Speed Grade: -4
Timing Detail:
--------------
All values displayed in nanoseconds (ns)
=====================================================================
====
Timing constraint: Default path analysis
Total number of paths / destination ports: 24 / 8
-------------------------------------------------------------------------
Delay: 6.546ns (Levels of Logic = 3)
Source: s<2> (PAD)
Destination: o<0> (PAD)
=====================================================================
====
-->
BLOCK DIAGRAM:
RTL SCHEMATIC:
TECHNOLOGY SCHEMATIC:
OUTPUT:
MULTIPLIER:
module multplr(
input [0:1] A,
input [0:1] B,
output [0:3] C
);
wire[0:3]D;
and a1(C[0],A[0],B[0]);
and a2(D[0],A[0],B[1]);
and a3(D[1],A[1],B[0]);
and a4(D[2],A[1],B[1]);
halfaddr ha1(C[1],D[3],D[0],D[1]);
halfaddr ha2(C[2],C[3],D[3],D[2]);
endmodule
module halfaddr(
input a,
input b,
output c,
output d
);
xor r1(c,a,b);
and p1(d,a,b);
endmodule
BLOCK DIAGRAM:
RTL SCHEMATIC:
TECHNOLOGY SCHEMATIC:
OUTPUT:
8-BIT ADDITION:
input [7:0] a;
input [7:0] b;
input c;
output sum;
output carry;
wire [8:0]tmp;
assign sum=[7:0]tmp;
assign sum=a+b+c;
assign carry=[8]tmp;
endmodule
test bench:
module ADDTEST_v;
// Inputs
reg [7:0] a;
reg [7:0] b;
reg c;
// Outputs
wire sum;
wire carry;
adder uut (
.a(a),
.b(b),
.c(c),
.sum(sum),
.carry(carry)
);
initial begin
// Initialize Inputs
a = 0;
b = 0;
c = 0;
#100 a=8'b11110000;b=8'b11110000;c=0;
end
endmodule
SIMULATION:
RESULT:
Thus the sequential circuits are designed and implemented using Verilog HDL by Xilinx and the
output is obtained
AIM:
To design and implement the sequential circuit using Verilog HDL
APPARATUS REQUIRED:
1) PC
2) Xilinx ISE Design Suite 13.1
PROCEDURE:
1) Open Xilinx ISE Design Suite 13.1
2) Click on File🡪New Project for opening an project file
3) Enter the Project Name🡪Click Next
4) Enter the device details as Spartan3, speed as -4 and device as XC3S50
5) Click on New Source tab🡪 Verilog Module to Enter the name of the Project and click
Next\
6) Define the input and output port for the module being designed and type the program
code
7) Check Syntax and if successful click on Synthesize XST
8) RTL Schematic and Technological Schematic can be obtained by selecting the
Implementation tab
9) Repeat the same procedure for creating New Source🡪 Verilog Text Fixture
10) The output graph can be obtained by simulation of the Verilog Text Fixture
PROGRAMS:
D LATCH:
module delaylatch(
input d,
input clk,
output q,
output qbar
);
wire b,c,a;
not(a,d);
nand(b,d,clk);
nand(c,a,clk);
nand(q,b,qbar);
nand(qbar,c,q);
endmodule
reg clk;
// Outputs
wire q;
wire qbar;
// Instantiate the Unit Under Test (UUT)
delaylatch uut (
.d(d),
.clk(clk),
.q(q),
.qbar(qbar)
);
initial
clk=0;
always
#5 clk=~clk;
initial begin
// Initialize Inputs
d = 0;
//clk = 0;
// Wait 100 ns for global reset to finish
#100 d=1;
#100 d=0;
#100 d=1;
// Add stimulus here
end
endmodule
SYNTHESIS REPORT:
Release 13.1 - xst O.40d (nt)
Copyright (c) 1995-2011 Xilinx, Inc. All rights reserved.
--> Parameter TMPDIR set to xst/projnav.tmp
TABLE OF CONTENTS
1) Synthesis Options Summary
2) HDL Compilation
3) Design Hierarchy Analysis
4) HDL Analysis
5) HDL Synthesis
5.1) HDL Synthesis Report
6) Advanced HDL Synthesis
6.1) Advanced HDL Synthesis Report
7) Low Level Synthesis
8) Partition Report
9) Final Report
9.1) Device utilization summary
9.2) Partition Resource Summary
9.3) TIMING REPORT
=====================================================================
====
* Synthesis Options Summary *
=====================================================================
====
---- Source Parameters
Input File Name : "delaylatch.prj"
Input Format : mixed
Ignore Synthesis Constraint File : NO
=====================================================================
====
=====================================================================
====
* HDL Compilation *
=====================================================================
====
Compiling verilog file "delaylatch.v" in library work
Module <delaylatch> compiled
No errors in compilation
Analysis of file <"delaylatch.prj"> succeeded.
=====================================================================
====
* Design Hierarchy Analysis *
=====================================================================
====
Analyzing hierarchy for module <delaylatch> in library <work>.
=====================================================================
====
* HDL Analysis *
=====================================================================
====
Analyzing top module <delaylatch>.
Module <delaylatch> is correct for synthesis.
=====================================================================
====
* HDL Synthesis *
=====================================================================
====
=====================================================================
====
HDL Synthesis Report
Found no macro
=====================================================================
====
=====================================================================
====
* Advanced HDL Synthesis *
=====================================================================
====
=====================================================================
====
Advanced HDL Synthesis Report
Found no macro
=====================================================================
====
=====================================================================
====
* Low Level Synthesis *
=====================================================================
====
WARNING:Xst:2170 - Unit delaylatch : the following signal(s) form a combinatorial loop:
qbar_and0000.
=====================================================================
====
Final Register Report
Found no macro
=====================================================================
====
=====================================================================
====
* Partition Report *
=====================================================================
====
-------------------------------
-------------------------------
=====================================================================
====
* Final Report *
=====================================================================
====
Final Results
RTL Top Level Output File Name : delaylatch.ngr
Top Level Output File Name : delaylatch
Output Format : NGC
Optimization Goal : Speed
Keep Hierarchy : No
Design Statistics
# IOs :4
Cell Usage :
# BELS :2
# INV :1
# LUT3 :1
# IO Buffers :4
# IBUF :2
# OBUF :2
=====================================================================
====
---------------------------
Partition Resource Summary:
---------------------------
---------------------------
=====================================================================
====
TIMING REPORT
Clock Information:
------------------
No clock signals found in this design
Timing Summary:
---------------
Speed Grade: -4
Timing Detail:
--------------
All values displayed in nanoseconds (ns)
=====================================================================
====
Timing constraint: Default path analysis
Total number of paths / destination ports: 4 / 2
-------------------------------------------------------------------------
Delay: 10.415ns (Levels of Logic = 4)
Source: clk (PAD)
Destination: qbar (PAD)
=====================================================================
====
-->
BLOCK DIAGRAM:
RTL SCHEMATIC:
TECHNOLOGY SCHEMATIC:
OUTPUT:
JK FLIP FLOP:
module jkflip(
input clk,
input reset,
input J,
input K,
output reg Q,
output reg Qbar
);
always @(posedge clk)
if(reset)
begin
Q<=0;
Qbar<=0;
end
else if(J==0&&K==0)
begin
Q<=Q;
Qbar<=Qbar;
end
else if(J==0&&K==1)
begin
Q<=0;
Qbar<=1;
end
else if(J==1&&K==0)
begin
Q<=1;
Qbar<=0;
end
else if(J==1&&K==1)
begin
Q<=Qbar;
end
//assign Qbar=~Q;
end
endmodule
module jkflip;
reg clk;
reg reset;
reg J;
reg K;
wire Q;
wire Qbar;
// Instantiate the Unit Under Test (UUT)
jkflip uut( clk(clk), reset(reset) J(J), K(K), Q(Q), Qbar(Qbar) );
// Initialize Inputs
begin
J=0;K=0;clk=0;reset=1;
// Wait 100 ns for global reset to finish
#100;
// Add stimulus here
#100;J=0;K=1;
#100;J=1;K=0;
#100;J=1;K=1;
#100;reset=0;J=0;K=0;
#100;J=0;K=1;
#100;J=1;K=0;
#100;J=1;K=1;
#100 $stop;
end always #1;
clk=~clk;
BLOCK DIAGRAM:
RTL SCHEMATIC:
TECHNOLOGY SCHEMATIC:
OUTPUT:
T-FLIPFLOP:
module tff(
input rst,
input clk,
input t,
output reg q
);
always@(clk)
begin
if(rst)
q=1'b0;
else
begin
if(t==1'b0)
q=1'b0;
else
q=~q;
end
end
endmodule
#100 t=1;
// Add stimulus here
end
endmodule
BLOCK DIAGRAM:
RTL SCHEMATIC:
TECHNOLOGY SCHEMATIC:
OUTPUT:
SR -FLIP FLOP:
module srff(
input rst,
input clk,
input s,
input r,
output q
);
reg q;
always@(rst,posedge clk,s,r)
begin
if(rst)
q=1'b0;
else
begin
if(s==1'b0&&r==1'b0)
q=q;
else if(s==1'b0&&r==1'b1)
q=1'b0;
else if(s==1'b1&&r==1'b0)
q=1'b1;
else
q=1'bX;
end
end
endmodule
rst = 0;
clk = 0;
s = 0;
r = 0;
// Wait 100 ns for global reset to finish
#100 s=1'b0;r=1'b0;
#100 s=1'b0;r=1'b1;
#100 s=1'b1;r=1'b0;
#100 s=1'b1;r=1'b1;
// Add stimulus here
end
endmodule
BLOCK DIAGRAM:
RTL SCHEMATIC:
TECHNOLOGY SCHEMATIC:
OUTPUT:
ALU:
PROGRAM:
input [7:0] A;
input [7:0] B;
output carryout;
reg[7:0]ALU_result;
wire[8:0]tmp;
assign ALU_out=ALU_result;
assign tmp={1'b0,A}+{1'b0,B};
assign carryout=tmp[8];
always@(*)
begin
case(ALU_sel)
4'b0000:
ALU_result=A+B;
4'b0001:
ALU_result=A-B;
4'b0010:
ALU_result=A*B;
//4'b0011:
//ALU_result=A/B;
4'b0100:
ALU_result=A<<1;
4'b0101:
ALU_result=A>>1;
4'b0110:
ALU_result={A[0],A[7:1]};
4'b0111:
ALU_result={A[0],A[7:1]};
4'b1000:
ALU_result=A&B;
4'b1001:
ALU_result=A|B;
4'b1010:
ALU_result=A^B;
4'b1011:
ALU_result=~(A|B);
4'b1100:
ALU_result=~(A&B);
4'b1101:
ALU_result=~(A^B);
4'b1110:
ALU_result=(A>B)?8'd1:8'd0;
4'b1111:
ALU_result=(A==B)?8'd1:8'd0;
default:
ALU_result=A+B;
endcase
end
endmodule
TEST BENCH:
#50;
A = 8'b01010110;
B = 8'b11011111;
ALU_sel = 4'b1010;
RTL SCHEMATIC:
TECHNOLOGY SCHEMATIC:
SYNTHESIS REPORT:
TABLE OF CONTENTS
2) HDL Compilation
4) HDL Analysis
5) HDL Synthesis
8) Partition Report
9) Final Report
=====================================================================
====
=====================================================================
====
Safe Implementation : No
Asynchronous To Synchronous : NO
Optimization Effort :1
Keep Hierarchy : NO
Hierarchy Separator :/
=====================================================================
====
=====================================================================
====
* HDL Compilation *
=====================================================================
====
No errors in compilation
=====================================================================
====
=====================================================================
====
=====================================================================
====
* HDL Analysis *
=====================================================================
====
=====================================================================
====
* HDL Synthesis *
=====================================================================
====
WARNING:Xst:643 - "alu.v" line 41: The result of a 8x8-bit multiplication is partially used.
Only the 8 least significant bits are used. If you are doing this on purpose, you may safely ignore
this warning. Otherwise, make sure you are not losing information, leading to unexpected circuit
behavior.
Found 8-bit comparator equal for signal <ALU_result$cmp_eq0013> created at line 69.
Found 8-bit comparator greater for signal <ALU_result$cmp_gt0000> created at line 67.
Summary:
inferred 2 Adder/Subtractor(s).
inferred 1 Multiplier(s).
inferred 2 Comparator(s).
INFO:Xst:1767 - HDL ADVISOR - Resource sharing has identified that some arithmetic
operations in this design can share the same physical resources for reduced device utilization.
For improved clock frequency you may try to disable resource sharing.
=====================================================================
====
Macro Statistics
# Multipliers :1
8x8-bit multiplier :1
# Adders/Subtractors :2
8-bit addsub :1
9-bit adder :1
# Comparators :2
# Xors :1
8-bit xor2 :1
=====================================================================
====
=====================================================================
====
=====================================================================
====
Loading device for application Rf_Device from file '3s100e.nph' in environment C:\Xilinx92i.
=====================================================================
====
Macro Statistics
# Multipliers :1
8x8-bit multiplier :1
# Adders/Subtractors :2
8-bit addsub :1
9-bit adder :1
# Comparators :2
# Xors :1
8-bit xor2 :1
=====================================================================
====
=====================================================================
====
=====================================================================
====
=====================================================================
====
Found no macro
=====================================================================
====
=====================================================================
====
* Partition Report *
=====================================================================
====
-------------------------------
-------------------------------
=====================================================================
====
* Final Report *
=====================================================================
====
Final Results
Keep Hierarchy : NO
Design Statistics
# IOs : 29
Cell Usage :
# BELS : 134
# GND :1
# LUT2 : 20
# LUT3 : 22
# LUT4 : 50
# MUXCY : 23
# MUXF5 :9
# VCC :1
# XORCY :8
# IO Buffers : 29
# IBUF : 20
# OBUF :9
# MULTs :1
# MULT18X18SIO :1
=====================================================================
====
---------------------------
Number of IOs: 29
---------------------------
---------------------------
---------------------------
=====================================================================
====
TIMING REPORT
Clock Information:
------------------
----------------------------------------
Timing Summary:
---------------
Speed Grade: -4
Timing Detail:
--------------
=====================================================================
====
-------------------------------------------------------------------------
Gate Net
---------------------------------------- ------------
----------------------------------------
=====================================================================
====
-->
MOORE MODEL:
input clk;
input reset;
input x1;
output out;
library IEEE
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entry fsm is
port(clk,reset,x1: in STD_LOIC:
end fsm:
signal state:state_type;
begin
process(clk,reset)
begin
if (reset='1')then
state<=s1;
out<='1';
case state is
else state<=s3;
out<='1';
end case;
end if;
end process;
end behavioural;
endmodule
Test Bench:
#100 a=1'b0;clk=1'b0;
#100 a=1'b0;clk=1'b1;
#100 a=1'b1;clk=1'b0;
#100 a=1'b1;clk=1’b1;
SIMULATION:
MEALY MODEL:
PROGRAM
input a;
input clk;
output z;
reg z;
parameter st0=0,st1=1,st2=2,st3=3;
reg[0:1]mealy_state;
initial
begin
mealy_state=st0;
end
always@(posedge clk)
case(mealy_state)
st0:
begin
z=1;
if(a)begin
mealy_state=st3;
end
else
z=0;
end
st1:
begin
if(a)begin
z=0;
mealy_state=st0;
end
else
z=1;
end
st2:
begin
if (a) begin
z=1;
mealy_state=st1;
end
else
z=0;
end
st3:
begin
z=0;
if(a) begin
mealy_state=st1;
end
mealy_state=st2;
end
endcase
endmodule
Test Bench:
#100a=1'b0;clk=1'b0;
#100a=1'b0;clk=1'b1;
#100a=1'b1;clk=1'b0;
#100a=1'b1;clk=1'b1;
TECHNOLOGY SCHEMATIC:
SYNTHESIS REPORT:
TABLE OF CONTENTS
2) HDL Compilation
4) HDL Analysis
5) HDL Synthesis
8) Partition Report
9) Final Report
=====================================================================
====
=====================================================================
====
Safe Implementation : No
Asynchronous To Synchronous : NO
Optimization Effort :1
Keep Hierarchy : NO
Hierarchy Separator :/
* HDL Compilation *
=====================================================================
====
=====================================================================
====
=====================================================================
====
st0 = "00000000000000000000000000000000"
st1 = "00000000000000000000000000000001"
st2 = "00000000000000000000000000000010"
st3 = "00000000000000000000000000000011"
=====================================================================
====
* HDL Analysis *
=====================================================================
====
st0 = 32'sb00000000000000000000000000000000
st1 = 32'sb00000000000000000000000000000001
st2 = 32'sb00000000000000000000000000000010
st3 = 32'sb00000000000000000000000000000011
=====================================================================
====
* HDL Synthesis *
Summary:
Unit <mealy1>
synthesized.============================================================
=============
Macro Statistics
# Registers :2
1-bit register :1
2-bit register :1
=====================================================================
====
Loading device for application Rf_Device from file '3s400.nph' in environment C:\Xilinx92i.
=====================================================================
====
Macro Statistics
# Registers :3
Flip-Flops :3
=====================================================================
====Optimizing unit <mealy1> ...
=====================================================================
====
Macro Statistics
# Registers :2
Flip-Flops :2
* Partition Report *
=====================================================================
====
-------------------------------
* Final Report *
=====================================================================
====
Final Results
Keep Hierarchy : NO
Design Statistics
# IOs :3
Cell Usage :
# BELS :2
# LUT3 :2
# FlipFlops/Latches :2
# FD :2
# Clock Buffers :1
# BUFGP :1
# IO Buffers :2
# IBUF :1
# OBUF :1
Number of IOs: 3
TIMING REPORT
Clock Information:
------------------
-----------------------------------+------------------------+-------+
-----------------------------------+------------------------+-------+
clk | BUFGP |2 |
-----------------------------------+------------------------+-------+
----------------------------------------
Timing Summary:
Speed Grade: -4
Timing Detail:
=====================================================================
====
-------------------------------------------------------------------------
Gate Net
---------------------------------------- ------------
----------------------------------------
=====================================================================
====
-------------------------------------------------------------------------
Source: a (PAD)
Gate Net
---------------------------------------- ------------
----------------------------------------
=====================================================================
====
-------------------------------------------------------------------------
Destination: z (PAD)
Gate Net
---------------------------------------- ------------
----------------------------------------
=====================================================================
====
-->
RING COUNTER:
input clk;
input start;
input reset;
input comp;
output done;
reg[3:0]ring_count;
reg[3:0]digitl;
wire D4,set0,set1,set2,set3;
assign D4 = ring_count[0];
begin
if(~reset)
ring_count<=4'b1000;
else
begin
if(start)
ring_count<=4'b1000;
endmodule
input clk;
input start;
input reset;
input comp;
output digitalout;
output done;
reg[3:0]ring_count;
reg[3:0]digital;
wire D4,set0,set1,set2,set3;
assign D4=ring_count[0];
assign done=!D4;
begin
if(~reset)
ring_count<=4'b1000;
else
begin
if(start)
ring_count<=4'b1000;
else
ring_count<=(ring_count>>1);
end
end
assign set3=ring_count[3];
assign set2=ring_count[2];
assign set1=ring_count[1];
assign set0=ring_count[0];
begin
if(~reset)
digital[3]<=1'b1;else
if(start)
digital[3]<=1'b1;
else if(set3)
digital[3]<=comp;
end
begin
if(~reset)
digital[2]<=1'b1;else
if(start)
digital[2]<=1'b1;
else if(set2)
digital[2]<=comp;
end
endmodule
TECHNOLOGY SCHEMATIC:
SHIFT REGISTER:
/////////////////////////////////////////////////////////////////////////////////
input clk;
input rst;
begin
if(rst)
dataout<=0;
else
begin
case(mode)
2'b00:dataout<=dataout;
2'b01:dataout<={datain[0],dataout[3:1]};
2'b10:dataout<={dataout[2:0],datain[0]};
2'b11:dataout<=datain;
endcase
end
end
endmodule
test:
module universalshifttest_v;
// Inputs
reg clk;
reg rst;
// Outputs
shift1 uut (
.clk(clk),
.rst(rst),
.mode(mode),
.datain(datain),
.dataout(dataout)
);
initial begin
// Initialize Inputs
clk = 0;
rst = 0;
mode = 0;
datain = 0;
#100;mode=2'b00;datain=4'b1010;
#100;mode=2'b01;datain=4'b1010;
#100;mode=2'b10;datain=4'b1010;
#100;mode=2'b11;datain=4'b1010;
end
endmodule
SIMULATION:
RTL SCHEMATIC:
TECHNOLOGY SCHEMATIC:
RESULT:
Thus the sequential circuits are designed and implemented using Verilog HDL by Xilinx and the
output is obtained
AIM:
To implement and design logic gates using Microwind
APPARATUS REQUIRED:
1) PC
2) Microwind Software
PROCEDURE:
1. Open the layouteditor(L-Edit) from Tanner EDA tools.
2. Select the new file and enter the file type and enter the cell name in the new cell
section.
3. Making use of the pallets in L-Edit draw the required layers for the layout.
4. Each layer should be based on the lambda values.
5. Check for DRC for any error at each level of layer.
6. Output waveform is viewed in the waveform viewer.
INVERTER GATE:
* (Pspice)
.PROBE
.END
OUTPUT:
NAND GATE:
OUTPUT:
AND GATE:
+CGSO=100.0p CGDO=100.0p
+CGBO= 60.0p CJSW=240.0p
*
* p-MOS Model 3:
*?
.MODEL P1 PMOS LEVEL=3 VTO=-1.00 UO=300.000 TOX= 3.0E-9
+LD =0.000U THETA=0.350 GAMMA=0.350
+PHI=0.680 KAPPA=0.010 VMAX=100.00K
+CGSO=100.0p CGDO=100.0p
+CGBO= 60.0p CJSW=240.0p
*
* Transient analysis
*
.TEMP 27.0
.TRAN 0.1N 20.00N
* (Pspice)
.PROBE
.END
OUTPUT:
NOR GATE:
OUTPUT:
OR GATE:
*
* p-MOS Model 3:
*?
.MODEL P1 PMOS LEVEL=3 VTO=-1.00 UO=300.000 TOX= 3.0E-9
+LD =0.000U THETA=0.350 GAMMA=0.350
+PHI=0.680 KAPPA=0.010 VMAX=100.00K
+CGSO=100.0p CGDO=100.0p
+CGBO= 60.0p CJSW=240.0p
*
* Transient analysis
*
.TEMP 27.0
.TRAN 0.1N 20.00N
* (Pspice)
.PROBE
.END
OR GATE:
OUTPUT:
RESULT:
Thus the design and implementation of Logic gates using Microwind layout is executed and the
output is obtained.
AIM:
To implement and design logic gates using Tanner
APPARATUS REQUIRED:
1) PC
2) Tanner Software
PROCEDURE:
1) To launch S-Edit in PC, go to START > PROGRAMS > TANNER > S-EDIT
2) Click on Module 🡪 Symbol Browser or click on to launch the symbol browser window.
Choose your device and click on Place
3) Once the main parts are in place, it is time to add I/O pins and wire the parts together.
Select and place an Input Pad and an Output pad on the schematic and give the pads a
unique name.
4) Now using the wiring tool make appropriate connections
5) Once Design Entry is over, Click and open T-Spice, then open Insert Command Dialog
and select Transient🡪 Enter the time step and length 🡪Click Insert
6) Select Transient Result by expanding Output 🡪Enter the node to be traced.Select Voltage
Sources and Enter the values for inputs stream
7) Finally all the Commands are entered in Module0 Window. Save and run Simulation.
Expand Chart to view the output
NOT GATE:
OUTPUT:
AND GATE:
OUTPUT:
NOR GATE:
OUTPUT:
OR GATE:
OUTPUT:
RESULT:
Thus the logic gates were designed and implemented using tanner was executed and the output
was obtained
AIM:
To implement and design combinational circuits using FPGA
APPARATUS REQUIRED:
1) PC
2) Xilinx ISE Design Suite 13.1
3) Xilinx FPGA
PROCEDURE:
1) Open Xilinx ISE Design Suite 13.1
2) Click on File🡪New Project for opening an project file
3) Enter the Project Name🡪Click Next
4) Enter the device details as Spartan3, speed as -4 and device as XC3S50
5) Click on New Source tab🡪 Verilog Module to Enter the name of the Project and click
Next\
6) Define the input and output port for the module being designed and type the program
code
7) By using the command User Constraint 🡪Floorplan I/O 🡪 Click YES. Enter PIN
Details🡪Save🡪 Click OK.
8) RUN🡪 IMPLEMENT DesignRUN🡪Generate Program file RUN 🡪Configure Target
device🡪 Manage configuration project🡪 IMPACT Window opens up.
9) After Clicking Finish 🡪Assign New Configuration File Dialog Opens up-🡪 Click
Bypass. After Clicking Bypass 🡪Assign New Configuration File Dialog Opens
up🡪Select bit file🡪 Click open.
10) Right Click the second IC and select Program. Click on Apply🡪OK
11) Check the output in kit
OUTPUT:
FLOOR PLAN:
ROUTER DESIGN:
OUTPUT:
FLOOR PLAN:
ROUTING TABLE:
RESULT:
Thus the design and implementation of combinational circuits was executed by using FPGA and
the output was obtained as shown.
AIM:
To implement and design sequential circuits using FPGA
APPARATUS REQUIRED:
1)PC
2)Xilinx ISE Design Suite 13.1
3)Xilinx FPGA
PROCEDURE:
1) Open Xilinx ISE Design Suite 13.1
2) Click on File🡪New Project for opening an project file
3) Enter the Project Name🡪Click Next
4) Enter the device details as Spartan3, speed as -4 and device as XC3S50
5) Click on New Source tab🡪 Verilog Module to Enter the name of the Project and click
Next
6) Define the input and output port for the module being designed and type the program
code
7) By using the command User Constraint 🡪Floorplan I/O 🡪 Click YES. Enter PIN
Details🡪Save🡪 Click OK.
8) RUN🡪 IMPLEMENT DesignRUN🡪Generate Program file RUN 🡪Configure Target
device🡪 Manage configuration project🡪 IMPACT Window opens up.
9) After Clicking Finish 🡪Assign New Configuration File Dialog Opens up-🡪 Click Bypass.
After Clicking Bypass 🡪Assign New Configuration File Dialog Opens up🡪Select bit
file🡪 Click open.
10) Right Click the second IC and select Program. Click on Apply🡪OK
11) Check the output in kit
module jkflip(
input clk,
input reset,
input J,
input K,
output reg Q,
output reg Qbar
);
always @(posedge clk)
if(reset)
begin
Q<=0;
Qbar<=0;
end
else if(J==0&&K==0)
begin
Q<=Q;
Qbar<=Qbar;
end
else if(J==0&&K==1)
begin
Q<=0;
Qbar<=1;
end
else if(J==1&&K==0)
begin
Q<=1;
Qbar<=0;
end
else if(J==1&&K==1)
begin
Q<=Qbar;
end
//assign Qbar=~Q;
end
endmodule
OUTPUT:
FLOOR PLAN:
ROUTING TABLE:
module counterusingdellay(
input clk,
input reset,
output reg [3:0] dout
);
reg[21: 0]delay;
wire en;
always@(posedge reset or posedge clk)
begin
if(reset)
delay = 22'b0;
else
delay = delay +1;
end
assign en=(delay ==22'b1111010000100100000000);
always@(posedge clk)
begin
if(((reset )||(dout>=15)))
dout=4'b0000;
else if(en)
dout=dout+1;
end
endmodule
OUTPUT:
FLOOR PLAN:
ROUTING TABLE:
RESULT:
Thus the design and implementation of sequential circuits was executed by using FPGA and the
output was obtained as shown.