SlideShare une entreprise Scribd logo
1  sur  18
Digital Design Using Verilog
- For Absolute Beginners
LEC 7 :Verilog Behavioral Model
Introduction
• This model is considered as the highest level of
abstraction in the Verilog design modelling methods.
•It is also popularly known as Procedural assignment.
•Verilog behavioral model procedural statements
control the simulation and manipulate variables of the
data types .
•This behavioral model provides a wide scope for the
designer to build any complex design which can be
properly simulated and synthesized.
contd
• These statements are contained within procedures.
Each procedure has an activity flow associated with
it.
•The procedural block of Verilog HDL is defined as “a
region of code containing sequential statements.
•There are two types of procedural blocks.
(i).The always block & (ii).The initial block
• Each initial construct and each always construct
starts a separate activity flow.
• All of the activity flows are concurrent to model
the inherent concurrence of hardware.
Procedural assignments
• Procedural assignments are used for updating reg, integer,
time, real, realtime,and memory data types.
• There is a significant difference between procedural
assignments and continuous assignments:
Continuous assignments drive nets and are evaluated and
updated whenever an input operand
changes its value.
Procedural assignments update the value of variables under
the control of the procedural flow constructs
that surround them.
The always Block
• The ‘always’ block is a continuous loop that never
terminates.
• A Verilog module can contain any number of ‘always’
blocks and all these blocks are executed concurrently.
• The basic syntax of always block is
always @ (sensitivity list)
begin
statement 1
------------
statement n
end
contd
23 June 2020 6yayavaram@yahoo.com
• The sequential statements are executed if and if only
,the signals of the sensitivity list changes .
• The LHS of the statements in ‘always ‘ block is reg
type only.
• Ex: let us consider an example code.
module my-mux(A,B,S,Q,Q_b);
input A,B,S;
output Q,Q_b;
reg Q,Q_b;
always @(A or B or S)
begin
if(S)
Q = A; // procedural descriptions
else Q = B;
end
assign Q = ~Q_b; // continuous assignment
endmodule
23 June 2020 7yayavaram@yahoo.com
contd
The Initial Block
• The initial block is typically used to write test bench
for simulation.
• It specifies the stimulus to be applied to the DUT.
• The initial block is executed only once at the
beginning of the simulation used in the test bench.
23 June 2020 8yayavaram@yahoo.com
Illustration
• module behave;
[1:0] a, b;
initial begin
a = 1’b1;
b = 1’b0;
end
always begin
#50 a = ~a;
end
always begin
#100 b = ~b;
end
endmodule
23 June 2020
9
yayavaram@yahoo.com
contd
• In this model, the reg variables a and b initialize to 1
and 0 respectively at simulation time zero.
• The initial construct is then complete and does not
execute again during this simulation run.
• This initial construct contains a begin-end block
(also called a sequential block) of statements. In this
begin-end block a is initialized first, followed by b.
• The always constructs also start at time zero
23 June 2020 10yayavaram@yahoo.com
contd
• But the values of the variables do not change until
the times specified by the delay controls (introduced
by #) have elapsed.
• Thus, reg a inverts after 50 time units and reg b
inverts after 100 time units.
• Since the always constructs repeat, this model will
produce two square waves.
• The reg a toggles with a period of 100 time units,
and reg b toggles with a period of 200 time units.
• The two always constructs proceed concurrently
throughout the entire simulation run.
23 June 2020 11yayavaram@yahoo.com
Different Sequential Statements
(i).begin
sequential statements
end
Note: If there is a single statement in the block ‘begin’
and ‘end ‘ not required
(ii).if(expression)
Sequential statement
else
Sequential statement
23 June 2020 12yayavaram@yahoo.com
contd
• (iii).case(expression)
expr1 : Sequential statement 1
………..
expr n : Sequential statement n
default : Sequential statement
endcase
• (iv).forever
Sequential statemet
23 June 2020 13yayavaram@yahoo.com
• (v). Repeat(expression)
Sequential statement
• (vi). while(expression)
Sequential statement
• (vii). for (expr1:expr2:expr3)
Sequential expression
• (viii).@(event_expression)
This makes a block of statements suspend until
event expression triggers.
23 June 2020 14yayavaram@yahoo.com
Ex: Sequential Logic (D-F/F)
• module ex_Dff(D,clk,Q,Qb);
input D,clk ;
output Q,Qb;
reg Q, Qb ;
always @(negedge clk)
begin
Q = D;
Qb = ~D;
end
endmodule
23 June 2020 15yayavaram@yahoo.com
Ex: 4 Bit ALU
• module ex_ALU4(Y,A,B,S);
input [3:0]A,B;
input [1:0] S ;
output [3:0] Y;
Parameter ADD=2’b00, SUB =2’b01, MUL = 2’10,
DIV = 2’b11;
always @(A or B or S)
case (S)
ADD : Y = A+B;
23 June 2020 16yayavaram@yahoo.com
contd
SUB : Y = A-B ;
MUL : Y=A * B ;
DIV : Y = A/B;
endcase
endmodule
23 June 2020 17yayavaram@yahoo.com
23 June 2020 18yayavaram@yahoo.com

Contenu connexe

Tendances

Day2 Verilog HDL Basic
Day2 Verilog HDL BasicDay2 Verilog HDL Basic
Day2 Verilog HDL BasicRon Liu
 
PPT ON VHDL subprogram,package,alias,use,generate and concurrent statments an...
PPT ON VHDL subprogram,package,alias,use,generate and concurrent statments an...PPT ON VHDL subprogram,package,alias,use,generate and concurrent statments an...
PPT ON VHDL subprogram,package,alias,use,generate and concurrent statments an...Khushboo Jain
 
gate level modeling
gate level modelinggate level modeling
gate level modelingVandanaBR2
 
Data flow model -Lecture-4
Data flow model -Lecture-4Data flow model -Lecture-4
Data flow model -Lecture-4Dr.YNM
 
Combinational circuits
Combinational circuits Combinational circuits
Combinational circuits DrSonali Vyas
 
VHDL- gate level modelling
VHDL- gate level modellingVHDL- gate level modelling
VHDL- gate level modellingVandanaPagar1
 
Sequential Logic Circuit
Sequential Logic CircuitSequential Logic Circuit
Sequential Logic CircuitRamasubbu .P
 
synchronous state machine design
synchronous state machine designsynchronous state machine design
synchronous state machine designAdarsh Patel
 
Finite state machines
Finite state machinesFinite state machines
Finite state machinesdennis gookyi
 
Complex Programmable Logic Device (CPLD) Architecture and Its Applications
Complex Programmable Logic Device (CPLD) Architecture and Its ApplicationsComplex Programmable Logic Device (CPLD) Architecture and Its Applications
Complex Programmable Logic Device (CPLD) Architecture and Its Applicationselprocus
 
Flip flops, counters & registers
Flip flops, counters & registersFlip flops, counters & registers
Flip flops, counters & registersDharit Unadkat
 
Gate level design -For beginners
Gate level design -For beginnersGate level design -For beginners
Gate level design -For beginnersDr.YNM
 
Level sensitive scan design(LSSD) and Boundry scan(BS)
Level sensitive scan design(LSSD) and Boundry scan(BS)Level sensitive scan design(LSSD) and Boundry scan(BS)
Level sensitive scan design(LSSD) and Boundry scan(BS)Praveen Kumar
 
Latches and flip flop
Latches and flip flopLatches and flip flop
Latches and flip flopShuaib Hotak
 

Tendances (20)

Day2 Verilog HDL Basic
Day2 Verilog HDL BasicDay2 Verilog HDL Basic
Day2 Verilog HDL Basic
 
Latches and flip flops
Latches and flip flopsLatches and flip flops
Latches and flip flops
 
PLA
PLAPLA
PLA
 
Pass transistor logic
Pass transistor logicPass transistor logic
Pass transistor logic
 
PPT ON VHDL subprogram,package,alias,use,generate and concurrent statments an...
PPT ON VHDL subprogram,package,alias,use,generate and concurrent statments an...PPT ON VHDL subprogram,package,alias,use,generate and concurrent statments an...
PPT ON VHDL subprogram,package,alias,use,generate and concurrent statments an...
 
Verilog hdl
Verilog hdlVerilog hdl
Verilog hdl
 
gate level modeling
gate level modelinggate level modeling
gate level modeling
 
Data flow model -Lecture-4
Data flow model -Lecture-4Data flow model -Lecture-4
Data flow model -Lecture-4
 
Combinational circuits
Combinational circuits Combinational circuits
Combinational circuits
 
VHDL- gate level modelling
VHDL- gate level modellingVHDL- gate level modelling
VHDL- gate level modelling
 
Sequential Logic Circuit
Sequential Logic CircuitSequential Logic Circuit
Sequential Logic Circuit
 
synchronous state machine design
synchronous state machine designsynchronous state machine design
synchronous state machine design
 
Finite state machines
Finite state machinesFinite state machines
Finite state machines
 
Complex Programmable Logic Device (CPLD) Architecture and Its Applications
Complex Programmable Logic Device (CPLD) Architecture and Its ApplicationsComplex Programmable Logic Device (CPLD) Architecture and Its Applications
Complex Programmable Logic Device (CPLD) Architecture and Its Applications
 
FSM and ASM
FSM and ASMFSM and ASM
FSM and ASM
 
Flip flops, counters & registers
Flip flops, counters & registersFlip flops, counters & registers
Flip flops, counters & registers
 
Gate level design -For beginners
Gate level design -For beginnersGate level design -For beginners
Gate level design -For beginners
 
Level sensitive scan design(LSSD) and Boundry scan(BS)
Level sensitive scan design(LSSD) and Boundry scan(BS)Level sensitive scan design(LSSD) and Boundry scan(BS)
Level sensitive scan design(LSSD) and Boundry scan(BS)
 
PLDs
PLDsPLDs
PLDs
 
Latches and flip flop
Latches and flip flopLatches and flip flop
Latches and flip flop
 

Similaire à Lect 7: Verilog Behavioral model for Absolute Beginners

MODULE 3 process synchronizationnnn.pptx
MODULE 3 process synchronizationnnn.pptxMODULE 3 process synchronizationnnn.pptx
MODULE 3 process synchronizationnnn.pptxsenthilkumar969017
 
FPGA Coding Guidelines
FPGA Coding GuidelinesFPGA Coding Guidelines
FPGA Coding GuidelinesChethan Kumar
 
Lecture-07 Modelling techniques.pdf
Lecture-07 Modelling techniques.pdfLecture-07 Modelling techniques.pdf
Lecture-07 Modelling techniques.pdfNikhilSoni177492
 
Test pattern Generation for 4:1 MUX
Test pattern Generation for 4:1 MUXTest pattern Generation for 4:1 MUX
Test pattern Generation for 4:1 MUXUrmilasSrinivasan
 
Verilog Lecture4 2014
Verilog Lecture4 2014Verilog Lecture4 2014
Verilog Lecture4 2014Béo Tú
 
Advanced Digital Design With The Verilog HDL
Advanced Digital Design With The Verilog HDLAdvanced Digital Design With The Verilog HDL
Advanced Digital Design With The Verilog HDLTony Lisko
 
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
 
Distributed Model Validation with Epsilon
Distributed Model Validation with EpsilonDistributed Model Validation with Epsilon
Distributed Model Validation with EpsilonSina Madani
 
VIT_Workshop.ppt
VIT_Workshop.pptVIT_Workshop.ppt
VIT_Workshop.pptVINOTHRAJR1
 
Digital System Design-Switchlevel and Behavioural Modeling
Digital System Design-Switchlevel and Behavioural ModelingDigital System Design-Switchlevel and Behavioural Modeling
Digital System Design-Switchlevel and Behavioural ModelingIndira Priyadarshini
 
Model simulation VHDL
Model simulation VHDLModel simulation VHDL
Model simulation VHDLAbd17m
 
2. overview of c#
2. overview of c#2. overview of c#
2. overview of c#Rohit Rao
 
Core Java Programming Language (JSE) : Chapter IV - Expressions and Flow Cont...
Core Java Programming Language (JSE) : Chapter IV - Expressions and Flow Cont...Core Java Programming Language (JSE) : Chapter IV - Expressions and Flow Cont...
Core Java Programming Language (JSE) : Chapter IV - Expressions and Flow Cont...WebStackAcademy
 

Similaire à Lect 7: Verilog Behavioral model for Absolute Beginners (20)

Ver1-iitkgp.ppt
Ver1-iitkgp.pptVer1-iitkgp.ppt
Ver1-iitkgp.ppt
 
MODULE 3 process synchronizationnnn.pptx
MODULE 3 process synchronizationnnn.pptxMODULE 3 process synchronizationnnn.pptx
MODULE 3 process synchronizationnnn.pptx
 
Sva.pdf
Sva.pdfSva.pdf
Sva.pdf
 
FPGA Coding Guidelines
FPGA Coding GuidelinesFPGA Coding Guidelines
FPGA Coding Guidelines
 
Lecture-07 Modelling techniques.pdf
Lecture-07 Modelling techniques.pdfLecture-07 Modelling techniques.pdf
Lecture-07 Modelling techniques.pdf
 
Test pattern Generation for 4:1 MUX
Test pattern Generation for 4:1 MUXTest pattern Generation for 4:1 MUX
Test pattern Generation for 4:1 MUX
 
Verilog Lecture4 2014
Verilog Lecture4 2014Verilog Lecture4 2014
Verilog Lecture4 2014
 
Advanced Digital Design With The Verilog HDL
Advanced Digital Design With The Verilog HDLAdvanced Digital Design With The Verilog HDL
Advanced Digital Design With The Verilog HDL
 
1.ppt
1.ppt1.ppt
1.ppt
 
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
 
C language (Part 2)
C language (Part 2)C language (Part 2)
C language (Part 2)
 
Distributed Model Validation with Epsilon
Distributed Model Validation with EpsilonDistributed Model Validation with Epsilon
Distributed Model Validation with Epsilon
 
VIT_Workshop.ppt
VIT_Workshop.pptVIT_Workshop.ppt
VIT_Workshop.ppt
 
Klee and angr
Klee and angrKlee and angr
Klee and angr
 
Digital System Design-Switchlevel and Behavioural Modeling
Digital System Design-Switchlevel and Behavioural ModelingDigital System Design-Switchlevel and Behavioural Modeling
Digital System Design-Switchlevel and Behavioural Modeling
 
embedded C.pptx
embedded C.pptxembedded C.pptx
embedded C.pptx
 
11 whiteboxtesting
11 whiteboxtesting11 whiteboxtesting
11 whiteboxtesting
 
Model simulation VHDL
Model simulation VHDLModel simulation VHDL
Model simulation VHDL
 
2. overview of c#
2. overview of c#2. overview of c#
2. overview of c#
 
Core Java Programming Language (JSE) : Chapter IV - Expressions and Flow Cont...
Core Java Programming Language (JSE) : Chapter IV - Expressions and Flow Cont...Core Java Programming Language (JSE) : Chapter IV - Expressions and Flow Cont...
Core Java Programming Language (JSE) : Chapter IV - Expressions and Flow Cont...
 

Plus de Dr.YNM

Introduction to DSP.ppt
Introduction to DSP.pptIntroduction to DSP.ppt
Introduction to DSP.pptDr.YNM
 
Atmel.ppt
Atmel.pptAtmel.ppt
Atmel.pptDr.YNM
 
PIC Microcontrollers.ppt
PIC Microcontrollers.pptPIC Microcontrollers.ppt
PIC Microcontrollers.pptDr.YNM
 
Crystalstructure-.ppt
Crystalstructure-.pptCrystalstructure-.ppt
Crystalstructure-.pptDr.YNM
 
Basics of OS & RTOS.ppt
Basics of OS & RTOS.pptBasics of OS & RTOS.ppt
Basics of OS & RTOS.pptDr.YNM
 
Introducion to MSP430 Microcontroller.pptx
Introducion to MSP430 Microcontroller.pptxIntroducion to MSP430 Microcontroller.pptx
Introducion to MSP430 Microcontroller.pptxDr.YNM
 
Microcontroller-8051.ppt
Microcontroller-8051.pptMicrocontroller-8051.ppt
Microcontroller-8051.pptDr.YNM
 
Introduction to ASICs.pptx
Introduction to ASICs.pptxIntroduction to ASICs.pptx
Introduction to ASICs.pptxDr.YNM
 
VHDL-PRESENTATION.ppt
VHDL-PRESENTATION.pptVHDL-PRESENTATION.ppt
VHDL-PRESENTATION.pptDr.YNM
 
Basics of data communications.pptx
Basics of data communications.pptxBasics of data communications.pptx
Basics of data communications.pptxDr.YNM
 
CPLD & FPGA Architectures and applictionsplications.pptx
CPLD & FPGA Architectures and applictionsplications.pptxCPLD & FPGA Architectures and applictionsplications.pptx
CPLD & FPGA Architectures and applictionsplications.pptxDr.YNM
 
Transient response of RC , RL circuits with step input
Transient response of RC , RL circuits  with step inputTransient response of RC , RL circuits  with step input
Transient response of RC , RL circuits with step inputDr.YNM
 
CISC & RISC ARCHITECTURES
CISC & RISC ARCHITECTURESCISC & RISC ARCHITECTURES
CISC & RISC ARCHITECTURESDr.YNM
 
Lect 4 ARM PROCESSOR ARCHITECTURE
Lect 4 ARM PROCESSOR ARCHITECTURELect 4 ARM PROCESSOR ARCHITECTURE
Lect 4 ARM PROCESSOR ARCHITECTUREDr.YNM
 
Lect 3 ARM PROCESSOR ARCHITECTURE
Lect 3  ARM PROCESSOR ARCHITECTURE Lect 3  ARM PROCESSOR ARCHITECTURE
Lect 3 ARM PROCESSOR ARCHITECTURE Dr.YNM
 
Microprocessor Architecture 4
Microprocessor Architecture  4Microprocessor Architecture  4
Microprocessor Architecture 4Dr.YNM
 
Lect 2 ARM processor architecture
Lect 2 ARM processor architectureLect 2 ARM processor architecture
Lect 2 ARM processor architectureDr.YNM
 
Microprocessor Architecture-III
Microprocessor Architecture-IIIMicroprocessor Architecture-III
Microprocessor Architecture-IIIDr.YNM
 
LECT 1: ARM PROCESSORS
LECT 1: ARM PROCESSORSLECT 1: ARM PROCESSORS
LECT 1: ARM PROCESSORSDr.YNM
 
Microprocessor architecture II
Microprocessor architecture   IIMicroprocessor architecture   II
Microprocessor architecture IIDr.YNM
 

Plus de Dr.YNM (20)

Introduction to DSP.ppt
Introduction to DSP.pptIntroduction to DSP.ppt
Introduction to DSP.ppt
 
Atmel.ppt
Atmel.pptAtmel.ppt
Atmel.ppt
 
PIC Microcontrollers.ppt
PIC Microcontrollers.pptPIC Microcontrollers.ppt
PIC Microcontrollers.ppt
 
Crystalstructure-.ppt
Crystalstructure-.pptCrystalstructure-.ppt
Crystalstructure-.ppt
 
Basics of OS & RTOS.ppt
Basics of OS & RTOS.pptBasics of OS & RTOS.ppt
Basics of OS & RTOS.ppt
 
Introducion to MSP430 Microcontroller.pptx
Introducion to MSP430 Microcontroller.pptxIntroducion to MSP430 Microcontroller.pptx
Introducion to MSP430 Microcontroller.pptx
 
Microcontroller-8051.ppt
Microcontroller-8051.pptMicrocontroller-8051.ppt
Microcontroller-8051.ppt
 
Introduction to ASICs.pptx
Introduction to ASICs.pptxIntroduction to ASICs.pptx
Introduction to ASICs.pptx
 
VHDL-PRESENTATION.ppt
VHDL-PRESENTATION.pptVHDL-PRESENTATION.ppt
VHDL-PRESENTATION.ppt
 
Basics of data communications.pptx
Basics of data communications.pptxBasics of data communications.pptx
Basics of data communications.pptx
 
CPLD & FPGA Architectures and applictionsplications.pptx
CPLD & FPGA Architectures and applictionsplications.pptxCPLD & FPGA Architectures and applictionsplications.pptx
CPLD & FPGA Architectures and applictionsplications.pptx
 
Transient response of RC , RL circuits with step input
Transient response of RC , RL circuits  with step inputTransient response of RC , RL circuits  with step input
Transient response of RC , RL circuits with step input
 
CISC & RISC ARCHITECTURES
CISC & RISC ARCHITECTURESCISC & RISC ARCHITECTURES
CISC & RISC ARCHITECTURES
 
Lect 4 ARM PROCESSOR ARCHITECTURE
Lect 4 ARM PROCESSOR ARCHITECTURELect 4 ARM PROCESSOR ARCHITECTURE
Lect 4 ARM PROCESSOR ARCHITECTURE
 
Lect 3 ARM PROCESSOR ARCHITECTURE
Lect 3  ARM PROCESSOR ARCHITECTURE Lect 3  ARM PROCESSOR ARCHITECTURE
Lect 3 ARM PROCESSOR ARCHITECTURE
 
Microprocessor Architecture 4
Microprocessor Architecture  4Microprocessor Architecture  4
Microprocessor Architecture 4
 
Lect 2 ARM processor architecture
Lect 2 ARM processor architectureLect 2 ARM processor architecture
Lect 2 ARM processor architecture
 
Microprocessor Architecture-III
Microprocessor Architecture-IIIMicroprocessor Architecture-III
Microprocessor Architecture-III
 
LECT 1: ARM PROCESSORS
LECT 1: ARM PROCESSORSLECT 1: ARM PROCESSORS
LECT 1: ARM PROCESSORS
 
Microprocessor architecture II
Microprocessor architecture   IIMicroprocessor architecture   II
Microprocessor architecture II
 

Dernier

Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoordharasingh5698
 
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
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxJuliansyahHarahap1
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringmulugeta48
 
Intro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdfIntro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdfrs7054576148
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdfSuman Jyoti
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
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
 
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
 
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
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Arindam Chakraborty, Ph.D., P.E. (CA, TX)
 
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
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
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
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 

Dernier (20)

Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
 
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
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
Intro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdfIntro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdf
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
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
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
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
 
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
 
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...
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
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
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
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
 
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
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 

Lect 7: Verilog Behavioral model for Absolute Beginners

  • 1. Digital Design Using Verilog - For Absolute Beginners LEC 7 :Verilog Behavioral Model
  • 2. Introduction • This model is considered as the highest level of abstraction in the Verilog design modelling methods. •It is also popularly known as Procedural assignment. •Verilog behavioral model procedural statements control the simulation and manipulate variables of the data types . •This behavioral model provides a wide scope for the designer to build any complex design which can be properly simulated and synthesized.
  • 3. contd • These statements are contained within procedures. Each procedure has an activity flow associated with it. •The procedural block of Verilog HDL is defined as “a region of code containing sequential statements. •There are two types of procedural blocks. (i).The always block & (ii).The initial block • Each initial construct and each always construct starts a separate activity flow. • All of the activity flows are concurrent to model the inherent concurrence of hardware.
  • 4. Procedural assignments • Procedural assignments are used for updating reg, integer, time, real, realtime,and memory data types. • There is a significant difference between procedural assignments and continuous assignments: Continuous assignments drive nets and are evaluated and updated whenever an input operand changes its value. Procedural assignments update the value of variables under the control of the procedural flow constructs that surround them.
  • 5. The always Block • The ‘always’ block is a continuous loop that never terminates. • A Verilog module can contain any number of ‘always’ blocks and all these blocks are executed concurrently. • The basic syntax of always block is always @ (sensitivity list) begin statement 1 ------------ statement n end
  • 6. contd 23 June 2020 6yayavaram@yahoo.com • The sequential statements are executed if and if only ,the signals of the sensitivity list changes . • The LHS of the statements in ‘always ‘ block is reg type only. • Ex: let us consider an example code. module my-mux(A,B,S,Q,Q_b); input A,B,S; output Q,Q_b; reg Q,Q_b;
  • 7. always @(A or B or S) begin if(S) Q = A; // procedural descriptions else Q = B; end assign Q = ~Q_b; // continuous assignment endmodule 23 June 2020 7yayavaram@yahoo.com contd
  • 8. The Initial Block • The initial block is typically used to write test bench for simulation. • It specifies the stimulus to be applied to the DUT. • The initial block is executed only once at the beginning of the simulation used in the test bench. 23 June 2020 8yayavaram@yahoo.com
  • 9. Illustration • module behave; [1:0] a, b; initial begin a = 1’b1; b = 1’b0; end always begin #50 a = ~a; end always begin #100 b = ~b; end endmodule 23 June 2020 9 yayavaram@yahoo.com
  • 10. contd • In this model, the reg variables a and b initialize to 1 and 0 respectively at simulation time zero. • The initial construct is then complete and does not execute again during this simulation run. • This initial construct contains a begin-end block (also called a sequential block) of statements. In this begin-end block a is initialized first, followed by b. • The always constructs also start at time zero 23 June 2020 10yayavaram@yahoo.com
  • 11. contd • But the values of the variables do not change until the times specified by the delay controls (introduced by #) have elapsed. • Thus, reg a inverts after 50 time units and reg b inverts after 100 time units. • Since the always constructs repeat, this model will produce two square waves. • The reg a toggles with a period of 100 time units, and reg b toggles with a period of 200 time units. • The two always constructs proceed concurrently throughout the entire simulation run. 23 June 2020 11yayavaram@yahoo.com
  • 12. Different Sequential Statements (i).begin sequential statements end Note: If there is a single statement in the block ‘begin’ and ‘end ‘ not required (ii).if(expression) Sequential statement else Sequential statement 23 June 2020 12yayavaram@yahoo.com
  • 13. contd • (iii).case(expression) expr1 : Sequential statement 1 ……….. expr n : Sequential statement n default : Sequential statement endcase • (iv).forever Sequential statemet 23 June 2020 13yayavaram@yahoo.com
  • 14. • (v). Repeat(expression) Sequential statement • (vi). while(expression) Sequential statement • (vii). for (expr1:expr2:expr3) Sequential expression • (viii).@(event_expression) This makes a block of statements suspend until event expression triggers. 23 June 2020 14yayavaram@yahoo.com
  • 15. Ex: Sequential Logic (D-F/F) • module ex_Dff(D,clk,Q,Qb); input D,clk ; output Q,Qb; reg Q, Qb ; always @(negedge clk) begin Q = D; Qb = ~D; end endmodule 23 June 2020 15yayavaram@yahoo.com
  • 16. Ex: 4 Bit ALU • module ex_ALU4(Y,A,B,S); input [3:0]A,B; input [1:0] S ; output [3:0] Y; Parameter ADD=2’b00, SUB =2’b01, MUL = 2’10, DIV = 2’b11; always @(A or B or S) case (S) ADD : Y = A+B; 23 June 2020 16yayavaram@yahoo.com
  • 17. contd SUB : Y = A-B ; MUL : Y=A * B ; DIV : Y = A/B; endcase endmodule 23 June 2020 17yayavaram@yahoo.com
  • 18. 23 June 2020 18yayavaram@yahoo.com

Notes de l'éditeur

  1. If the value of S is 1 ,then Y= B other wise Y= A