VHDL (First Unit)
VHDL (First Unit)
VHDL 2
Identifiers, data objects and data types
Chapter2
Data
Identifiers objects Data types
BUFFER - An output which is also used internally and has a limited fan-out.
We will not use mode BUFFER. This will make it easier to use entities in
hierarchical designs as VHDL is a strongly typed language.
VHDL 2. Identifiers, data objects and data
types ver.9b
Syntax to create data objects
In entity declarations
Data
Identifiers objects Data types
Data
Identifiers objects Data types
•
Constants Signals Variables
(Global) (Global) (Local)
Discrete types
Numeric types
• Example:
• TYPE Resistance IS RANGE 1 TO 10E9
• UNITS
• ohm; --the base unit.
• kohm=1000 ohm; --secondary unit, multiple of base unit.
• END UNITS;
entity reg4 is
port ( d0, d1, d2, d3, en, clk : in bit;
q0, q1, q2, q3 : out bit );
end entity reg4; punctuation
entity reg4 is
port ( d0, d1, d2, d3, en, clk : in bit;
q0, q1, q2, q3 : out bit );
end reg4;
a Inertial
b
sum
carry Transport
s1
s2
In2 s4
s2
In2
Delta IN2
time
S2
Z
S3
S1
Z
S2
10 Δ 2Δ 3Δ
S4
10 20 30 40 50 60 70
Models
• Data flow
• Behavioral model
• Structure model
• Mixed model
In2 s4
s2
sum
a
out
b carry b
ports
full_adder.vhd
half_adder.vhd
or_2.vhd
-- bottom level
and2.vhd xor2.vhd
In1 s1 sum
H H
In2 A A s2
c_out
c_in s3
bit1
d_latch
d1 q1
d q
clk
bit2
d_latch
d2 q2
d q
clk
bit3
d_latch
d3 q3
d q
gate clk
and2
en int_clk
a y
clk
b
Concurrent signal assignment
• The syntax is as follows: