4.10 Component declarations

...
ENTITY e IS
    ...
BEGIN
    ...
END e ;

...
ARCHITECTURE a OF e IS
    ...
BEGIN
    ...
END a ;

...
CONFIGURATION c
        OF e IS
    ...
    ...
    ...
END

...
PACKAGE pkg IS
    ...
    ...
    ...
END pkg ;

component_declaration ::=

component
identifier [ is ]
        [ local_ generic_clause ]
        [ local_ port_clause ]
end component ;

...
PACKAGE BODY pck
        IS
    ...
    ...
    ...
END pck ;

...
b: BLOCK IS
    ...
BEGIN
    ...
END BLOCK b ;

FUNCTION f (...)
    RETURN r IS
    ...
BEGIN
    ...
END f ;

PROCEDURE p (...) IS
    ...
BEGIN
    ...
END p ;

p : PROCESS
    ...
BEGIN
    ...
END PROCESS p ;

4.10.1 Further definitions

identifier ::=
    basic_identifier | extended_identifier

generic_clause ::=
    generic ( generic_list ) ;

port_clause ::=
    port ( port_list ) ;

4.10.2 Examples

COMPONENT gen_clock
   PORT ( clk : OUT tri_bit ) ;
END COMPONENT ;

The component gen_clock is declared whose
only interface to the outside is the output clk.

COMPONENT adder_8_bit
   PORT (a, b : IN bit_vector(1 TO 8);
         cin : IN bit ;
         sum : OUT bit_vector(1 TO 8);
         cout: OUT bit ) ;
END COMPONENT ;


The component adder_8_bit declared here has
the inputs a , b and cin and the outputs sum
and cout .

COMPONENT adder_n_bit
   GENERIC ( n : positive ) ;
   PORT (a, b : IN bit_vector(1 TO n);
         cin : IN bit ;
         sum : OUT bit_vector(1 TO n);
         cout: OUT bit ) ;
END COMPONENT ;

The component adder_n_bit declared here
is parameterised via the generic n.

The width of the input vectors a and b and
that of the output vector sum is determined by the
value of the generic n .