Professional Documents
Culture Documents
Session 2-2EC202-FPGASD-2024
Session 2-2EC202-FPGASD-2024
Logic Values
Verilog Basics
2
/2024
Logic Strenths
Verilog Basics
3
Gate Level Modeling
Basic Gates
Verilog Basics 5
Truth Table To Follow
Verilog Basics 6
Buffer and Not Gates
Verilog Basics 7
Bufif/Notif
Verilog Basics 8
Bufif/Notif (Cont…)
Verilog Basics 9
Gate Delays
Rise Delay
Fall Delay
Turnoff Delay
Verilog Basics 10
Gate Delays (Cont…)
Verilog Basics 11
Max, Min, Typ Delays
Verilog Basics 12
Delay Use
Verilog Basics 13
Data Flow Modelling
Outline
Continuous Assignment
o The assign statement
o Implicit Continuous Assignment
o Implicit Net Declaration
Gate Level Vs Data Flow Modeling
Delays:
o Regular Assignment delay
o Implicit Continuous Assignment Delay
o Net Declaration Delay
Expressions, Operands and Operators
Parameter
Issues with 4-valued logic
04/14/2024 Verilog Basics 15
Continuous Assignment
Examples:
o d1 && d2 // && is an operator on
operands d1 and d2
o !a[0] // ! is an operator on operand a[0]
o B >> 1 // >> is an operator on operands
B and 1
A*B
D/E
A+B
B-A
F = E ** F;
• 4-valued logic issue:
13 % 3 x and z values
16 % 4 in1 = 4'b101x;
-7 % 2 in2 = 4'b1010;
7 % -2 sum = in1 + in2;
assign e = a & d;
assign c = b | e;
endmodule
// A = 4, B = 3 // Z = 4'b1xxz, M = 4'b1xxz
// X = 4'b1010, Y = 4'b1101 // N = 4'b1xxx
X == Z -x
A == B - 0
X != Y - 1 Z === M - 1
Z === N - 0
M !== N - 1
04/14/2024 Verilog Basics 37
Bitwise Operators
Reduction Operators:
and(&), nand(~&), or(|), nor(~|), xor(^),
xnor(~^)
Takes only one operand
Results in one bit output
Works from right to left
Y = X >> 1;
Y = X << 1;
Y = X << 2;
integer a, b, c;
a = 0;
b = -10;
c = a + (b >> 3);
// A = 1'b1, B = 2'b00,
// C = 2'b10, D = 3'b110
Y = {B , C} Y = 4'b0010
Y = {A , B , C , D , 3'b001} Y = 11'b100……01
Y = {A , B[0], C[1]} Y = 3'b101
Thank You
Verilog Basics 52