Explorer les Livres électroniques
Catégories
Explorer les Livres audio
Catégories
Explorer les Magazines
Catégories
Explorer les Documents
Catégories
ENSL1 :
Electronique numrique et synthse logique Logique combinatoire
1
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
ENSL1
Ce circuit sera dit combinatoire si, chaque fois quon lui prsente une mme combinaison en entre, il donnera toujours la mme rponse en sortie. Il sera dit squentiel si, une mme combinaison en entre, prsente des instants diffrents, peut donner des rponses diffrentes en sortie.
2
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
ENSL1
Circuits combinatoires
Dcodeurs Binaire naturel binaire rflchi Dcodeur 2 4, 3 8, BCD 7 segments, Encodeurs Encodeur 4 2, 8 3,
Encodeur de priorit
Multiplexeur Multiplexeur 2 1, 4 1, Dmultiplexeur Dmultiplexeur 1 2, 1 4, Additionneur /Soustracteur Comparateur Unit Arithmtique et logique (A.L.U)
3
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
ENSL1
4
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
ENSL1
Dcodeur BN
1/
BR (Recherche du schma)
trouver le schma logique du circuit combinatoire qui gnre une valeur de sortie en binaire rflchie, correspondant une valeur dentre exprime en binaire naturel
2/
5
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
ENSL1
Dcodeur BN
3/
BR (Recherche du schma)
E2 E1 E0 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 S2 S1 S0 0 0 0 0 1 1 1 1 0 0 1 1 1 1 0 0 0 1 1 0 0 1 1 0
4/
ENSL1
Dcodeur BN
5/
BR
S2 = E2 S1 = E2 S0 = E1 E1 E0
(Recherche du schma)
Etablir le schma
E2 E1 E0
E2
INPUT VCC XOR OUTPUT OUTPUT
S2
E1
INPUT VCC
S1
S2 S1 S0
inst
XOR OUTPUT
E0
INPUT VCC
S0
inst2
7
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
ENSL1
5/ 6/
ENSL1
Dcodeur BN
1/
BR (Description VHDL)
trouver le schma logique du circuit combinatoire qui gnre une valeur de sortie en binaire rflchie, correspondant une valeur dentre exprime en binaire naturel
2/
9
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
ENSL1
Dcodeur BN
3/
BR (Description VHDL)
entity bn_br is port ( E2,E1,E0 : in std_logic; S2,S1,S0 : out std_logic ); end bn_br;
10
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
ENSL1
Dcodeur BN
4/
BR (Description VHDL)
E2 E1 E0 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 S2 S1 S0 0 0 0 0 1 1 1 1 0 0 1 1 1 1 0 0 0 1 1 0 0 1 1 0
5/
Si les quations sont simples, crire la dclaration darchitecture laide daffectations simples.
Cest le cas S2 = E2 S1 = E2 S0 = E1 E1 E0
11
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
ENSL1
Dcodeur BN
S2 = E2 S1 = E2 S0 = E1
BR (Description VHDL)
E1 E0
5/ Dclaration darchitecture
architecture bn_br_arch of bn_br is begin S2 <= E2; S1 <= E2 xor E1; S0 <= E1 xor E0; end bn_br_arch; bn_br_arch
12
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
ENSL1
Dcodeur BN
BR (Description VHDL)
13
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
ENSL1
Dcodeur BN BR (Description VHDL utilisant une affectation conditionnelle) 6/ Description faite directement partir de la table de vrit :
architecture bn_br_arch2 of bn_br is signal entree,sortie : std_logic_vector (2 downto 0); begin entree(2) <= E2; Ne pas oublier dinitialiser les entree(1) <= E1; cases du tableau des entres entree(0) <= E0; avant de lutiliser. sortie <= "000" when entree="000" else "001" when entree="001" else "011" when entree="010" else "010" when entree="011" else "110" when entree="100" else "111" when entree="101" else "101" when entree="110" else "100" ; S2 <= sortie(2); Ne pas oublier daffecter les S1 <= sortie(1); signaux de sorties avant de S0 <= sortie(0); fermer larchitecture end bn_br_arch2; 14
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
E2 E1 E0 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1
S2 S1 S0 0 0 0 0 1 1 1 1 0 0 1 1 1 1 0 0 0 1 1 0 0 1 1 0
ENSL1
Dcodeur BN BR (Description VHDL utilisant une affectation slective) 6/ Description faite directement partir de la table de vrit :
E2 E1 E0 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1
S2 S1 S0 0 0 0 0 1 1 1 1 0 0 1 1 1 1 0 0 0 1 1 0 0 1 1 0
architecture bn_br_arch2 of bn_br is signal entree,sortie : std_logic_vector (2 downto 0); begin entree(2) <= E2; entree(1) <= E1; entree(0) <= E0; with entree select sortie <= "000" when "000" , "001" when "001" , "011" when "010" , "010" when "011" , "110" when "100" , "111" when "101" , "101" when "110" , "100" when others; others; S2 <= sortie(2); S1 <= sortie(1); S0 <= sortie(0); end bn_br_arch2; 15
Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
Michel KRAMMER
ENSL1
Un dcodeur 2 4 est un circuit 2 entres et 4 sorties. Un dcodeur 3 8 est un circuit 3 entres et 8 sorties. Cest un circuit qui, a un instant donn, na quune seule sortie active, parmi les 4 ou les 8. Cest la sortie dont lindice correspond la valeur dentre. Ltat actif dune sortie peut tre ltat 1 ou ltat 0.
16
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
ENSL1
S3
0 1 0 1
E1 E0
S2 S1 S0
17
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
ENSL1
4/
quations videntes
18
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
ENSL1
Dcodeur 2 4
5/
(Recherche du schma)
S0 = E1.E0 S1 = E1.E0 S2 = E1.E0 S3 = E1.E0
Etablir le schma
E1 E0
NOT
AND2 OUTPUT
E1
INPUT VCC
inst3
NOT
S0
S0 S1 S2 S3
inst4
AND2 OUTPUT
E0
INPUT VCC
inst
S1
inst5
AND2 OUTPUT
S2
inst6
AND2 OUTPUT
S3
inst7
19
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
ENSL1
ENSL1
(Description VHDL)
Un dcodeur BCD 7 segments est un circuit de commande dun afficheur 7 segments. Il gnre en sortie les 7 signaux ncessaires laffichage du symbole hexadcimal, correspondant la valeur binaire dentre comprise entre 0 et 15
2/
Il possde 4 entres (valeur binaire de 0 15) , et 7 sorties commandant chacune les segments de lafficheur.
21
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
ENSL1
(Description VHDL)
a b c d e f g S0 S1 S2 S3 S4 S5 S6 1 1 1 1 1 1 0 0 1 1 0 0 0 0 1 1 0 1 1 0 1 1 1 1 1 0 0 1 0 1 1 0 0 1 1 1 0 1 1 0 1 1 1 0 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 0 0 1 1 1 1 1 1 0 0 1 1 1 0 0 1 1 1 1 0 1 1 0 0 1 1 1 1 1 0 0 0 1 1 1
22
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
ENSL1
Dcodeur BCD 7 segments Schma interne
23
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
ENSL1
(Description VHDL)
24
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
S0 S1 S2 S3 S4 S5 S6 1 0 1 1 0 1 1 1 1 1 1 0 1 0 1 1 1 1 1 1 1 0 0 1 1 1 1 0 0 1 0 0 1 1 0 1 1 1 1 1 1 1 1 1 0 1 0 0 1 0 1 1 0 1 1 0 1 1 0 1 1 1 1 0 1 0 1 0 0 0 1 0 1 0 1 1 1 1 1 1 1 0 0 0 1 1 1 0 1 1 1 1 1 0 1 1 0 0 1 1 1 1 1 0 1 1 1 1 0 1 1 1
Dclaration darchitecture (en utilisant une affectation slective) slective) a E3 E2 E1 E0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 b c d e f g architecture bcd_7seg_2_arch of bcd_7seg_2 is begin with E select S <= "1111110" when "0000" , "0110000" when "0001" , "1101101" when "0010" , "1111001" when "0011" , "0110011" when "0100" , "1011011" when "0101" , "1011111" when "0110" , "1110000" when "0111" , "1111111" when "1000" , "1111011" when "1001" , "1110111" when "1010" , "0011111" when "1011" , "1001110" when "1100" , "0111101" when "1101" , "1001110" when "1110" , "1000111" when others ; end bcd_7seg_2_arch; 26
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
S0 S1 S2 S3 S4 S5 S6 1 0 1 1 0 1 1 1 1 1 1 0 1 0 1 1 1 1 1 1 1 0 0 1 1 1 1 0 0 1 0 0 1 1 0 1 1 1 1 1 1 1 1 1 0 1 0 0 1 0 1 1 0 1 1 0 1 1 0 1 1 1 1 0 1 0 1 0 0 0 1 0 1 0 1 1 1 1 1 1 1 0 0 0 1 1 1 0 1 1 1 1 1 0 1 1 0 0 1 1 1 1 1 0 1 1 1 1 0 1 1 1
S sel1 sel0
27
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
Table de vrit
Sel1 Sel0 0 0 1 1 0 1 0 1 S E0 E1 E2 E3
Equation
S = Sel1.Sel0.E0 + Sel1.Sel0.E1 + Sel1.Sel0.E2 + Sel1.Sel0.E3
28
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
Schma
E3 E2 E1 E0 Sel1 Sel0
AND3
E3
INPUT VCC
inst
AND3
E2
INPUT VCC
OR4
inst7
OUTPUT AND3
E1
INPUT VCC
inst8
AND3
inst11
E0
INPUT VCC
inst9
NOT
Sel1
inst12
NOT
Sel0
inst13
29
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
ENSL1 Multiplexeurs 4 1
( 1re Description VHDL utilisant une affectation simple) S = Sel1.Sel0.E0 + Sel1.Sel0.E1 + Sel1.Sel0.E2 + Sel1.Sel0.E3
library ieee; use ieee.std_logic_1164.all; entity mux4_1 is port ( ); end mux4_1; architecture mux4_1_arch1 of mux4_1 is begin S <= ((not Sel1) and (not Sel0) and E0) or ((not Sel1) and Sel0 and E1) or (Sel1 and (not Sel0) and E2) or (Sel1 and Sel0 and E3) ; end mux4_1_arch1; E3,E2,E1,E0,Sel1,Sel0 : in std_logic; S: out std_logic
30
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
ENSL1 Multiplexeurs 4 1
conditionnelle) (2me Description VHDL utilisant une affectation
Symbole :
mux4_1 E3 E2 E1 E0 Sel1 Sel0 S
inst
Sel1 Sel0 0 0 1 1 0 1 0 1
S E0 E1 E2 E3
ENSL1 Multiplexeurs 4 1
slective ) ( 3me Description VHDL utilisant une affectation
les entres aiguiller sont dclares sous forme de simple bit les entres de slection sont dclares sous forme de BUS
library ieee; use ieee.std_logic_1164.all; entity mux_4_1 is port ( E3,E2,E1,E0 : in std_logic; sel: in std_logic_vector ( 1 downto 0); S: out std_logic ); end mux_4_1; architecture mux_4_1_arch3 of mux_4_1 is begin with sel select s <= E0 when "00" , E1 when "01" , E2 when "10" , E3 when others; end mux_4_1_arch3; 32
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
Symbole :
mux_4_1 E3 E2 E1 E0 sel[1..0] inst1 S
Sel1 Sel0 0 0 1 1 0 1 0 1
S E0 E1 E2 E3
33
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
Table de vrit
Sel1 Sel0 0 0 1 1 0 1 0 1 S0 S1 S2 S3 E 0 0 0 0 E 0 0 0 0 E 0 0 0 0 E
Equations
S0 = Sel1.Sel0.E S1 = Sel1.Sel0.E S2 = Sel1.Sel0.E S3 = Sel1.Sel0.E
34
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
Schma
AND3
INPUT VCC
OUTPUT
S3
S3 S2 S1 S0
inst5
AND3 OUTPUT
S2
inst6
AND3 OUTPUT
S1
Sel1 Sel0
NOT
Sel1
INPUT VCC
inst7
AND3 OUTPUT
inst
NOT
Sel0
INPUT VCC
S0
inst4
inst8
35
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
Symbole:
dmux1_4 E S3
sel[1..0] S2 S1 S0
inst
36
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
I3
I2
I1
I0
Gs Q1 Q0
37
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
Table de vrit
I3 I2 I1 I0 0 0 0 0 1 0 0 0 1 X 0 0 1 X X 0 1 X X X Gs Q1 Q0 0 1 1 1 1 0 0 0 1 1 0 0 1 0 1
I3
I2
I1
I0
Gs Q1 Q0
Les lignes dentres sont notes de I3 I0 Les sorties dencodage sont Q1 et Q0 Lorsque deux entres sont actives simultanment la priorit est donne au poids le plus fort (indice le plus grand) Si toutes les entres sont inactives alors Q1 Q0 = 00 et Gs=0 La sorties Gs (Got Something), indique par un 1 quun code est valide en sortie ( au moins une ligne est active).
38
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
- Les quations
I3 I2 I1 I0 0 0 0 0 1 0 0 0 1 X 0 0 1 X X 0 1 X X X Gs Q1 Q0 0 1 1 1 1 0 0 0 1 1 0 0 1 0 1
Q0
I3 I2
I1 I0
00 01 11 0 0 1 1 0 0 1 1 1 0 1 1
10 1 0 1 1
00 01 11 10
Equations videntes :
Gs = I3 + I2 + I1 + I0 Q1 = I3 + I2 Q0 = I3 + ( I2 . I1 )
39
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
Gs = I3 + I2 + I1 + I0 Q1 = I3 + I2 Q0 = I3 + ( I2 . I1 ) - Le schma
I3 I2 I1 I0
OR4
I3 I2 I1 I0
Gs
Gs
inst
OR2 OUTPUT
Q1
Q1 Q0
inst5 inst6
NOT OR2 OUTPUT AND2
Q2
inst8
inst7
40
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
(Recherche du schma)
En vue dassocier plusieurs encodeurs entre eux, deux lignes sont rajoutes : Ei en entre et Eo en sortie
I3 Ei
I2
I1
I0 Eo
Gs Q1 Q0
41
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
(Recherche du schma)
Eo Gs Q1 Q0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 1 1 1 0 1 1 1
- Equations
Gs = Ei . ( I3 + I2 + I1 + I0 ) Q1 = Ei . ( I3 + I2 ) Q0 = Ei . ( I3 + ( I2 . I1 ) ) Eo = Ei . ( I3 + I2 + I1 + I0 )
42
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
Gs = Ei . ( I3 + I2 + I1 + I0 ) Q1 = Ei . ( I3 + I2 ) Q0 = Ei . ( I3 + ( I2 . I1 ) ) Eo = Ei . ( I3 + I2 + I1 + I0 ) - Le schma
NOT AND2 OUTPUT
Ei I3 I2 I1 I0
inst10 Ei I3 I2 I1 I0
INPUT VCC OR4 INPUT VCC INPUT VCC INPUT VCC INPUT VCC AND2
Eo
Eo Gs Q1 Q0
inst9
OUTPUT
Gs
inst4 inst
AND2 OR2 OUTPUT
Q1
inst5 inst6
NOT OR2
inst2
AND2 OUTPUT
Q0
AND2
inst8
inst3
inst7
43
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
E3 E2 E1 E0
I3 Ei Gs Q1 Q0 I2 I1 I0 Eo
Ei
Gs2 Q3 Q2
Gs1 Q1 Q0
?
Gs S2 S1 S0
44
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
E7 E6 E5 E4
I3 I2 I1 I0 Eo Gs Q1 Q0
ENSL1
E3 E2 E1 E0
I3 Ei Gs Q1 Q0 I2 I1 I0 Eo
Ei
Gs2 Q3 Q2
Gs1 Q1 Q0
?
Table de vrit
E7 E6 E5 E4 E3 E2 E1 E0
Gs
S2
S1
S0
- Equations
Gs S2 S1 S0
Gs2 Q3 Q2
Gs1 Q1 Q0
0 0 0 0 0 0 0 0 1
X X X X X X X X X X X X X X X X X X
0 0 0 0 0 0 0 1
0 0 0 0 0 0 1
0 0 0 0 0 1
0 0 0 0 1
0 0 0 1 X
0 0 0 1 1 X
X X
X X
X X X X
0 0 0 0 0 1 1 1 1
0 0 0 0 0 0 0 1 1
0 0 0 0 0 0 1 0 1
0 1 1 1 1 0 0 0 0
0 0 0 1 1 0 0 0 0
0 0 1 0 1 0 0 0 0
0 1 1 1 1 1 1 1 1
0 0 0 0 0 1 1 1 1
0 0 0 1 1 0 0 1 1
0 0 1 0 1 0 1 0 1
45
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
En binaire:
bit de retenue
1 1 1
bits dentres
Si on arrive trouver le schma logique, dune cellule capable de gnrer le bit de somme et le bit de retenue, pour toutes les combinaisons possibles des bits dentres, alors en cascadant n cellules identiques, on arrivera faire laddition de nombres au format n bits.
bit de somme
Chaque cellule additionneur aura : 3 bits dentres : an (bit de rang n du nombre A) bn (bit de rang n du nombre B) rn (retenue gnre par la cellule de rang n-1) sn (bit de somme de rang n) rn+1 (retenue de rang n applique la cellule de rang n+1)
an bn Add rn+1 sn rn
2 bits de sortie :
46
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
s4 s3 s2 s1 s0
a3
b3
r3
a2
b2
r2
a1
b1
r1
a0
b0
r0
an
bn Add
rn
an
bn Add
rn
an
bn Add
rn
an
bn Add
rn
rn+1 sn
rn+1 sn
rn+1 sn
rn+1 sn
s4
s3
s2
s1
s0
47
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
ENSL1
an bn Add rn+1 sn rn
Karnaugh:
rn+1
rn
an bn 00
01 0 1
11 1 1
10 0 1
0 1
0 0
rn
01 1 0
11 0 1
10 1 0
0 1
0 1
sn= rn.an.bn + rn.an.bn + rn.an.bn + rn.an.bn sn= rn.(an.bn + an.bn) + rn.(an.bn + an.bn) sn= rn.(an bn) + rn.(an bn) = rn an
bn
sn= rn
an
bn
48
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
ENSL1
Symbole:
inst
XOR OUTPUT
sn
rin
inst3
AND2
inst1
AND2 OR3 OUTPUT
rout
rn+1
inst
inst2
AND2
inst5
inst4
49
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
a[0] b[0]
rin a b
inst
s rout
a[3..0]
INPUT VCC
OUTPUT
s[4..0]
b[3..0]
INPUT VCC
Add
s[1] a[1] b[1]
rin a b
inst1
s rout
Add
s[2] a[2] b[2]
rin a b
inst2
s rout
Add
s[3] a[3] b[3]
rin a b
inst3
s rout
s[4]
50
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
Symbole:
Add rin a b
inst
);
s rout
rn an 0 0 0 0 0 1 0 1 1 0 1 0 1 1 1 1
bn 0 1 0 1 0 1 0 1
rn+1 sn 0 0 0 1 0 1 1 1 0 1 1 0 1 0 0 1
51
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
ENSL1 Comparateur
Cest un circuit qui reoit deux nombres binaire A & B, en entre, comme ladditionneur, et qui dtermine sur trois sorties si : A>B, A<B ou A=B. Principe de la comparaison :
Soit deux nombres A= 01101101 et B= 01110100, simplement en les observant, on peut dire que
A<B
Il suffit pour cela de comparer leurs bits de mme rang, en commenant par les poids forts :
A= 0 1 1 0 B= 0 1 1 1
Le premier bit 1 rencontr sur lun des deux nombres, alors que son quivalent est 0 sur lautre, permet de dterminer le plus grand des deux nombres
52
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
sin, ein & iin : bits dentre, utiliss lors de la mise en cascade de plusieurs cellules
Deux cas dterminerons des comportements diffrents de la cellule : 1er cas : 2me cas : Si an = bn , alors sout = sin, eout = ein, iout = iin Si an bn , soit 2 possibilits : an=1 et bn=0 (an > bn) , alors sout=1, eout=0, iout=0 an=0 et bn=1 (an < bn) , alors sout=0, eout=0, iout=1
53
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
Equations
54
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
ENSL1
sout = an.bn + sin.(an . bn) e = e .(a . b )
out in n n
Comp_sch sin ein iin b a
inst
Schma
bn
NOT
INPUT VCC
inst inst6
AND2 OR2
sout
sout iout
inst12
an
NOT
INPUT VCC
OUTPUT
iout
inst5
XNOR
inst7
inst13
AND2
inst9 sin
INPUT VCC
inst8
AND2 OUTPUT
ein
INPUT VCC
eout
eout
inst10
AND2
iin
INPUT VCC
inst11
55
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
ENSL1
Comparateur 4 bits
GND VCC
b[3..0]
b[0] a[0]
a[3..0]
b[1] a[1]
b[2] a[2]
b[3] a[3]
S E I
56
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
ENSL1
Comparateur (description VHDL) Symbole :
library ieee; use ieee.std_logic_1164.all; entity comp is port ( sin,ein,iin,b,a : in std_logic; sout,eout,iout : out std_logic ); end comp; architecture comp_arch of comp is signal entree : std_logic_vector (1 downto 0); begin entree(1) <= a; entree(0) <= b; sout <= iout <= eout <= '1' when entree="10" else '0' when entree="01" else sin; '0' when entree="10" else '1' when entree="01" else iin; '0' when entree="10" else '0' when entree="01" else ein;
Comp_sch sin ein iin b a
inst
end comp_arch;
57
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
INPUT VCC
OUTPUT
inst
E
50% 50%
Ralit
tPHL tf
E
tPLH tr
Reprsentation
59
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
00 01 11 0 0 1 0 1 0 A.C
10 1 1 A.B
0 1
F = A.C + A.B
Lala se rencontre lorsque lon passe dune case une case adjacente de mme valeur ntant pas dans un mme groupement
Dans notre exemple on risque de rencontrer un ala sur un changement dtat de la variable dentre A lorsque C=0 et B=1
60
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
ENSL1
Schma :
F = A.C + A.B
NOT
A B=1 C=0
INPUT VCC
AND2
inst inst2
A.B
OR2 OUTPUT
AND2
inst4
inst1
C=1
inst3
A.C
A A A.C A.B F
0 1 0
Etat transitoire de trs courte dure, du aux temps de propagation travers les portes logiques, o pendant environ 1ns les 2 entres du OU sont 0. Ce qui provoque un ala.
61
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
00 01 11 0 0 1 0 1 0 A.C
10 1 1 A.B B.C
0 1
a3 a2 a1 a0
b3 b2 b1 b0
s4 s3 s2 s1 s0
a3
b3
r3
a2
b2
r2
a1
b1
r1
a0
b0
r0
an
bn Add
rn
an
bn Add
rn
an
bn Add
rn
an
bn Add
rn
rn+1 sn
rn+1 sn
rn+1 sn
rn+1 sn
s4
s3
s2
s1
s0
63
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
Symbole:
Add rin a b
inst
);
s rout
rn an 0 0 0 0 0 1 0 1 1 0 1 0 1 1 1 1
bn 0 1 0 1 0 1 0 1
rn+1 sn 0 0 0 1 0 1 1 1 0 1 1 0 1 0 0 1
64
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
a[0] b[0]
rin a b
inst
s rout
a[3..0]
INPUT VCC
OUTPUT
s[4..0]
b[3..0]
INPUT VCC
Add
s[1] a[1] b[1]
rin a b
inst1
s rout
Add
s[2] a[2] b[2]
rin a b
inst2
s rout
Add
s[3] a[3] b[3]
rin a b
inst3
s rout
s[4]
65
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
ENSL1 Additionneur
a b
Additionneur
s
library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity addi is port ( a,b : in std_logic_vector (3 downto 0); s : out std_logic_vector (4 downto 0) ); end addi; architecture addi_a of addi is begin s <= ('0'&a) + ('0'&b); end addi_a; Pour pouvoir utiliser des oprateurs arithmtiques standards (+,-, ) sur des std_logic_vector
& :oprateur de concatnation La concatnation est dfinie sur des tableaux une dimension : std_logic_vector Lopration : CONCAT & ENATION donne : CONCATENATION
66
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
ENSL1
En VHDL il est possible de fusionner deux tableaux, on appelle cette opration la concatnation, pour affecter les valeurs correspondantes un tableau plus grand
signal etat : std_logic_vector ( 4 downto 0 ) ; signal sous_etat1 : std_logic_vector ( 1 downto 0 ) ; signal sous_etat2 : std_logic_vector ( 2 downto 0 ) ; etat <= sous_etat1 & sous_etat2 ; --concatenation
67
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
ENSL1
Lutilisation de la librairie ieee.std_logic_unsigned.all va permettre de faciliter la tche du concepteur. On a bien vu que la description de ladditionneur est beaucoup plus simple en utilisant la librairie ieee.std_logic_unsigned.all
68
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
ENSL1
Unit Arithmtique et logique (A.L.U)
a sel b cin
A.L.U.
y
a[7..0] b[7..0]
L.U. M U X
Y[7..0]
A.U.
cin sel[3..0] sel[2..0]
sel[3]
69
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
L.U. M U X
Y[7..0]
A.U.
cin sel[3..0] sel[2..0]
sel[3]
library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity ALU is port ( a, b: in std_logic_vector(7 downto 0); sel: in std_logic_vector(3 downto 0); cin: in std_logic; y: out std_logic_vector(7 downto 0) ); end ALU;
architecture ALU_arch of ALU is signal arith, logic: std_logic_vector(7 downto 0); begin ----- Unit arithmtique: -----with sel(2 downto 0) select arith <= a when "000", a+1 when "001", a-1 when "010", b when "011", b+1 when "100", b-1 when "101", a+b when "110", a+b+cin when others; ----- Unit logique: ----------with sel(2 downto 0) select logic <= not(a) when "000", not(b) when "001", a and b when "010", a or b when "011", a nand b when "100", a nor b when "101", a xor b when "110", not(a xor b) when others; -------- Mux: --------------with sel(3) select y <= arith when '0', logic when others; end ALU_arch;
70
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011
ENSL1
71
Michel KRAMMER Iut de Toulon Dpt: GEII - Semestre 1 2010/2011