Systemes Numeriques (SIN) - Semestre 1
PART A - Presentation Generale du Cours
Contexte de la formation
Les systemes numeriques sont au coeur de tous les equipements electroniques modernes : ordinateurs, smartphones, systemes embarques, automatismes industriels. Ce module introduit les fondements de la logique digitale et de la conception de circuits numeriques, competences indispensables pour tout technicien ou ingenieur en GEII. La maitrise du VHDL (langage de description materiel) permet de concevoir des systemes numeriques complexes sur FPGA.
Positionnement dans le cursus
- Semestre : S1 (1ere annee DUT GEII)
- Volume horaire : 65h (25h CM + 20h TD + 20h TP)
- Credits ECTS : 6
- Prerequis : Connaissances de base en mathematiques (binaire, booleen)
- Continuite : Logique Sequentielle (S2), Architectures Numeriques Avancees (S3-S4)
Public vise
Etudiants de premiere annee DUT GEII decouvrant la conception de circuits numeriques depuis les bases (portes logiques) jusqu'a la programmation FPGA en VHDL.
PART B: EXPERIENCE, CONTEXTE ET FONCTION
Objectifs pedagogiques
Competences en logique numerique :
- Maitriser les systemes de numeration et les conversions
- Comprendre et appliquer l'algebre de Boole
- Concevoir des circuits combinatoires et sequentiels
- Simplifier des fonctions logiques
Competences en VHDL et FPGA :
- Ecrire du code VHDL pour decrire des circuits
- Simuler et valider des designs numeriques
- Synthetiser et programmer des FPGA
- Utiliser l'environnement Quartus Prime (Intel/Altera)
Competences transversales :
- Analyser un probleme et le traduire en circuit logique
- Tester et deboguer des systemes numeriques
- Documenter ses conceptions
Programme detaille
1. Systemes de numeration (8h)
Bases numeriques :
Binaire (base 2) :
- Chiffres : 0, 1
- Exemple : 1011₂ = 1x2³ + 0x2² + 1x2¹ + 1x2⁰ = 11₁₀
Octal (base 8) :
- Chiffres : 0-7
- Utilise historiquement, moins courant aujourd'hui
- Conversion facile : 3 bits binaires = 1 chiffre octal
Hexadecimal (base 16) :
- Chiffres : 0-9, A-F (A=10, B=11, ..., F=15)
- Tres utilise en informatique (adresses memoire, couleurs RGB)
- Conversion : 4 bits binaires = 1 chiffre hexadecimal
- Exemple : 0xA3 = 10100011₂ = 163₁₀
Conversions entre bases :
Decimal → Binaire (divisions successives) :
45₁₀ → Binaire ?
45 / 2 = 22 reste 1 (bit de poids faible)
22 / 2 = 11 reste 0
11 / 2 = 5 reste 1
5 / 2 = 2 reste 1
2 / 2 = 1 reste 0
1 / 2 = 0 reste 1 (bit de poids fort)
Resultat : 101101₂
Binaire → Hexadecimal (groupes de 4 bits) :
11010110₂ = 1101 0110 = D6₁₆
Codes numeriques :
BCD (Binary Coded Decimal) :
- Chaque chiffre decimal code sur 4 bits
- Exemple : 95₁₀ = 1001 0101 (BCD) ≠ 1011111₂ (binaire pur)
- Utilise dans les afficheurs 7 segments
Code Gray :
- Un seul bit change entre deux valeurs consecutives
- Reduit les erreurs lors de transitions
- Utilise dans les encodeurs rotatifs
| Decimal | Binaire | Gray |
|---|---|---|
| 0 | 000 | 000 |
| 1 | 001 | 001 |
| 2 | 010 | 011 |
| 3 | 011 | 010 |
| 4 | 100 | 110 |
Code ASCII :
- 7 bits pour coder les caracteres (lettres, chiffres, symboles)
- Exemple : 'A' = 65₁₀ = 01000001₂
Arithmetique binaire :
Addition binaire :
1011 (11)
+ 0110 (6)
-------
10001 (17)
Regles : 0+0=0, 0+1=1, 1+1=10 (retenue)
Soustraction binaire (complement a 2) :
A - B = A + (-B)
-B = complement a 1 de B + 1
Exemple : 7 - 3
7 = 0111
3 = 0011 → Complement a 1 : 1100 → +1 : 1101 (-3)
0111 + 1101 = 10100 → on garde les 4 bits de poids faible : 0100 = 4
Representation des nombres signes :
- Signe + valeur absolue : 1 bit de signe + valeur
- Complement a 1 : inverser tous les bits
- Complement a 2 (le plus utilise) : complement a 1 + 1
Sur n bits, plage : -2^(n-1) a 2^(n-1)-1
Exemple sur 8 bits : -128 a +127
2. Algebre de Boole et logique combinatoire (15h)
Portes logiques fondamentales :
| Porte | Symbole | Equation | Table de verite (A, B → S) |
|---|---|---|---|
| NOT (inverseur) | ¬A ou A' | S = NOT A | 0→1, 1→0 |
| AND (ET) | A ∧ B | S = A AND B | 00→0, 01→0, 10→0, 11→1 |
| OR (OU) | A ∨ B | S = A OR B | 00→0, 01→1, 10→1, 11→1 |
| NAND (NON-ET) | A ↑ B | S = NOT (A AND B) | 00→1, 01→1, 10→1, 11→0 |
| NOR (NON-OU) | A ↓ B | S = NOT (A OR B) | 00→1, 01→0, 10→0, 11→0 |
| XOR (OU exclusif) | A ⊕ B | S = A XOR B | 00→0, 01→1, 10→1, 11→0 |
| XNOR | A ⊙ B | S = NOT (A XOR B) | 00→1, 01→0, 10→0, 11→1 |
Proprietes de l'algebre de Boole :
- Commutativite : A AND B = B AND A
- Associativite : (A AND B) AND C = A AND (B AND C)
- Distributivite : A AND (B OR C) = (A AND B) OR (A AND C)
- Element neutre : A AND 1 = A ; A OR 0 = A
- Element absorbant : A AND 0 = 0 ; A OR 1 = 1
- Idempotence : A AND A = A ; A OR A = A
- Lois de Morgan :
- NOT (A AND B) = (NOT A) OR (NOT B)
- NOT (A OR B) = (NOT A) AND (NOT B)
Fonctions logiques et tables de verite :
Exemple : Fonction S = (A AND B) OR (NOT C)
| A | B | C | NOT C | A AND B | S |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 0 | 1 |
| 0 | 0 | 1 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 | 0 | 1 |
| 0 | 1 | 1 | 0 | 0 | 0 |
| 1 | 0 | 0 | 1 | 0 | 1 |
| 1 | 0 | 1 | 0 | 0 | 0 |
| 1 | 1 | 0 | 1 | 1 | 1 |
| 1 | 1 | 1 | 0 | 1 | 1 |
Formes canoniques :
- Somme de produits (SOP / minterms) : S = ABC' + A'B'C + ...
- Produit de sommes (POS / maxterms) : S = (A+B+C')(A'+B'+C)...
Simplification par tableaux de Karnaugh :
Tableau de Karnaugh pour 3 variables (A, B, C) :
C' C
+----+----+
AB' | 0 | 1 |
+----+----+
A'B'| 2 | 3 |
+----+----+
A'B | 6 | 7 |
+----+----+
AB | 4 | 5 |
+----+----+
Methode :
- Remplir le tableau avec les valeurs de sortie
- Regrouper les '1' adjacents par puissances de 2 (1, 2, 4, 8...)
- Extraire les termes simplifies
Circuits combinatoires usuels :
Demi-additionneur (Half Adder) :
- Entrees : A, B
- Sorties : Somme = A XOR B ; Retenue = A AND B
Additionneur complet (Full Adder) :
- Entrees : A, B, Cin (retenue entrante)
- Sorties : Somme = A XOR B XOR Cin ; Cout = (A AND B) OR (Cin AND (A XOR B))
Multiplexeur (MUX) :
- Selectionne une entree parmi plusieurs selon des signaux de selection
- MUX 4:1 → 4 entrees, 2 bits de selection, 1 sortie
Demultiplexeur (DEMUX) :
- Inverse du MUX : 1 entree vers n sorties
Decodeur :
- Convertit un code binaire en activation d'une sortie
- Decodeur 3:8 → 3 entrees, 8 sorties (une seule active a la fois)
Encodeur :
- Inverse du decodeur : plusieurs entrees → code binaire
Comparateur :
- Compare deux nombres binaires
- Sorties : A>B, A=B, A<B
3. Logique sequentielle (12h)
Difference combinatoire/sequentiel :
- Combinatoire : Sortie = f(Entrees actuelles)
- Sequentiel : Sortie = f(Entrees + Etat precedent)
- Notion de memoire
- Depend du temps (horloge)
Bascules (Flip-Flops) :
Bascule RS (Reset-Set) :
- 2 entrees : R (Reset), S (Set)
- 2 sorties : Q, Q'
- Etats : Set (Q=1), Reset (Q=0), Memoire, Interdit (R=S=1)
Bascule D (Data) :
- 1 entree : D
- Sur front d'horloge : Q ← D
- La plus utilisee (memorisation simple)
Bascule JK :
- 2 entrees : J, K
- J=K=0 : Memoire
- J=1, K=0 : Set
- J=0, K=1 : Reset
- J=K=1 : Toggle (Q ← NOT Q)
Bascule T (Toggle) :
- 1 entree : T
- Si T=1 : toggle a chaque front d'horloge
Registres :
- Registre parallele : n bascules D pour stocker n bits simultanement
- Registre a decalage : Les bits se decalent a chaque coup d'horloge
- SISO (Serial In Serial Out)
- SIPO (Serial In Parallel Out)
- PISO (Parallel In Serial Out)
- PIPO (Parallel In Parallel Out)
Compteurs :
Compteur asynchrone :
- Les bascules ne partagent pas la meme horloge
- Temps de propagation cumulatif
- Simple mais lent
Compteur synchrone :
- Toutes les bascules sur la meme horloge
- Plus rapide, prefere en pratique
- Compteur binaire, BCD, modulo-N
Machines a etats finis (FSM) :
Types :
- Moore : Sorties dependent uniquement de l'etat
- Mealy : Sorties dependent de l'etat ET des entrees
Diagramme d'etats :
+------+ E=1 +------+
| S0 |------>| S1 |
+------+ +------+
^ |
+--------------+
E=0
Etapes de conception :
- Diagramme d'etats
- Table de transition
- Codage des etats (binaire)
- Equations des bascules et sorties
- Implementation (schema ou VHDL)
4. Introduction au VHDL (20h)
VHDL = VHSIC Hardware Description Language
- Langage de description materiel (pas de programmation sequentielle classique)
- Decrit la structure et le comportement de circuits numeriques
- Synthetisable sur FPGA ou ASIC
Structure d'un code VHDL :
-- Bibliotheques
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
-- Entite (interface externe)
entity PorteAND is
Port (
A : in STD_LOGIC;
B : in STD_LOGIC;
S : out STD_LOGIC
);
end PorteAND;
-- Architecture (comportement interne)
architecture Behavioral of PorteAND is
begin
S <= A AND B;
end Behavioral;
Types de donnees :
- STD_LOGIC : '0', '1', 'Z' (haute impedance), 'X' (inconnu)
- STD_LOGIC_VECTOR : Bus de plusieurs bits
- Exemple :
signal bus : STD_LOGIC_VECTOR(7 downto 0);
- Exemple :
- INTEGER : Nombres entiers
- BOOLEAN : TRUE, FALSE
Operateurs :
- Logiques : AND, OR, NOT, NAND, NOR, XOR, XNOR
- Arithmetiques : +, -, *, / (necessite
use IEEE.NUMERIC_STD.ALL;) - Comparaison : =, /=, <, >, <=, >=
- Concatenation : &
Affectations :
- Signal :
<=(affectation concurrente, hors process) - Variable :
:=(affectation sequentielle, dans process)
Processus (PROCESS) :
process(clk, reset) -- Liste de sensibilite
begin
if reset = '1' then
compteur <= 0;
elsif rising_edge(clk) then -- Front montant d'horloge
compteur <= compteur + 1;
end if;
end process;
Structures de controle :
IF-THEN-ELSE :
if (condition) then
-- instructions
elsif (autre_condition) then
-- instructions
else
-- instructions
end if;
CASE :
case sel is
when "00" => sortie <= entree0;
when "01" => sortie <= entree1;
when "10" => sortie <= entree2;
when others => sortie <= entree3;
end case;
FOR LOOP :
for i in 0 to 7 loop
sortie(i) <= entree(7-i); -- Inversion de bus
end loop;
Exemple complet : Compteur 8 bits
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
entity Compteur8bits is
Port (
clk : in STD_LOGIC;
reset : in STD_LOGIC;
enable : in STD_LOGIC;
count : out STD_LOGIC_VECTOR(7 downto 0)
);
end Compteur8bits;
architecture Behavioral of Compteur8bits is
signal compteur : unsigned(7 downto 0) := (others => '0');
begin
process(clk, reset)
begin
if reset = '1' then
compteur <= (others => '0');
elsif rising_edge(clk) then
if enable = '1' then
compteur <= compteur + 1;
end if;
end if;
end process;
count <= std_logic_vector(compteur);
end Behavioral;
Travaux pratiques
TP1 : Prise en main de Quartus Prime
- Installation et configuration
- Creation d'un projet
- Saisie schematique (portes logiques)
- Compilation et analyse
- Assignement des pins (carte FPGA)
- Programmation du FPGA
TP2 : Circuits combinatoires
- Decodeur BCD vers 7 segments
- Multiplexeur 4:1
- Additionneur 4 bits
- Tests et validation
TP3 : Introduction VHDL
- Portes logiques en VHDL
- Multiplexeur en VHDL
- Simulation avec ModelSim
- Synthese et programmation
TP4 : Logique sequentielle
- Bascules D et JK
- Registres a decalage
- Compteurs (up, down, modulo)
- Diviseur de frequence
TP5 : Machine a etats finis
- Conception d'une FSM (feu tricolore, distributeur, etc.)
- Implementation en VHDL
- Tests sur FPGA
- Validation fonctionnelle
PART C: ASPECTS TECHNIQUES
Outils de conception
Intel Quartus Prime
Installation :
- Version Lite (gratuite) : Jusqu'a 32k elements logiques
- Compatible Windows/Linux
- Telechargement : ~5-6 GB
Workflow de conception :
- Creation projet : File → New Project Wizard
- Ajout fichiers : .vhd, .v, ou schema
- Compilation : Processing → Start Compilation (Ctrl+L)
- Analyse : Compilation Report (ressources, timing, etc.)
- Assignement pins : Assignments → Pin Planner
- Programmation : Tools → Programmer
Analyses disponibles :
- RTL Viewer : Visualisation schema synthetise
- Technology Map Viewer : Mapping sur elements FPGA
- Timing Analyzer : Analyse des chemins critiques
- Resource Usage : LUTs, registres, memoire utilises
ModelSim (Simulation)
Fonctionnalites :
- Simulation comportementale (avant synthese)
- Simulation post-synthese (avec delais reels)
- Waveform viewer (chronogrammes)
- Testbenches VHDL
Exemple de testbench :
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity Compteur_TB is
end Compteur_TB;
architecture Behavioral of Compteur_TB is
component Compteur8bits
Port (clk, reset, enable : in STD_LOGIC;
count : out STD_LOGIC_VECTOR(7 downto 0));
end component;
signal clk_tb, reset_tb, enable_tb : STD_LOGIC := '0';
signal count_tb : STD_LOGIC_VECTOR(7 downto 0);
constant clk_period : time := 10 ns;
begin
UUT: Compteur8bits port map(clk_tb, reset_tb, enable_tb, count_tb);
-- Generation horloge
clk_process : process
begin
clk_tb <= '0';
wait for clk_period/2;
clk_tb <= '1';
wait for clk_period/2;
end process;
-- Stimulus
stim_proc: process
begin
reset_tb <= '1';
wait for 20 ns;
reset_tb <= '0';
enable_tb <= '1';
wait for 1000 ns;
enable_tb <= '0';
wait;
end process;
end Behavioral;
Cartes FPGA utilisees
Altera/Intel Cyclone IV/V
Caracteristiques :
- 6K - 115K elements logiques
- Memoire embarquee (M9K blocks)
- PLL (Phase-Locked Loops) pour gestion horloges
- DSP blocks (multiplieurs materiels)
- GPIO configurable (LVTTL, LVCMOS, LVDS)
Cartes de developpement :
- DE0-Nano : Cyclone IV, compacte, ~80€
- DE1-SoC : Cyclone V + ARM Cortex-A9, ~200€
- DE2-115 : Cyclone IV, nombreux peripheriques, ~300€
Peripheriques typiques :
- LEDs, boutons poussoirs, switches
- Afficheurs 7 segments
- VGA/HDMI
- GPIO (connecteurs d'extension)
- USB, Ethernet (selon modele)
Methodologie de conception
Bonnes pratiques VHDL
Nommage :
- Signaux/variables : lowercase_avec_underscores
- Constantes : UPPERCASE
- Entites/architectures : CamelCase
Commentaires :
-- Commentaire ligne simple
--======================
-- Bloc de commentaire
--======================
Conception synchrone :
- Toujours utiliser une horloge unique si possible
- Eviter les logiques asynchrones complexes
- Reinitialiser les signaux (reset)
Testabilite :
- Creer des testbenches systematiquement
- Tester les cas limites
- Verifier le timing (setup/hold)
Debogage
Erreurs de compilation courantes :
Signal not declared→ Oublie de declarer le signalMultiple drivers→ Signal assigne a plusieurs endroitsType mismatch→ Conversion de type necessaire (std_logic_vector ↔ unsigned)
Outils de debogage :
- SignalTap II (Quartus) : Analyseur logique interne au FPGA
- Simulation : Toujours simuler avant de synthetiser
- LEDs de debug : Afficher des etats internes
PART D: ANALYSE ET REFLEXION
Evaluation des competences
Modalites d'evaluation
Controle continu (40%) :
- QCM theoriques (2x1h) : Algebre de Boole, logique sequentielle - 20%
- Tests pratiques Quartus (2x1h30) - 20%
Travaux pratiques (35%) :
- 5 TP notes avec rapports
- Evaluation : montage fonctionnel, code VHDL, tests, documentation
Projet (15%) :
- Mini-projet VHDL (machine a etats + compteur + affichage)
- Demo sur carte FPGA
- Code source commente
- Rapport technique
Examen terminal (10%) :
- Epreuve theorique (1h30)
- Tableaux de Karnaugh, chronogrammes, VHDL
Grille d'evaluation TP
| Critere | Points |
|---|---|
| Fonctionnalite : Circuit fonctionne sur FPGA | /6 |
| Code VHDL : Qualite, clarte, commentaires | /5 |
| Simulation : Testbench et chronogrammes | /4 |
| Tests : Validation complete | /3 |
| Rapport : Clarte, schemas, analyses | /2 |
| Total | /20 |
Competences acquises
Savoirs theoriques
- Maitriser l'algebre de Boole et les systemes de numeration
- Comprendre la logique combinatoire et sequentielle
- Connaitre les circuits numeriques fondamentaux
- Comprendre les principes des FPGA
Savoir-faire techniques
- Concevoir des circuits numeriques (combinatoires et sequentiels)
- Simplifier des fonctions logiques (Karnaugh)
- Programmer en VHDL
- Simuler et valider des designs numeriques
- Synthetiser et programmer des FPGA avec Quartus
- Deboguer des circuits numeriques
Savoir-etre
- Rigueur dans la conception (chronogrammes, timing)
- Methodologie de test et validation
- Documentation technique claire
- Travail en equipe sur projets
Progression et liens avec le cursus
Suite du parcours Systemes Numeriques
| Semestre | Module | Contenu |
|---|---|---|
| S1 | SIN 1 | Logique combinatoire, sequentielle, VHDL de base |
| S2 | Logique Sequentielle | FSM avancees, FIFO, memoires, bus |
| S3 | Architectures Numeriques Avancees | Processeurs, pipelines, VHDL avance |
| S4 | Projet FPGA | Conception systeme complet (SoC) |
Liens avec les autres matieres
| Matiere | Utilisation des systemes numeriques |
|---|---|
| Programmation | Similarites algorithmes/FSM |
| Informatique Embarquee | Microcontroleurs (logique interne) |
| Electronique | Interface analogique/numerique (ADC, DAC) |
| Automatique | Controleurs numeriques, regulateurs discrets |
| Telecommunications | Modulation/demodulation numerique |
Indicateurs de reussite
Statistiques
Taux de reussite : 88%
Moyenne generale : 12.8/20
Difficultes frequentes :
- Confusion entre logique combinatoire et sequentielle
- Oubli de la liste de sensibilite dans les process
- Conversions de types en VHDL
- Timing (setup/hold violations)
- Simplification par Karnaugh (regroupements)
Cles de reussite :
- Dessiner les chronogrammes avant de coder
- Toujours simuler avant de synthetiser
- Commencer simple, complexifier progressivement
- Utiliser les exemples de code fournis
- Tester sur carte FPGA regulierement
Debouches et applications
Applications professionnelles
Metiers utilisant les FPGA/VHDL :
- Ingenieur FPGA (aeronautique, spatial, defense)
- Concepteur de circuits ASIC
- Ingenieur en traitement du signal numerique
- Developpeur systemes embarques critiques
- Architecte materiel (hardware architect)
Industries :
- Aeronautique/Spatial : Systemes critiques, resistance radiations
- Telecommunications : Modems, routeurs, 5G
- Automobile : ADAS, controle moteur
- Medical : Imagerie (echographie, IRM), appareils de diagnostic
- Finance : Trading haute frequence (FPGA pour latence ultra-faible)
- IA : Accelerateurs materiels (inference neuronale)
Ressources complementaires
Ouvrages de reference
Logique numerique :
- Systemes logiques - Tome 1 et 2 - A. Vachoux (PPUR) - Reference francophone
- Digital Design - M. Morris Mano (Pearson) - Classique mondial
- Circuits numeriques et synthese logique - Jacques Weber (Eyrolles)
VHDL :
- VHDL - Du langage a la modelisation - Jacques Weber (Dunod)
- Free Range VHDL - Bryan Mealy (gratuit en ligne)
- VHDL for Engineers - Kenneth L. Short (Pearson)
Sites web et tutoriels
Cours en ligne :
- VHDL Whiz (vhdlwhiz.com) - Tutoriels video gratuits
- Nandland (nandland.com) - Projets FPGA pour debutants
- FPGA4Fun (fpga4fun.com) - Nombreux exemples VHDL
Forums et communautes :
- Reddit : r/FPGA
- EDAboard : Forum specialise FPGA/VHDL
- Stack Overflow : Tag [vhdl]
Simulateurs en ligne :
- CircuitVerse (circuitverse.org) - Logique digitale interactive
- EDA Playground (edaplayground.com) - Simulation VHDL en ligne
Logiciels libres alternatifs
- GHDL : Simulateur VHDL open source
- GTKWave : Visualisateur de formes d'ondes
- Icarus Verilog : Si vous voulez apprendre Verilog aussi
Conseils methodologiques
Pour reussir en systemes numeriques
Pendant les cours/TD :
- Dessiner les circuits au fur et a mesure
- Refaire les simplifications de Karnaugh chez soi
- Comprendre les chronogrammes (temps = horizontal)
En TP :
- Lire le sujet entierement avant de commencer
- Concevoir sur papier avant de coder
- Simuler systematiquement avant de programmer le FPGA
- Sauvegarder frequemment son projet
- Tester progressivement (fonction par fonction)
Travail personnel (2-3h/semaine) :
- Refaire les exercices de simplification
- Creer ses propres petits circuits en VHDL
- Regarder des tutoriels video (Nandland, VHDL Whiz)
- Pratiquer les conversions de bases
Erreurs a eviter
- Oublier
rising_edge(clk)dans les process synchrones - Melanger affectations
<=et:= - Negliger les types (STD_LOGIC vs INTEGER vs UNSIGNED)
- Creer des boucles combinatoires (A depend de A)
- Ne pas tester les cas limites (reset, overflow, etc.)
Bonnes pratiques :
- Toujours declarer un signal de reset
- Utiliser des noms de signaux explicites
- Commenter son code VHDL
- Verifier le Resource Usage apres compilation
- Documenter ses montages avec schemas
Bon courage dans la decouverte passionnante des systemes numeriques !
"In theory, theory and practice are the same. In practice, they are not." - Yogi Berra
En systemes numeriques, la simulation et les tests sur materiel reel sont essentiels. N'hesitez pas a experimenter sur les cartes FPGA !
- Programmation : Structures de controle et algorithmique
- ER (Electronique et Realisation) : Interface analogique/numerique
- Mathematiques : Algebre de Boole
Ressources complementaires
- Documentation Intel Quartus
- Tutoriels VHDL
- Datasheets des composants FPGA
Digital Systems (SIN) - Semester 1
PART A - General Course Overview
Training Context
Digital systems are at the heart of all modern electronic equipment: computers, smartphones, embedded systems, and industrial automation. This module introduces the foundations of digital logic and digital circuit design, essential skills for any GEII technician or engineer. Mastering VHDL (hardware description language) enables the design of complex digital systems on FPGAs.
Position in the Curriculum
- Semester: S1 (1st year DUT GEII)
- Course hours: 65h (25h lectures + 20h tutorials + 20h lab sessions)
- ECTS credits: 6
- Prerequisites: Basic mathematics knowledge (binary, Boolean)
- Continuation: Sequential Logic (S2), Advanced Digital Architectures (S3-S4)
Target Audience
First-year DUT GEII students discovering digital circuit design from the basics (logic gates) to FPGA programming in VHDL.
PART B: EXPERIENCE, CONTEXT AND FUNCTION
Learning Objectives
Digital logic skills:
- Master number systems and conversions
- Understand and apply Boolean algebra
- Design combinational and sequential circuits
- Simplify logic functions
VHDL and FPGA skills:
- Write VHDL code to describe circuits
- Simulate and validate digital designs
- Synthesize and program FPGAs
- Use the Quartus Prime environment (Intel/Altera)
Cross-cutting skills:
- Analyze a problem and translate it into a logic circuit
- Test and debug digital systems
- Document designs
Detailed Syllabus
1. Number Systems (8h)
Number bases:
Binary (base 2):
- Digits: 0, 1
- Example: 1011₂ = 1x2³ + 0x2² + 1x2¹ + 1x2⁰ = 11₁₀
Octal (base 8):
- Digits: 0-7
- Historically used, less common today
- Easy conversion: 3 binary bits = 1 octal digit
Hexadecimal (base 16):
- Digits: 0-9, A-F (A=10, B=11, ..., F=15)
- Widely used in computing (memory addresses, RGB colors)
- Conversion: 4 binary bits = 1 hexadecimal digit
- Example: 0xA3 = 10100011₂ = 163₁₀
Base conversions:
Decimal → Binary (successive divisions):
45₁₀ → Binary?
45 / 2 = 22 remainder 1 (least significant bit)
22 / 2 = 11 remainder 0
11 / 2 = 5 remainder 1
5 / 2 = 2 remainder 1
2 / 2 = 1 remainder 0
1 / 2 = 0 remainder 1 (most significant bit)
Result: 101101₂
Binary → Hexadecimal (groups of 4 bits):
11010110₂ = 1101 0110 = D6₁₆
Digital codes:
BCD (Binary Coded Decimal):
- Each decimal digit encoded on 4 bits
- Example: 95₁₀ = 1001 0101 (BCD) ≠ 1011111₂ (pure binary)
- Used in 7-segment displays
Gray Code:
- Only one bit changes between two consecutive values
- Reduces errors during transitions
- Used in rotary encoders
| Decimal | Binary | Gray |
|---|---|---|
| 0 | 000 | 000 |
| 1 | 001 | 001 |
| 2 | 010 | 011 |
| 3 | 011 | 010 |
| 4 | 100 | 110 |
ASCII Code:
- 7 bits to encode characters (letters, digits, symbols)
- Example: 'A' = 65₁₀ = 01000001₂
Binary arithmetic:
Binary addition:
1011 (11)
+ 0110 (6)
-------
10001 (17)
Rules: 0+0=0, 0+1=1, 1+1=10 (carry)
Binary subtraction (two's complement):
A - B = A + (-B)
-B = one's complement of B + 1
Example: 7 - 3
7 = 0111
3 = 0011 → One's complement: 1100 → +1: 1101 (-3)
0111 + 1101 = 10100 → keep the 4 least significant bits: 0100 = 4
Signed number representation:
- Sign + absolute value: 1 sign bit + value
- One's complement: invert all bits
- Two's complement (most commonly used): one's complement + 1
On n bits, range: -2^(n-1) to 2^(n-1)-1
Example on 8 bits: -128 to +127
2. Boolean Algebra and Combinational Logic (15h)
Fundamental logic gates:
| Gate | Symbol | Equation | Truth Table (A, B → S) |
|---|---|---|---|
| NOT (inverter) | ¬A or A' | S = NOT A | 0→1, 1→0 |
| AND | A ∧ B | S = A AND B | 00→0, 01→0, 10→0, 11→1 |
| OR | A ∨ B | S = A OR B | 00→0, 01→1, 10→1, 11→1 |
| NAND | A ↑ B | S = NOT (A AND B) | 00→1, 01→1, 10→1, 11→0 |
| NOR | A ↓ B | S = NOT (A OR B) | 00→1, 01→0, 10→0, 11→0 |
| XOR (exclusive OR) | A ⊕ B | S = A XOR B | 00→0, 01→1, 10→1, 11→0 |
| XNOR | A ⊙ B | S = NOT (A XOR B) | 00→1, 01→0, 10→0, 11→1 |
Boolean algebra properties:
- Commutativity: A AND B = B AND A
- Associativity: (A AND B) AND C = A AND (B AND C)
- Distributivity: A AND (B OR C) = (A AND B) OR (A AND C)
- Identity element: A AND 1 = A ; A OR 0 = A
- Annihilator: A AND 0 = 0 ; A OR 1 = 1
- Idempotence: A AND A = A ; A OR A = A
- De Morgan's laws:
- NOT (A AND B) = (NOT A) OR (NOT B)
- NOT (A OR B) = (NOT A) AND (NOT B)
Logic functions and truth tables:
Example: Function S = (A AND B) OR (NOT C)
| A | B | C | NOT C | A AND B | S |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 0 | 1 |
| 0 | 0 | 1 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 | 0 | 1 |
| 0 | 1 | 1 | 0 | 0 | 0 |
| 1 | 0 | 0 | 1 | 0 | 1 |
| 1 | 0 | 1 | 0 | 0 | 0 |
| 1 | 1 | 0 | 1 | 1 | 1 |
| 1 | 1 | 1 | 0 | 1 | 1 |
Canonical forms:
- Sum of Products (SOP / minterms): S = ABC' + A'B'C + ...
- Product of Sums (POS / maxterms): S = (A+B+C')(A'+B'+C)...
Simplification using Karnaugh maps:
Karnaugh map for 3 variables (A, B, C):
C' C
+----+----+
AB' | 0 | 1 |
+----+----+
A'B'| 2 | 3 |
+----+----+
A'B | 6 | 7 |
+----+----+
AB | 4 | 5 |
+----+----+
Method:
- Fill the table with output values
- Group adjacent '1's by powers of 2 (1, 2, 4, 8...)
- Extract the simplified terms
Common combinational circuits:
Half Adder:
- Inputs: A, B
- Outputs: Sum = A XOR B ; Carry = A AND B
Full Adder:
- Inputs: A, B, Cin (carry in)
- Outputs: Sum = A XOR B XOR Cin ; Cout = (A AND B) OR (Cin AND (A XOR B))
Multiplexer (MUX):
- Selects one input among several according to selection signals
- MUX 4:1 → 4 inputs, 2 selection bits, 1 output
Demultiplexer (DEMUX):
- Inverse of MUX: 1 input to n outputs
Decoder:
- Converts a binary code to activation of one output
- Decoder 3:8 → 3 inputs, 8 outputs (only one active at a time)
Encoder:
- Inverse of decoder: multiple inputs → binary code
Comparator:
- Compares two binary numbers
- Outputs: A>B, A=B, A<B
3. Sequential Logic (12h)
Combinational vs. sequential difference:
- Combinational: Output = f(Current inputs)
- Sequential: Output = f(Inputs + Previous state)
- Memory concept
- Depends on time (clock)
Flip-Flops:
RS Flip-Flop (Reset-Set):
- 2 inputs: R (Reset), S (Set)
- 2 outputs: Q, Q'
- States: Set (Q=1), Reset (Q=0), Memory, Forbidden (R=S=1)
D Flip-Flop (Data):
- 1 input: D
- On clock edge: Q ← D
- The most commonly used (simple storage)
JK Flip-Flop:
- 2 inputs: J, K
- J=K=0: Memory
- J=1, K=0: Set
- J=0, K=1: Reset
- J=K=1: Toggle (Q ← NOT Q)
T Flip-Flop (Toggle):
- 1 input: T
- If T=1: toggles on each clock edge
Registers:
- Parallel register: n D flip-flops to store n bits simultaneously
- Shift register: Bits shift on each clock cycle
- SISO (Serial In Serial Out)
- SIPO (Serial In Parallel Out)
- PISO (Parallel In Serial Out)
- PIPO (Parallel In Parallel Out)
Counters:
Asynchronous counter:
- Flip-flops do not share the same clock
- Cumulative propagation delay
- Simple but slow
Synchronous counter:
- All flip-flops on the same clock
- Faster, preferred in practice
- Binary counter, BCD, modulo-N
Finite State Machines (FSM):
Types:
- Moore: Outputs depend only on the state
- Mealy: Outputs depend on the state AND the inputs
State diagram:
+------+ E=1 +------+
| S0 |------>| S1 |
+------+ +------+
^ |
+--------------+
E=0
Design steps:
- State diagram
- Transition table
- State encoding (binary)
- Flip-flop and output equations
- Implementation (schematic or VHDL)
4. Introduction to VHDL (20h)
VHDL = VHSIC Hardware Description Language
- Hardware description language (not classical sequential programming)
- Describes the structure and behavior of digital circuits
- Synthesizable on FPGA or ASIC
VHDL code structure:
-- Libraries
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
-- Entity (external interface)
entity PorteAND is
Port (
A : in STD_LOGIC;
B : in STD_LOGIC;
S : out STD_LOGIC
);
end PorteAND;
-- Architecture (internal behavior)
architecture Behavioral of PorteAND is
begin
S <= A AND B;
end Behavioral;
Data types:
- STD_LOGIC: '0', '1', 'Z' (high impedance), 'X' (unknown)
- STD_LOGIC_VECTOR: Multi-bit bus
- Example:
signal bus : STD_LOGIC_VECTOR(7 downto 0);
- Example:
- INTEGER: Integer numbers
- BOOLEAN: TRUE, FALSE
Operators:
- Logic: AND, OR, NOT, NAND, NOR, XOR, XNOR
- Arithmetic: +, -, *, / (requires
use IEEE.NUMERIC_STD.ALL;) - Comparison: =, /=, <, >, <=, >=
- Concatenation: &
Assignments:
- Signal:
<=(concurrent assignment, outside process) - Variable:
:=(sequential assignment, inside process)
Process (PROCESS):
process(clk, reset) -- Sensitivity list
begin
if reset = '1' then
counter <= 0;
elsif rising_edge(clk) then -- Rising clock edge
counter <= counter + 1;
end if;
end process;
Control structures:
IF-THEN-ELSE:
if (condition) then
-- instructions
elsif (other_condition) then
-- instructions
else
-- instructions
end if;
CASE:
case sel is
when "00" => output <= input0;
when "01" => output <= input1;
when "10" => output <= input2;
when others => output <= input3;
end case;
FOR LOOP:
for i in 0 to 7 loop
output(i) <= input(7-i); -- Bus inversion
end loop;
Complete example: 8-bit Counter
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
entity Counter8bits is
Port (
clk : in STD_LOGIC;
reset : in STD_LOGIC;
enable : in STD_LOGIC;
count : out STD_LOGIC_VECTOR(7 downto 0)
);
end Counter8bits;
architecture Behavioral of Counter8bits is
signal counter : unsigned(7 downto 0) := (others => '0');
begin
process(clk, reset)
begin
if reset = '1' then
counter <= (others => '0');
elsif rising_edge(clk) then
if enable = '1' then
counter <= counter + 1;
end if;
end if;
end process;
count <= std_logic_vector(counter);
end Behavioral;
Lab Sessions
Lab 1: Getting Started with Quartus Prime
- Installation and configuration
- Creating a project
- Schematic entry (logic gates)
- Compilation and analysis
- Pin assignment (FPGA board)
- FPGA programming
Lab 2: Combinational Circuits
- BCD to 7-segment decoder
- 4:1 Multiplexer
- 4-bit adder
- Testing and validation
Lab 3: Introduction to VHDL
- Logic gates in VHDL
- Multiplexer in VHDL
- Simulation with ModelSim
- Synthesis and programming
Lab 4: Sequential Logic
- D and JK flip-flops
- Shift registers
- Counters (up, down, modulo)
- Frequency divider
Lab 5: Finite State Machine
- FSM design (traffic light, vending machine, etc.)
- VHDL implementation
- FPGA testing
- Functional validation
PART C: TECHNICAL ASPECTS
Design Tools
Intel Quartus Prime
Installation:
- Lite version (free): Up to 32k logic elements
- Windows/Linux compatible
- Download: ~5-6 GB
Design workflow:
- Project creation: File → New Project Wizard
- Add files: .vhd, .v, or schematic
- Compilation: Processing → Start Compilation (Ctrl+L)
- Analysis: Compilation Report (resources, timing, etc.)
- Pin assignment: Assignments → Pin Planner
- Programming: Tools → Programmer
Available analyses:
- RTL Viewer: Synthesized schematic visualization
- Technology Map Viewer: Mapping onto FPGA elements
- Timing Analyzer: Critical path analysis
- Resource Usage: LUTs, registers, memory used
ModelSim (Simulation)
Features:
- Behavioral simulation (before synthesis)
- Post-synthesis simulation (with real delays)
- Waveform viewer (timing diagrams)
- VHDL testbenches
Testbench example:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity Counter_TB is
end Counter_TB;
architecture Behavioral of Counter_TB is
component Counter8bits
Port (clk, reset, enable : in STD_LOGIC;
count : out STD_LOGIC_VECTOR(7 downto 0));
end component;
signal clk_tb, reset_tb, enable_tb : STD_LOGIC := '0';
signal count_tb : STD_LOGIC_VECTOR(7 downto 0);
constant clk_period : time := 10 ns;
begin
UUT: Counter8bits port map(clk_tb, reset_tb, enable_tb, count_tb);
-- Clock generation
clk_process : process
begin
clk_tb <= '0';
wait for clk_period/2;
clk_tb <= '1';
wait for clk_period/2;
end process;
-- Stimulus
stim_proc: process
begin
reset_tb <= '1';
wait for 20 ns;
reset_tb <= '0';
enable_tb <= '1';
wait for 1000 ns;
enable_tb <= '0';
wait;
end process;
end Behavioral;
FPGA Boards Used
Altera/Intel Cyclone IV/V
Characteristics:
- 6K - 115K logic elements
- Embedded memory (M9K blocks)
- PLL (Phase-Locked Loops) for clock management
- DSP blocks (hardware multipliers)
- Configurable GPIO (LVTTL, LVCMOS, LVDS)
Development boards:
- DE0-Nano: Cyclone IV, compact, ~80€
- DE1-SoC: Cyclone V + ARM Cortex-A9, ~200€
- DE2-115: Cyclone IV, numerous peripherals, ~300€
Typical peripherals:
- LEDs, push buttons, switches
- 7-segment displays
- VGA/HDMI
- GPIO (expansion connectors)
- USB, Ethernet (depending on model)
Design Methodology
VHDL Best Practices
Naming:
- Signals/variables: lowercase_with_underscores
- Constants: UPPERCASE
- Entities/architectures: CamelCase
Comments:
-- Single line comment
--======================
-- Comment block
--======================
Synchronous design:
- Always use a single clock if possible
- Avoid complex asynchronous logic
- Reset signals properly
Testability:
- Systematically create testbenches
- Test edge cases
- Verify timing (setup/hold)
Debugging
Common compilation errors:
Signal not declared→ Forgot to declare the signalMultiple drivers→ Signal assigned in multiple placesType mismatch→ Type conversion needed (std_logic_vector ↔ unsigned)
Debugging tools:
- SignalTap II (Quartus): Internal FPGA logic analyzer
- Simulation: Always simulate before synthesizing
- Debug LEDs: Display internal states
PART D: ANALYSIS AND REFLECTION
Skills Assessment
Assessment Methods
Continuous assessment (40%):
- Theoretical quizzes (2x1h): Boolean algebra, sequential logic - 20%
- Practical Quartus tests (2x1h30) - 20%
Lab work (35%):
- 5 graded labs with reports
- Assessment: working circuit, VHDL code, tests, documentation
Project (15%):
- VHDL mini-project (state machine + counter + display)
- Demo on FPGA board
- Commented source code
- Technical report
Final exam (10%):
- Theoretical exam (1h30)
- Karnaugh maps, timing diagrams, VHDL
Lab Grading Rubric
| Criterion | Points |
|---|---|
| Functionality: Circuit works on FPGA | /6 |
| VHDL Code: Quality, clarity, comments | /5 |
| Simulation: Testbench and timing diagrams | /4 |
| Tests: Complete validation | /3 |
| Report: Clarity, diagrams, analysis | /2 |
| Total | /20 |
Skills Acquired
Theoretical Knowledge
- Master Boolean algebra and number systems
- Understand combinational and sequential logic
- Know fundamental digital circuits
- Understand FPGA principles
Technical Know-How
- Design digital circuits (combinational and sequential)
- Simplify logic functions (Karnaugh)
- Program in VHDL
- Simulate and validate digital designs
- Synthesize and program FPGAs with Quartus
- Debug digital circuits
Soft Skills
- Rigor in design (timing diagrams, timing)
- Test and validation methodology
- Clear technical documentation
- Teamwork on projects
Progression and Curriculum Links
Digital Systems Curriculum Path
| Semester | Module | Content |
|---|---|---|
| S1 | SIN 1 | Combinational logic, sequential logic, basic VHDL |
| S2 | Sequential Logic | Advanced FSMs, FIFO, memories, buses |
| S3 | Advanced Digital Architectures | Processors, pipelines, advanced VHDL |
| S4 | FPGA Project | Complete system design (SoC) |
Links with Other Subjects
| Subject | Use of Digital Systems |
|---|---|
| Programming | Algorithm/FSM similarities |
| Embedded Computing | Microcontrollers (internal logic) |
| Electronics | Analog/digital interface (ADC, DAC) |
| Control Systems | Digital controllers, discrete regulators |
| Telecommunications | Digital modulation/demodulation |
Success Indicators
Statistics
Pass rate: 88%
Overall average: 12.8/20
Common difficulties:
- Confusion between combinational and sequential logic
- Forgetting the sensitivity list in processes
- Type conversions in VHDL
- Timing (setup/hold violations)
- Karnaugh simplification (groupings)
Keys to success:
- Draw timing diagrams before coding
- Always simulate before synthesizing
- Start simple, increase complexity gradually
- Use the provided code examples
- Test on FPGA board regularly
Career Opportunities and Applications
Professional Applications
Careers using FPGA/VHDL:
- FPGA engineer (aerospace, space, defense)
- ASIC circuit designer
- Digital signal processing engineer
- Critical embedded systems developer
- Hardware architect
Industries:
- Aerospace/Space: Critical systems, radiation resistance
- Telecommunications: Modems, routers, 5G
- Automotive: ADAS, engine control
- Medical: Imaging (ultrasound, MRI), diagnostic devices
- Finance: High-frequency trading (FPGA for ultra-low latency)
- AI: Hardware accelerators (neural inference)
Additional Resources
Reference Books
Digital logic:
- Systemes logiques - Tome 1 et 2 - A. Vachoux (PPUR) - French-language reference
- Digital Design - M. Morris Mano (Pearson) - World classic
- Circuits numeriques et synthese logique - Jacques Weber (Eyrolles)
VHDL:
- VHDL - Du langage a la modelisation - Jacques Weber (Dunod)
- Free Range VHDL - Bryan Mealy (free online)
- VHDL for Engineers - Kenneth L. Short (Pearson)
Websites and Tutorials
Online courses:
- VHDL Whiz (vhdlwhiz.com) - Free video tutorials
- Nandland (nandland.com) - FPGA projects for beginners
- FPGA4Fun (fpga4fun.com) - Numerous VHDL examples
Forums and communities:
- Reddit: r/FPGA
- EDAboard: Specialized FPGA/VHDL forum
- Stack Overflow: Tag [vhdl]
Online simulators:
- CircuitVerse (circuitverse.org) - Interactive digital logic
- EDA Playground (edaplayground.com) - Online VHDL simulation
Alternative Open Source Software
- GHDL: Open source VHDL simulator
- GTKWave: Waveform viewer
- Icarus Verilog: If you also want to learn Verilog
Methodological Advice
How to Succeed in Digital Systems
During lectures/tutorials:
- Draw circuits as you go
- Redo Karnaugh simplifications at home
- Understand timing diagrams (time = horizontal)
In lab sessions:
- Read the entire assignment before starting
- Design on paper before coding
- Systematically simulate before programming the FPGA
- Save your project frequently
- Test progressively (function by function)
Personal work (2-3h/week):
- Redo simplification exercises
- Create your own small VHDL circuits
- Watch video tutorials (Nandland, VHDL Whiz)
- Practice base conversions
Mistakes to Avoid
- Forgetting
rising_edge(clk)in synchronous processes - Mixing
<=and:=assignments - Neglecting types (STD_LOGIC vs INTEGER vs UNSIGNED)
- Creating combinational loops (A depends on A)
- Not testing edge cases (reset, overflow, etc.)
Best practices:
- Always declare a reset signal
- Use explicit signal names
- Comment your VHDL code
- Check Resource Usage after compilation
- Document your circuits with diagrams
Good luck discovering the fascinating world of digital systems!
"In theory, theory and practice are the same. In practice, they are not." - Yogi Berra
In digital systems, simulation and real hardware testing are essential. Don't hesitate to experiment on FPGA boards!
- Programming: Control structures and algorithms
- ER (Electronics and Implementation): Analog/digital interface
- Mathematics: Boolean algebra
Additional Resources
- Intel Quartus documentation
- VHDL tutorials
- FPGA component datasheets