Introduction To Verilog
Introduction To Verilog
Pre-requisites
1. A little knowledge of various digital combinational and sequential
circuits will make the learning easier.
2. People with the basic knowledge of C or C++ will have an edge in
Verilog programming.
Suggested Time
8 hrs
Motivation
As digital systems become more complex, it becomes very important to
verify the functionality of a design before implementing it in a system.
A Hardware description language allows us to simulate the hardware at
different levels i.e. gate level, behavioral level etc before actually
implementing it on a silicon chip.
Verilog is one of the most popular HARDWARE DESCRIPTION
LANGUAGE (HDL). Another standard HDL is VHDL. In this course we will
focus on Verilog and use it as standard language to implement any
logic.
Learning Outcome
By end of this module you will know
Introduction
Verilog is a hardware description language, which is used to model any
system before fabrication. In the silicon chip design process, the final
fabrication is very costly so before implementing any system on actual
silicon chip we have to make sure that the system is working perfectly
by implementing it in a hardware description language. Verilog is the
most popular HDL which is standardized by IEEE.
Behavioral level
Behavior is highest level of abstraction in Verilog. To implement the
circuit in this abstraction level the behavior of circuit is required.
Functions, Tasks and Always blocks are the main elements of this level.
There is no regard to the structural realization of the design. In the Fig.
2 we design 1-bit multiplexer on behavioral level.
NOTE: If you are not comfortable with C, I will recommend you to
quickly brush up the basic of C before proceeding.
Fig. 2 Behavioral and Register transfer level code for 1 bit Multiplexer
Register-Transfer Level
Designs using the Register-Transfer Level specify the characteristics of a
circuit by operations and the transfer of data between the registers.
This abstraction level is lower than behavioral level but higher than
register level. The keyword assign is used for different types of
assignment in this abstraction level. In the Fig 2 we design 1-bit
multiplexer on RTL level.
Gate Level
In the logic level the characteristics of a system are described by logical gates and their
timing properties. In this level all signals are discrete signals, which can
only have definite logical values (`0', `1', `X', `Z`). We have to specify
gate connection of each and every gate and net/wire. This is similar to
drawing the actual circuit of the system but only in code form.
Gate level diagram of 1-bit multiplexer and Verilog code is given in Fig.
Fig. 3 Gate level Verilog code for 1 bit Multiplexer
Summary
We learned that there are 3 different levels of abstractions in Verilog.
In reality there is 1 more abstraction level called transistor level but for
practical purposes it is not very useful as it is even lower abstraction
level compared to gate level.
We also saw the codes in all abstraction levels for a simple circuit, it is
okay if you don’t understand the code below, and the only thing that
we should observe is