Documente Academic
Documente Profesional
Documente Cultură
La reprsentation flottante permet la reprsentation de nombres trs petits ou trs grands en utilisant trs peu de digits au prix dune reprsentation avec une certaine prcision
IFT1215
IFT1215
Notation exponentielle
Reprsentations quivalentes dans la base 10 de 1,234
123,400.0 12,340.0 1,234.0 123.4 12.34 1.234 x 10-2 x 10-1 x 100 x 101 x 102 x 103 Le point dcimal flotte (ajustement appropri de lexposant). Signe de la mantisse
-0.9876 x 10-3
Position du point dcimal Mantisse
Exposant
0.1234 x 104
IFT1215 Introduction aux systmes informatiques IFT1215 Introduction aux systmes informatiques
Reprsentation normalise
Un nombre reprsent en virgule flottante est normalis sil est sous la forme:
0,M * Xc M un nombre dont le premier chiffre est non nul
Exemple:
+ 59,4151 * 10-5 => Normalis: +0,594151 * 10-3
IFT1215
Overflows / Underflows
De .00001 x 10-50 .99999 x 1049 1 x 10-55 .99999 x 1049
IFT1215
IFT1215
Format typique
IFT1215
IFT1215
Exemple:
10100000000000000000000 Mantisse: Reprsentation: 1.1012 = 1.62510
IFT1215 Introduction aux systmes informatiques
Reprsentez lexposant 1410 avec un excentrement 127: 12710 1410 Reprsentation = = = + 011111112 + 000011102 100011012
= = =
IFT1215
IFT1215
Exemple
Simple prcision
0 10000010 11000000000000000000000 1.112 = 1.7510 130 127 = 3 0 = mantisse positive
Rponse:
+1.75 23 = 14.0
IFT1215 Introduction aux systmes informatiques IFT1215 Introduction aux systmes informatiques
Solution
1 10000010 11110110000000000000000
En dcimal
130 - 127 = 3 1.11110110000000000000000000
Rponse: -15.6875
23 * 1.9609375
( negatif )
= 15.6875
- 15.6875
Introduction aux systmes informatiques
IFT1215
IFT1215
En dcimal
130 - 127 = 3 Dcalez Point
( negatif )
1.11110110000000000000000000 1111.10110000000000000000000
- 15.6875
IFT1215
IFT1215
Quelle est la reprsentation interne du nombre 3.1410? Remarque: utiliser seulement les 10 chiffres significatifs pour la mantisse Rponse:
0 10000000 10010001111000000000000
11.001000111101 1001000111101
10000000
0 10000000 10010001111010000000000
IFT1215 Introduction aux systmes informatiques IFT1215 Introduction aux systmes informatiques
IEEE-754
IEEE-754 dfinit deux reprsentations diffrentes pour chaque taille de mot
31
M2 M23
Reprsentation normalise
Le plus petit nombre reprsentable (simple): 2-126 Le plus grand nombre reprsentable (simple): 2128
IFT1215
Signe 1 bit (0 +; 1 -) Exposant 8 bits (excentrement-127) Mantisse 23 bits Format binaire Normalisation : 1.MMMM Bit cach
Introduction aux systmes informatiques IFT1215
IFT1215
IFT1215
Arithmtique en flottant
Oprandes 6.144 102 +9.975 104 Alignement 0.06144 104 +9.975 104 10.03644 104 Normaliser & arrondir 1.003644 105 + .0005 105 1.004 105
...
Jusqu' 31 digits
.99718 * .67000 = 0.6681106 51 + 49 = 100 et 100 50 = 50 .6681106 .66811 .66811 * 100 (comme 50 signifie e = 0)
Introduction aux systmes informatiques
Programmation
Calcul avec des entiers
Plus facile pour lordinateur Trs haute prcision ou mme sans perte de prcision Plus rapide (mois daccs mmoire, circuits logiques plus simples, etc.) Langage C: short (16 bits), long (32 bits)
Programmation
Calcul avec des flottants
Variable ou constante avec une partie fractionnaire Perte de prcision Moins rapide Langage C
simple prcision float Double prcision double
IFT1215
IFT1215