Vous êtes sur la page 1sur 5

B.

Description comportementale et structurelle

Il existe deux façons distinctes de décrire une structure. L'une dite comportementale et l'autre structurelle.

Description comportementale

Dans ce type de description, le comportement de la structure est directement inscrit dans l'architecture à
l'aide d'instructions séquentielles ou sous forme de flow de données.

Description comportementale à l'aide d'instructions séquentielles :

architecture Arch_comp1 of entité_X is


begin
process (A, B)
begin
if (A = '0' and B = '0') then
Som <= '0'; Ret <= '0';
if (A = '0' and B = '1') then
Som <= '1'; Ret <= '0';
if (A = '1' and B = '0') then
Som <= '1'; Ret <= '0';
if (A = '1' and B = '1') then
Som <= '1'; Ret <= '1';
end if;
end process;
end arch_comp1;

Description comportementale sous forme de flow de données :

architecture Arch_comportementale of entité_X is


begin
Som <= A xor B;
Ret <= A and B;
end arch_comportementale;

Description structurelle

Dans ce type de description, on relie entre eux des composants préalablement décrits en VHDL.

entite XOU is entite ET is


port (E1, E2 : in bit; S1 : out bit); port (E2, E3 : in bit; S2 : out bit);
end XOU; end ET;
architecture A_XOU of XOU is architecture A_ET of ET is
begin begin
S1 <= E1 XOR E2; S2 <= E3 AND E4;
end A_XOU; end A_ET;
Entité add is
port (A, B : in bit; Som, Ret : out bit);
end add;
architecture Arch_structurelle of add is
component XOU
Déclaration du composant XOU. port (E1, E2 : in bit; S : out bit);
end component;
component ET
Déclaration du composant ET.
port (E1, E2 : in bit; S : out bit);
end component;
Spécification de l'entité et de l'architecture à for U1 : XOU use entity work.XOU(A_XOU);
utiliser pour les composants ET et XOU for U2 : ET use entity work.ET(A_ET);
begin
Câblage des composants XOU U1 : XOU port map (A, B, Som);
et ET appelé U1 et U2. U2 : ET port map (A, B, Ret);
end arch_structurelle;

EXEMPLE DE DESCRIPTION D’UN SYSTEME ELECTRONIQUE ADDITIONNEUR


1. DESCRIPTION COMPORTEMENTALE D’UN ADDITIONNEUR COMPLET 1 BIT

Les équations logiques régissant le comportement d’un additionneur complet sont données par :
Une description comportementale exploitant ces équations peut être directement obtenue par le
programme VHDL suivant :

LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
ENTITY fa IS PORT (
Ci, Xi, Yi: IN STD_LOGIC;
Ci1, Si: OUT STD_LOGIC);
END fa;
ARCHITECTURE Dataflow OF fa IS
BEGIN
Ci1 <= (Xi AND Yi) OR (Ci AND (Xi XOR Yi));
Si <= Xi XOR Yi XOR Ci;
END Dataflow;

2. DESCRIPTION STRUCTURELLE D’UN ADDITIONNEUR COMPLET 1 BIT

L’additionneur complet décrit plus haut peut aussi être décrit de manière

LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
ENTITY Full_Adder IS
PORT (
xi: IN STD_LOGIC;
yi: IN STD_LOGIC;
cin: IN STD_LOGIC;
si: OUT STD_LOGIC;
cout OUT STD_LOGIC);
END Full_Adder;

ARCHITECTURE Full_Adder_structural OF Full_Adder IS


SIGNAL xy, xxory, xxorycin: STD_LOGIC;
COMPONENT AND2 PORT (I0,I1: IN STD_LOGIC; O: OUT STD_LOGIC);
END COMPONENT;
COMPONENT XOR2 PORT (I0,I1: IN STD_LOGIC; O: OUT STD_LOGIC);
END COMPONENT;
COMPONENT OR2 PORT (I0,I1: IN STD_LOGIC; O: OUT STD_LOGIC);
END COMPONENT;
BEGIN
U1: AND2 PORT MAP (xi, yi, xy);
U2: XOR2 PORT MAP (xi, yi, xxory);
U3: XOR2 PORT MAP (xxory, cin, si);
U4: AND2 PORT MAP (xxory, cin, xxorycin);
U5: OR2 PORT MAP (xy, xxorycin, cout);
END Full_Adder_structural;

3. DESCRIPTION STRUCTURELLE AADITIONNEUR COMPLET 4 BITS EN CASCADE

Additionneur en cascade

L’additionneur complet permet d’additionner deux opérandes de 1 bit chacun. Lorsqu’il s’agit d’additionner
deux opérateurs de plus de 2 bits chacun, il devient plus intéressant de faire recours à l’additionneur en
cascade dont le principe est de mettre en série plusieurs additionneurs complets 1 bit.

Le schéma ci-dessous donne le principe d’un tel additionneur dans le cas de deux opérandes de quatre bits
chacun à savoir x 3 x 2 x 1 x 0 et y 3 y 2 y 1 y 0.

Une description structurelle de ce circuit peut être faite en dupliquant quatre fois le composant
additionneur complet préalablement défini. Ceci peut se faire en utilisant les instructions PORT MAP quatre
fois et FOR-GENERATE afin de générer automatiquement les quatre composants. L’instruction FOR k IN 3
DOWNTO 0 GENERATE spécifie le nombre de fois que l’instruction PORT MAP sera appelée.

LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
ENTITY Adder4 IS
PORT (
A, B: IN STD_LOGIC_VECTOR(3 DOWNTO 0);
Cout: OUT STD_LOGIC;
SUM: OUT STD_LOGIC_VECTOR (3 DOWNTO 0));
END Adder4;
ARCHITECTURE Structural OF Adder4 IS
COMPONENT FA PORT (
ci, xi, yi: IN STD_LOGIC;
co, si: OUT STD_LOGIC);
END COMPONENT;
SIGNAL Carryv: STD_LOGIC_VECTOR(4 DOWNTO 0);
BEGIN
Carryv(0) <= '0';
Adder: FOR k IN 3 DOWNTO 0 GENERATE
FullAdder: FA PORT MAP (Carryv(k), A(k), B(k), Carryv(k+1), SUM(k));
END GENERATE Adder;
Cout <= Carryv(4);
END Structural;

Vous aimerez peut-être aussi