Activity: Number Systems & Binary Arithmetic

Conversions, arithmetic operations, and complement methods with interactive tools

Grade XI • Computer Science ⏱️ ~35 min
Part 1 Number System Conversions

Computers understand binary (base 2). Humans use decimal (base 10), octal (base 8), and hexadecimal (base 16). Understanding how to convert between these is fundamental to computer science.

Tool: Base Converter with Step-by-Step Working
Result and steps will appear here...
Task 1: Decimal to Binary (The Remainder Method)

To convert decimal to binary, we repeatedly divide by 2 and record the remainders from bottom to top.

  1. Divide the decimal number by 2.
  2. Write down the remainder (0 or 1).
  3. Repeat until the quotient is 0.
  4. Read remainders in reverse order (MSB to LSB).
Practice Problem: Convert 25₁₀ to Binary
    25 / 2 = 12 rem 1
    12 / 2 = 6 rem 0
    6 / 2 = 3 rem 0
    3 / 2 = 1 rem 1
    1 / 2 = 0 rem 1
    Result: 11001₂
Task 2: Binary to Decimal (Positional Weight)

Each bit in a binary number has a weight of 2ⁿ. Sum the weights of all '1' bits.

Bit1011
Weight2³=82²=42¹=22⁰=1
Value8021

Total: 8 + 0 + 2 + 1 = 11₁₀

Practice: What is 10101₂ in Decimal?
16 + 0 + 4 + 0 + 1 = 21₁₀
Task 3: Decimal to Octal (Base 8)

Similar to binary conversion, but divide by 8. Use the powers of 8 table for reference.

Power8⁰
Value5126481
Practice Problem: Convert 173₁₀ to Octal
    173 / 8 = 21 rem 5
    21 / 8 = 2 rem 5
    2 / 8 = 0 rem 2
    Result: 255₈
Task 4: Decimal to Hexadecimal (Base 16)

Divide by 16. Remember the mapping for remainders > 9:

10=A, 11=B, 12=C, 13=D, 14=E, 15=F

Practice Problem: Convert 450₁₀ to Hexadecimal
    450 / 16 = 28 rem 2
    28 / 16 = 1 rem 12 (C)
    1 / 16 = 0 rem 1
    Result: 1C2₁₆
Task 5: The Shortcut (Binary ↔ Octal/Hex)

Instead of going through decimal, use groupings:

Practice: Convert 111101₂ to Octal and Hex
    Octal: 111 | 101 = 75₈
    Hex: 0011 | 1101 = 3D₁₆
Task 6: Mixed Conversion Challenge

Test your ability to cross between multiple bases.

Challenge 1: (72)₈ = (?)₁₆
    Step 1: 72₈ to Binary = 111 010₂
    Step 2: 0011 1010₂ to Hex = 3A₁₆
Challenge 2: (A5)₁₆ = (?)₈
    Step 1: A5₁₆ to Binary = 1010 0101₂
    Step 2: 010 100 101₂ to Octal = 245₈
Part 2 Binary Arithmetic
Tool: Binary Arithmetic Calculator
Working steps will appear here...
Task 7: Binary Addition
Practice: 1011 + 1101
11000₂
Task 8: Binary Subtraction (Borrow Method)

When subtracting a larger bit from a smaller one (0-1), borrow 1 from the next higher column. The borrowed 1 acts as 2 in the current column (10 - 1 = 1).

Worked Example: 1001 - 110
   1001 (9)
-  0110 (6)
-------
   0011 (3)
Practice: 1010 - 11
0111₂ (10 - 3 = 7)
Task 9: Binary Multiplication

Similar to decimal multiplication. Multiply by each bit and sum the partial products.

Practice: 101 x 11
  101
x  11
-----
  101 (101 x 1)
+1010 (101 x 10)
-----
 1111 (15₁₀)
Task 10: Binary Division

Use the long division method. It's actually easier than decimal because you only compare if the divisor goes in 0 or 1 times.

Practice: 1100 / 11
    11 goes into 11 exactly 1 time.
    Result: 100₂ (12 / 3 = 4)
Part 3 Complements & Signed Numbers
Tool: 1's & 2's Complement Finder
Step-by-step complementation...
Task 11: 1's Complement Practice

Just flip every bit: 0 → 1 and 1 → 0.

Practice: Find 1's complement of 1100101
0011010
Task 12: Subtraction using 1's Complement

Add the 1's complement of the subtrahend. If a carry is generated, add it to the LSB (End-around carry).

Worked Example: 7 - 3 (using 4-bit)
    7 = 0111
    3 = 0011 → 1's comp = 1100
    Sum: 0111 + 1100 = (1)0011
    End-around carry: 0011 + 1 = 0100 (4₁₀)
Task 13: Subtraction using 2's Complement

Add the 2's complement. Discard the final carry for positive results.

Practice: 10 - 4 (using 8-bit)
    10 = 00001010
    4 = 00000100 → 2's comp = 11111100
    Sum: 00001010 + 11111100 = (1)00000110
    Discard carry: 00000110 (6₁₀)
Task 14: Signed 8-bit Representation

In signed 2's complement, the leftmost bit (MSB) is the sign bit (0 = positive, 1 = negative).

Practice: Represent -13 in 8-bit signed binary
    +13 = 00001101
    1's comp = 11110010
    2's comp = 11110011 (Result)

Mastered the numbers?

Test your speed and accuracy in the Number Systems Assessment.

Launch Assessment →