SlideShare ist ein Scribd-Unternehmen logo
1 von 10
Digital System Design
Digital Circuit Verification
Hardware Descriptive Language
Verilog
Overview
 More Structural Verilog Examples
 Dataflow Modeling
 Dataflow Verilog Examples
 Writing Test Bench
4-1 Multiplexer - Structural Verilog Description
module multiplexer_4_to_1_st_v(S, I, Y);
input [1:0] S; // S is a vector with components S[1] and S[0]
input [3:0] I; // I is a 4-bit input; vectors: I[0]
I[3]
output Y;
wire [1:0] not_S; // connecting NOT-AND
wire [0:3] D, N; // D connecting AND-AND
not // N  AND outputs
gn0(not_S[0], S[0]), // gn0(output, input)
gn1(not_S[1], S[1]);
and
g0(D[0], not_S[1], not_S[0]),
g1(D[1], not_S[1], S[0]),
g2(D[2], S[1], not_S[0]),
g3(D[3], S[1], S[0]),
g4(N[0], D[0], I[0]),
g5(N[1], D[1], I[1]),
g6(N[2], D[2], I[2]),
g7(N[3], D[3], I[3]);
or go(Y, N[0], N[1], N[2], N[3]);
endmodule
D0
g0
not_S[0]S[0]
g4
N[0]
2-to-4 Line Decoder Structural Verilog
// 2-to-4 Line Decoder: Structural Verilog Description.
// (See Figure 4-10 for logic diagram)
module decoder_2_to_4_st_v(EN, A0, A1, D0, D1, D2, D3);
input EN, A0, A1;
output D0, D1, D2, D3;
wire A0_n, A1_n, N0, N1, N2, N3;
not
go(A0_n, A0),
g1(A1_n, A1);
and
g3(N0, A0_n, A1_n),
g4(N1, A0, A1_n),
g5(N2, A0_n, A1),
g6(N3, A0, A1),
g7(D0, N0, EN),
g8(D1, N1, EN),
g9(D2, N2, EN),
g10(D3, N3, EN);
endmodule
A1_n
N0
N1
g3
A0_n
g6 N3
Dataflow Verilog Modeling
 A dataflow description is based on function rather than
structure.
 A dataflow uses a number of operators that act on operands
to produce the desired function  Boolean equations are used
in place of logic schematics.
4-1 Multiplexer - Dataflow Verilog
// 4-to-1 Line Multiplexer: Dataflow Verilog Description (Boolean)
// (See Figure 4-14 for logic diagram)
module multiplexer_4_to_1_df_v(S, I, Y);
input [1:0] S;
input [3:0] I;
output Y;
assign Y = (~ S[1] & ~ S[0] & I[0])| (~ S[1] & S[0] & I[1])
| (S[1] & ~ S[0] & I[2]) | (S[1] & S[0] & I[3]);
endmodule
2-to-4 Line Decoder Dataflow Verilog
// 2-to-4 Line Decoder with Enable: Dataflow Verilog Desc.
// (See Figure 4-10 for logic diagram)
module decoder_2_to_4_df_v(EN, A0, A1, D0, D1, D2, D3);
input EN, A0, A1;
output D0, D1, D2, D3;
assign D0 =(EN & ~A1 & ~A0);
assign D1 =(EN & ~A1 & A0);
assign D2 =(EN & A1 & ~A0);
assign D3 =(EN & A1 & A0);
endmodule
Writing a Test Bench
 A test bench in an HDL program for applying stimulus to
an HDL design in order to test it and observe the response
during simulation.
initial
begin
A = 0; B = 0; // @ t = 0 A and B are set to 0
#10 A = 1; // 10 time units later, A is changed to 1
#20 A = 0; B = 1; // @ t = 30 A is changed to 0 and B to 1
end
Test Bench Example
//HDL Example
//------------------------------------------
//Gate-level description of a combinational circuit
module analysis (A,B,C,F1,F2);
input A,B,C;
output F1,F2;
wire T1,T2,T3,F2not,E1,E2,E3;
or g1 (T1,A,B,C);
and g2 (T2,A,B,C);
and g3 (E1,A,B);
and g4 (E2,A,C);
and g5 (E3,B,C);
or g6 (F2,E1,E2,E3);
not g7 (F2not,F2);
and g8 (T3,T1,F2not);
or g9 (F1,T2,T3);
endmodule
//Stimulus to analyze the circuit
module test_circuit;
reg [2:0]D;
wire F1,F2;
analysis circuit(D[2],D[1],D[0],F1,F2);
initial
begin
D = 3'b000;
repeat (7)
#10 D = D + 1'b1;
end
initial
$monitor ("ABC = %b F1 = %b F2 =%b ",D, F1, F2);
endmodule
Test Bench Example (continued)

Weitere Àhnliche Inhalte

Was ist angesagt?

Hardware Description Language
Hardware Description Language Hardware Description Language
Hardware Description Language Prachi Pandey
 
Verilog HDL- 2
Verilog HDL- 2Verilog HDL- 2
Verilog HDL- 2Prabhavathi P
 
Day2 Verilog HDL Basic
Day2 Verilog HDL BasicDay2 Verilog HDL Basic
Day2 Verilog HDL BasicRon Liu
 
Verilog overview
Verilog overviewVerilog overview
Verilog overviewposdege
 
System Verilog Tutorial - VHDL
System Verilog Tutorial - VHDLSystem Verilog Tutorial - VHDL
System Verilog Tutorial - VHDLE2MATRIX
 
VHDL- gate level modelling
VHDL- gate level modellingVHDL- gate level modelling
VHDL- gate level modellingVandanaPagar1
 
Verilog HDL
Verilog HDLVerilog HDL
Verilog HDLMantra VLSI
 
Verilog lab manual (ECAD and VLSI Lab)
Verilog lab manual (ECAD and VLSI Lab)Verilog lab manual (ECAD and VLSI Lab)
Verilog lab manual (ECAD and VLSI Lab)Dr. Swaminathan Kathirvel
 
Lecture 2 verilog
Lecture 2   verilogLecture 2   verilog
Lecture 2 verilogvenravi10
 
Verilog HDL Training Course
Verilog HDL Training CourseVerilog HDL Training Course
Verilog HDL Training CoursePaul Laskowski
 
verilog code for logic gates
verilog code for logic gatesverilog code for logic gates
verilog code for logic gatesRakesh kumar jha
 
An Introductory course on Verilog HDL-Verilog hdl ppr
An Introductory course on Verilog HDL-Verilog hdl pprAn Introductory course on Verilog HDL-Verilog hdl ppr
An Introductory course on Verilog HDL-Verilog hdl pprPrabhavathi P
 
Fpga 04-verilog-programming
Fpga 04-verilog-programmingFpga 04-verilog-programming
Fpga 04-verilog-programmingMalik Tauqir Hasan
 
VHDL- data types
VHDL- data typesVHDL- data types
VHDL- data typesVandanaPagar1
 
Basics of digital verilog design(alok singh kanpur)
Basics of digital verilog design(alok singh kanpur)Basics of digital verilog design(alok singh kanpur)
Basics of digital verilog design(alok singh kanpur)Alok Singh
 

Was ist angesagt? (20)

Hardware Description Language
Hardware Description Language Hardware Description Language
Hardware Description Language
 
Verilog HDL- 2
Verilog HDL- 2Verilog HDL- 2
Verilog HDL- 2
 
Day2 Verilog HDL Basic
Day2 Verilog HDL BasicDay2 Verilog HDL Basic
Day2 Verilog HDL Basic
 
Verilog overview
Verilog overviewVerilog overview
Verilog overview
 
System Verilog Tutorial - VHDL
System Verilog Tutorial - VHDLSystem Verilog Tutorial - VHDL
System Verilog Tutorial - VHDL
 
VHDL- gate level modelling
VHDL- gate level modellingVHDL- gate level modelling
VHDL- gate level modelling
 
Verilog HDL
Verilog HDLVerilog HDL
Verilog HDL
 
Crash course in verilog
Crash course in verilogCrash course in verilog
Crash course in verilog
 
Verilog lab manual (ECAD and VLSI Lab)
Verilog lab manual (ECAD and VLSI Lab)Verilog lab manual (ECAD and VLSI Lab)
Verilog lab manual (ECAD and VLSI Lab)
 
Verilog
VerilogVerilog
Verilog
 
Coding verilog
Coding verilogCoding verilog
Coding verilog
 
Verilog tutorial
Verilog tutorialVerilog tutorial
Verilog tutorial
 
Lecture 2 verilog
Lecture 2   verilogLecture 2   verilog
Lecture 2 verilog
 
Verilog HDL Training Course
Verilog HDL Training CourseVerilog HDL Training Course
Verilog HDL Training Course
 
verilog code for logic gates
verilog code for logic gatesverilog code for logic gates
verilog code for logic gates
 
An Introductory course on Verilog HDL-Verilog hdl ppr
An Introductory course on Verilog HDL-Verilog hdl pprAn Introductory course on Verilog HDL-Verilog hdl ppr
An Introductory course on Verilog HDL-Verilog hdl ppr
 
Verilog èȘžæł•æ•™ć­ž
Verilog èȘžæł•æ•™ć­ž Verilog èȘžæł•æ•™ć­ž
Verilog èȘžæł•æ•™ć­ž
 
Fpga 04-verilog-programming
Fpga 04-verilog-programmingFpga 04-verilog-programming
Fpga 04-verilog-programming
 
VHDL- data types
VHDL- data typesVHDL- data types
VHDL- data types
 
Basics of digital verilog design(alok singh kanpur)
Basics of digital verilog design(alok singh kanpur)Basics of digital verilog design(alok singh kanpur)
Basics of digital verilog design(alok singh kanpur)
 

Andere mochten auch

test generation
test generationtest generation
test generationdennis gookyi
 
An 8 bit_multiplier
An 8 bit_multiplierAn 8 bit_multiplier
An 8 bit_multiplierRobi Parvez
 
Factory Act
Factory ActFactory Act
Factory Actsland10
 
uMobile: Jasig-Sakai 2012
uMobile: Jasig-Sakai 2012uMobile: Jasig-Sakai 2012
uMobile: Jasig-Sakai 2012Jennifer Bourey
 
Vhdl Project List - Verilog Projects
Vhdl Project List - Verilog Projects Vhdl Project List - Verilog Projects
Vhdl Project List - Verilog Projects E2MATRIX
 
Fpga implementation of high speed 8 bit vedic multiplier using barrel shifter(1)
Fpga implementation of high speed 8 bit vedic multiplier using barrel shifter(1)Fpga implementation of high speed 8 bit vedic multiplier using barrel shifter(1)
Fpga implementation of high speed 8 bit vedic multiplier using barrel shifter(1)Karthik Sagar
 
Multipliers in VLSI
Multipliers in VLSIMultipliers in VLSI
Multipliers in VLSIKiranmai Sony
 
ieee projects list
ieee projects listieee projects list
ieee projects list8130809758
 
Project of industrial law on factory act
Project of industrial law on factory actProject of industrial law on factory act
Project of industrial law on factory actStewart Serrao
 
8 bit alu design
8 bit alu design8 bit alu design
8 bit alu designshobhan pujari
 
verilog code
verilog codeverilog code
verilog codeMantra VLSI
 
Termination of-service
Termination of-serviceTermination of-service
Termination of-serviceHarshith Agarwal
 
Social security on employment in sri lanka
Social security on employment in sri lankaSocial security on employment in sri lanka
Social security on employment in sri lankaArjun Ariaratnam
 
Law codes , labor standard and factory ordinance
Law codes , labor standard and factory ordinanceLaw codes , labor standard and factory ordinance
Law codes , labor standard and factory ordinancezahraan01
 
Legal system of sri lanaka
Legal system of sri lanakaLegal system of sri lanaka
Legal system of sri lanakaR.R.G.S Bandara
 
Vlsi mini project list 2013
Vlsi mini project list 2013Vlsi mini project list 2013
Vlsi mini project list 2013Vision Solutions
 
vlsi projects using verilog code 2014-2015
vlsi projects using verilog code 2014-2015vlsi projects using verilog code 2014-2015
vlsi projects using verilog code 2014-2015E2MATRIX
 
Number system
Number systemNumber system
Number systemMantra VLSI
 

Andere mochten auch (20)

test generation
test generationtest generation
test generation
 
An 8 bit_multiplier
An 8 bit_multiplierAn 8 bit_multiplier
An 8 bit_multiplier
 
Factory Act
Factory ActFactory Act
Factory Act
 
uMobile: Jasig-Sakai 2012
uMobile: Jasig-Sakai 2012uMobile: Jasig-Sakai 2012
uMobile: Jasig-Sakai 2012
 
Vhdl Project List - Verilog Projects
Vhdl Project List - Verilog Projects Vhdl Project List - Verilog Projects
Vhdl Project List - Verilog Projects
 
B.Tech VLSI projects list
B.Tech VLSI projects listB.Tech VLSI projects list
B.Tech VLSI projects list
 
Fpga implementation of high speed 8 bit vedic multiplier using barrel shifter(1)
Fpga implementation of high speed 8 bit vedic multiplier using barrel shifter(1)Fpga implementation of high speed 8 bit vedic multiplier using barrel shifter(1)
Fpga implementation of high speed 8 bit vedic multiplier using barrel shifter(1)
 
Multipliers in VLSI
Multipliers in VLSIMultipliers in VLSI
Multipliers in VLSI
 
ieee projects list
ieee projects listieee projects list
ieee projects list
 
Project of industrial law on factory act
Project of industrial law on factory actProject of industrial law on factory act
Project of industrial law on factory act
 
8 bit alu design
8 bit alu design8 bit alu design
8 bit alu design
 
verilog code
verilog codeverilog code
verilog code
 
Termination of-service
Termination of-serviceTermination of-service
Termination of-service
 
Matlab isim link
Matlab isim linkMatlab isim link
Matlab isim link
 
Social security on employment in sri lanka
Social security on employment in sri lankaSocial security on employment in sri lanka
Social security on employment in sri lanka
 
Law codes , labor standard and factory ordinance
Law codes , labor standard and factory ordinanceLaw codes , labor standard and factory ordinance
Law codes , labor standard and factory ordinance
 
Legal system of sri lanaka
Legal system of sri lanakaLegal system of sri lanaka
Legal system of sri lanaka
 
Vlsi mini project list 2013
Vlsi mini project list 2013Vlsi mini project list 2013
Vlsi mini project list 2013
 
vlsi projects using verilog code 2014-2015
vlsi projects using verilog code 2014-2015vlsi projects using verilog code 2014-2015
vlsi projects using verilog code 2014-2015
 
Number system
Number systemNumber system
Number system
 

Ähnlich wie Digital System Design - Structural and Dataflow Verilog Examples and Test Bench Writing

Verilog tutorial
Verilog tutorialVerilog tutorial
Verilog tutorialamnis_azeneth
 
vlsi design using verilog presentaion 1
vlsi design using verilog   presentaion 1vlsi design using verilog   presentaion 1
vlsi design using verilog presentaion 1MANDHASAIGOUD1
 
Verilog Final Probe'22.pptx
Verilog Final Probe'22.pptxVerilog Final Probe'22.pptx
Verilog Final Probe'22.pptxSyedAzim6
 
Rsa Signature: Behind The Scenes
Rsa Signature: Behind The Scenes Rsa Signature: Behind The Scenes
Rsa Signature: Behind The Scenes acijjournal
 
RSA SIGNATURE: BEHIND THE SCENES
RSA SIGNATURE: BEHIND THE SCENESRSA SIGNATURE: BEHIND THE SCENES
RSA SIGNATURE: BEHIND THE SCENESacijjournal
 
Verilog
VerilogVerilog
Verilogabkvlsi
 
SKEL 4273 CAD with HDL Topic 2
SKEL 4273 CAD with HDL Topic 2SKEL 4273 CAD with HDL Topic 2
SKEL 4273 CAD with HDL Topic 2alhadi81
 
CombVerilog.pdf
CombVerilog.pdfCombVerilog.pdf
CombVerilog.pdfashwkr07
 
Verilog_Overview.pdf
Verilog_Overview.pdfVerilog_Overview.pdf
Verilog_Overview.pdfQuangHuyDo3
 
C language first program
C language first programC language first program
C language first programNIKHIL KRISHNA
 
Digital System Design-Gatelevel and Dataflow Modeling
Digital System Design-Gatelevel and Dataflow ModelingDigital System Design-Gatelevel and Dataflow Modeling
Digital System Design-Gatelevel and Dataflow ModelingIndira Priyadarshini
 
An Overview of SystemVerilog for Design and Verification
An Overview of SystemVerilog  for Design and VerificationAn Overview of SystemVerilog  for Design and Verification
An Overview of SystemVerilog for Design and VerificationKapilRaghunandanTrip
 
VerilogHDL_Utkarsh_kulshrestha
VerilogHDL_Utkarsh_kulshresthaVerilogHDL_Utkarsh_kulshrestha
VerilogHDL_Utkarsh_kulshresthaUtkarsh Kulshrestha
 
CP Handout#9
CP Handout#9CP Handout#9
CP Handout#9trupti1976
 

Ähnlich wie Digital System Design - Structural and Dataflow Verilog Examples and Test Bench Writing (20)

Verilog tutorial
Verilog tutorialVerilog tutorial
Verilog tutorial
 
vlsi design using verilog presentaion 1
vlsi design using verilog   presentaion 1vlsi design using verilog   presentaion 1
vlsi design using verilog presentaion 1
 
Verilog Final Probe'22.pptx
Verilog Final Probe'22.pptxVerilog Final Probe'22.pptx
Verilog Final Probe'22.pptx
 
Rsa Signature: Behind The Scenes
Rsa Signature: Behind The Scenes Rsa Signature: Behind The Scenes
Rsa Signature: Behind The Scenes
 
RSA SIGNATURE: BEHIND THE SCENES
RSA SIGNATURE: BEHIND THE SCENESRSA SIGNATURE: BEHIND THE SCENES
RSA SIGNATURE: BEHIND THE SCENES
 
Verilogspk1
Verilogspk1Verilogspk1
Verilogspk1
 
Verilog
VerilogVerilog
Verilog
 
SKEL 4273 CAD with HDL Topic 2
SKEL 4273 CAD with HDL Topic 2SKEL 4273 CAD with HDL Topic 2
SKEL 4273 CAD with HDL Topic 2
 
CombVerilog.pdf
CombVerilog.pdfCombVerilog.pdf
CombVerilog.pdf
 
Verilog_Overview.pdf
Verilog_Overview.pdfVerilog_Overview.pdf
Verilog_Overview.pdf
 
C language first program
C language first programC language first program
C language first program
 
Spdas2 vlsibput
Spdas2 vlsibputSpdas2 vlsibput
Spdas2 vlsibput
 
Introduction to HDLs
Introduction to HDLsIntroduction to HDLs
Introduction to HDLs
 
Digital System Design-Gatelevel and Dataflow Modeling
Digital System Design-Gatelevel and Dataflow ModelingDigital System Design-Gatelevel and Dataflow Modeling
Digital System Design-Gatelevel and Dataflow Modeling
 
C++
C++C++
C++
 
Verilog HDL
Verilog HDL Verilog HDL
Verilog HDL
 
An Overview of SystemVerilog for Design and Verification
An Overview of SystemVerilog  for Design and VerificationAn Overview of SystemVerilog  for Design and Verification
An Overview of SystemVerilog for Design and Verification
 
VerilogHDL_Utkarsh_kulshrestha
VerilogHDL_Utkarsh_kulshresthaVerilogHDL_Utkarsh_kulshrestha
VerilogHDL_Utkarsh_kulshrestha
 
VerilogHDL.ppt
VerilogHDL.pptVerilogHDL.ppt
VerilogHDL.ppt
 
CP Handout#9
CP Handout#9CP Handout#9
CP Handout#9
 

KĂŒrzlich hochgeladen

Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
Vishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsVishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsSachinPawar510423
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncssuser2ae721
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
Piping Basic stress analysis by engineering
Piping Basic stress analysis by engineeringPiping Basic stress analysis by engineering
Piping Basic stress analysis by engineeringJuanCarlosMorales19600
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfAsst.prof M.Gokilavani
 
Call Us ≜ 8377877756 ≌ Call Girls In Shastri Nagar (Delhi)
Call Us ≜ 8377877756 ≌ Call Girls In Shastri Nagar (Delhi)Call Us ≜ 8377877756 ≌ Call Girls In Shastri Nagar (Delhi)
Call Us ≜ 8377877756 ≌ Call Girls In Shastri Nagar (Delhi)dollysharma2066
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfme23b1001
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgUnit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgsaravananr517913
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...Chandu841456
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptMadan Karki
 
8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitterShivangiSharma879191
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
TechTACÂź CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTACÂź CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTACÂź CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTACÂź CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catcherssdickerson1
 

KĂŒrzlich hochgeladen (20)

Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
Vishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsVishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documents
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
Piping Basic stress analysis by engineering
Piping Basic stress analysis by engineeringPiping Basic stress analysis by engineering
Piping Basic stress analysis by engineering
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
 
Call Us ≜ 8377877756 ≌ Call Girls In Shastri Nagar (Delhi)
Call Us ≜ 8377877756 ≌ Call Girls In Shastri Nagar (Delhi)Call Us ≜ 8377877756 ≌ Call Girls In Shastri Nagar (Delhi)
Call Us ≜ 8377877756 ≌ Call Girls In Shastri Nagar (Delhi)
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdf
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgUnit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.ppt
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
TechTACÂź CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTACÂź CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTACÂź CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTACÂź CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
 

Digital System Design - Structural and Dataflow Verilog Examples and Test Bench Writing

  • 1. Digital System Design Digital Circuit Verification Hardware Descriptive Language Verilog
  • 2. Overview  More Structural Verilog Examples  Dataflow Modeling  Dataflow Verilog Examples  Writing Test Bench
  • 3. 4-1 Multiplexer - Structural Verilog Description module multiplexer_4_to_1_st_v(S, I, Y); input [1:0] S; // S is a vector with components S[1] and S[0] input [3:0] I; // I is a 4-bit input; vectors: I[0]
I[3] output Y; wire [1:0] not_S; // connecting NOT-AND wire [0:3] D, N; // D connecting AND-AND not // N  AND outputs gn0(not_S[0], S[0]), // gn0(output, input) gn1(not_S[1], S[1]); and g0(D[0], not_S[1], not_S[0]), g1(D[1], not_S[1], S[0]), g2(D[2], S[1], not_S[0]), g3(D[3], S[1], S[0]), g4(N[0], D[0], I[0]), g5(N[1], D[1], I[1]), g6(N[2], D[2], I[2]), g7(N[3], D[3], I[3]); or go(Y, N[0], N[1], N[2], N[3]); endmodule D0 g0 not_S[0]S[0] g4 N[0]
  • 4. 2-to-4 Line Decoder Structural Verilog // 2-to-4 Line Decoder: Structural Verilog Description. // (See Figure 4-10 for logic diagram) module decoder_2_to_4_st_v(EN, A0, A1, D0, D1, D2, D3); input EN, A0, A1; output D0, D1, D2, D3; wire A0_n, A1_n, N0, N1, N2, N3; not go(A0_n, A0), g1(A1_n, A1); and g3(N0, A0_n, A1_n), g4(N1, A0, A1_n), g5(N2, A0_n, A1), g6(N3, A0, A1), g7(D0, N0, EN), g8(D1, N1, EN), g9(D2, N2, EN), g10(D3, N3, EN); endmodule A1_n N0 N1 g3 A0_n g6 N3
  • 5. Dataflow Verilog Modeling  A dataflow description is based on function rather than structure.  A dataflow uses a number of operators that act on operands to produce the desired function  Boolean equations are used in place of logic schematics.
  • 6. 4-1 Multiplexer - Dataflow Verilog // 4-to-1 Line Multiplexer: Dataflow Verilog Description (Boolean) // (See Figure 4-14 for logic diagram) module multiplexer_4_to_1_df_v(S, I, Y); input [1:0] S; input [3:0] I; output Y; assign Y = (~ S[1] & ~ S[0] & I[0])| (~ S[1] & S[0] & I[1]) | (S[1] & ~ S[0] & I[2]) | (S[1] & S[0] & I[3]); endmodule
  • 7. 2-to-4 Line Decoder Dataflow Verilog // 2-to-4 Line Decoder with Enable: Dataflow Verilog Desc. // (See Figure 4-10 for logic diagram) module decoder_2_to_4_df_v(EN, A0, A1, D0, D1, D2, D3); input EN, A0, A1; output D0, D1, D2, D3; assign D0 =(EN & ~A1 & ~A0); assign D1 =(EN & ~A1 & A0); assign D2 =(EN & A1 & ~A0); assign D3 =(EN & A1 & A0); endmodule
  • 8. Writing a Test Bench  A test bench in an HDL program for applying stimulus to an HDL design in order to test it and observe the response during simulation. initial begin A = 0; B = 0; // @ t = 0 A and B are set to 0 #10 A = 1; // 10 time units later, A is changed to 1 #20 A = 0; B = 1; // @ t = 30 A is changed to 0 and B to 1 end
  • 9. Test Bench Example //HDL Example //------------------------------------------ //Gate-level description of a combinational circuit module analysis (A,B,C,F1,F2); input A,B,C; output F1,F2; wire T1,T2,T3,F2not,E1,E2,E3; or g1 (T1,A,B,C); and g2 (T2,A,B,C); and g3 (E1,A,B); and g4 (E2,A,C); and g5 (E3,B,C); or g6 (F2,E1,E2,E3); not g7 (F2not,F2); and g8 (T3,T1,F2not); or g9 (F1,T2,T3); endmodule
  • 10. //Stimulus to analyze the circuit module test_circuit; reg [2:0]D; wire F1,F2; analysis circuit(D[2],D[1],D[0],F1,F2); initial begin D = 3'b000; repeat (7) #10 D = D + 1'b1; end initial $monitor ("ABC = %b F1 = %b F2 =%b ",D, F1, F2); endmodule Test Bench Example (continued)