Skip to content

Types & Values

The most common type. Nine possible states defined by IEEE 1164:

ValueMeaning
'0'Driven low
'1'Driven high
'Z'High impedance (tri-state)
'X'Unknown / conflict
'U'Uninitialized (default)
'W'Weak unknown
'L'Weak low
'H'Weak high
'-'Don’t care
signal clk : std_logic := '0';

Requires: library ieee; use ieee.std_logic_1164.all;

Simple two-state logic: '0' or '1'.

signal flag : bit := '0';
signal done : boolean := false;

An array of std_logic bits. Declared with a range:

-- MSB-first (most common)
signal data : std_logic_vector(7 downto 0) := x"00";
-- LSB-first
signal addr : std_logic_vector(0 to 3) := "0000";
-- Single bit
signal msb : std_logic;
msb <= data(7);
-- Slice
signal upper : std_logic_vector(7 downto 4);
upper <= data(7 downto 4);

Combine signals with &:

signal full : std_logic_vector(7 downto 0);
full <= upper & lower;

32-bit signed integer.

signal count : integer := 0;
SyntaxTypeExample
'0', '1'bit / std_logicclk <= '1';
"10101010"binary vectordata <= "10101010";
x"FF"hex vectordata <= x"FF";
42integercount <= 42;
true, falsebooleandone <= true;

If you don’t assign an initial value, std_logic signals start as 'U' (uninitialized). This shows up as orange in the waveform viewer. Assign defaults to avoid surprises:

signal clk : std_logic := '0';
signal data : std_logic_vector(7 downto 0) := x"00";