Systèmes à Microprocesseurs Cycle Ingénieur Troisième Année Polytech’Nice Sophi

Systèmes à Microprocesseurs Cycle Ingénieur Troisième Année Polytech’Nice Sophia - Département Electronique - Université de Nice Sophia Antipolis - S. Bilavarn - 1 - Polytech Nice Sophia - Dpt Ingénierie des Systèmes Electroniques - Université Côte d’Azur - S. Bilavarn - 1 - Sébastien Bilavarn Cycle Ingénieur Troisième Année Organisation du module µP  12 cours (1h) + 6 TDs (2h)  http://users.polytech.unice.fr/~bilavarn/  login elec3, mdp nios2007  Cours, TDs, TPs, exercices complémentaires, bibliographie  TDs: environnement de développement (GCC ARM, Linux) Polytech’Nice Sophia - Département Electronique - Université de Nice Sophia Antipolis - S. Bilavarn - 2 - Polytech Nice Sophia - Dpt Ingénierie des Systèmes Electroniques - Université Côte d’Azur - S. Bilavarn - 2 -  Examen partiel (1h): mardi 24 mars  Examen final (2h): vendredi 15 mai  Final_CM_TD=(2*Exam_partiel+3*Exam_final)/5 COEF 5  5 séances TP notées (Compte rendus) + Examen TP  Final_TP=(MOY_CR_TP + 2*Exam_TP ) / 3 COEF 3 Plan  Ch1 – Représentation de l’information  Ch2 – ARM Instruction Set Architecture  Ch3 – Accès aux données  Ch4 – Programmation structurée  Ch5 – Cycle d’exécution Polytech’Nice Sophia - Département Electronique - Université de Nice Sophia Antipolis - S. Bilavarn - 3 - Polytech Nice Sophia - Dpt Ingénierie des Systèmes Electroniques - Université Côte d’Azur - S. Bilavarn - 3 -  Ch5 – Cycle d’exécution  Ch6 – Codage binaire  Ch7 – Microcontrôleur ARM Cortex-M Représentation de l’information Polytech’Nice Sophia - Département Electronique - Université de Nice Sophia Antipolis - S. Bilavarn - 4 - Polytech Nice Sophia - Dpt Ingénierie des Systèmes Electroniques - Université Côte d’Azur - S. Bilavarn - 4 -  Représentation de l’information  Opérations sur les données Représentation de l’information  Types de données de base  Nombres entiers (0, -23, 10, 6, 65635)  Nombres réels (0.3, -3.2, 5, 10e3)  Booléens (true, false)  Caractères (‘a’, ‘b’, ‘?’, ‘&’, ‘0’)  Systèmes de numération Polytech’Nice Sophia - Département Electronique - Université de Nice Sophia Antipolis - S. Bilavarn - 5 - Polytech Nice Sophia - Dpt Ingénierie des Systèmes Electroniques - Université Côte d’Azur - S. Bilavarn - 5 -  Systèmes de numération  Décimal: 0 … 9, décomposition en puissances de 10  Hexadécimal: 0 à 9 et A…F, décomposition en puissances de 16  Binaire: 0 ou 1, décomposition en puissances de 2  Décimal et hexadécimal sont utilisables pour l’être humain  La représentation binaire est utilisable par l’ordinateur Représentation de l’information  Mot binaire  Bit (Binary digit)  Quartet (nibble) 4 bits  Octet (byte) 8 bits  Terminologie utilisée sur les processeurs 32-bit (y compris ARM) Polytech’Nice Sophia - Département Electronique - Université de Nice Sophia Antipolis - S. Bilavarn - 6 - Polytech Nice Sophia - Dpt Ingénierie des Systèmes Electroniques - Université Côte d’Azur - S. Bilavarn - 6 - compris ARM)  Demi-mot (half-word) 16 bits  Mot (word) 32 bits  Double-mot (double word) 64 bits  /!\ la terminologie peut changer d’une famille à l’autre  Motorola, Intel  word 16 bits, long word 32 bits, quad word 64 bits Représentation des nombres entiers  Binaire pur sur n bits  Représentation des entiers entre 0 et 2n-1  Exemples (sur 8 bits): (00000000) = (0) Polytech’Nice Sophia - Département Electronique - Université de Nice Sophia Antipolis - S. Bilavarn - 7 - Polytech Nice Sophia - Dpt Ingénierie des Systèmes Electroniques - Université Côte d’Azur - S. Bilavarn - 7 -  (00000000)bin = (0)dec  (11111111)bin = (28-1)dec = (255)dec  (11001001)bin = 1x 27 + 1x 26 + 0x 25 + 0x 24 + 1x 23 + 0x 22 + 0x 21 + 1x 20 = (128 + 64 + 8 + 1 )dec = (201 )dec Représentation des nombres entiers  Vocabulaire  Bit de poids fort: bit le plus significatif (MSB, Most Significant Bit)  Bit de poids faible: bit le moins significatif (LSB, Least Significant Bit) Polytech’Nice Sophia - Département Electronique - Université de Nice Sophia Antipolis - S. Bilavarn - 8 - Polytech Nice Sophia - Dpt Ingénierie des Systèmes Electroniques - Université Côte d’Azur - S. Bilavarn - 8 - 1 0 0 1 1 1 0 0 0 0 0 0 1 1 1 1 0 7 8 15 Bit de poids fort Bit de poids faible Octet de poids fort Octet de poids faible Représentation des nombres entiers  Complément à deux sur n bits  Représentation des entiers compris entre -2n-1 et 2n-1-1  Conversion décimal vers complément à deux  Nombres positifs: correspondance directe avec le binaire pur  Nombres négatifs: convertir 2n + x en binaire pur. Polytech’Nice Sophia - Département Electronique - Université de Nice Sophia Antipolis - S. Bilavarn - 9 - Polytech Nice Sophia - Dpt Ingénierie des Systèmes Electroniques - Université Côte d’Azur - S. Bilavarn - 9 -  Méthode pour prendre l’opposé d’un nombre en complément à deux  Complémenter bit à bit  Puis ajouter 1 au résultat Représentation des nombres entiers  Complément à deux sur n bits  Exemples (sur 8 bits)  (10000000)bin = (-128)dec  (11111111)bin = (-1)dec  (00000000)bin = (0)dec  (01111111)bin = (127)dec Polytech’Nice Sophia - Département Electronique - Université de Nice Sophia Antipolis - S. Bilavarn - 10 - Polytech Nice Sophia - Dpt Ingénierie des Systèmes Electroniques - Université Côte d’Azur - S. Bilavarn - 10 - (01111111)bin = (127)dec  (5)dec = (00000101)bin  (-5)dec = (00000101)bin + 1 = (11111010)bin + 1 = (11111011)bin Représentation des nombres entiers 255 Décimal … 129 128 127 … 3 Binaire pur Complément à deux 11111111 … 10000001 10000000 01111111 … 00000011 01111111 … 00000011 Polytech’Nice Sophia - Département Electronique - Université de Nice Sophia Antipolis - S. Bilavarn - 11 - Polytech Nice Sophia - Dpt Ingénierie des Systèmes Electroniques - Université Côte d’Azur - S. Bilavarn - 11 - 3 2 1 0 -1 -2 -3 … -127 -128 00000011 00000010 00000001 00000000 00000011 00000010 00000001 00000000 11111111 11111110 11111101 … 10000001 10000000 Représentation des nombres entiers  Correspondance entre binaire et hexadécimal  Un chiffre hexadécimal pour 4 bits  Exemples:  (53)hex = (0101 0011)bin  (FF)hex = (1111 1111)bin  Nombres négatifs Polytech’Nice Sophia - Département Electronique - Université de Nice Sophia Antipolis - S. Bilavarn - 12 - Polytech Nice Sophia - Dpt Ingénierie des Systèmes Electroniques - Université Côte d’Azur - S. Bilavarn - 12 - Nombres négatifs  En décimal on fait figurer le signe –  En hexadécimal par convention, on traduit directement à partir du binaire  Exemple en complément à deux sur 8 bits  (-1)dec = (1111 1111)bin = (FF)hex Représentation des caractères  Le code ASCII  American Standard Code for Information Interchange  1 caractère = 1 octet  Exemples: Décimal Caractère Décimal Caractère Décimal Caractère Polytech’Nice Sophia - Département Electronique - Université de Nice Sophia Antipolis - S. Bilavarn - 13 - Polytech Nice Sophia - Dpt Ingénierie des Systèmes Electroniques - Université Côte d’Azur - S. Bilavarn - 13 - 32 ESPACE 33 ! 34 ‘’ 35 # 36 $ 37 % 38 & 39 ’ 40 ( 48 0 49 1 … … 57 9 … … 65 A 66 B … … 90 Z 91 [ 92 \ 63 ] … … 97 a 98 b … … 122 z Représentation des nombres réels  Le standard IEEE 754 (32-bit, simple précision) 0 22 E: Exposant (8 bits) (-1)S*(1 + M/223) * 2E-127 23 30 31 M: Mantisse (23 bits) S: Signe (1 bit) Polytech’Nice Sophia - Département Electronique - Université de Nice Sophia Antipolis - S. Bilavarn - 14 - Polytech Nice Sophia - Dpt Ingénierie des Systèmes Electroniques - Université Côte d’Azur - S. Bilavarn - 14 -  Le standard IEEE 754 (64-bit, double précision) 0 51 E: Exposant (11 bits) (-1)S*(1 + M/252) * 2E-1023 52 62 63 M: Mantisse (52 bits) S: Signe (1 bit) Représentation des nombres réels  Exemple: 01000100 01000001 01010100 01000101  Signe: 0 positif Polytech’Nice Sophia - Département Electronique - Université de Nice Sophia Antipolis - S. Bilavarn - 15 - Polytech Nice Sophia - Dpt Ingénierie des Systèmes Electroniques - Université Côte d’Azur - S. Bilavarn - 15 -  Exposant: 10001000 = (136)dec  Mantisse: 1000001 01010100 01000101 = (4281413)dec  Résultat: (1 + 4281413/223) * 2136-127 = = 1.5103842 * 29 = 773.31671 Représentation de l’information Polytech’Nice Sophia - Département Electronique - Université de Nice Sophia Antipolis - S. Bilavarn - 16 - Polytech Nice Sophia - Dpt Ingénierie des Systèmes Electroniques - Université Côte d’Azur - S. Bilavarn - 16 -  Représentation de l’information  Opérations sur les données Opérations arithmétiques  Addition n bits  Exemple 1 0 0 1 1 0 0 1 + 1 0 1 1 1 0 1 1 1 1 1 1 1 Polytech’Nice Sophia - Département Electronique - Université de uploads/Litterature/ ch1-representation.pdf

  • 20
  • 0
  • 0
Afficher les détails des licences
Licence et utilisation
Gratuit pour un usage personnel Attribution requise
Partager