To perform calculations and process information, people have created different number systems. Let’s learn the basic number systems commonly used in computers.

**1. What is the number system?**

Number system is a set of symbols (digit, letter) to represent numbers. Each number system consists of a finite set of digits. The number of digits of each number system is called “**base**” or “**radix**”.

The basic number systems in computers are:

- Binary number system – base 2
- Octal number system – base 8
- Decimal number system – base 10
- Hexadecimal number system – base 16

**2. Binary number system (base 2)**

- Radix 2
- Represented by 2 digits: 0 and 1
- Binary numbers have the form: A
_{(2)}=a_{n}a_{n-1}a_{n-2}…a_{0.}a_{-1}a_{-2}…a_{-m} - The value of A in base 10 is calculated as follows: A
_{(10)}=a_{n}2^{n}+a_{n-1}2^{n-1}+a_{n-2}2^{n-2}+…+a_{0}2^{0}+a_{-1}2^{-1}+a_{-2}2^{-2}+…+a_{-m}2^{-m} - Example:
**101**_{(2)}= 1.2^{2}+ 0.2^{1}+ 1.2^{0}= 5_{(10)}

**3. Octal number system (base 8)**

- Radix 8
- Represented by 8 digits: 0, 1, 2, 3, 4, 5, 6, 7
- Octal numbers have the form: A
_{(8)}=a_{n}a_{n-1}a_{n-2}…a_{0.}a_{-1}a_{-2}…a_{–}_{m} - The value of A in base 10 is calculated as follows: A
_{(10)}=a_{n}8^{n}+a_{n-1}8^{n-1}+a_{n-2}8^{n-2}+…+a_{0}8^{0}+a_{-1}8^{-1}+a_{-2}8^{-2}+…+a_{-m}8^{-m} - Example:
**43**_{(8)}= 4.8^{1}+ 3.8^{0}= 35_{(10)}

**4. Decimal number system (base 10)**

- Radix 10
- Represented by 10 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
- Decimal numbers have the form: A
_{(10)}=a_{n}a_{n-1}a_{n-2}…a_{0.}a_{-1}a_{-2}…a_{-m} - The value of A in base 10 is calculated as follows: A
_{(10)}=a_{n}10^{n}+a_{n-1}10^{n-1}+a_{n-2}10^{n-2}+…+a_{0}10^{0}+a_{-1}10^{-1}+a_{-2}10^{-2}+…+a_{-m}10^{-m} - Example:
**536**_{(10)}= 5.10^{2}+ 3.10^{1}+ 6.10^{0}= 536_{(10)}

**5. Hexadecimal number system (base 16)**

- Radix 16
- Represented by 16 digits and letters: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F. In there, A
(equivalent) 10, B*⟺*11, C*⟺*12, D*⟺*13, E*⟺*14, F*⟺*15.*⟺* - Hexadecimal numbers have the form: A
_{(16)}=a_{n}a_{n-1}a_{n-2}…a_{0.}a_{-1}a_{-2}…a-_{m} - The value of A in base 10 is calculated as follows: A
_{(10)}=a_{n}16^{n}+a_{n-1}16^{n-1}+a_{n-2}16^{n-2}+…+a_{0}16^{0}+a_{-1}16^{-1}+a_{-2}16^{-2}+…+a_{-m}16^{-m} - Example:
**19**_{(16)}= 1.16^{1}+ 9.16^{0}= 25_{(10)}_{, }**1AB**_{(16)}= 1.16^{2}+ 10.16^{1}+ 11.16^{0 }= 427_{(10)}

**6. Conversion table between radix systems**

Binary | Octal | Decimal | Hexadecimal |
---|---|---|---|

0000 | 0 | 0 | 0 |

0001 | 1 | 1 | 1 |

0010 | 2 | 2 | 2 |

0011 | 3 | 3 | 3 |

0100 | 4 | 4 | 4 |

0101 | 5 | 5 | 5 |

0110 | 6 | 6 | 6 |

0111 | 7 | 7 | 7 |

1000 | 10 | 8 | 8 |

1001 | 11 | 9 | 9 |

1010 | 12 | 10 | A |

1011 | 13 | 11 | B |

1100 | 14 | 12 | C |

1101 | 15 | 13 | D |

1110 | 16 | 14 | E |

1111 | 17 | 15 | F |

**Read more:** Convert between basic numbering systems