Le binaire

La numération binaire

Pour écrire un nombre en base 2 (binaire) il faut :

2 chiffres (ou graphismes) : 0 1,  c’est là aussi une convention. On aurait pu choisir n’importe quelle représentation (des carrés et des ronds …)

Définir la position des chiffres. Chaque position, en partant de la droite vers la gauche définie une puissance de 2 :

Exemple : 1100 0110 = 1x128 + 1x64 + 0x32 + 0x16 + 0x8 +1x4 +1x2 + 0x1 = 198

on notera : (1100 0110)2 = (198)10

Rang 7

Rang 6

Rang 5

Rang 4

Rang 3

Rang 2

Rang 1

Rang 0

27

26

25

24

23

22

21

20

128

64

32

16

8

4

2

1

1

1

0

0

0

1

1

0


  • Un chiffre binaire est appelé un bit (binary digit)
  • Celui le plus à droite est dit de poids faible ou le moins signifiant least significant bit = lsb
  • Celui le plus à gauche est dit de poids fort ou le plus signifiant Most Significant Bit = MSB
  • Un groupe de 8 bits est un octet (byte)


Pour un nombre binaire décimal (à virgule) il en est de même 

Exemple : 1011,0101 = 1x8 + 0x4 + 1x2 + 1x1 + 0x0,5 +1x0,25 + 0x0,125 + 1x0,0625 = 11,3125

on notera : (1011,0101)2 = (11,3125)10

Rang 3

Rang 2

Rang 1

Rang 0

Rang -1

Rang -2

Rang -3

Rang -4

23

22

21

20

2-1

2-2

2-3

2-4

8

4

2

1

0,5

0,25

0,125

0,0625

1

1

0

0

0

1

0

1


un nombre N en base 2 s'écrit donc de la façon suivante:


N = Ai x 2i + ... + A4 x 24 + A3 x 23 + A2 x 22 + A1 x 21 + A0 x 20 + A-1 x 2-1 + A-2 x 2-2 + A-3 x 2-3 + ...

                           avec:   Ai  = 0 ou 1

Créé avec HelpNDoc Personal Edition: Outil de création d'aide complet