The document appears to be a lab manual describing various adder designs to be implemented and tested in Verilog, including ripple carry adders, carry lookahead adders, carry select adders, and carry skip adders. It provides Verilog code examples and test benches for 32-bit implementations of each adder type, as well as expected results for propagation delay, resource utilization, and output waveforms. The manual is meant to guide students through designing and analyzing the performance of different adder architectures.
Verilog Tutorial - Verilog HDL Tutorial with ExamplesE2MATRIX
E2MATRIX Research Lab
Opp Phagwara Bus Stand, Backside Axis Bank,
Parmar Complex, Phagwara Punjab (India).
Contact : +91 9041262727
web: www.e2matrix.com -- email: support@e2matrix.com
Simulation tools typically accept full set of Verilog language constructs
Some language constructs and their use in a Verilog description make simulation efficient and are ignored by synthesis tools
Synthesis tools typically accept only a subset of the full Verilog language constructs
In this presentation, Verilog language constructs not supported in Synopsys FPGA Express are in red italics
There are other restrictions not detailed here, see [2].
The Module Concept
Basic design unit
Modules are:
Declared
Instantiated
Modules declarations cannot be nested
Those slides describe digital design using Verilog HDL,
starting with Design methodologies for any digital circuit then difference between s/w (C/C++) and H/w (Verilog) and the most important constructs that let us start hardware design using Verilog HDL.
Verilog Tutorial - Verilog HDL Tutorial with ExamplesE2MATRIX
E2MATRIX Research Lab
Opp Phagwara Bus Stand, Backside Axis Bank,
Parmar Complex, Phagwara Punjab (India).
Contact : +91 9041262727
web: www.e2matrix.com -- email: support@e2matrix.com
Simulation tools typically accept full set of Verilog language constructs
Some language constructs and their use in a Verilog description make simulation efficient and are ignored by synthesis tools
Synthesis tools typically accept only a subset of the full Verilog language constructs
In this presentation, Verilog language constructs not supported in Synopsys FPGA Express are in red italics
There are other restrictions not detailed here, see [2].
The Module Concept
Basic design unit
Modules are:
Declared
Instantiated
Modules declarations cannot be nested
Those slides describe digital design using Verilog HDL,
starting with Design methodologies for any digital circuit then difference between s/w (C/C++) and H/w (Verilog) and the most important constructs that let us start hardware design using Verilog HDL.
Verilog HDL is a hardware description language used to design and document electronic systems. Verilog HDL allows designers to design at various levels of abstraction. It is the most widely used HDL with a user community of more than 50,000 active designers.
A brief history
Verilog HDL originated at Automated Integrated Design Systems (later renamed as Gateway Design Automation) in 1985. The company was privately held at that time by Dr. Prabhu Goel, the inventor of the PODEM test generation algorithm. Verilog HDL was designed by Phil Moorby, who was later to become the Chief Designer for Verilog-XL and the first Corporate Fellow at Cadence Design Systems. Gateway Design Automation grew rapidly with the success of Verilog-XL and was finally acquired by Cadence Design Systems, San Jose, CA in 1989.
Verilog was invented as simulation language. Use of Verilog for synthesis was a complete afterthought. Rumors abound that there were merger discussions between Gateway and Synopsys in the early days, where neither gave the other much chance of success..
In the late 1980's it seemed evident that designers were going to be moving away from proprietary languages like n dot, HiLo and Verilog towards the US Depatment of Defense standard H.D.L., known as the VHSIC Hardware Description Language. VHSIC it self stands for "Very High Speen Intergrated Circuit" BTW).
Perhaps due to such market pressure, Cadence Design Systems decided to open the Verilog language to the public in 1990, and thus OVI (Open Verilog International) was born. Until that time, Verilog HDL was a proprietary language, being the property of Cadence Design Systems. When OVI was formed in 1991, a number of small companies began working on Verilog simulators, including Chronologic Simulation, Frontline Design Automation, and others. The first of these came to market in 1992, and now there are mature Verilog simulators available from many sources.
As a result, the Verilog market has grown substantially. The market for Verilog related tools in 1994 was well over $75,000,000, making it the most commercially significant hardware description language on the market.
An IEEE working group was established in 1993 under the Design Automation Sub-Committee to produce the IEEE Verilog standard 1364. Verilog became IEEE Standard 1364 in 1995.
As an international standard, the Verilog market continued to grow. In 1998 the market for Verilog simulators alone was well over $150,000,000; continuing its dominance.
The IEEE working group released a revised standard in March of 2002, known as IEEE 1364-2001. Significant publication errors marred this release, and a revised version was released in 2003, known as IEEE 1364-2001 Revision C.
Verilog HDL is a hardware description language used to design and document electronic systems. Verilog HDL allows designers to design at various levels of abstraction. It is the most widely used HDL with a user community of more than 50,000 active designers.
A brief history
Verilog HDL originated at Automated Integrated Design Systems (later renamed as Gateway Design Automation) in 1985. The company was privately held at that time by Dr. Prabhu Goel, the inventor of the PODEM test generation algorithm. Verilog HDL was designed by Phil Moorby, who was later to become the Chief Designer for Verilog-XL and the first Corporate Fellow at Cadence Design Systems. Gateway Design Automation grew rapidly with the success of Verilog-XL and was finally acquired by Cadence Design Systems, San Jose, CA in 1989.
Verilog was invented as simulation language. Use of Verilog for synthesis was a complete afterthought. Rumors abound that there were merger discussions between Gateway and Synopsys in the early days, where neither gave the other much chance of success..
In the late 1980's it seemed evident that designers were going to be moving away from proprietary languages like n dot, HiLo and Verilog towards the US Depatment of Defense standard H.D.L., known as the VHSIC Hardware Description Language. VHSIC it self stands for "Very High Speen Intergrated Circuit" BTW).
Perhaps due to such market pressure, Cadence Design Systems decided to open the Verilog language to the public in 1990, and thus OVI (Open Verilog International) was born. Until that time, Verilog HDL was a proprietary language, being the property of Cadence Design Systems. When OVI was formed in 1991, a number of small companies began working on Verilog simulators, including Chronologic Simulation, Frontline Design Automation, and others. The first of these came to market in 1992, and now there are mature Verilog simulators available from many sources.
As a result, the Verilog market has grown substantially. The market for Verilog related tools in 1994 was well over $75,000,000, making it the most commercially significant hardware description language on the market.
An IEEE working group was established in 1993 under the Design Automation Sub-Committee to produce the IEEE Verilog standard 1364. Verilog became IEEE Standard 1364 in 1995.
As an international standard, the Verilog market continued to grow. In 1998 the market for Verilog simulators alone was well over $150,000,000; continuing its dominance.
The IEEE working group released a revised standard in March of 2002, known as IEEE 1364-2001. Significant publication errors marred this release, and a revised version was released in 2003, known as IEEE 1364-2001 Revision C.
FiberStore CWDM Mux/Demux is a universal device capable of multiplex multiple CWDM (1270~1610nm) up to 18 channels or optical signals into a fiber pair or single fiber. FiberSotre provide full complete configuration like 2, 4, 5, 8, 9, 16, 18 channels. Optional wide band for existing 1310nm or 1550nm to multiplex with these CWDM channels. Fully utilize with the existing equipments. Together with our CWDM transceivers or the wavelength converters, the bandwidth of the fiber can be utilized in a cost effective way.
Verilog code for design a specific processor to down sample a given image via a math-lab by using SPARTAN-6 FPGA. Math-lab code, results also included.
Verilog codes and testbench codes for basic digital electronic circuits. shobhan pujari
Verilog codes and test bench codes for full adder,full adder using 2 half adders,Ripple carry adder,16x1 mux using 4x1 mux,decoder,mealy state machine,counter. These are more useful for bachelor students and masters students who are pursuing degree in electrical engineering .
EELE 5331 Digital ASIC DesignLab ManualDr. Yushi Zhou.docxtoltonkendal
EELE 5331: Digital ASIC Design
Lab Manual
Dr. Yushi Zhou
Department of Electrical Engineering
Lakehead University
Thunder Bay, Ontario, Canada
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2 MOSFET Devices and Layout Tutorial . . . . . . . . . . . . . 4
2.1 Prepare For Schematic . . . . . . . . . . . . . . . . . . 4
2.2 Perform Simulation . . . . . . . . . . . . . . . . . . . . 7
2.3 Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.4 Layout Veri�cation . . . . . . . . . . . . . . . . . . . . 17
2.5 Report . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.6 How to understand DRC error report . . . . . . . . . . 26
3 CMOS Inverter . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3.1 Design speci�cations . . . . . . . . . . . . . . . . . . . 27
3.2 Lab Procedure . . . . . . . . . . . . . . . . . . . . . . 29
3.3 Report . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
1
EELE5331:Digital ASIC Design [email protected]
1 Introduction
This lab manual is an essential components of EELE5331: Digital ASIC
Design, o�ered by Dr. Yushi Zhou. The lab works consists of schematic
entry, symbol generation, pre-layout simulation, layout, physical and logic
veri�cation, extraction and post-layout simulation for the design. All the
students are required to submit individual lab report before the deadline.
All reports must be typed and professionally prepared. The content that
needs to be included in the report are given at the end of each lab. There
are total three labs, and each part will be released before the lab starts.
• Lab 1: MOSFET devices and layout tutorial
• Lab 2: CMOS Inverter
• Lab 3: CMOS Digital Logic Circuits
It should be noted that the students are not limited to the assigned lab
time, which may not be enough to complete the lab. Students are expected
to work on the lab during their free time if that case is required. You may
use remote log-in to complete the labs.
TSMC CMOS 180 nm technology process design kit (PDK) is a 1-Poly,
6-Metal technology, with a maximum supply voltage of 1.8 V for thin oxide
devices and 3.3 V for thick oxide devices. This process is suitable for design-
ing analog, digital, RF and mixed-signal circuits and systems. In this course,
all the labs are designed based upon CMOS 180 nm process. The computer-
aided design (CAD) tools that are adopted in this course are from Cadence
Design Systems for the purpose of schematic entry, simulation, implemen-
tation and veri�cation. The Cadence custom IC design platform provides
a graphical interface for various stages in the design �ow. An overview of
the design �ow and which tools are involved in each stage is shown in Fig.1.
As you may notice that there are loops, indicating iterative procedures. For
instance, if the physical layout does not pass design rules check or LVS check,
Page 2
EELE5331:Digital ASIC Design [email protected]
the modi�cation of.
This project is concerned with the
design of SoC for detecting and correcting the error which may occur in the memory unit due to
radiation in LEO (Lower Earth Orbit) and due to stuck-at faults in memory unit in space station.
The error free data is feed to the predestined processor using the serial communication protocol
(UART) and perform its function specified in the data input which is sent from the ground station.
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
The Roman Empire A Historical Colossus.pdfkaushalkr1407
The Roman Empire, a vast and enduring power, stands as one of history's most remarkable civilizations, leaving an indelible imprint on the world. It emerged from the Roman Republic, transitioning into an imperial powerhouse under the leadership of Augustus Caesar in 27 BCE. This transformation marked the beginning of an era defined by unprecedented territorial expansion, architectural marvels, and profound cultural influence.
The empire's roots lie in the city of Rome, founded, according to legend, by Romulus in 753 BCE. Over centuries, Rome evolved from a small settlement to a formidable republic, characterized by a complex political system with elected officials and checks on power. However, internal strife, class conflicts, and military ambitions paved the way for the end of the Republic. Julius Caesar’s dictatorship and subsequent assassination in 44 BCE created a power vacuum, leading to a civil war. Octavian, later Augustus, emerged victorious, heralding the Roman Empire’s birth.
Under Augustus, the empire experienced the Pax Romana, a 200-year period of relative peace and stability. Augustus reformed the military, established efficient administrative systems, and initiated grand construction projects. The empire's borders expanded, encompassing territories from Britain to Egypt and from Spain to the Euphrates. Roman legions, renowned for their discipline and engineering prowess, secured and maintained these vast territories, building roads, fortifications, and cities that facilitated control and integration.
The Roman Empire’s society was hierarchical, with a rigid class system. At the top were the patricians, wealthy elites who held significant political power. Below them were the plebeians, free citizens with limited political influence, and the vast numbers of slaves who formed the backbone of the economy. The family unit was central, governed by the paterfamilias, the male head who held absolute authority.
Culturally, the Romans were eclectic, absorbing and adapting elements from the civilizations they encountered, particularly the Greeks. Roman art, literature, and philosophy reflected this synthesis, creating a rich cultural tapestry. Latin, the Roman language, became the lingua franca of the Western world, influencing numerous modern languages.
Roman architecture and engineering achievements were monumental. They perfected the arch, vault, and dome, constructing enduring structures like the Colosseum, Pantheon, and aqueducts. These engineering marvels not only showcased Roman ingenuity but also served practical purposes, from public entertainment to water supply.
Francesca Gottschalk - How can education support child empowerment.pptxEduSkills OECD
Francesca Gottschalk from the OECD’s Centre for Educational Research and Innovation presents at the Ask an Expert Webinar: How can education support child empowerment?
Unit 8 - Information and Communication Technology (Paper I).pdfThiyagu K
This slides describes the basic concepts of ICT, basics of Email, Emerging Technology and Digital Initiatives in Education. This presentations aligns with the UGC Paper I syllabus.
Palestine last event orientationfvgnh .pptxRaedMohamed3
An EFL lesson about the current events in Palestine. It is intended to be for intermediate students who wish to increase their listening skills through a short lesson in power point.
Honest Reviews of Tim Han LMA Course Program.pptxtimhan337
Personal development courses are widely available today, with each one promising life-changing outcomes. Tim Han’s Life Mastery Achievers (LMA) Course has drawn a lot of interest. In addition to offering my frank assessment of Success Insider’s LMA Course, this piece examines the course’s effects via a variety of Tim Han LMA course reviews and Success Insider comments.
How libraries can support authors with open access requirements for UKRI fund...
Verilog lab mauual
1. 2016MVE 006 2016
MDDV Lab Manual Page 1
A Lab Manual on
Morden Digital Design Using Verilog
Submitted By:-
Mr.Bhushan Sunil Mhaske.
2016MVE006
(M.Tech First Year ES & VLSI)
Under the guidance of
Prof.Y.V.Joshi.
Mr.Prasad Bharade.
Shri Guru Gobind Singhji Institute of Engineering and Technology,
Nanded -431606 (MS)
Dept. of Electronics and Telecommunication Engineering.
2. 2016MVE 006 2016
MDDV Lab Manual Page 2
INDEX
List of Practical
Practical 1: Ripple Carry Adder................................................................................. 4
Practical 2: Carry Look Ahead Adder........................................................................ 9
Practical 3: Carry Select Adder.................................................................................. 13
Practical 4: Carry Skip Adder..................................................................................... 17
Practical 5: Carry save Adder.................................................................................... 22
Practical 6: Add Shift Multiplier................................................................................ 25
Practical 7: Carry save Multiplier............................................................................... 32
Practical 8: Booths Multiplier ..................................................................................... 36
Practical 9: Floating Point Adder.................................................................................. 40
Practical 10: Floating Point Multiplier ......................................................................... 45
Practical 11: Implementation of sin(x), cos(x) & ex
using Taylor’s series.................... 48
Practical 12: Reciprocal & square Root using Newton’s raphson method ................ 49
6. 2016MVE 006 2016
MDDV Lab Manual Page 6
RTL Schematic:
RTL Schematic of 1 bit full adder
RTL Schematic of 32 bit Ripple carry adder
7. 2016MVE 006 2016
MDDV Lab Manual Page 7
Test Bench for 32 bit adder:
//////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
// Create Date: 13:56:15 12/05/2016
// Design Name: bit_32_adder
// Module Name: D:/terminator/ripplecarryadder/tb_cra.v
// Project Name: ripplecarryadder
// Target Device:
// Tool versions:
// Description:
// Verilog Test Fixture created by ISE for module: bit_32_adder
// Dependencies:
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
////////////////////////////////////////////////////////////////////////////
module tb_cra;
// Inputs
reg [31:0] A;
reg [31:0] B;
reg Cin;
// Outputs
wire [31:0] Sum;
wire Cout;
// Instantiate the Unit Under Test (UUT)
bit_32_adder uut (
.Sum(Sum),
.Cout(Cout),
.A(A),
.B(B),
.Cin(Cin)
);
initial begin
// Initialize Inputs
A = 32'd1245789613858;
B = 32'd1245789613858;
Cin = 1;
// Wait 100 ns for global reset to finish
#1000;
A = 32'd33245789613858;
B = 32'd1245789613858;
Cin = 1;
8. 2016MVE 006 2016
MDDV Lab Manual Page 8
// Wait 100 ns for global reset to finish
#1000;
A = 32'd12457896613858;
B = 32'd56945789613858;
Cin = 1;
// Wait 100 ns for global reset to finish
#1000;
A = 32'd46245789613858;
B = 32'd55245789613858;
Cin = 1;
// Wait 100 ns for global reset to finish
#1000;
A = 32'd16845789613858;
B = 32'd45245789613858;
Cin = 1;
// Wait 100 ns for global reset to finish
#1000;
// Add stimulus here
end
endmodule
Parameter Values:
a) Delay: 12.762ns
b) Area in term of slices :- 32 out of 7200
c) % utilization Factor :- 1%
d) Output Waveform :-
9. 2016MVE 006 2016
MDDV Lab Manual Page 9
PRACTICAL NO 2
Aim:-Design & implementation of carry look ahead generator for given number of input
bits and observe, calculate following parameter
1.RTL schematic,
2.Propagration delay,
3.Number of slices in terms of % utilization,
4.Write test bench & verify timing behaviour carry look ahead generator
Design Properties:
Family - VERTEX 5 FPGA
Device - XC5VLX50T
Simulator - ISIM
Verilog Code:
Main code
////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//Create Date: 14:28:15 12/05/2016
// Design Name:
// Module Name: CLA_add
// Project Name:
// Target Devices:
// Tool versions:
// Description:
// Dependencies:
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
////////////////////////////////////////////////////////////////////////////
module CLA_add (A, B, Cin,Cout, sum );
parameter N=32;
input [N-1:0]A,B;
input Cin;
output [N-1:0] sum;
output Cout;
wire [N:0]c;
wire [N-1:0]g,p;
assign c[0]=Cin;
genvar i;
generate
for(i=0;i<N;i=i+1)
10. 2016MVE 006 2016
MDDV Lab Manual Page 10
begin: CLA
carry_generate A1(.G(g[i]),.A(A[i]),.B(B[i]));
carry_propagate A2(.P(p[i]),.A(A[i]),.B(B[i]));
sum_CLA S1(.S(sum[i]),.A(c[i]),.B(p[i]));
assign c[i+1]=(g[i]|(p[i]&c[i]));
end
assign Cout=c[N];
endgenerate
endmodule
1.Program for Sum
module sum_CLA( input A,B, output S );
assign S=A^B;
endmodule
2.Program for Carry propagate
Module carry_propagate(
input A,B,
output P
);
assign P=(A^B);
endmodule
3.Program for Carry generate
Module carry_generate(
input A,B,
output G
);
assign G= (A&B);
endmodule
RTL Schematic:
11. 2016MVE 006 2016
MDDV Lab Manual Page 11
Test bench:-
module tb_CLA;
// Inputs
reg [31:0] A;
reg [31:0] B;
reg Cin;
// Outputs
wire Cout;
wire [31:0] sum;
// Instantiate the Unit Under Test (UUT)
CLA_add uut (
.A(A),
.B(B),
.Cin(Cin),
.Cout(Cout),
.sum(sum)
);
initial begin
// Initialize Inputs
A = 32'd568795425447847;
B = 32'd58795425447856;
Cin = 1;
// Wait 100 ns for global reset to finish
#100;
A = 32'd368795425447847;
B = 32'd258795425447856;
Cin = 1;
// Wait 100 ns for global reset to finish
#100;
A = 32'd86875425447847;
B = 32'd95875425447856;
Cin = 1;
// Wait 100 ns for global reset to finish
#100;
A = 32'd568795425447847;
B = 32'd158795425447856;
Cin = 0;
// Wait 100 ns for global reset to finish
#100;
// Add stimulus here
end
endmodule
12. 2016MVE 006 2016
MDDV Lab Manual Page 12
Parameter Values:
a) Propagation /Combinational delay :- 13.332ns
b) Area in term of slices :- 25 out of 7200
c) % utilization Factor :- 1%
d) Output Waveform :
13. 2016MVE 006 2016
MDDV Lab Manual Page 13
PRACTICAL NO 3
Aim:-Design & implementation of carry select adder for given number of input bits and
observe, calculate following parameter
1.RTL schematic,
2.Propagration delay,
3.Number of slices in terms of % utilization,
4.Write test bench & verify timing behaviour carry select adder
Design Properties:
Family - VERTEX 5 FPGA
Device - XC5VLX50T
Simulator - ISIM
Verilog Code:
Main code:
////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
// Create Date: 15:36:11 5/12/2016
// Design Name:
// Module Name: CSA
// Project Name:
// Target Devices:
// Tool versions:
// Description:
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
////////////////////////////////////////////////////////////////////////////
module CSA(A,B,Cin,S, Cout);
parameter N=32;
input [N-1:0]A,B;
input Cin;
output [N-1:0]S;
output Cout;
wire [N:0] c;
wire [N:1] c0,c1;
wire [N-1:0] sum0,sum1;
assign c[0]=Cin;
// assign c1[0]=1;
//assign c0[0]=0;
genvar i;
15. 2016MVE 006 2016
MDDV Lab Manual Page 15
// Outputs
wire [31:0] S;
wire Cout;
// Instantiate the Unit Under Test (UUT)
CSA uut (
.A(A),
.B(B),
.Cin(Cin),
.S(S),
.Cout(Cout)
);
initial begin
// Initialize Inputs
A = 32'h5446341;
B = 32'h3854487;
Cin = 0;
// Wait 100 ns for global reset to finish
#100;
A = 32'h563471;
B = 32'h38843;
// Wait 100 ns for global reset to finish
#100;
A = 32'h5566341;
B = 32'h386787;
Cin = 1;
// Wait 100 ns for global reset to finish
#100;
A = 32'h453743;
B = 32'h3427fff;
Cin = 0;
// Wait 100 ns for global reset to finish
#100;
A = 32'hffffffff;
B = 32'h1;
Cin = 0;
// Wait 100 ns for global reset to finish
#100;
// Add stimulus here
16. 2016MVE 006 2016
MDDV Lab Manual Page 16
end
endmodule
Parameter Values:
1.Propagation Delay : 12.757ns (Levels of Logic = 18)
2.Number of occupied Slices: 32 out of 7,200 3.Utilisation Factor
4. Output Waveform: 1%
17. 2016MVE 006 2016
MDDV Lab Manual Page 17
PRACTICAL NO 4
Aim:- Design & implementation of Carry Skip Adder for given number of input bits and
observe, calculate following parameter
1.RTL schematic,
2.Propagration delay,
3.Number of slices in terms of % utilization,
4.Write test bench & verify timing behaviour
Design Properties:
Family - VERTEX 5 FPGA
Device - XC5VLX50T
Simulator - ISIM
Verilog Code:
Main code:
////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
// Create Date: 15:38:04 12/05/2016
// Design Name:
// Module Name: Carry_skip32
// Project Name:
// Target Devices:
// Tool versions:
// Description:
// Dependencies:
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
////////////////////////////////////////////////////////////////////////////
module Carry_skip32(X,Y,Z,P,Q);
parameter N=32;
input[N-1:0]X,Y;
input Z;
output[N-1:0]P;
output Q;
wire [N-1:0]w1,w2;
wire [N:0]C;
assign C[0]=Z;
genvar i;
generate
19. 2016MVE 006 2016
MDDV Lab Manual Page 19
RTL Schematic:-
Test Bench:-
////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
// Create Date: 16:21:06 12/05/2016
// Design Name: Carryskip32
// Module Name: C:/Users/VLSI P1/Desktop/MDDV/SOM/CARRY_SKIP/Tb_CARRY_SKIP.v
// Project Name: CARRY_SKIP
// Target Device:
// Tool versions:
// Description:
// Verilog Test Fixture created by ISE for module: Carryskip32
// Dependencies:
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
////////////////////////////////////////////////////////////////////////////////
20. 2016MVE 006 2016
MDDV Lab Manual Page 20
module Tb_CARRY_SKIP;
// Inputs
reg [31:0] X;
reg [31:0] Y;
reg Z;
// Outputs
wire [31:0] P;
wire Q;
// Instantiate the Unit Under Test (UUT)
Carryskip32 uut (
.X(X),
.Y(Y),
.Z(Z),
.P(P),
.Q(Q)
);
initial begin
// Initialize Inputs
X = 32'd76875425447847;
Y = 32'd65875425447856;
Z = 1;
// Wait 100 ns for global reset to finish
#100;
X = 32'd12875425447847;
Y = 32'd94675425447856;
Z = 0;
// Wait 100 ns for global reset to finish
#100;
X = 32'd72875425447847;
Y = 32'd74175425447856;
Z = 0;
// Wait 100 ns for global reset to finish
#100;
// Add stimulus here
end
endmodule
21. 2016MVE 006 2016
MDDV Lab Manual Page 21
Parameter Values:
a) Propagation /Combinational Delay: 15.387ns
b) Area in term of slices :- 32 out of 7200
c) % utilization Factor :- 8 out of 480 nearly 20%
d) Output Waveform :
22. 2016MVE 006 2016
MDDV Lab Manual Page 22
PRACTICAL NO 5
Aim:- Design & implementation of Carry Save Adder for given number of input bits and
observe, calculate following parameter
1.RTL schematic,
2.Propagration delay,
3.Number of slices in terms of % utilization,
4.Write test bench & verify timing behaviour
Design Properties:
Family - VERTEX 5 FPGA
Device - XC5VLX50T
Simulator - ISIM
Verilog Code:
Main code:
////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
// Create Date: 16:36:15 12/05/2016
// Design Name:
// Module Name: carry_save
// Project Name:
// Target Devices:
// Tool versions:
// Description:
// Dependencies:
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
////////////////////////////////////////////////////////////////////////////
module carry_save( X,Y,Z,S,Cout);
parameter N=32;
input[N-1:0]X,Y,Z;
output[N:0]S;
output Cout;
wire [N:0]l;
wire [N-1:0]m;
wire[N+1:0]w;
assign l[0]=0;
assign w[0]=0;
genvar i;
24. 2016MVE 006 2016
MDDV Lab Manual Page 24
Test Bench:-
module TB_CARRY_SAVEADDER;
// Inputs
reg [31:0] X;
reg [31:0] Y;
reg [31:0] Z;
// Outputs
wire [32:0] S;
wire Cout;
// Instantiate the Unit Under Test (UUT)
carry_save uut (
.X(X),
.Y(Y),
.Z(Z),
.S(S),
.Cout(Cout)
);
initial begin
// Initialize Inputs
X = 32'd22875425447847;
Y = 32'd84675425447856;
Z = 1;
// Wait 100 ns for global reset to finish
#100;
X = 32'd21875425447847;
Y = 32'd49675425447856;
Z = 0;
// Wait 100 ns for global reset to finish
#100;
X = 32'd55875425447847;
Y = 32'd33675425447856;
Z = 1;
// Wait 100 ns for global reset to finish
#100;
X = 32'd85275425447847;
Y = 32'd25875425447856;
Z = 0;
// Wait 100 ns for global reset to finish
#100;
X = 32'd82175425447847;
25. 2016MVE 006 2016
MDDV Lab Manual Page 25
Y = 32'd46975425447856;
Z = 1;
// Add stimulus here
end
endmodule
Parameter Values:
a) Propagation /Combinational Delay: 10.387ns
b) Area in term of slices :- 30 out of 7,200
c) % utilization Factor :- 1%
d) Output Waveform :
Conclusion:-
1. Ripple carry adder is just series of full adders connected serially where carry
propagates from first full adder to last one. Delay is maximum in this case.
2. Carry look ahead contains combinational circuit which calculates beforehand.
Area is largely increased in this case. Of course delay is much less.
3. In case of carry save and carry select adder delay is minimum as compared to
other but there is more power consumption & area requirements. Also Hardware
is slightly complex as compared to other adder configuration.
4. A carry-Skip consists of a simple ripple carry-adder with a special up carry chain
called a skip chain. Carry skip adder is a fast adder compared to ripple carry
adder. A carry-skip adder is designed to speed up a wide adder by aiding the
propagation of a carry bit around a portion of the entire adder. Area and power
consumption is moderate.
30. 2016MVE 006 2016
MDDV Lab Manual Page 30
Test Bench:-
module Tb_Add_Shift_Mul;
// Inputs
reg [3:0] A;
reg [3:0] B;
// Outputs
wire [7:0] S;
// Instantiate the Unit Under Test (UUT)
Add_Shift_mul uut (
.A(A),
.B(B),
.S(S)
);
initial begin
// Initialize Inputs
A = 4'b1100;
B = 4'b1100;
// Wait 100 ns for global reset to finish
#100;
A = 4'b1100;
B = 4'b1100;
// Wait 100 ns for global reset to finish
#100;
A = 4'b1010;
B = 4'b1111;
// Wait 100 ns for global reset to finish
#100;
A = 4'b1001;
B = 4'b1001;
// Wait 100 ns for global reset to finish
#100;
A = 4'b1000;
B = 4'b1000;
// Wait 100 ns for global reset to finish
#100;
// Add stimulus here
end
endmodule
31. 2016MVE 006 2016
MDDV Lab Manual Page 31
Output waveform:-
Conclusion:-
Thus we have written the verilog code for Add Shift Multiplier (4 bit)
& verified the result using test bench in Xilinx.
32. 2016MVE 006 2016
MDDV Lab Manual Page 32
PRACTICAL NO 7
Aim:- Design & implementation of Carry Save Multiplier for given number of input bits
and observe, calculate following parameter
1.RTL schematic,
2.Propagration delay,
3.Number of slices in terms of % utilization,
4.Write test bench & verify timing behaviour .
Design Properties:
Family - VERTEX 5 FPGA
Device - XC5VLX50T
Simulator - ISIM
Verilog Code:-
module carry_save_mul(
input [3:0] A,B,
output [7:0] P
);
wire [19:0]w;
andgate A1(.a(A[0]),.b(B[0]),.c(P[0]));
andgate A2(.a(A[0]),.b(B[1]),.c(w[0]));
andgate A3(.a(A[0]),.b(B[2]),.c(w[1]));
andgate A4(.a(A[0]),.b(B[3]),.c(w[2]));
hadr H1(.a(w[0]),.b(A[1]&B[0]),.s(P[1]),.c(w[3]));
hadr H2(.a(w[1]),.b(A[1]&B[1]),.s(w[4]),.c(w[5]));
hadr H3(.a(w[2]),.b(A[1]&B[2]),.s(w[6]),.c(w[7]));
hadr H4(.a(w[17]),.b(A[1]&B[3]),.s(w[8]),.c(w[9]));
fulladr F1(.x(w[4]),.z(w[3]),.y(A[2]&B[0]),.p(P[2]),.q(w[10]));
fulladr F2(.x(w[6]),.y(A[2]&B[1]),.z(w[5]),.p(w[11]),.q(w[12]));
fulladr F3(.x(w[8]),.y(A[2]&B[2]),.z(w[7]),.p(w[13]),.q(w[14]));
fulladr F4(.x(w[18]),.y(A[2]&B[3]),.z(w[9]),.p(w[15]),.q(w[16]));
fulladr F5(.x(w[11]),.y(A[3]&B[0]),.z(w[10]),.p(P[3]),.q(w[17]));
fulladr F6(.x(w[13]),.y(A[3]&B[1]),.z(w[12]),.p(P[4]),.q(w[18]));
fulladr F7(.x(w[15]),.y(A[3]&B[2]),.z(w[14]),.p(P[5]),.q(w[19]));
fulladr F8(.x(w[19]),.y(A[3]&B[3]),.z(w[16]),.p(P[6]),.q(P[7]));
endmodule
34. 2016MVE 006 2016
MDDV Lab Manual Page 34
Test Bench:-
module Tb_Carry_save_Mul;
// Inputs
reg [3:0] A;
reg [3:0] B;
// Outputs
wire [7:0] P;
// Instantiate the Unit Under Test (UUT)
carry_save_mul uut (
.A(A),
.B(B),
.P(P)
);
initial begin
// Initialize Inputs
A = 4'b1100;
B = 4'b1100;
// Wait 100 ns for global reset to finish
#100;
A = 4'b1010;
B = 4'b1111;
// Wait 100 ns for global reset to finish
#100;
A = 4'b1011;
B = 4'b1010;
// Wait 100 ns for global reset to finish
#100;
A = 4'b1010;
B = 4'b1101;
// Wait 100 ns for global reset to finish
#100;
// Add stimulus here
end
Endmodule
35. 2016MVE 006 2016
MDDV Lab Manual Page 35
Parameter Values:
a) Propagation /Combinational Delay : 8.131ns (Levels of Logic = 8)
b) Area in term of slices :- 30 out of 7200
c) % utilization Factor :- 1%
d) Output Waveform :
Conclusion:-
Thus we have written the verilog code for Carry Save Multiplier (4 bit) & verified
the result using test bench in Xilinx.
36. 2016MVE 006 2016
MDDV Lab Manual Page 36
Practical 8: Booths Multiplier
Aim: Design and implementation of Booths multiplier for given number of input bits.
Verilog Codes for Booths Multiplier
module own_booths( a,b,y,sign);
parameter N=16, P=N/2; // N = no of inputsP= no of groups
output reg sign;
input [N-1:0] a,b; // a= multiplier b= multiplicant
output [(N+N-1):0]y;
integer k,i;
reg [2:0] m [P-1:0];
reg [(N+N-1):0] b1 [P-1:0];
reg [(N+N-1):0] z [P-1:0];
reg [(N+N-1):0]z1;
always @ (a or b ) begin
m[0]={a[1],a[0],1'b0};
for(k=1;k<P;k=k+1) begin
m[k]={a[2*k+1],a[2*k],a[2*k-1]};
end
for (k=0; k<P; k=k+1) begin
case(m[k])
3'b000: b1[k]=0;
3'b001: b1[k]=b;
3'b010: b1[k]=b;
3'b011: b1[k]=b*2;
3'b100: b1[k]=b*(-2);
3'b101: b1[k]=b*(-1);
3'b110: b1[k]=b*(-1);
3'b111: b1[k]=0;
endcase
z[k]= $signed(b1[k]);
for (i=0; i<k; i=i+1) begin
z[k]={z[k],2'b00};
end
end
z1=z[0];
for (k=1; k<P; k=k+1) begin
z1 = z1 + z[k];
sign=0;
end
if(z1[2*N-1]==1) begin
z1= (~z1 + 1'b1);
sign=1;
end
end
assign y = z1;
endmodule
37. 2016MVE 006 2016
MDDV Lab Manual Page 37
RTL Schematic for Booths Multiplier:-
Testbench
`
module Tb_Booths_mul;
// Inputs
reg [15:0] a;
reg [15:0] b;
// Outputs
wire [31:0] y;
wire sign;
// Instantiate the Unit Under Test (UUT)
Booth_Mul uut (
.a(a),
.b(b),
.y(y),
.sign(sign)
);
38. 2016MVE 006 2016
MDDV Lab Manual Page 38
initial begin
// Initialize Inputs
a = 16'd1514;
b = 16'd1514;
// Wait 100 ns for global reset to finish
#100;
a = 16'd1000;
b = 16'd1000;
// Wait 100 ns for global reset to finish
#100;
a = 16'd1514;
b = 16'd1895;
// Wait 100 ns for global reset to finish
#100;
a = 16'd1223;
b = 16'd1012;
// Wait 100 ns for global reset to finish
#100;
end
endmodule
Parameter Values:
a) Propagation /Combinational Delay :- 9.081ns (Levels of Logic = 24)
b) Area in term of slices :- 32 out of 7200 1%
c) % utilization Factor 1%
d) Output Waveform :
Conclusion:-
Thus we have written the verilog code for Booth’s Multiplier (32 bit)
& verified the result using test bench in Xilinx.
40. 2016MVE 006 2016
MDDV Lab Manual Page 40
Practical 9: Floating Point Adder
Aim: Design and implementation of floating point Adder for given number of input bits.
Verilog Code for Floating Point Adder
module fpadd(a,b,clk,out);
input[31:0]a,b;
input clk;
output [31:0]out;
wire [7:0]e1,e2,ex,ey,exy,ex1,ey1,ex2,ex3;
wire s1,s2,s,s3,sr,sn,s4,sx1,sy1,sn1,sn2,sn3,sn4,sr1,sr2,sn5,sn6;
wire [23:0]m1,m2,mx,my,mxy,mx1,my1;
wire [24:0]mxy1,mxy2;
assign s1=a[31];
assign s2=b[31];
assign e1=a[30:23];
assign e2=b[30:23];
assign m1[23]=1'b1;
assign m2[23]=1'b1;
assign m1[22:0]=a[22:0];
assign m2[22:0]=b[22:0];
//submodule for compare and shfit
cmpshift as(e1[7:0],e2[7:0],s1,s2,m1[23:0],m2[23:0],clk,ex,ey,mx,my,s,sx1,sy1);
buffer1 buff1(ex,ey,sx1,sy1,mx,my,s,clk,ex1,ey1,mx1,my1,sn,sn1,sn2);
//sub module for mantissa addition snd subtraction
faddsub as1(mx1,my1,sn1,sn2,sn,ex1,clk,mxy1,ex2,sn3,sn4,s3,sr1);
buffer2 buff2(mxy1,s3,sr1,ex2,sn3,sn4,clk,mxy2,ex3,sn5,sn6,s4,sr2);
//sub module for normalization
normalized as2(mxy2,sr2,sn5,sn6,s4,clk,ex3,sr,exy,mxy);
assign out={sr,exy,mxy[22:0]};
endmodule
Compare& shift module:
module cmpshift(e1,e2,s1,s2,m1,m2,clk,ex,ey,mx,my,s,sx1,sy1); //module for
copare&shift
input [7:0]e1,e2;
input [23:0]m1,m2;
input clk,s1,s2;
output reg[7:0]ex,ey;
output reg[23:0]mx,my;
output reg s,sx1,sy1;
reg [7:0]diff;
41. 2016MVE 006 2016
MDDV Lab Manual Page 41
always@(posedgeclk)
begin
sx1=s1;
sy1=s2;
if(e1==e2)
begin
ex=e1+8'b1;
ey=e2+8'b1;
mx=m1;
my=m2;
s=1'b1;
end
else if(e1>e2)
begin
diff=e1-e2;
ex=e1+8'b1;
ey=e1+8'b1;
mx=m1;
my=m2>>diff;
s=1'b1;
end
else
begin
diff=e2-e1;
ex=e2+8'b1;
ey=e2+8'b1;
mx=m2;
my=m1>>diff;
s=1'b0;
end
end
endmodule
faddsub module:-
module faddsub(a,b,s1,s2,sn,ex1,clk,out,ex2,sn3,sn4,s,sr1); //submodule for addition or
subtraction
input [23:0]a,b;
input[7:0]ex1;
input s1,s2,clk,sn;
output reg [7:0]ex2;
output reg[24:0]out;
output reg s,sn3,sn4,sr1;
always@(posedge clk)
begin
ex2=ex1;
sr1=sn;
sn3=s1;
42. 2016MVE 006 2016
MDDV Lab Manual Page 42
sn4=s2;
s=s1^s2;
if(s)
begin
out=a-b;
end
else
begin
out=a+b;
end
end
endmodule
Buffer:
module buffer2(mxy1,s3,sr1,ex,sn3,sn4,clk,mxy2,ex3,sn5,sn6,s4,sr2);
input [24:0]mxy1;
input s3,clk,sr1,sn3,sn4;
input [7:0]ex;
output reg[24:0]mxy2;
output reg[7:0]ex3;
output reg s4,sn5,sn6,sr2;
always@(posedgeclk)
begin
sr2=sr1;
sn5=sn3;
sn6=sn4;
ex3=ex;
mxy2=mxy1;
s4=s3;
end
endmodule
module buffer1(ex,ey,sx1,sy1,mx,my,s,clk,ex1,ey1,mx1,my1,sn,sn1,sn2);
input [7:0]ex,ey;
input [23:0]mx,my;
input s,clk,sx1,sy1;
output reg [7:0]ex1,ey1;
output reg [23:0]mx1,my1;
output reg sn,sn1,sn2;
always@(posedgeclk)
begin
sn1=sx1;
sn2=sy1;
ex1=ex;
ey1=ey;
43. 2016MVE 006 2016
MDDV Lab Manual Page 43
mx1=mx;
my1=my;
sn=s;
end
endmodule
LOD & Normalization:
module normalized(mxy1,s,s1,s2,s3,clk,ex,sr,exy,mxy);
input[24:0]mxy1;
input s,s1,s2,s3,clk;
input[7:0]ex;
output regsr;
output reg[7:0]exy;
output reg[23:0]mxy;
reg [24:0]mxy2;
always@(posedgeclk)
begin
sr=s?s1^(mxy1[24]&s3):s2^(mxy1[24]&s3);
mxy2=(mxy1[24]&s3)?~mxy1+25'b1:mxy1;
mxy=mxy2[24:1];
exy=ex;
repeat(24)
begin
if(mxy[23]==1'b0)
begin
mxy=mxy<<1'b1;
exy=exy-8'b1;
end
end
end
endmodule
RTL Schematic:-
44. 2016MVE 006 2016
MDDV Lab Manual Page 44
Test bench:-
module tb_FPA;
reg [31:0] a;
reg [31:0] b;
regclk;
// Outputs
wire [31:0] out;
// Instantiate the Unit Under Test (UUT)
fpadduut (
.a(a),
.b(b),
.clk(clk),
.out(out)
);
initial begin
// Initialize Inputs
a = 32'h15856378;
b = 32'h46543643;
// Wait 100 ns for global reset to finish
#100;
// Add stimulus here
end
endmodule
Output waveform:-
Conclusion:- Thus we have write the verilog code for floating point adder (32 bit)
pipelined structure and verified the it using test bench.
45. 2016MVE 006 2016
MDDV Lab Manual Page 45
Practical 10: Floating Point Multiplier
Aim: Design and implementation of floating point Multiplier for given number of input
bits.
Verilog code for Floating point multiplier
module floating(a,b,bias,out);
input[31:0]a;
input[31:0]b;
input[7:0]bias;
output[31:0]out;
wire[47:0]mo;
wire[22:0]mout;
wire[22:0]ma;
wire[22:0]mb;
wire[7:0]e1;
wire[7:0]e2;
wire[7:0]eo;
wire[7:0]eout;
wire sa,sb,so;
assign sa=a[31];
assign sb=b[31];
assign so=sa^sb;
assign e1[7:0]=a[30:23];
assign e2[7:0]=b[30:23];
assign eo[7:0]=e1+e2-bias;
assign ma[22:0]=a[22:0];
assign mb[22:0]=b[22:0];
assign mo[47:0]={1'b1,ma}*{1'b1,mb};
mantisainst (mo,eo,eout,mout);
assign out[31:0]={so,eout,mout};
endmodule
Verilog code for mantissa
module mantisa( mo,eo,eout,mout);
input[47:0]mo;
input[7:0]eo;
output[7:0]eout;
output[22:0]mout;
reg[7:0]eout;
reg[22:0]mout;
always@ (*)
begin
if(mo[47]==1)
begin
eout<=eo+1;
46. 2016MVE 006 2016
MDDV Lab Manual Page 46
mout<=mo[46:24];
end
else
begin
eout<=eo;
mout<=mo[45:23];
end
end
endmodule
RTL Schematic:-
Parameters
Propagation Delay : 9.436ns (Levels of Logic = 6)
Area in terms of Slices: 28 out of 7200
Utilization factor : 1%
47. 2016MVE 006 2016
MDDV Lab Manual Page 47
Output Waveform:-
Conclusion:-
Thus we have written the verilog code for floating point Multiplier (32bit) and
verified the it using test bench in Xilinx.
48. 2016MVE 006 2016
MDDV Lab Manual Page 48
Practical 11:
Aim: Design & Implement given function Sin(x), Cos(x) and ex Using Taylors series in
Questa Sim .
Verilog Code for sin(x)
module sinx(input [63:0]x, output reg[63:0] sumout);
real term=64'd1,sum=64'd1,k=64'd1,x1;
always@(x, k)
begin
x1=(x*(3.141592654/180));
if(0<k<100)
begin
term=((-1)*term*((x1*x1)/((k+1)*(k+2))));
sum<=(x1*(sum+term));
k<=k+2;
end
end
endmodule
Verilog Code for cos(x)
module cosx(input [63:0] a, output reg [63:0] sumout);
real x, term=64'd1,sum=64'd1,k=64'd1,final,x1;
always@(x, k)
begin
x1=(x*(3.141592654/180));
if(0<k<100)
begin
term=((-1)*term*((x1*x1)/((k)*(k+1))));
sum<=sum+term;
k<=k+2;
end
end
endmodule
49. 2016MVE 006 2016
MDDV Lab Manual Page 49
Verilog Code for eX
module exponential(input [64:0]x,output reg[64:0] sumout);
real term=64'd1,sum=64'd1,k=64'd1;
real finalsum=64'd0;
always@(x,k)
begin
if(0<k<20)
begin
term=(term*(x/k));
sum<=sum+term;
k<=k+1;
end
assign finalsum=sum;
end
endmodule
Output waveform:-
Conclusion:-
Thus we have implemented & verified the code for function Sin(x),
Cos(x) and ex Using Taylors series in Questa Sim .
50. 2016MVE 006 2016
MDDV Lab Manual Page 50
Practical No. 12
Aim:-Design and implement the verilog code for Questa sim for
1. Reciprocal of Number
2. Square root of Number using Newton Raphson Method.
Questa Sim :-Questa Sim is part of the Questa Advanced Functional Verification
Platform and is the latest tool in Mentor Graphics tool suite for Functional Verification.
The tool provides simulation support for latest standards of System, System Verilog,
Verilog 2001 standard and VHDL.
Verilog code for Reciprocal:-
module reciprocal (input[63:0] d,output reg[63:0] out);
real final, reci=64'd1, z=64'd1, reci1=64'd0, i ;
always @(*)
begin
final=1/z;
for(i=0;i<=5;i=i+1)
begin
if(reci==final)
begin
$display("reciprocal of x is %f ",reci);
end
else
begin
reci=(reci*(2-(z*reci)));
end
end
end
endmodule
Output Waveform:-
51. 2016MVE 006 2016
MDDV Lab Manual Page 51
Verilog code for Square Root:-
module sqroot(input[63:0] d,output reg[63:0] out);
real final,reci=64'd1,z=64'd1,i;
always @(*)
begin
final=1/z;
for(i=0;i<=5;i=i+1)
begin
if(reci==final)
begin
$display("reciprocal of x is %f ",reci);
end
else
begin
reci=(((reci*reci)+z)/(2*reci));
end
end
end
endmodule
Output Waveform:-
Conclusion:-
Thus we have Perform the practical & verified the code for Reciprocal
& Square root of given Number using Newton raphson’s method.