Lexical Tokens
Lexical tokens are the basic building blocks of Verilog code that are keywords, identifiers, operators. They are like a way of communicating with the language and are useful for constructing Verilog statements and expressions. Some of the lexical tokens are:
a. White space
b. Comments
c. Numbers
d. Operators
e. Identifiers and Keywords
f. Datatypes
1. Nets
2. registers
g. Module declaration
White Space
In Verilog, we use this white spaces in output commands like $display, $monitor, $strobe etc. In this “\t” represents tab space, “\n” represents new line.
Comments
There are 2 ways for writing comments in Verilog. One way is to enclose the comment in “/*……..*/” . This will be helpful when there are multi-lined comments. and another way is to append “//” at the beginning of the sentence. This will be helpful for writing comments that are single-lined or of short context.
/*
This is an example for Multi-lined comment.
Hello there
welcome to Verilog tutorial
*/
//this is a example for single line comment.
//Hello there.
Getting Started with Verilog
For a long time, computer programming languages like FORTRAN, Pascal, and C were used to describe computer programs and their code execution is sequential. But there isn’t any language to describe the digital circuits. This is when Hardware Description Language(HDL) came into play. HDLs are even popular for verification purposes. There are mainly two types of HDL:
- Verilog HDL
- VHDL (Very High-Speed was Integrated Circuit (VHSIC) Hardware Description Language)
Note: Verilog HDL and VHDL aren’t the same. VHDL was used before Verilog came into existence. the difference between them will be discussed in the later part.
Table of Content
- What is Verilog?
- Gate Level Modeling
- Data-Flow Modeling
- Behavioral Modeling
- Operators
- Identifiers and Keywords
- Datatypes
- Module Declaration
- Classification of Verilog
- Verilog HDL Vs VHDL