TABLE 10.27 VHDL
summary. |
VHDL feature |
Example |
Book |
93LRM |
Comments |
-- this is a comment |
10.3 |
13.8 |
Literals (fixed-value items) |
12 1.0E6 '1' "110" 'Z'
2#1111_1111# "Hello
world"
STRING'("110") |
10.4 |
13.4 |
Identifiers
(case-insensitive, start
with letter) |
a_good_name Same same
2_Bad bad_ _bad very__bad |
10.4 |
13.3 |
Several basic units of code |
entity
architecture configuration |
10.5 |
1.1-1.3 |
Connections made through
ports |
port ( signal
in i : BIT; out o : BIT); |
10.7 |
4.3 |
Default expression |
port (i : BIT :=
'1');
-- i='1' if left open |
10.7 |
4.3 |
No built-in logic-value
system.
BIT and BIT_VECTOR (STD). |
type BIT is
('0', '1'); -- predefined
signal myArray: BIT_VECTOR (7 downto 0);
|
10.8 |
14.2 |
Arrays |
myArray(1 downto
0) <= ('0', '1'); |
10.8 |
3.2.1 |
Two basic types of logic
signals |
a signal
corresponds to a real wire
a variable
is a memory location in RAM |
10.9 |
4.3.1.2
4.3.1.3 |
Types and explicit initial/default
value |
signal ONE : BIT
:= '1' ; |
10.9 |
4.3.2 |
Implicit initial/default
value |
BIT'LEFT = '0' |
10.9 |
4.3.2 |
Predefined attributes |
clk'EVENT, clk'STABLE
|
10.9.4 |
14.1 |
Sequential statements
inside
processes model things
that happen one after another and repeat |
process begin
wait until
alarm = ring;
eat; work; sleep;
end process; |
10.10 |
8 |
Timing with wait statement |
wait for
1 ns; -- not wait 1 ns
wait on
light until light = green; |
10.10.1 |
8.1 |
Update to signals occurs
at the end of a simulation cycle |
signal <= 1; -- delta
time delay
signal <= variable1
after 2 ns; |
10.10.3 |
8.3 |
Update to variables is immediate |
variable := 1; -- immediate
update |
10.10.3 |
8.4 |
Processes and concurrent
statements model things
that happen at the same time |
process
begin rain ; end process
;
process
begin sing ; end process
;
process
begin dance; end process
; |
10.13 |
9.2 |
IEEE Std_Logic_1164
(defines logic operators
on 1164 types) |
STD_ULOGIC
, STD_LOGIC
, STD_ULOGIC_VECTOR
, and STD_LOGIC_VECTOR
type STD_ULOGIC is
('U','X','0','1','Z','W','L','H','-');
|
10.6 |
-- |
IEEE Numeric_Bit and
Numeric_Std
(defines arithmetic operators
on BIT and 1164 types) |
UNSIGNED
and SIGNED
X <= "10"
* "01"
-- OK with numeric pkgs.
|
10.12 |
-- |