Professional Documents
Culture Documents
3.1 Introduction To Verilog
3.1 Introduction To Verilog
Digital Electronics
3.1 Introduction to Verilog
Rajat Chakraborty
Lecturer
Dept. of EEE, BUET
Verilog
Common mistakes:
i. Forgetting assign ii. Use of bracket
Procedural Statement
❖ after the @ symbol, in parentheses, is called the sensitivity list. The statements
inside an always block are executed by the simulator only when one or more of
the signals in the sensitivity list changes value.
always @ (*) / always @*- valid (but only for teachers in lab quiz :P )
❖If a signal is assigned a value using procedural statements, then Verilog syntax
requires that it be declared as a variable - keyword reg
Procedural for AND
Procedural for XOR
Adder Circuit
Tips
❖Choose between continuous assignment and procedural if not stated (structural
almost never used)
❖Choose meaningful and methodical variable name
❖Write module and endmodule together while coding
❖Write the i/p, o/p, reg or sensitivity list after finishing the code
❖Use comment, indentation- for your own benefit
❖Remember to put ; , reg, assign- check Quartus to know the nature of the error