Docsity

Behavioral Modeling-Verilog HDL-Lab Assignment, Exercises of Verilog and VHDL

Partial preview of the text

Download Behavioral Modeling-Verilog HDL-Lab Assignment and more Exercises Verilog and VHDL in PDF only on Docsity!

Behavioral Modeling

Lab 3Lab 3

Behavioral Modeling 

Behavioral modeling represents the design athigh level of abstraction with emphasis on thebehavior of the algorithm



In behavioral modeling designers do not think in terms of logic gates or digital circuitsterms of logic gates or digital circuits



Design at behavioral level resembles CProgramming and behavioral verilog constructsare similar to C Language constructs. e.g. if-elsestatements, case statement , for loops

Initial Statement •^

An initial statement starts with an ‘initial’

construct and multiple initial statementsconstitute an initial block

An initial block starts at time 0 and executes only

once during simulationonce during simulation

Multiple initial statements must be grouped

together using ‘begin’ and ‘end’ keywords

Initial blocks are used for initialization,

monitoring, waveforms and for processes thatexecute only once

Stimulus (test bench) uses initial statement to

initialize input ports of design to be tested

Initial Statement : Example

Always Statement : Example

Initial Block vs. Always Block •

Initial Block executes only once. Initial blocks are non

synthesizable and are only part of Stimulus

Always block executes in a loop. Behavioral Design Modules

contain only Always blocks

Blocking Assignment •

Blocking assignments are used in the order they are specified

Blocking assignments are specified with the operator ‘=‘

Nonblocking Assignment •

Nonblocking assignment statements allow scheduling

of assignment without blocking execution of thestatements that follow in a sequential block

All nonblocking assignments will execute in parallel - Nonblocking assignments are specified with the - Nonblocking assignments are specified with the

operator ‘<=‘

Nonblocking assignments are used where concurrent

data transfers take place after a common event

Nonblocking assignments are used in modeling of

sequential blocks

  • Nonblocking Assignment :Example

Conditional Statements •^

Conditional statements are used for making decisions based upon

certain conditions

-^

Keywords ‘if’ & ‘else’ are used for conditional statements

4-bits Full Adder : BehavioralModel

4 to 1 Mux : Behavioral Modeling

Design of a Register : BehavioralModel

Digital Design Structures •

Digital Designs are composed of

both combinational blocks andsequential blocks

-^

Sequential

blocks

work

synchronously

on

a

clock

signal

-^

Good

Verilog

design

should

model

combinational

and

sequential blocks separate

-^

Combinational

blocks

use

blocking

assignments

while

sequential

blocks

use

nonblocking assignments