Professional Documents
Culture Documents
Scalar Data Types, Operations, Entities, Architectures, and Packages
Scalar Data Types, Operations, Entities, Architectures, and Packages
Scalar Data Types, Operations, Entities, Architectures, and Packages
Type qualification
logic_level’(unknown), system_state’(unknown)
Type conversion
arithematic ---
**, abs, *, /, mod, rem, +, -, relational (=, /=, etc.)
logical --- for bit or boolean
not, shift (sll, etc.), relational, and, or, nand, etc.
Expression as a formula
operands --- literal, data objects, and attributes
Entities and Architectures
entity and 2 is
generic ( Tdelay : time);
port (a, b: in bit; y : out bit); gate1: entry and2(simple)
end entity and2; generic map (Tdelay =>
2ns)
port map (a => a1, b=> b1,
architecture simple of and2 is
y=> sig1);
begin
y <= a and b after Tdelay;
end architecture simple;
Generics
entity XOR
port (a,b:in bit;
z : out bit );
end;
architecture nand_gates of XOR is
signal s0, s1, s2: bit;
begin
s0 <= a nand b;
s1 <= a nand s0;
s2 <= b nand s0;
z <= s1 nand s2;
end nand_gates;
Concurrent VHDL Statements
placing the first statement (s0 <= …) after the last statement has
absolutely no effect on execution or the result. The s1 <= … and
s2 <= … statements would have used the old s0 value anyhow.
Hierarchical Design Strategies
Bottom Up Strategy
create low level and auxiliary models first, entity and architecture
once low level entities are present, they can be used as
components in the next higher level architectural body.
Top Down Strategy
create highest level entity and architecture first, creating only the
interface definitions (entity declarations) for lower level
architectures
Middle Out Strategy -- Language features required to work from
middle UP are same as those provided to support bottom up
design.
middle DOWN are same as those provided to support top down
design.
Packages: Declaration and Body
Support modular design by encapsulating Data Abstractions: type
PACKAGE std_logic_1164 IS
-- logic state system (unresolved)
TYPE std_ulogic IS ( 'U', -- Uninitialized
'X', -- Forcing Unknown
'0', -- Forcing 0
'1', -- Forcing 1
'Z', -- High Impedance
'W', -- Weak Unknown
'L', -- Weak 0
'H', -- Weak 1
'-' -- Don't care );