Professional Documents
Culture Documents
Reviewer NG Mga Bobo
Reviewer NG Mga Bobo
What is HDL?
Digital circuits consist primarily of interconnected transistors.
We design and analyze these circuits with the aid of a hierarchical structure: we could,
in theory, interpret a central processing unit (CPU) as a vast sea of transistors, but it is
much easier to organize transistors into logic gates, logic gates into adders or registers
or timing modules, registers into memory banks, and so forth.
Another way to describe digital circuits is to use a textual language that is specifically
intended to clearly and concisely capture the defining features of digital design.
The most popular hardware description languages are Verilog and VHDL.
They are widely used in conjunction with FPGAs, which are digital devices that are
specifically designed to facilitate the creation of customized digital circuits.
Hardware description languages allow you to describe a circuit using words and
symbols, and then development software can convert that textual description into
configuration data that is loaded into the FPGA in order to implement the desired
functionality.
HDLs resemble high-level programming languages such as C or Python, but it’s
important to understand that there is a fundamental difference: statements in HDL
code involve parallel operation, whereas programming languages represent sequential
operation.
When we write a computer program or firmware module, we understand that the
processor will execute lines of code one at a time, following the top-to-bottom
organization that we use when reading text on a page.
In HDL code, we are describing digital hardware, and separate portions of this hardware
can operate simultaneously, despite the fact that the corresponding lines of code are
written using a top-to-bottom organization.
INTRODUCTION TO HDL
Both Verilog and VHDL are powerful tools that can be used to design a complex digital
circuit.
Verilog was designed in early 1984 by Gateway Design Automation (about three years
after the US Department of Defense initiated VHDL).
With the DoD's support, VHDL became an IEEE standard in 1987.
Verilog didn't make it into the scene until 1995.
Today, VHDL and Verilog are popular HDLs, and FPGA design tools usually support both
languages.
The word “Verilog” is a portmanteau of the words "verification" and "logic" because the
language was first suggested as a simulation and verification tool.
-Lines 1 and 8-
These two lines use the keywords “module” and “endmodule” to specify that the lines
in between (lines 2 to 7) all describe a circuit named “Circuit_1”.
-Lines 2 to 6-
The input and output ports are described using the keywords “input” and “output”.
These keywords are followed by another keyword “wire” and then the name of the port
What does the keyword “wire” specify? “Wire” is a Verilog data type that represents a
physical wire in the design.
-Lines 7-
This line uses the bitwise AND operator, i.e. &, to describe the functionality of the
circuit.
The keyword “assign” puts a&b on the output port out1.
This type of assignment is called a continuous assignment.
Example 2:
The above code also uses some new Verilog bitwise operators: ~ for NOT and | for OR
operation.
Example 3:
Note that the index range of the
vectors can be either ascending
([0:2] as used above) or descending
([2:0]).
EXAMPLE 1.1.
An electric switch is a manufactured control system controlling the flow of electricity.
By definition, the apparatus or person flipping the switch is not part of this control
system.
Flipping the switch on or off may be considered as the input. The input can be in one of
two states: on or off. The output is the flow or nonflow (two states) of electricity.
EXAMPLE 1.2.
A thermostatically controlled heater or furnace automatically regulating the
temperature of a room or enclosure is a control system. The input to this system is a
reference temperature, usually specified by appropriately setting a thermostat. The
output is the actual temperature of the room or enclosure.
When the thermostat detects that the output is less than the input, the furnace
provides heat until the temperature of the enclosure becomes equal to the reference
input. Then the furnace is automatically turned off. When the temperature falls
somewhat below the reference temperature, the furnace is turned on again.
EXAMPLE 1.3.
The seemingly simple act of pointing at an object with a finger requires a biological
control system consisting chiefly of the eyes, the arm, hand, and finger, and the
brain.The input is the precise direction of the object (moving or not) with respect to
some reference, and the output is the actual pointed direction with respect to the same
reference.
EXAMPLE 1.4.
A part of the human temperature control system is the perspiration system. When the
temperature of the air exterior to the skin becomes too high the sweat glands secrete
heavily, including cooling of the skin by evaporation. Secretions are reduced when the
desired cooling effect is achieved, or when the air temperature falls sufficiently.
The input to this system may be “normal” or comfortable skin temperature, a
“setpoint,” or the air temperature, a physical variable. The output is the actual skin
temperature.
EXAMPLE 1.5.
The control system, which consists of a person in an automobile, has components that are
clearly both manufactured and biological. The driver wants to keep the automobile in the
appropriate roadway lane. He or she accomplishes this by constantly watching the
automobile's direction to the road's direction. In this case, the direction or heading of the
road, represented by the painted guideline or lines on either side of the lane, may be
considered as the input. The heading of the automobile is the output of the system. The
driver controls this output by constantly measuring it with his or her eyes and brain and
correcting it with his or her hands on the steering wheel. The major components of this
control system are the driver’s hands, eyes, brain, and the vehicle.
Example 1.7.
an autopilot mechanism and the airplane it controls is a closed-loop (feedback) control
system. Its purpose is to maintain a specified airplane heading, despite atmospheric
changes. It performs this task by continuously measuring the actual airplane heading, and
automatically adjusting the airplane control surfaces (rudder, ailerons, etc) so as to bring the
actual airplane heading into correspondence with the specified heading. The human pilot or
operator who presets the autopilot is not part of the control system.
-Typical op-amps-
The ideal op-amp has infinite voltage gain and infinite input resistance (open), so that it
does not load the driving source.
(Input resistance is sometimes called input impedance.)
Also, it has a zero-output resistance.
(Output resistance is sometimes called output impedance.)
A differential amplifier is the input stage for the op-amp; it has two inputs and provides
amplification of the difference voltage between the two inputs.
The voltage amplifier is usually a class A amplifier that provides additional op-amp gain.
Some op-amps may have more than one voltage amplifier stage.