Chapter 3 - Basic Language Construcs of VHDL
Chapter 3 - Basic Language Construcs of VHDL
DIGITAL IC DESIGN
USING HDL
CHAPTER 3: BASIC
LANGUAGE
CONSTRUCTS OF VHDL
The end!
Integer:
VHDL does not define the exact range of
the integer type but specifies that the
minimal range is from (-231) to (231 – 1),
which corresponds to 32 bits.
Boolean: defined as (false, true).
Bit: defined as (‘0’, ‘1’).
Bit_vector: defined as a one-dimensional array
with elements of the bit data type.
NGUYEN THANH NGHIA 28
Chapter 3: Basic language constructs of VHDL
5. Data types and operators
PREDEFINED DATA TYPES IN VHDL
Concatenation operator
• The concatenation operator, &, is very
useful for array manipulation.
• We can combine segments of elements and
smaller arrays to form a larger array.
y <= "00" & a(7 downto 2);
Array aggregate
• For example, if we want to assign a value of
"10100000" to the a signal, it can be written as:
a <= "10100000 ";
• Another way is to list each value of the
element in the corresponding position, which is
known as positional association. The previous
assignment becomes.
a <= (‘1’,‘0’,‘1’, ‘0’, ‘0’,‘0’,‘0’,‘0’);
NGUYEN THANH NGHIA 42
Chapter 3: Basic language constructs of VHDL
5. Data types and operators
DATA TYPES IN THE IEEE STD_LOGIC_1164 PACKAGE
Array aggregate
• We can also use the form of index => value to
explicitly specify the value for each index,
known as named association.
• The statement can be written as
a <= (7=> '1', 6=> '0', 5=> '1', 4=> '0', 3=> '0',
2=> '0', 1=> '0', 0=> '0');
NGUYEN THANH NGHIA 43
Chapter 3: Basic language constructs of VHDL
5. Data types and operators
DATA TYPES IN THE IEEE STD_LOGIC_1164 PACKAGE
Array aggregate
• We can combine the index, as in
a <= ((7|5)=> '1', 6|4|3|2|1|0=> '0');
• or use a reserved word, others, to cover all the
unused indexes, as in
a <= ((7|5)=> '1', others=> '0');
Array aggregate
• For example, if we want to assign "00000000" to
the a signal, we can write
a <= (others => '0');
• It is more compact than
a <= “00000000";
Package by Synopsys;
std_logic_arith:
• Similar to numeric_std
• New data types: unsigned, signed
• Details are different
std_logic_unsigned/ std_logic_signed
• Treat std_logic_vector as unsigned and signed
numbers
• i.e., overload std_logic_vector with arith operations
The end!