Académique Documents
Professionnel Documents
Culture Documents
Entity Portes is
Port (A, B: in std_logic;
Y1, Y2, Y3, Y4, Y5, Y6, Y7: out std_logic);
end Portes ;
Exercice 2
B A S
0 0 1
0 1 1
1 0 1
1 1 0
1) Faire la description VHDL de ce circuit ?
2) De quel circuit s’agit-il ?
3) Dessiner le schéma bloc de ce circuit ?
Exercice 4
Soit la description VHDL suivante :
Library ieee ;
Use ieee.std_logic_1164.all;
Entity Fonction_mystere is
Port (e0, e1: in std_logic;
sel: in std_logic;
Sort: out std_logic);
end Fonction_mystere ;
Architecture V0 of Fonction_mystere is
begin
Sort <= e0 when sel= '0' else e1;
end V0;
A Y1
AND
B
Y5
NOT
Y2
OR
NOT Y6
XOR
Y3
NOT Y7
NOT Y4
Exercice 2
1) Faire la description VHDL de ce circuit ?
Library ieee ;
Use ieee.std_logic_1164.all ;
Use ieee.std_logic_arith.all ;
Entity Ex_2 is
Port (A, B: in std_logic;
S: out std_logic);
end Ex_2 ;
NAND
S
B
Exercice 3
1) Faire la description VHDL de ce circuit ?
Library ieee ;
Use ieee.std_logic_1164.all ;
Use ieee.std_logic_arith.all ;
Entity Ex_3 is
Port (A0, A1, A2, A3: in std_logic;
S0, S1: out std_logic);
end Ex_3 ;
Architecture arch_ex3 of Ex_3 is
begin
process (A0, A1, A2, A3)
begin
if (A0='1' and A1='0' and A2='1' and A3='0') then S0<= '1'; S1<='1' ;
else if (A0='0' and A1='1' and A2='1' and A3='0') then S0<= '1'; S1<='0' ;
else if (A0='1' and A1='0' and A2='1' and A3='1') then S0<= '0'; S1<='1' ;
end if;
end if;
end if;
end process;
end arch_ex2;
2) Ecrire une description VHDL qui utilise les entrées et les sorties en vecteurs dans
une entité et plusieurs architectures qui contiennent différentes descriptions :
✓ Affectation sélective (with… select… when) ?
✓ Affectation conditionnelle (when… else) ?
✓ Structure de test (if… then… else)?
✓ Structure de choix (case… is… when) ?
Library ieee ;
Use ieee.std_logic_1164.all ;
Use ieee.std_logic_arith.all ;
Entity vecteur is
Port (A: in std_logic_vector (3 downto 0);
S: out std_logic_vector (1 downto 0));
end vecteur;
e1 0 E0
sort 1 E1
sel
E1 E0 sel sort
0 0 0 0
0 0 1 0
0 1 0 1
0 1 1 0
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 1
Entity Fonction_mystere is
Port (e0, e1: in std_logic;
sel: in std_logic;
Sort: out std_logic);
end Fonction_mystere ;
sel
e0
e1
sort