Introduction To Verilog
Introduction To Verilog
Lowest Level
of Abstraction
Register Transfer Level :
A combination of Behavioral and Data flow.
blocks that are available to us. We build bigger cells, using these
building blocks.
module.
The <port list> is a list of input, inout and output ports which are
assign 01 = I1 ^ I2;
assign O2 = I1 & I2;
endmodule
•Sequence of characters
No
Noofof Binary
Binary
bbor
orBB Consecutive
bits Consecutivechars
chars
bits Octal
Octal
ooororOO 0-f,
0-f,x,x,zz
Decimal
Decimal
ddor
orDD
Hexadecimal
Hexadecimal hhor
orHH
8’h ax = 1010xxxx
12’habc //12 bit hexadecimal number
18 Verilog HDL Basics
Numbers in Verilog (ii)
You can insert “_” for readability
12’b 000_111_010_100
12’b 000111010100 Represent the same number
Bit extension
MS bit = 0, x or z extend this
4’b x1 = 4’b xx_x1
32’bz//32 bit high impedance number
4’b10?? = 4’b10zz
•Value/Scalar set
•Nets
•Registers
•Vectors
•Integer, Real and Time Register
•Arrays
•Strings
4 bits
0
.
.
1023
! logical NOT
a = 4’b1010;
...
d = a >> 2; // d = 0010
c = a << 1; // c = 0100
37 R V College of Engineering 24/1/2014
Conditional Operator
cond_expr ? true_expr : false_expr
A ternary operator
Acts like a 2-to-1 mux.
Negative integers:
Use parentheses to
enforce your
priority