Understanding VHDL: The Language That Designs Hardware #
Have you ever wondered how electronic circuits are designed these days? In the world of modern electronics, engineers rarely draw circuits by hand anymore. Instead, they use special languages to describe how circuits should work. One of the most important of these languages is VHDL.
What is VHDL? #
VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language. Unlike regular programming languages that tell computers what to do, VHDL describes actual electronic hardware. When you write VHDL code, you’re essentially designing a physical circuit that can be built in the real world.
The main uses of VHDL are:
- Creating digital circuits for CPLD and FPGA chips (types of programmable hardware)
- Generating designs for manufacturing custom chips (called ASICs)
VHDL was created in the 1980s as part of a project funded by the U.S. Department of Defense. It was the first hardware description language to be standardized by IEEE, which helps ensure that VHDL code works the same way across different tools and technologies.
VHDL Versions #
VHDL has evolved over the years with several versions:
- VHDL 87 (the original version)
- VHDL 93
- VHDL 2002
- VHDL 2008 (released in February 2009)
Each version added new features while maintaining compatibility with previous versions.
How VHDL Designs Become Real Circuits #
The journey from VHDL code to a working circuit follows a clear path:
Writing the code: Engineers write VHDL code that describes what they want the circuit to do.
Synthesis: Special software reads the VHDL code and translates it into basic hardware structures.
Place and Route: The software decides where to put each component inside the chip and how to connect them.
Simulation: Before building anything physical, the design is tested in software to make sure it works correctly.
Implementation: Finally, the design is converted into a format that can be used to program a chip or manufacture a custom circuit.
Let’s look at a simple example. A full-adder is a basic circuit that adds two bits plus a carry-in bit. In VHDL, it might look like this:
ENTITY full_adder IS
PORT (a, b, cin: IN BIT;
sum, cout: OUT BIT);
END full_adder;
ARCHITECTURE dataflow OF full_adder IS
BEGIN
sum <= a XOR b XOR cin;
cout <= (a AND b) OR (a AND cin) OR (b AND cin);
END dataflow;
This code describes a circuit with three inputs (a, b, and cin) and two outputs (sum and cout). The sum output is high when an odd number of inputs are high, and the cout (carry-out) is high when two or more inputs are high.
From this code, the synthesis tool can create different physical circuits depending on the target technology. It might use basic logic gates for an FPGA, or it could create a transistor-level design for a custom chip.
Testing VHDL Designs #
One of the great advantages of VHDL is that you can thoroughly test your design before building anything physical. This testing, called simulation, shows how the circuit would behave in the real world.
There are two main types of simulation:
- Functional simulation: Shows what the circuit does without considering timing delays
- Timing simulation: Takes into account the actual delays that would occur in the physical circuit
Unlike other types of electronic design, VHDL designs that pass careful simulation are almost guaranteed to work when built as physical circuits.
VHDL Syntax and Number Representation #
VHDL is not case-sensitive (except for a few special symbols), but by convention, reserved words are usually written in CAPITAL LETTERS, while user-defined names use lowercase.
VHDL supports several ways to represent numbers:
Integers:
- Normal decimal numbers: 5, 32, 3250
- You can use underscores for readability: 3_250
- Scientific notation: 3E2 (equals 300)
- Other bases from 2 to 16: 2#0111# (binary 7), 16#9F# (hex 159)
Binary values:
- Single bit: ‘0’ or ‘1’
- Multiple bits: “0111” (equals 7)
- Hexadecimal form: X"C2F" (equals 3119)
- Octal form: O"54" (equals 44)
VHDL can work with both unsigned numbers (always positive) and signed numbers (can be negative). For signed numbers, it uses two’s complement representation, where the leftmost bit indicates whether the number is positive (0) or negative (1).
Tools for VHDL Design #
Several software packages help engineers create and test VHDL designs:
- Quartus II from Altera (now part of Intel)
- ISE from Xilinx
- ModelSim for simulation
- Tools from other companies like Mentor Graphics, Synopsys, and Cadence
These tools provide everything needed to write VHDL code, convert it to a circuit design, simulate its behavior, and prepare it for implementation in hardware.
Why VHDL Matters #
VHDL has become essential in modern digital electronics design because it:
- Lets engineers describe complex circuits in a standardized way
- Works across different technologies and vendors
- Allows thorough testing before physical implementation
- Makes designs portable and reusable
Whether it’s designing a simple digital watch or a complex processor for a smartphone, VHDL gives engineers the power to create reliable electronic circuits efficiently and with confidence.