Verilog Slides
Verilog Slides
Overview of Verilog
• Objectives
• Verilog Basics
Notation
Keywords & Constructs
Operators
• Types of Descriptions
Structural
Dataflow
• Boolean Equations
• Conditions using Binary Combinations
• Conditions using Binary Decisions
Behavioral & Hierarchical
System Modeling:
describe the system in gate-level, data-flow, or
behavioral style…
endmodule
• Module Declaration
module module_name (module_port, module_port, …);
Example: module full_adder (A, B, c_in,
c_out, S);
Digital Systems: HDL
Verilog Keywords & Constructs - 2
• Input Declaration
Scalar
• input list of input identifiers;
• Example: input A, B, c_in;
Vector
• input[range] list of input identifiers;
• Example: input[15:0] A, B, data;
• Output Declaration
Scalar Example: output c_out, OV, MINUS;
Vector Example: output[7:0] ACC, REG_IN, data_out;
output Z; T2
D2
input [3:0] D;
D1 T1
input [1:0] S;
wire S0b, S1b, T0, T1, T2, T3; T0
D0
S0
not #5 inv0(S0b, S[0]),
inv1(S1b, S[1]); S1
and #10 and0(T0, D[0], S1b, S0b),
and1(T1, D[1], S1b, S[0]),
and2(T2, D[2], S[1], S0b),
and3(T3, D[3], S[0], S[1]);
or #10 or1(Z, T0,T1,T2,T3);
endmodule