1.2 numération.ppt

Download Report

Transcript 1.2 numération.ppt

Représentation de
l’information
Laurent JEANPIERRE <[email protected]>
D’après le cours de Pascal FOUGERAY
IUT de CAEN – Campus 3
Département Informatique
Contenu du cours

Les systèmes de numération

La conversion

Les opérations arithmétiques

Les nombres négatifs
Département Informatique
2
Do you speak english?
Département Informatique
3
Les systèmes de numération
« Façon d’énoncer ou d’écrire les nombres »
 Séries hiérarchisées de symboles
 Plusieurs numérations :

Arabe : 0, 1, 2, 4, 5, 6, 7, 9, 10, 50, 100, 1000
 Romaine : I, II, IV, V, VI, VII, IX, X, L, C, M


Plusieurs bases par numération
Nombre de symboles différents utilisés.
 Ce cours : 4 bases différentes.

Département Informatique
4
Le système décimal

Base 10
dix chiffres
 01 234 5 6789

Nombres : composition de chiffres
 Exemple :

199510 (mille neuf cent quatre-vingt quinze)
 = 1*103 + 9*102 + 9*101 + 5*100
 = 1*1000 + 9*100 + 9*10 + 5*1

Département Informatique
5
Notation
Exemple : 199510
 Le rang :

1 : rang des milliers
 5 : rang des unités


Le poids :
1 : chiffre de poids fort
 5 : chiffre de poids faible

Département Informatique
6
Le système binaire

Base 2

chiffres 0 1
Le courant passe ou pas
 Exemple :

10112 = Onze
 = 1*23 + 0*22 +1*21 +1*20
 = 8+
2+
1
 = 1110

Département Informatique
7
Notations

Bit = « Binary digit »
= chiffre binaire

MSB = « Most significant bit »
= bit de poids fort

LSB = « Least significant bit »
= bit de poids faible
Département Informatique
8
Le problème du binaire

199510=111110010112

=3 7

= 7
1
C
3
B
= 37138 (octal)
= 7CB16 = 7CBh
(hexadécimal)
Département Informatique
9
Conversion
16
0
1
2
3
4
5
6
7
10
0
1
2
3
4
5
6
7
8
0
1
2
3
4
5
6
7
Bases
2
16
0
1
10
8
9
A
11
100
101
B
C
D
110
111
E
F
Département Informatique
10
8
9
10
11
12
13
14
15
8
10
11
12
13
14
15
16
17
2
1000
1001
1010
1011
1100
1101
1110
1111
10
L’arithmétique binaire

ADDITION



Aucun problème
1 + 1 = 102
102 + 112 = ?
= 1012
Département Informatique
1
10
+ 11
------------101
11
Les nombres négatifs
En décimal : -xxx
 Mais : Ordinateur  0/1 uniquement
  Réserver un bit



Convention la plus utilisée:
MSB = 0 : Positif
MSB = 1 : Négatif
Arithmétique ????
Département Informatique
12
Soustraction (fausse)
Addition avec l’opposé
 110 – 110 = 110 + (-1) 10
 = 000000012 + 100000012
 = 100000102
 = (-2) 10 !


000000012 + 1??????? = 000000002
Département Informatique
13
Le complément à 2
= Complément à 1 + 1
 = inversion des bits + 1


Exemple :
(-1)10 = 1 + compl(1)
 = 1 + compl(000000012)
 = 1 + 111111102
 = 111111112 = (-1)2

Département Informatique
14
L’arithmétique binaire

La soustraction


Addition avec l’opposé (complément à 2)
Exemple :
5 – 2 = 5 + (-2)
 = 01012 + (1 + compl(102))
 = 01012 + (1 + 11012)
Sur 4 bits
 = 01012 + 11102
 = 00112 = 3

Département Informatique
15
L’arithmétique binaire

Multiplication


Ce n’est qu’une suite d’additions
Division

Ce n’est qu’une suite de soustractions
Département Informatique
16
Les nouveaux (1998) multiples

1 kibi  2^{10}= 1 024 unités

1 mébi  2^{20}= 1024 * 1024 = 1 048 576 unités

1 gibi  2^{30}= 1024 * 1024 * 1024 = 1 073 741 824 unités

1 tebi  2^{40}= 1024 * 1024 * 1024 * 1024 = 1 099 511 627 776 unités

1 pebi  2^{50}= 1024 * etc… = 1 125 899 906 842 624 unités

1 exbi  2^{60}= 1024* etc...= 1 152 921 504 606 846 976 unités

1 zebi  2^{70}= 1024* etc...= 1 180 591 620 717 411 303 424 unités

1 yobi  2^{80}= 1024* etc...= 1 208 925 819 614 629 174 706 176 unités
Département Informatique
17
Capacités de stockage
© Wikipedia
Département Informatique
18