🔢
TPs Systemes Numeriques
3 Projets : Karnaugh, Compteurs, VHDL
📊 Karnaugh🔄 Compteurs💻 VHDL
TP1 : Simplification par Karnaugh
Optimisation de fonctions logiques
🎯 Objectifs
- Construire un tableau de Karnaugh
- Former les groupements optimaux
- Deduire l'equation simplifiee
- Implementer le circuit logique
Exercice 1 : Fonction 4 variables
Table de verite :
A B C D | F
0 0 0 0 | 1
0 0 0 1 | 1
0 0 1 0 | 0
0 0 1 1 | 1
0 1 0 0 | 1
0 1 0 1 | 1
0 1 1 0 | 0
0 1 1 1 | 1
1 0 0 0 | 0
1 0 0 1 | 0
1 0 1 0 | 0
1 0 1 1 | 1
1 1 0 0 | 0
1 1 0 1 | 0
1 1 1 0 | 0
1 1 1 1 | 1
Tableau de Karnaugh :
CD
00 01 11 10
┌────┬────┬────┬────┐
AB 00 │ 1 │ 1 │ 1 │ 0 │
├────┼────┼────┼────┤
01 │ 1 │ 1 │ 1 │ 0 │
├────┼────┼────┼────┤
11 │ 0 │ 0 │ 1 │ 0 │
├────┼────┼────┼────┤
10 │ 0 │ 0 │ 1 │ 0 │
└────┴────┴────┴────┘
Groupements :
- Groupe 1 (4 cases) : /A·/C (cases 00,01,11 lignes 00,01)
- Groupe 2 (4 cases) : C·D (colonne 11)
Équation simplifiee : F = /A·/C + C·D
Exercice 2 : Afficheur 7 segments
Concevoir le decodeur BCD → segment 'a' (segment superieur)
Segment 'a' allume pour : 0,2,3,5,6,7,8,9
BCD: D C B A | a
0 0 0 0 | 1 (0)
0 0 0 1 | 0 (1)
0 0 1 0 | 1 (2)
0 0 1 1 | 1 (3)
0 1 0 0 | 0 (4)
0 1 0 1 | 1 (5)
0 1 1 0 | 1 (6)
0 1 1 1 | 1 (7)
1 0 0 0 | 1 (8)
1 0 0 1 | 1 (9)
À simplifier avec Karnaugh...
TP2 : Compteurs et Registres
Circuits sequentiels avec bascules
Exercice 1 : Compteur modulo 6
Compteur 0-1-2-3-4-5-0... (modulo 6)
États : 000 → 001 → 010 → 011 → 100 → 101 → (reset) 000
Detection de 110 (6) : Q2·Q1·/Q0 → RESET
Avec 74LS93 (compteur 4 bits) :
- Connecter Q1·Q2 a RESET (detection de 6)
- Sortie : Q0 Q1 Q2 (3 bits)
Chronogramme :
CLK ─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─
└─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘
Q0 ───┐ ┌───┐ ┌───┐ ┌─────
└───┘ └───┘ └───┘
Q1 ───────┐ ┌───────┐
└───────┘ └─────
Q2 ───────────────┐ ┌─────
└───────┘
État 0 1 2 3 4 5 0
Exercice 2 : Registre a decalage 8 bits
Registre SIPO (74HC595) - Serie → Parallele
Donnees serie : D = 10110010 (0xB2)
Apres 8 coups d'horloge :
Q7 Q6 Q5 Q4 Q3 Q2 Q1 Q0
1 0 1 1 0 0 1 0
Chronogramme d'entree :
CLK ─┐┌┐┌┐┌┐┌┐┌┐┌┐┌┐┌─
DATA ─┘└┘└──┘└┘└─┘└──┘─
bit: 0 1 0 0 1 1 0 1
(LSB first)
TP3 : Introduction VHDL
Description materielle et simulation
Exercice 1 : Porte logique en VHDL
-- TP3 : Porte ET en VHDL library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity porte_et is Port ( A : in STD_LOGIC; B : in STD_LOGIC; S : out STD_LOGIC ); end porte_et; architecture Behavioral of porte_et is begin S <= A and B; end Behavioral;
Exercice 2 : Bascule D en VHDL
-- Bascule D avec reset asynchrone library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity bascule_d is Port ( CLK : in STD_LOGIC; RST : in STD_LOGIC; D : in STD_LOGIC; Q : out STD_LOGIC ); end bascule_d; architecture Behavioral of bascule_d is begin process(CLK, RST) begin if RST = '1' then Q <= '0'; elsif rising_edge(CLK) then Q <= D; end if; end process; end Behavioral;
Exercice 3 : Compteur 4 bits en VHDL
-- Compteur 4 bits avec enable library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity compteur_4bits is Port ( CLK : in STD_LOGIC; RST : in STD_LOGIC; EN : in STD_LOGIC; Q : out STD_LOGIC_VECTOR(3 downto 0) ); end compteur_4bits; architecture Behavioral of compteur_4bits is signal cnt : STD_LOGIC_VECTOR(3 downto 0) := "0000"; begin process(CLK, RST) begin if RST = '1' then cnt <= "0000"; elsif rising_edge(CLK) then if EN = '1' then cnt <= cnt + 1; end if; end if; end process; Q <= cnt; end Behavioral;
Criteres d'evaluation
| Critere | Points |
|---|---|
| TP1 : Karnaugh + circuit implemente | /6 |
| TP2 : Compteurs + chronogrammes | /6 |
| TP3 : Code VHDL + simulation | /8 |
| Total | /20 |