VHDL (VHSIC Hardware Description Language) is a standard language used to describe, simulate and synthesise digital hardware. Unlike a normal programming language that runs instructions one after another on a processor, an HDL describes circuits that operate in parallel, mirroring how real gates and flip-flops behave simultaneously in silicon.
This article introduces what an HDL is and why it is used, compares VHDL with Verilog, and explains the design entity built from an entity and an architecture. We cover port modes, signals versus variables, the core data types, the three modelling styles (dataflow, behavioral, structural), concurrent versus sequential statements, the process and its sensitivity list, the signal-assignment operator, simulation versus synthesis, and the idea of a test bench. These appear regularly in Wireless PSI and GPSC technical papers.
What Is an HDL and Why Use One?
A Hardware Description Language (HDL) lets you describe digital circuits as text rather than drawing schematics. As designs grew to millions of gates, schematic capture became impractical, so HDLs took over. With an HDL you can describe behaviour, simulate it to verify correctness, and then synthesise it into actual gates for an FPGA or ASIC.
The key conceptual difference from software is concurrency: statements in the body of a design execute in parallel and react to signal changes, just like real hardware. This is why HDL code is sometimes said to be described rather than executed line by line.
VHDL vs Verilog
The two dominant HDLs are VHDL and Verilog. VHDL is strongly typed, verbose and Ada-like, which makes it explicit and less error-prone but more wordy. Verilog is weakly typed, C-like and more concise. Both can model and synthesise the same hardware; the choice is largely organisational. For exams, simply remember that VHDL is strongly typed and verbose while Verilog is C-like and concise.
Design Entity: Entity and Architecture
Every VHDL design is a design entity made of two parts. The entity declares the external interface, that is the name of the block and its input/output ports, similar to the symbol of a component. The architecture describes the internal implementation, that is what the block actually does. One entity can have several architectures (for example one behavioral and one structural), which is useful for comparing implementations.
In prose terms, an entity declaration names the block and lists its ports inside a port clause, while an architecture begins with the keyword architecture, names the entity it belongs to, declares internal signal objects between its header and the keyword begin, and then contains the statements that define behaviour. Exam tip: the entity is the interface, the architecture is the body; questions often test exactly this split.
Port Modes
Each port in the entity has a mode that defines the direction of data flow. There are four modes:
| Mode | Direction | Readable inside? | Driveable inside? |
|---|
| in | Input only | Yes | No |
| out | Output only | No (classic VHDL) | Yes |
| inout | Bidirectional | Yes | Yes |
| buffer | Output, also fed back | Yes | Yes (single driver) |
An in port can only be read; an out port can only be driven and, in classic VHDL, not read back inside the architecture; inout is a true bidirectional port used for buses; and buffer is an output whose value can also be read internally but with the restriction of a single internal driver. Common mistake: trying to read an out port inside the architecture. To read back an output, declare it as buffer or use an internal signal.
Signals, Variables and Data Types
Signals vs variables
A signal represents a physical wire or net and is updated with a scheduled delay; its new value takes effect only after the current simulation step, so signal assignments inside a process do not update immediately. A variable exists only inside a process or subprogram and updates instantly when assigned, like a normal programming variable. The assignment operators differ too: signals use the signal-assignment operator (<=) while variables use the variable-assignment operator (:=).
Exam tip: the classic distinction is that signals are updated at the end of the simulation delta cycle (scheduled), whereas variables update immediately within the process.
Common data types
| Type | Meaning | Typical use |
|---|
| bit | Single 0 or 1 | Simple two-value signals |
| bit_vector | Array of bit | Simple buses |
| std_logic | 9-value logic (0,1,Z,X,U etc.) | Realistic single-line signal |
| std_logic_vector | Array of std_logic | Realistic buses, tri-state |
| integer | Whole numbers | Counters, indices, arithmetic |
The std_logic type, from the IEEE std_logic_1164 package, is preferred over bit because it models high impedance (Z), unknown (X) and uninitialised (U) values needed for real designs and tri-state buses.
Modelling Styles: Dataflow, Behavioral, Structural
VHDL architectures can be written in three styles, and many designs mix them:
- Dataflow: describes the circuit using concurrent signal assignments and Boolean/expression equations, for example assigning an output equal to a logic expression of inputs. It captures how data flows through logic.
- Behavioral: describes what the circuit does using a process containing sequential statements such as if and case. This is the most abstract style and is ideal for state machines and algorithmic descriptions.
- Structural: describes the circuit as an interconnection of smaller components using component instantiation and port map, like a netlist or schematic in text. It builds hierarchy from sub-blocks.
| Style | Built from | Statement type | Best for |
|---|
| Dataflow | Concurrent assignments and expressions | Concurrent | Combinational logic |
| Behavioral | Process with if and case | Sequential (inside process) | FSMs, algorithms |
| Structural | Component instances and port map | Concurrent | Hierarchy and netlists |
Common mistake: calling a structural description behavioral. Structural is an interconnection of components, whereas behavioral describes function abstractly inside a process.
Concurrent vs Sequential Statements and the Process
Statements placed directly in the architecture body are concurrent: they all run in parallel and re-evaluate whenever any signal they depend on changes, regardless of textual order. In contrast, statements inside a process are sequential and execute top to bottom like ordinary code, which is why if and case constructs live inside a process.
A process has a sensitivity list, the set of signals that trigger it. The process wakes up and re-runs only when a signal in this list changes. For combinational logic, every input read must be in the sensitivity list, otherwise simulation and synthesis disagree. Common mistake: leaving a signal out of the sensitivity list, which causes the simulator to miss updates and produces a mismatch with the synthesised hardware. Note also that a process itself is a single concurrent statement from the architecture viewpoint, even though its insides are sequential.
Simulation, Synthesis and the Test Bench
Simulation verifies that the description behaves correctly by applying input stimuli and observing outputs over time; it can use the full language including delays and file I/O. Synthesis converts the description into real gates and flip-flops, and only a synthesisable subset of the language is allowed, with delays ignored. A construct may simulate fine yet be non-synthesisable, so designers keep to the synthesisable subset for hardware.
A test bench is a VHDL module with no external ports that instantiates the design under test, generates input stimuli (including a clock), and checks the outputs. It exists only for simulation and is never synthesised. Exam tip: a test bench has no ports because it is the top of the simulation hierarchy and drives everything internally.
- A VHDL design entity has two parts: the entity (interface and ports) and the architecture (internal implementation).
- The four port modes are in (read only), out (drive only), inout (bidirectional), and buffer (output that can be read back).
- Signals model wires and update with scheduled delay using the signal-assignment operator; variables live inside a process and update immediately.
- The three modelling styles are dataflow (concurrent assignments), behavioral (process with if and case), and structural (component instantiation with port map).
- Architecture-level statements are concurrent; statements inside a process are sequential and triggered by the sensitivity list. Test benches verify designs in simulation and are not synthesised.
Practice MCQs
Q1. In VHDL, which part of a design entity declares the external ports and interface?
- A.The architecture
- B.The entity
- C.The process
- D.The test bench
Correct Answer: B
Explanation: The entity declares the name and the input/output ports, which form the external interface. The architecture describes the internal implementation.
Q2. Which port mode is purely an input that can be read but not driven inside the architecture?
Correct Answer: C
Explanation: The in mode is input only: it can be read inside the architecture but cannot be driven. The out mode is drive only, inout is bidirectional and buffer is a readable output.
Q3. What is the key difference between a signal and a variable in VHDL?
- A.Signals update immediately while variables are scheduled
- B.Variables update immediately within a process while signals update with scheduled delay
- C.Variables model wires while signals are local
- D.There is no difference
Correct Answer: B
Explanation: Variables update instantly when assigned inside a process, whereas signals model wires and take their new value after the current simulation step (scheduled delay).
Q4. Which modelling style uses component instantiation and port map to interconnect sub-blocks?
- A.Dataflow
- B.Behavioral
- C.Structural
- D.Concurrent
Correct Answer: C
Explanation: Structural modelling builds a design as an interconnection of components using component instantiation and port map, similar to a textual netlist.
Q5. Statements written directly in the architecture body (outside any process) are:
- A.Sequential
- B.Concurrent
- C.Always combinational
- D.Ignored by simulation
Correct Answer: B
Explanation: Statements placed directly in the architecture are concurrent: they run in parallel and re-evaluate when their input signals change, regardless of textual order.
Q6. What is the purpose of the sensitivity list of a process?
- A.It lists the output ports
- B.It lists the signals whose change triggers the process to re-run
- C.It declares variables
- D.It sets the clock frequency
Correct Answer: B
Explanation: The sensitivity list names the signals that wake up the process. The process re-executes only when one of those signals changes; omitting an input can cause simulation mismatches.
Q7. Which data type is preferred over bit because it models high impedance and unknown states for realistic and tri-state designs?
- A.integer
- B.bit_vector
- C.std_logic
- D.boolean
Correct Answer: C
Explanation: std_logic from the IEEE std_logic_1164 package offers multiple values including Z (high impedance) and X (unknown), making it suitable for real and tri-state designs, unlike the two-value bit type.
Q8. Why does a VHDL test bench have no external ports?
- A.Because it is synthesised into hardware
- B.Because it is the top level that internally drives the design under test in simulation
- C.Because ports are not allowed in VHDL
- D.Because it only uses variables
Correct Answer: B
Explanation: A test bench sits at the top of the simulation hierarchy, generates stimuli internally and instantiates the design under test, so it needs no external ports. It is used only in simulation and is not synthesised.