Design Entry in VHDL, Entity, Architecture
Design Entry in VHDL, Entity, Architecture
LANGUAGE: VHDL
A. Jawahar
SSN College of Engineering
Session Objectives
design Units.
Entity Declaration
Architecture Body
Configuration Declaration
Package Declaration
Package Body
Entity Declaration
Specifies the name of the entity being modeled and lists the set of
interface ports.
Ports are signals through which the entity communicates with the
other models in its external environment.
Specifies the declarations and statements that are part of the design.
entity entity_name is
port ( [signal] identifier
{, identifier}: [mode] signal_type
{; [signal] identifier
{, identifier}: [mode] signal_type});
end [entity] [entity_name];
entity HALF_ADDER is
port (A,B: in BIT; SUM, CARRY: out BIT);
end HALF_ADDER;
Architecture body & Declaration Styles
Associates the signals in the entity with the ports of that sub-
component.
Interface description
of the half-adder and
or gate
Full adder example
Decoder 2-to-4
entity decoder_2_to_4 is
port (a, b, en: in bit; data: out bit_vector (0 to 3);
end decoder_2_to_4;
architecture decoder_str of decoder_2_to_4 is
component NOT
port (d: in bit; e: out bit);
end component;
component NAND3
port (p, q, r: in bit; s: out bit);
end component;
signal a_bar, b_bar: bit;
begin
I0: NOT port map (a, a_bar);
I0: NOT port map (b, b_bar);
N0: NAND3 port map (en, a_bar, b_bar, data(0));
N1: NAND3 port map (en, a_bar, b, data(1));
N2: NAND3 port map (en, a, b_bar, data(2));
N3: NAND3 port map (en, a, b, data(3));
end decoder_str;
Decoder
entity decoder is
port (a, b, en: in bit; z: out bit_vector( 0 to 3));
end decoder;
architecture deco_behave of decoder is
begin
process (a, b, en)
variable abar, bbar: bit;
begin
abar := not a; bbar := not b;
if en = ‘1’ then
z(0) <= not (abar and bbar);
z(1) <= not (abar and b);
z(2) <= not (a and bbar);
z(3) <= not (a and b);
else
z <= “1111”;
end if;
end process;
end deco_behave;
open