💻
⌨️
🖱️
🖥️
💾
← Back to Dashboard
Font Size:

1. Introduction

A number system is a way of writing numbers using a fixed set of symbols called digits. Humans normally use the decimal number system, which has ten digits from 0 to 9, because we have ten fingers. However, a computer cannot count with fingers. It works with electricity, and an electric circuit can be in only two states — on or off. That is why a computer uses the binary number system, which has only two digits, 0 and 1. Besides decimal and binary, there are two other important number systems used in computing: the octal number system with eight digits and the hexadecimal number system with sixteen digits.

2. The Decimal Number System

The decimal number system is also called the base-10 system because it uses ten digits, 0 to 9, and its base is 10. The position of a digit in a decimal number decides its place value. In the number 345, the digit 5 is in the units place, 4 is in the tens place, and 3 is in the hundreds place, so 345 means 3 hundreds plus 4 tens plus 5 ones. Mathematically, 345 = 3 x 100 + 4 x 10 + 5 x 1. Each place value is a power of 10: 10 to the power 0 is 1, 10 to the power 1 is 10, 10 to the power 2 is 100 and so on.

3. The Binary Number System

The binary number system is also called the base-2 system because it uses only two digits, 0 and 1, and its base is 2. Each 0 or 1 in a binary number is called a bit, and a group of 8 bits is called a byte. In a binary number, every place value is a power of 2: the units place is 2 to the power 0 which is 1, the next place is 2 to the power 1 which is 2, then 4, 8, 16, 32 and so on. For example, the binary number 1101 means 1 x 8 + 1 x 4 + 0 x 2 + 1 x 1, which equals 13 in decimal.

4. The Octal Number System

The octal number system is called the base-8 system because it uses eight digits from 0 to 7, and its base is 8. Digits 8 and 9 are never used in octal numbers. Each place value is a power of 8: 1, 8, 64, 512 and so on. For example, the octal number 17 means 1 x 8 + 7 x 1, which equals 15 in decimal. The octal system is used by computer programmers as a compact way of writing binary numbers, because one octal digit represents exactly three bits.

5. The Hexadecimal Number System

The hexadecimal number system is called the base-16 system because it uses sixteen digits: 0 to 9 for the values zero to nine, and the letters A, B, C, D, E and F for the values ten to fifteen. Each place value is a power of 16: 1, 16, 256 and so on. For example, the hexadecimal number 2A means 2 x 16 + 10 x 1, which equals 42 in decimal. One hexadecimal digit represents exactly four bits, so hexadecimal is the shortest and most compact way to write binary numbers, and it is used to write memory addresses and colour codes.

6. Conversion Between Decimal and Binary

To convert a decimal number into binary, the number is divided repeatedly by 2, and the remainders are collected. The remainder of the last division becomes the first digit, and the remainders are read from bottom to top. For example, to convert 13 to binary: 13 divided by 2 gives remainder 1, 6 divided by 2 gives remainder 0, 3 divided by 2 gives remainder 1, and 1 divided by 2 gives remainder 1, so reading upward gives 1101. To convert binary back to decimal, multiply each digit by its place value and add: 1101 = 1 x 8 + 1 x 4 + 0 x 2 + 1 x 1 = 13.

7. Conversion Among Octal and Hexadecimal

Decimal to octal is converted by repeatedly dividing by 8 and reading the remainders from bottom to top. Decimal to hexadecimal is converted by repeatedly dividing by 16 and reading the remainders from bottom to top, writing letters A to F for remainders 10 to 15. The easiest way to convert between binary and octal is to group the binary digits into groups of three, starting from the right, and replace each group with its octal digit. Similarly, binary to hexadecimal is done by grouping the binary digits into groups of four and replacing each group with its hexadecimal digit.

8. Why Computers Use Binary

Computers use binary because they are made of electronic circuits that can easily represent two states. A switch that is off represents 0 and a switch that is on represents 1. Data inside the computer travels as electric pulses, a low voltage meaning 0 and a high voltage meaning 1. This two-state system is simple, reliable and cheap to build. Storage devices such as hard disks also store data as magnetic patterns of two kinds. This is why every character, number, picture and sound inside the computer is ultimately stored as a long series of 0s and 1s.

Quick Revision Tables

Table 1: The Four Number Systems

Number System Base Digits Used Used By
Decimal 10 0 to 9 Humans for everyday counting
Binary 2 0 and 1 Computer internal processing
Octal 8 0 to 7 Compact writing of binary
Hexadecimal 16 0-9 and A-F Memory addresses and colours

Table 2: Place Values and Examples

Number System Place Values Example Decimal Value
Binary 1, 2, 4, 8, 16 1101 13
Octal 1, 8, 64, 512 17 15
Hexadecimal 1, 16, 256 2A 42
Decimal 1, 10, 100 345 345

Mind Map

graph TD A["Number Systems"] --> B["Decimal Base 10"] A --> C["Binary Base 2"] A --> D["Octal Base 8"] A --> E["Hexadecimal Base 16"] C --> C1["Used by computers"] C --> C2["Only digits 0 and 1"] D --> D1["Group of 3 bits"] E --> E1["Group of 4 bits"] C --> F["Convert by division and place value"]

Important Diagrams (SVG)

Diagram 1: Place Values in Binary

Binary Number 1101 1 1 0 1 8s place 4s place 2s place 1s place = 8 = 4 = 0 = 1 8 + 4 + 0 + 1 = 13 in Decimal Multiply each bit by its place value and add them together 1 bit = 0 or 1 Smallest unit 1 byte = 8 bits Holds one character 1000 bytes = 1 KB Kilobyte Golden Rule: Binary place values from the right are 1, 2, 4, 8, 16 — powers of two. Multiply each bit by its place value and add to get the decimal number.

Diagram 2: Decimal to Binary Conversion of 13

Converting 13 (Decimal) to Binary 2 | 13 remainder 1 2 | 6 remainder 0 2 | 3 remainder 1 2 | 1 remainder 1 | 0 STOP Read Remainders Bottom to Top 1101 Binary answer 13 decimal = 1101 binary Divide by 2 again and again until the quotient becomes 0. The last remainder is the first digit of the binary number. Golden Rule: To convert decimal to binary, keep dividing by 2 and read the remainders upwards. To convert binary to decimal, multiply each bit by its place value and add.

Common Mistakes

  1. Writing digits 8 and 9 inside a binary number. Binary can contain only 0 and 1.
  2. Reading binary digits from left to right after division. Remainders must be read from bottom to top.
  3. Forgetting that the units place has a value of 1, which is 2 to the power 0.
  4. Confusing octal and hexadecimal. Octal uses digits 0-7 and base 8; hexadecimal uses 0-9 and A-F and base 16.
  5. Writing the hexadecimal digit G. The letters used are only A, B, C, D, E and F.
  6. Using base 8 grouping for hexadecimal. Binary to octal uses groups of three, while binary to hexadecimal uses groups of four.
  7. Calling a bit a byte. A bit is a single 0 or 1; a byte is a group of 8 bits.
  8. Forgetting to convert remainders 10 to 15 into letters while converting decimal to hexadecimal.

Exam Tips

  1. Always state the base of each system: decimal is base 10, binary is base 2, octal is base 8, hexadecimal is base 16.
  2. Show the full division steps when converting decimal to binary; partial marks are given for correct steps.
  3. Memorise the first few binary place values: 1, 2, 4, 8, 16, 32, 64, 128.
  4. For conversion questions, always check the answer by converting back using place values.
  5. Learn that 1 nibble is 4 bits and 1 byte is 8 bits; this helps in hexadecimal grouping.
  6. Practise converting the same number through all four systems to build speed and confidence.
  7. Write "A=10, B=11, C=12, D=13, E=14, F=15" before starting any hexadecimal conversion.

Conclusion

Number systems are the language of computing. Humans count in decimal, but computers store every value in binary using only 0 and 1. Octal and hexadecimal systems help us write long binary numbers in a short and readable form. With conversion skills between these four systems, we understand how data is stored inside the machine. Next, we explore the operating system, which is the master program that manages the whole computer and all the files created by these systems.