Number Systems for Computer Operator: Binary, Octal, Decimal and Hexadecimal Conversion

⏱ 4 min read

Number systems are a regular source of marks in the Computer Operator exam (Paper I job knowledge and Paper II). This note explains binary, octal, decimal and hexadecimal numbers, how to convert between them, binary arithmetic and how computers store data.

1. The four number systems

SystemBaseDigits usedExample
Binary20, 11011₂
Octal80–717₈
Decimal100–925₁₀
Hexadecimal160–9 and A–F (A=10 … F=15)1F₁₆

2. Decimal to binary

Divide the number by 2 again and again and write the remainders from bottom to top. Example: 13 ÷ 2 = 6 r1, 6 ÷ 2 = 3 r0, 3 ÷ 2 = 1 r1, 1 ÷ 2 = 0 r1 → 1101₂.

3. Binary to decimal

Multiply each bit by its place value (1, 2, 4, 8, 16 …) from the right and add. Example: 1011₂ = 8 + 0 + 2 + 1 = 11.

4. Binary ↔ octal and hexadecimal

  • Group binary digits in 3s from the right for octal: 101 110₂ = 56₈.
  • Group binary digits in 4s from the right for hexadecimal: 1010 1111₂ = AF₁₆.
  • Each hex digit equals 4 bits; each octal digit equals 3 bits.

5. Binary arithmetic rules

AdditionResult
0 + 00
0 + 11
1 + 110 (0 carry 1)
1 + 1 + 111 (1 carry 1)

6. Data units and codes

  • 1 bit = 0 or 1; 4 bits = 1 nibble; 8 bits = 1 byte.
  • 1 KB = 1024 bytes; 1 MB = 1024 KB; 1 GB = 1024 MB; 1 TB = 1024 GB.
  • ASCII uses 7 bits (128 characters); extended ASCII uses 8 bits.
  • Unicode supports characters of all languages, including Devanagari.
  • 1’s complement: flip all bits; 2’s complement: 1’s complement + 1 (used for negative numbers).

7. Quick reference: 0 to 15

Learn this table by heart. It makes every binary ↔ octal ↔ hexadecimal conversion fast, because each octal digit is a group of 3 bits and each hex digit is a group of 4 bits.

DecimalBinary (4 bits)OctalHex
0000000
1000111
2001022
3001133
4010044
5010155
6011066
7011177
81000108
91001119
10101012A
11101113B
12110014C
13110115D
14111016E
15111117F

8. Octal and hexadecimal to decimal

Multiply each digit by its place value and add. Place values are powers of the base: for octal 1, 8, 64, 512 …; for hexadecimal 1, 16, 256, 4096 … (counted from the right).

  • 157₈ = 1×64 + 5×8 + 7×1 = 64 + 40 + 7 = 111₁₀
  • 2B₁₆ = 2×16 + 11×1 = 32 + 11 = 43₁₀ (B = 11)
  • 1A3₁₆ = 1×256 + 10×16 + 3×1 = 256 + 160 + 3 = 419₁₀ (A = 10)

9. Decimal to octal and hexadecimal

Use the same repeated-division method as for binary, but divide by 8 (octal) or 16 (hexadecimal). Read the remainders from bottom to top.

  • 100 → octal: 100 ÷ 8 = 12 r4, 12 ÷ 8 = 1 r4, 1 ÷ 8 = 0 r1 → 144₈ (check: 64 + 32 + 4 = 100)
  • 250 → hex: 250 ÷ 16 = 15 r10, 15 ÷ 16 = 0 r15 → remainders 15 and 10 = F and A → FA₁₆ (check: 15×16 + 10 = 250)
  • Octal → hex: go through binary. 75₈ = 111 101 = 111101₂ = 0011 1101 = 3D₁₆ (both equal 61₁₀)

10. Fractions in binary

Binary fraction to decimal: place values after the point are ½, ¼, ⅛ … Example: 101.11₂ = 4 + 0 + 1 + 0.5 + 0.25 = 5.75₁₀.

Decimal fraction to binary: multiply the fraction by 2 again and again and write the whole-number parts from top to bottom. Example: 0.625 × 2 = 1.25 → 1; 0.25 × 2 = 0.5 → 0; 0.5 × 2 = 1.0 → 1 → 0.101₂. Some fractions never end: 0.1₁₀ = 0.000110011…₂ (the pattern 0011 repeats).

11. Binary subtraction, multiplication and 2’s complement

SubtractionResult
0 − 00
1 − 01
1 − 10
0 − 11 (borrow 1)
  • Addition example: 1011₂ + 0110₂ = 10001₂ (11 + 6 = 17)
  • Subtraction example: 1101₂ − 0110₂ = 0111₂ (13 − 6 = 7)
  • Multiplication rules: 0×0 = 0, 0×1 = 0, 1×1 = 1. Example: 101₂ × 11₂ = 1111₂ (5 × 3 = 15)
  • Subtraction by 2’s complement (4 bits), 7 − 5: 5 = 0101 → 1’s complement 1010 → 2’s complement 1011. Now 0111 + 1011 = 1 0010; drop the extra carry → 0010₂ = 2
  • −5 in 8-bit 2’s complement: 00000101 → 11111010 → 11111011

12. Ranges and BCD

  • With n bits (unsigned) you can store 0 to 2n − 1. 8 bits → 0 to 255.
  • In 2’s complement (signed), n bits store −2n−1 to 2n−1 − 1. 8 bits → −128 to +127.
  • BCD (Binary Coded Decimal) writes each decimal digit as its own 4-bit group: 59₁₀ = 0101 1001 (BCD), which is different from 59 in pure binary (111011₂).

13. Practice questions (answers below)

  1. Convert 45₁₀ to binary.
  2. Convert 110110₂ to decimal.
  3. Convert 11010111₂ to hexadecimal.
  4. Convert 63₈ to decimal.
  5. Convert C5₁₆ to decimal.
  6. Convert 200₁₀ to octal.
  7. Add 1110₂ + 1011₂.
  8. Find the 2’s complement of 01101100.
  9. How many bits are there in 2 KB?
  10. What is the largest unsigned number that fits in 6 bits?
Show answers
  1. 101101₂ (32 + 8 + 4 + 1)
  2. 54 (32 + 16 + 4 + 2)
  3. D7₁₆ (1101 = D, 0111 = 7)
  4. 51 (6×8 + 3)
  5. 197 (12×16 + 5)
  6. 310₈ (200 ÷ 8 = 25 r0, 25 ÷ 8 = 3 r1, 3 ÷ 8 = 0 r3)
  7. 11001₂ (14 + 11 = 25)
  8. 10010100 (flip → 10010011, then + 1)
  9. 16,384 bits (2 × 1024 × 8)
  10. 63 (26 − 1)

📌 Key points to remember

  • Binary base 2, octal base 8, decimal base 10, hexadecimal base 16.
  • Hex uses A–F for 10–15.
  • Decimal → binary: divide by 2, read remainders upward.
  • Binary → octal: groups of 3; binary → hex: groups of 4.
  • 1 + 1 = 10 in binary.
  • 8 bits = 1 byte; 1 KB = 1024 bytes.
📝 Quiz

Test yourself: Number Systems for Computer Operator

Practise The four number systems, Quick reference: 0 to 15 and Practice questions (answers below) with 50 questions. Each attempt picks 25 at random.

Loading quiz...

Leave a Comment

Your email address will not be published. Required fields are marked *

Loksewa Pathsala is an independent educational platform. It is not affiliated with the Public Service Commission (Lok Sewa Aayog) or the Government of Nepal. · लोक सेवा आयोगको आधिकारिक साइट होइन। · Sources & disclaimer
Scroll to Top