Académique Documents
Professionnel Documents
Culture Documents
Licence professionnelle
Semestre 6
Module : Conception des
Systèmes Embarqués
S
Entity
b (AND)
3
Programme en VHDL d'une porte AND :
Library ieee;
USE ieee.std_logic_1164.all;
a
S
Entity Function_AND is Entity
Port (a : in std_logic; b (AND)
b : in std_logic;
s : out std_logic);
End Function_AND;
4
Manipulation 2:
5
Programme en VHDL d’un demi-additionneur :
7
Programme en VHDL d’un additionneur :
𝑆 = 𝐴⨁𝐵⨁𝐶𝑖𝑛
𝐶𝑜𝑢𝑡 = 𝐴𝐵 + 𝐶𝑖𝑛𝐴 + 𝐶𝑖𝑛𝐵
Library ieee;
USE ieee.std_logic_1164.all;
Entity addi is
Port (A : in std_logic;
B : in std_logic;
Cin : in std_logic;
Cout : out std_logic;
S : out std_logic);
End addi;
8
Manipulation 4:
9
Programme en VHDL du circuit ci-dessous:
library ieee;
use ieee.std_logic_1164.all;
entity exemple2 is
port (
A,B,C : in std_logic;
F : out std_logic);
end exemple2;
architecture arch2 of exemple2 is
signal T1 : std_logic;
signal T2 : std_logic;
begin
T1 <= not(C);
T2 <= T1 xor B;
F <= T2 nand A;
end arch2;
1
0
Manipulation 5:
1
1
Programme en VHDL modèle combinatoire simple représenté à côté :
E1 SEL S
E2 00 E1
S
MUX 01 E2
E3
10 E3
E4
11 E4
SEL[1..0]
13
Programme en VHDL d’un multiplexeur (sans process) :
SEL S
Library ieee; 00 E1
USE ieee.std_logic_1164.all; 01 E2
10 E3
Entity multiplex is 11 E4
Port ( E1,E2,E3,E4 : in std_logic;
SEL : in std_logic_vector (1 downto 0);
S : out std_logic );
End multiplex;
E1
E2 S
Architecture desc_multiplex of multiplex is
E3 MUX
Begin
S <= E1 when SEL = "00" Else E4
E2 when SEL = "01"Else
E3 when SEL = "10"Else SEL[1..0]
E4;
End desc_multiplex;
14
Programme en VHDL d’un multiplexeur (process avec case et when) :
Library ieee; SEL S
USE ieee.std_logic_1164.all; 00 E1
01 E2
entity MUX is
10 E3
port (E1, E2, E3, E4: in std_logic;
SEL: in std_logic_vector(1 downto 11 E4
0);
S: out std_logic);
End MUX;
E1
architecture CMP of MUX is E2 S
begin E3 MUX
process (SEL) E4
begin
case SEL is SEL[1..0]
when "00" => S <= E1;
when "01" => S <= E2;
when "10" => S <= E3;
when OTHERS => S <= E4;
end case;
end process;
end CMP;
15
Programme en VHDL d’un multiplexeur (process avec if) :
Library ieee; SEL S
USE ieee.std_logic_1164.all; 00 E1
01 E2
entity multiplex is
10 E3
port (E1, E2, E3, E4: in std_logic;
SEL: in std_logic_vector(1 downto 0); 11 E4
S: out std_logic);
end multiplex;
16