SlideShare uma empresa Scribd logo
1 de 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)

Mais conteúdo relacionado

Mais procurados

Hardware Description Language
Hardware Description Language Hardware Description Language
Hardware Description Language Prachi Pandey
 
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
 
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
 
Verilog 語法教學
Verilog 語法教學 Verilog 語法教學
Verilog 語法教學 艾鍗科技
 
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
 

Mais procurados (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)
 

Destaque

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
 
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
 
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
 

Destaque (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
 

Semelhante a Digital Circuit Verification Hardware Descriptive Language Verilog

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
 
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
 

Semelhante a Digital Circuit Verification Hardware Descriptive Language Verilog (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
 

Último

Unit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfUnit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfRagavanV2
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfJiananWang21
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXssuser89054b
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptNANDHAKUMARA10
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueBhangaleSonal
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . pptDineshKumar4165
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdfKamal Acharya
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 

Último (20)

Unit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfUnit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdf
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 

Digital Circuit Verification Hardware Descriptive Language Verilog

  • 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)