Professional Documents
Culture Documents
g Design
g
(using verilog-HDL)
Application
pp Areas of Verilog
g
System Specification Suitable for all levels
Behavioral level
Hardware Softwre
Spec Spec
ASIC
Boards
FPGA & Software
Systems
PLD
Behavioral
i
Gate
Switch
Concurrency
Structure
Procedural
Statements
Ti
Time
Case sensitivity
myid ≠ Myid
/* Multiple line
comment */
<size>’<radix> <value>
8’h ax = 1010xxxx
12’o
12 o 3zx7 = 011zzzxxx111
wand (wired-AND)
wor (wired-OR)
tri (tri-state)
gu e net
In Figure et a is
s co
connected
ected to tthe
e output
of and gate g1. Net a will continuously
assume the value computed at the output
of gate g1.
A wire Y; // declaration
Y assign Y = A & B;
B
dr
A Y tri Y; // declaration
assign Y = (dr) ? A : z;
wand Y; // declaration
A
assign Y = A;
assign Y = B;
Y
B
wor Y; // declaration
assign Y = A;
assign Y = B;
initial
string value = "Hello
string_value Hello Verilog World
World";
;
// String can be stored in variable
Æ Monitoring information
Verilog
V il provides
id a mechanism
h i to
t monitor
it a signal
i l when
h its
it value
l
changes. This facility is provided by the $monitor task.
Usage: $monitor(p1,p2,p3,....,pn);
The parameters p1
p1, p2
p2, ... , pn can be variables,
variables signal names
names, or
quoted strings.
`d fi
`define
The `define directive is used to define text macros in
V il
Verilog. The
Th Verilog
V il compiler il substitutes
b tit t the
th text
t t off
the macro wherever it encounters a `<macro_name>.
This is similar to the #define construct in C.