What Is an HDL? Compare the Same 2:1 Mux in Verilog and VHDL
A hardware description language (HDL) describes digital circuit behavior, signals, and connections. Read one 2:1 multiplexer in Verilog and VHDL to distinguish HDL from RTL, separate testbench code from synthesizable design code, and learn what to check when choosing a language.
What Is an HDL? Compare the Same 2:1 Mux in Verilog and VHDL
A hardware description language (HDL) describes digital circuit functions, signal connections, and behavior over time. Verilog and VHDL are established HDLs; SystemVerilog is an IEEE-standard language for hardware design and verification. HDL expresses circuit behavior rather than a sequence of commands for ordinary software to execute. Comparing one 2:1 multiplexer in Verilog and VHDL makes the difference in notation clear.
HDL is a language; RTL is a design level
HDL and RTL are not interchangeable. HDL is a language for expressing hardware. RTL (register-transfer level) is one design abstraction level that can be expressed in an HDL. A language can also describe higher-level behavior or structural connections between gates.
| Term | What it refers to | Example |
|---|---|---|
| HDL | A language for describing hardware and verification behavior | Verilog, SystemVerilog, VHDL |
| RTL | A design level describing register state and clocked data operations | A clocked circuit written in an HDL |
| Testbench | HDL code that stimulates a design and checks its output in a simulator | Generate input cases and compare results |
An HDL file does not always become physical circuitry. The design and its testbench serve different purposes. Testbench code using simulator-only delays, file input, or checks is generally not part of the design synthesized into hardware.
Describe the same 2:1 mux in two languages
A 2:1 multiplexer (mux) sends one of two inputs, a or b, to output y according to control signal sel. When sel is 0, y=a; when sel is 1, y=b. The examples assume binary values, 0 or 1.
Verilog
module mux2 (
input wire a,
input wire b,
input wire sel,
output wire y
);
assign y = sel ? b : a;
endmoduleVHDL
library ieee;
use ieee.std_logic_1164.all;
entity mux2 is
port (
a : in std_logic;
b : in std_logic;
sel : in std_logic;
y : out std_logic
);
end entity mux2;
architecture rtl of mux2 is
begin
y <= b when sel = '1' else a;
end architecture rtl;Both snippets express the same selection rule. Verilog uses a conditional operator; VHDL uses a conditional signal assignment.
| sel | Selected input | Output |
|---|---|---|
| 0 | a | y=a |
| 1 | b | y=b |
This mux is combinational logic and stores no state. Its output depends on the current inputs and sel. If a simulation must handle X or Z values, define and check those cases according to each language's expression rules. Even when two HDL descriptions specify the same logical function, they do not guarantee identical cells or routing after synthesis.
Separate simulation code from synthesizable design code
HDL files can serve different purposes:
**Design code** describes circuit inputs, outputs, logic, registers, and connections.
**A testbench** applies input stimulus and checks whether outputs match expectations. Recording cases makes checks repeatable.
**Synthesis** translates HDL constructs supported by a tool into logic for a target ASIC or FPGA. Not every construct allowed in simulation can be synthesized.
**Implementation** places and connects synthesized logic in the target device. Clock, I/O, timing, device, and routing constraints affect the result.
For example, AMD Vivado UG901 2024.2 supports mixed VHDL and Verilog projects subject to stated exceptions and reads only the synthesizable subset supported by that release. AMD Vivado Simulator UG900 2024.2 documents functional and timing simulation for VHDL, Verilog, SystemVerilog, and some mixed-language designs. These details apply to those AMD releases, not automatically to all vendors' tools.
IEEE lists SystemVerilog standard IEEE 1800-2023 for hardware design, specification, and verification, and VHDL standard IEEE 1076-2019 for use across electronic-system development. The standards define language syntax and meaning; exact synthesis support and hardware mapping still depend on the tool, version, and target device. The IEEE pages were checked on November 19, 2026.
Choose an HDL for the project
The language name alone does not predict speed, power, or area. A practical choice depends on the project's source code, IP, verification flow, and target tools.
| Check | Question | Why it matters |
|---|---|---|
| Existing design and IP | What language are current modules and supplied IP written in? | Mixed-language projects may need extra file, library, and port-boundary configuration. |
| Tool and version | Which standards and constructs do the target simulator and synthesizer support? | A construct that compiles in simulation may not be synthesizable. |
| Verification flow | Which languages do the testbench, assertions, and functional/timing simulation support? | The design and verification environments must work together. |
| Team maintenance | Which coding conventions and review practices does the team use? | Consistent notation and repeatable checks help maintain the design. |
When mixing languages, do not paste different grammars into one source file. Write each design unit in its own language and connect units through tool-supported ports and library boundaries. AMD Vivado's mixed-language flow, for example, has instance and boundary restrictions to check.
Verify the example in order
**Fix the conditions.** Record the target ASIC or FPGA, simulator and synthesis-tool versions, input values, and expected behavior.
**Write expected results.** For this mux, y must equal a when sel is 0 and b when sel is 1.
**Check the combinations in a testbench.** Apply input cases and compare y with the table. If results differ, check the conditional operand order, VHDL's true/false branches, and when the testbench changes inputs.
**Run synthesis and read warnings.** Confirm each file is interpreted as the intended HDL and look for unsupported constructs or unintended inferred logic. A tiny example passing synthesis does not prove that a larger project is fully synthesizable.
**Review implementation.** Check the synthesized logic view, resource report, and timing report against target constraints. For a physical device, verify board pins and clock conditions as well.
The key idea is that an HDL is a language for expressing circuit behavior. RTL is one way to describe registers and data flow in that language, while a testbench is separate code for checking the design. After writing HDL, check supported constructs, simulation results, and implementation reports for the target tool and device.
Sources
[IEEE SA: IEEE 1800-2023 SystemVerilog Standard](https://standards.ieee.org/ieee/1800/7743/)
[IEEE SA: IEEE 1076-2019 VHDL Language Reference Manual](https://standards.ieee.org/ieee/1076/5179/)
[AMD Vivado Design Suite User Guide: Synthesis (UG901), Setting Synthesis Inputs, 2024.2](https://docs.amd.com/r/2024.2-English/ug901-vivado-synthesis/Setting-Synthesis-Inputs)
[AMD Vivado UG901, Multiplexer Case Statement Example (Verilog), 2024.2](https://docs.amd.com/r/2024.2-English/ug901-vivado-synthesis/Multiplexer-Case-Statement-Example-Verilog)
[AMD Vivado UG901, Concurrent Selection Assignment Example (VHDL), 2024.2](https://docs.amd.com/r/2024.2-English/ug901-vivado-synthesis/Concurrent-Selection-Assignment-Example-VHDL)
[AMD Vivado Design Suite User Guide: Logic Simulation (UG900), Simulating with Vivado Simulator, 2024.2](https://docs.amd.com/r/2024.2-English/ug900-vivado-logic-simulation/Simulating-with-Vivado-Simulator)
[AMD Vivado UG900, Using Test Benches and Stimulus Files, 2024.1](https://docs.amd.com/r/2024.1-English/ug900-vivado-logic-simulation/Using-Test-Benches-and-Stimulus-Files)
References
- IEEE SA: IEEE 1800-2023 SystemVerilog Standard
- IEEE SA: IEEE 1076-2019 VHDL Language Reference Manual
- AMD Vivado Design Suite User Guide: Synthesis (UG901), Setting Synthesis Inputs, 2024.2
- AMD Vivado UG901, Multiplexer Case Statement Example (Verilog), 2024.2
- AMD Vivado UG901, Concurrent Selection Assignment Example (VHDL), 2024.2
- AMD Vivado Design Suite User Guide: Logic Simulation (UG900), Simulating with Vivado Simulator, 2024.2
- AMD Vivado UG900, Using Test Benches and Stimulus Files, 2024.1