Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
33 views
Verilog Test Bench
Verilog Test Bench How to Write a Basic Verilog Testbench Syntax of Verilog Test Bench & explanation
Uploaded by
sujay g
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Save
Save Verilog Test Bench For Later
Save
Save Verilog Test Bench For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Report
0 ratings
0% found this document useful (0 votes)
33 views
Verilog Test Bench
Verilog Test Bench How to Write a Basic Verilog Testbench Syntax of Verilog Test Bench & explanation
Uploaded by
sujay g
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Save
Save Verilog Test Bench For Later
Carousel Previous
Carousel Next
Save
Save Verilog Test Bench For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Report
You are on page 1
/ 2
Search
Fullscreen
VERILOG TEST BENCH HA adder code with delay module half_adder( input a,b, output sum, carry }; assign 0 sum =a 4b; assign #10 carry =a & b; endmodule ‘TEST BENCH EXAMPLE module tb_half_adder; /[1. Define inputs and outputs rega,b; —// inputs using reg wire sum, carry; // outputs using wire 1/2. \nstantiate or call the half adder module & map variables half_adder wut (.a(a), .0(b), sum(sum), carry(carry) ); 1/3. Allinput combinations initial begin a=0;b=0; #10; a=0;b=1; #10; a= 1;b=0; #0; a=1;b=1;#10; Stinish; // End simulation end 1/4.%o display values initial begin $monitor(" 2 = %6b,b =%b, sum = %b, carry =%b", a,b, sum, carry); end endmodule Explanation for Test Bench Testbench : Itis program used to tet the functionality of the main module or main program. It provides all posible input combinations to check whether the main program works correctly. Test bench is created using keyword module with the name tb_half_adder; Here name of the test bench is tb_half_adder; 1. Define Inputs and Outputs: * Inputs are defined using reg keyw © rega,b; ts e keyword 2. Insatiate oF Call the Half Adder Modu: + The ha: module is instantiated (called) and given local name wut + Inpatsioutputs ofthe main program (half adder) are connected or mapped tothe testbench variables. adde Prof. Sujay Gejji ECE, SGBIT BelagaviVERILOG TEST BENCH 3. Generate Input Combinations: ‘© All possible input combinations are mentioned within the initial block a=0;b=1; #10; ‘© Here 10 time units delayed is mentioned 4, Display Results: ‘+ Smonitor command is used to continuously print or display the values of variables 2, b, sum, and carry whenever they change. ‘+ Alternatively, we can use Sdisplay to print or displ: Sdisplay (" a = %eb, b = %kb, sum =%b, carry = %6b", a,b, sum, carry); Sdisplay command displays or prints the values only once, but monitor displays values continuously ‘whenever they change. © End the Simulation: ‘The $finish commend is used to stop the simulation afterall input combinations are tested, Prof. Sujay Gejji ECE, SGBIT Belagavi
You might also like
Chap 2 Data Types Fall 2014
PDF
No ratings yet
Chap 2 Data Types Fall 2014
78 pages
Verilog - Mano
PDF
No ratings yet
Verilog - Mano
43 pages
11 Verilog Operators 19-08-2023
PDF
No ratings yet
11 Verilog Operators 19-08-2023
48 pages
Verilog HDL
PDF
No ratings yet
Verilog HDL
40 pages
Test Benches in Verilog
PDF
No ratings yet
Test Benches in Verilog
16 pages
Verilog Fundamentals
PDF
No ratings yet
Verilog Fundamentals
49 pages
Verilog
PDF
No ratings yet
Verilog
46 pages
New DSD Manual Rvitm (4-7)
PDF
No ratings yet
New DSD Manual Rvitm (4-7)
72 pages
Verilog: Hardware Description Language
PDF
No ratings yet
Verilog: Hardware Description Language
53 pages
DSD Unit 1-4 PDF
PDF
No ratings yet
DSD Unit 1-4 PDF
95 pages
SystemVerilog 20041201165354
PDF
No ratings yet
SystemVerilog 20041201165354
34 pages
DataFlow Modelling
PDF
No ratings yet
DataFlow Modelling
6 pages
Lab2 Verilog
PDF
No ratings yet
Lab2 Verilog
5 pages
Verilog Modules and Ports
PDF
100% (1)
Verilog Modules and Ports
28 pages
Verilog-HDL: "Our Actions Inspires To "
PDF
No ratings yet
Verilog-HDL: "Our Actions Inspires To "
3 pages
HDL Lab Manual VTU
PDF
No ratings yet
HDL Lab Manual VTU
63 pages
Verilog Parameters and Operators
PDF
No ratings yet
Verilog Parameters and Operators
25 pages
08-Verilog Tasks and Functions
PDF
No ratings yet
08-Verilog Tasks and Functions
20 pages
Ee 241 Digital Circuits Final Exam Solution Manual
PDF
No ratings yet
Ee 241 Digital Circuits Final Exam Solution Manual
10 pages
Verilogexample
PDF
No ratings yet
Verilogexample
20 pages
Verilog Tutorial For Beginners
PDF
No ratings yet
Verilog Tutorial For Beginners
4 pages
15EC62 Arm MC and Es Course File 2018
PDF
No ratings yet
15EC62 Arm MC and Es Course File 2018
10 pages
BCD 2 Binary
PDF
No ratings yet
BCD 2 Binary
25 pages
Experiment Sheet - FPGA Design ALL
PDF
No ratings yet
Experiment Sheet - FPGA Design ALL
38 pages
System Verilog Datatypes
PDF
No ratings yet
System Verilog Datatypes
50 pages
Verilog Designs: Introduction To Simulation of Using Modelsim-Altera
PDF
No ratings yet
Verilog Designs: Introduction To Simulation of Using Modelsim-Altera
31 pages
Experiment No 6: Implementation of Instruction Fetch Unit: Team Details: Terminal No: SL No Name Id No 1 2 3
PDF
No ratings yet
Experiment No 6: Implementation of Instruction Fetch Unit: Team Details: Terminal No: SL No Name Id No 1 2 3
6 pages
Systemverilog Procedural Statements: New Operators
PDF
No ratings yet
Systemverilog Procedural Statements: New Operators
15 pages
Lec4 Verilog
PDF
No ratings yet
Lec4 Verilog
58 pages
Lab Report Fpga
PDF
No ratings yet
Lab Report Fpga
34 pages
Lec10 Register Transfer and Microoperations
PDF
No ratings yet
Lec10 Register Transfer and Microoperations
22 pages
Descrip (On Styles in Verilog
PDF
100% (1)
Descrip (On Styles in Verilog
31 pages
Multiplexers
PDF
No ratings yet
Multiplexers
20 pages
Verilog SAP
PDF
No ratings yet
Verilog SAP
69 pages
Finite State Machines: by Mike Chen
PDF
No ratings yet
Finite State Machines: by Mike Chen
25 pages
Computer Organization 5th Edition
PDF
No ratings yet
Computer Organization 5th Edition
818 pages
Block Diagram Reduction Techniques
PDF
No ratings yet
Block Diagram Reduction Techniques
47 pages
Open File 2
PDF
No ratings yet
Open File 2
68 pages
Chapter 06
PDF
100% (2)
Chapter 06
54 pages
Verilog For Verification
PDF
No ratings yet
Verilog For Verification
23 pages
EX. NO: 1 Date: Implementation of Basic Logic Gates in Fpga
PDF
No ratings yet
EX. NO: 1 Date: Implementation of Basic Logic Gates in Fpga
66 pages
VLSI Design and Verification
PDF
No ratings yet
VLSI Design and Verification
11 pages
VLSI Design Lab
PDF
No ratings yet
VLSI Design Lab
47 pages
Hardware Description Languages
PDF
No ratings yet
Hardware Description Languages
12 pages
Lecture 24
PDF
No ratings yet
Lecture 24
41 pages
Field Programmable Gate Array (FPGA)
PDF
No ratings yet
Field Programmable Gate Array (FPGA)
8 pages
Assignment Solution Week3
PDF
No ratings yet
Assignment Solution Week3
3 pages
Module 1 Chapter 1
PDF
No ratings yet
Module 1 Chapter 1
14 pages
Number Systems and Boolean Logic
PDF
No ratings yet
Number Systems and Boolean Logic
9 pages
Verilog Test Bench
PDF
No ratings yet
Verilog Test Bench
34 pages
Verilog HDL Basics Lab Assignments: Lab Work 1. Study of Module Declaration and Module Instantiation Principles
PDF
No ratings yet
Verilog HDL Basics Lab Assignments: Lab Work 1. Study of Module Declaration and Module Instantiation Principles
3 pages
Verilog HDL - 18ec56 Assignment
PDF
No ratings yet
Verilog HDL - 18ec56 Assignment
2 pages
Timer Counter in ARM7 (LPC2148) : Aarav Soni
PDF
No ratings yet
Timer Counter in ARM7 (LPC2148) : Aarav Soni
26 pages
Digital Design With Verilog: Course Notes For Second Edition
PDF
No ratings yet
Digital Design With Verilog: Course Notes For Second Edition
11 pages
Experiment-1 Combinational Circuits
PDF
No ratings yet
Experiment-1 Combinational Circuits
15 pages
Simulation of Half Adder and Full Adder Using Verilog HDL
PDF
No ratings yet
Simulation of Half Adder and Full Adder Using Verilog HDL
6 pages
DLD Lab Manual 15
PDF
No ratings yet
DLD Lab Manual 15
6 pages
Design and Simulate Full Adder Using Half Adder in The Xilinx ISE Tool
PDF
No ratings yet
Design and Simulate Full Adder Using Half Adder in The Xilinx ISE Tool
4 pages
Verilog_notes topper notes
PDF
No ratings yet
Verilog_notes topper notes
5 pages