Académique Documents
Professionnel Documents
Culture Documents
« Logique programmable»
A. ZAKRITI 2
- Ils peuvent être décrit par tout type de description
(structurelle, comportementale en mode concurent et
avec des équations booléennes et comportementale
en mode process). En mode process, tous les signaux
d’entrée pour un système combinatoire doivent être
dans la liste de sensibilité.
A. ZAKRITI 3
SYSTÈMES COMBINATOIRES
entity Gray_Bin is
Port (
G : in STD_LOGIC_VECTOR (2 downto 0);
B : out STD_LOGIC_VECTOR (2 downto 0));
end Gray_Bin;
A. ZAKRITI 4
SYSTÈMES COMBINATOIRES
architecture Behavioral of Gray_Bin is
Begin
With G select
B<= "000" when "000",
"001" when "001",
"010" when "011",
"011" when "010",
"100" when "110",
"101" when "111",
"110" when "101",
"111" when "100",
“000" when others;
end Behavioral;
A. ZAKRITI 5
SYSTÈMES COMBINATOIRES
A. ZAKRITI 6
SYSTÈMES COMBINATOIRES
i
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity BCD27SEG is
Port (
i : in std_logic_vector(3 downto 0);
a, b, c, d, e, f, g : out std_logic);
end BCD27SEG;
A. ZAKRITI 7
SYSTÈMES COMBINATOIRES
architecture Behavioral of BCD27SEG is
BEGIN
WITH i SELECT
(a,b,c,d,e,f,g) <= std_logic_vector’(‘1’,’1’,’1’,’1’,’1’,’1’,’0’) WHEN "0000",
std_logic_vector’(‘0’,’1’,’1’,’0’,’0’,’0’,’0’) WHEN "0001",
std_logic_vector’(‘1’,‘1’,’0’,’1’,’1’,’0’,’1’) WHEN "0010",
std_logic_vector’(‘1’,’1’,’1’,’1’,’0’,’0’,’1’) WHEN "0011",
std_logic_vector’(‘0’,’1’,’1’,’0’,’0’,’1’,’1’) WHEN "0100",
std_logic_vector’(‘1’,’0’,’1’,’1’,’0’,’1’,’1’) WHEN "0101",
std_logic_vector’(‘1’,’0’,’1’,’1’,’1’,’1’,’1’) WHEN "0110",
std_logic_vector’(‘1’,’1’,’1’,’0’,’0’,’0’,’0’) WHEN "0111",
std_logic_vector’(‘1’,’1’,’1’,’1’,’1’,’1’,’1’) WHEN "1000",
std_logic_vector’(‘1’,’1’,’1’,’1’,’0’,’1’,’1’) WHEN "1001",
std_logic_vector’(‘1’,’0’,’0’,’1’,’1’,’1’,’1’) WHEN OTHERS ;
end Behavioral;
A. ZAKRITI 8
SYSTÈMES COMBINATOIRES
Autrement:
A. ZAKRITI 9
SYSTÈMES COMBINATOIRES
a <= seg(6);
b <= seg(5);
c <= seg(4);
d <= seg(3);
e <= seg(2);
f <= seg(1);
g <= seg(0);
end Behavioral;
A. ZAKRITI 10
SYSTÈMES COMBINATOIRES
A. ZAKRITI 11
SYSTÈMES COMBINATOIRES
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.std_logic_unsigned.all;
entity comparaison is
Port ( A : in STD_LOGIC_VECTOR (3 downto 0); -- A sur 4 bits
B : in STD_LOGIC_VECTOR (2 downto 0); -- B sur 3 bits
S : out STD_LOGIC );
end comparaison;
A. ZAKRITI 13
SYSTÈMES COMBINATOIRES
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity compar is
Port ( A : in STD_LOGIC_VECTOR (4 downto 0);
B : in STD_LOGIC_VECTOR (3 downto 0);
INF : out STD_LOGIC;
EQ : out STD_LOGIC;
SUP : out STD_LOGIC);
end compar;
A. ZAKRITI 14
SYSTÈMES COMBINATOIRES
end Behavioral;
Exemple: Si A<= "01111" et B<= "1000";
SUP<= '1'; INF<= '0'; EQ<='0';
A. ZAKRITI 15
SYSTÈMES COMBINATOIRES
Entity multiplexeur41_1bits is
port ( entree : in std_logic_vector(3 downto 0);
selecteur : in std_logic_vector(1 downto 0);
sortie : out std_logic );
End multiplexeur41_1bits;
A. ZAKRITI 16
SYSTÈMES COMBINATOIRES
A. ZAKRITI 17
SYSTÈMES COMBINATOIRES
A. ZAKRITI 18
Library ieee;
Use ieee.std_logic_1164.all;
Entity MULTIPLEXEUR41_8bits is
port ( selecteur : in std_logic_vector(1 downto 0);
E0, E1, E2, E3 : in std_logic_vector(7 downto 0);
S : out std_logic_vector(7 downto 0) );
end MULTIPLEXEUR41_8bits;
A. ZAKRITI 20
SYSTÈMES COMBINATOIRES
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity Demux is
Port ( Sel : in STD_LOGIC_VECTOR (1 downto 0); -- Sel = a, b
end Demux;
A. ZAKRITI 21
SYSTÈMES COMBINATOIRES
end case;
end process;
end Behavioral;
A. ZAKRITI 22
SYSTÈMES COMBINATOIRES
A. ZAKRITI 23
SYSTÈMES COMBINATOIRES
IV-2 Démultiplexeur 1 à 8
Ecrire un code VHDL d’un démultiplexeur 1 vers 8 en utilisant
l’instruction séquentielle : « if ….. elsif…… end if ». L’entrée
de donnée est en permanence à ‘1’
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity demux is
Port ( O : out std_logic_vector (7 downto 0) ;
Sel : in std_logic_vector (2 downto 0));
end demux;
A. ZAKRITI 24
SYSTÈMES COMBINATOIRES
architecture arch_demux of ent_demux is
begin
process (Sel)
begin
if Sel = “000" then O <= "00000001";
elsif Sel = "001" then O <= "00000010";
elsif Sel = "010" then O <= "00000100";
elsif Sel = "011" then O <= "00001000";
elsif Sel = "100" then O <= "00010000";
elsif Sel = "101" then O <= "00100000";
elsif Sel = "110" then O <= "01000000";
elsif Sel = "111" then O <= "10000000";
end if;
end process;
end arch_demux;
A. ZAKRITI 25
SYSTÈMES COMBINATOIRES
A. ZAKRITI 26
SYSTÈMES COMBINATOIRES
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity Demux is
Port ( Sel : in STD_LOGIC_VECTOR (1 downto 0);
Enable : in STD_LOGIC;
Y : out STD_LOGIC_VECTOR (3 downto 0));
end Demux;
A. ZAKRITI 27
SYSTÈMES COMBINATOIRES
A. ZAKRITI 28
SYSTÈMES COMBINATOIRES
A. ZAKRITI 30
SYSTÈMES COMBINATOIRES
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
Entity UAL is
port( A : in std_logic_vector(3 downto 0);
B : std_logic_vector(3 downto 0);
Sel : std_logic_vector(1 downto 0);
R: out std_logic_vector(3 downto 0));
End UAL;
A. ZAKRITI 31
SYSTÈMES COMBINATOIRES
A. ZAKRITI 32
A. ZAKRITI 33