Number Systems

Topics

  • Decimal
  • Binary
  • Conversion between decimal and binary
  • Other bases

Decimal

  • Or base-10 number
  • Usually used in normal life.
  • Each place has 10 posible numbers (0, 1, 2, ..., 9).
  • The weight of n-th place is
10^{n-1}
10n1

Example

231 = 2\cdot10^2 + 3\cdot10^1 + 1\cdot10^0
231=2102+3101+1100
= 2\cdot100 + 3\cdot10 + 1\cdot1
=2100+310+11
= 200 + 30 + 1
=200+30+1

binary

  • Or base-2 number
  • Usually used in digtal sytems (including digital computer).
  • Each place has 2 posible numbers (0 and 1).
  • The weight of n-th place is
2^{n-1}
2n1

Example

1101_2 = 1\cdot2^3 + 1\cdot2^2 + 0\cdot2^1 + 1\cdot2^0
11012=123+122+021+120
= 1\cdot8 + 1\cdot4 + 0\cdot2 + 1\cdot1
=18+14+02+11
= 8 + 4 + 0 + 1
=8+4+0+1

The Conversion

Decimal to binary

101100101_2
1011001012

The conversion

Binary to decimal

1101_2 = 1\cdot2^3 + 1\cdot2^2 + 0\cdot2^1 + 1\cdot2^0
11012=123+122+021+120
= 1\cdot8 + 1\cdot4 + 0\cdot2 + 1\cdot1
=18+14+02+11
= 8 + 4 + 0 + 1
=8+4+0+1
= 13
=13

Other bases

octal

  • Or base-8 number
  • Used represent base-2 number for short.
  • Each place has 8 posible numbers (0, 1, 2, ..., 7).
  • The weight of n-th place is
8^{n-1}
8n1

using octal to represent the binary

hexadecimal

  • Or base-16 number
  • Used represent base-2 number for short (shorter than octal).
  • Each place has 10 posible numbers (0, 1, 2, ..., 9) and 6 possible alphabets (A, B, C, ..., F)
  • The weight of n-th place is
16^{n-1}
16n1

using hexadecimal to represent binary

thanks

for your
Attention

Number Bases

By whcwhc78

Number Bases

  • 516