Back to Hub
STANDALONE ARCADE
⚡

BitMaster: Binary & Hex Trainer

Sharpen binary, hex, and two's complement mental conversion speed, advance through 12 Computing Architecture rank tiers, and conquer 21 stages across 6 core computing topics.

Binary and Hexadecimal Numbers.

Computers represent all data using binary transistor switches (0 and 1). Hexadecimal is used as compact shorthand where every hex digit represents exactly 4 binary bits (1 nibble).

8-Bit Binary Register

Toggle individual bits, step values, or switch encoding modes to see how denary and hex are represented in hardware.

Number Mode:
High Nibble (Bits 7 - 4) Hex: 0
128
0
MSB
64
0
Bit 6
32
0
Bit 5
16
0
Bit 4
Low Nibble (Bits 3 - 0) Hex: 0
8
0
Bit 3
4
0
Bit 2
2
0
Bit 1
1
0
LSB
Denary Value (Base 10)
0
0 = 0
Hexadecimal (Base 16)
00₁₆
Hexadecimal Shorthand (Base 16)
Binary String (8-bit)
0000 0000
1 Byte (8 bits)
Unsigned Binary Numbers (0 to 255)
Base 2

In unsigned binary, every bit represents a positive power of 2. The place values start at 1 on the far right (Least Significant Bit, LSB) and double with each step moving left: 1, 2, 4, 8, 16, 32, 64, 128.

128
2⁷
64
2⁶
32
2⁵
16
2⁴
8
2³
4
2²
2
2¹
1
2⁰ (LSB)
How to easily convert Binary to Denary (Decimal):
1. Write down the 8 place value headers: 128, 64, 32, 16, 8, 4, 2, 1.
2. Place your binary bits directly beneath each header column.
3. Add up only the numbers where the bit is a 1 (ignore columns with 0).
Example: 00101010 → 32 + 8 + 2 = 42 in denary.
Hexadecimal Numbers (Base 16)
Base 16

Long binary strings like 11011010 are difficult to read and error-prone for humans. Computer scientists use Hexadecimal (Base 16) as a compact, human-friendly shorthand. Because 16 = 2⁴, each hexadecimal digit represents exactly 4 binary bits (1 nibble).

Common Notations

0x Prefix: Standard in programming (e.g. 0x2A, 0xFF)
# Hash: Used in web design & colours (e.g. #FF5733)
Subscript 16: Standard in exams (e.g. 2A₁₆)

Converting Hex to Denary

Multiply the high digit by 16, then add the low digit:
3F₁₆ = (3 × 16) + 15 = 48 + 15 = 63

The "10" Trap

• 10₁₀ (Denary): Ten (1 ten + 0 units)
• 10₁₆ (Hexadecimal): Sixteen (1 sixteen + 0 units)
• 10₂ (Binary): Two (1 two + 0 units)
The written digits "10" always equal the base value itself.

Real World Application: Hex RGB Colour Picker

3 bytes = 16.7M colours (24-bit)

Computer screens mix Red, Green, and Blue light. Each colour channel gets 1 byte (0 to 255), represented by 2 hex digits (00 to FF). Combining the three channels produces a 6-digit hex code such as #FF8733.

Red Byte FF (255)
Green Byte 87 (135)
Blue Byte 33 (51)
#FF8733
Presets:

3-Way Number Converter

8 bits (1 Byte)
Presets:

Type in Denary, Hexadecimal, or Binary to instantly synchronize all three representations. Supports numbers up to 2⁴⁰ (1,099,511,627,775).

Denary (Decimal) Base 10
Everyday human numbers (0 to 2⁴⁰)
Hexadecimal Base 16
Hexadecimal (Base 16)
Binary (Formatted in Nibbles) Base 2
Raw bits (grouped in 4-bit nibbles)

Binary Maths

Computers carry out calculations using binary arithmetic. Subtraction is performed by adding negative numbers in Two's Complement, and multiplication and division are performed using logical bit shifts.

The 4 Golden Rules of Binary Addition
0 + 0 = 0
1 + 0 = 1
1 + 1 = 0 carry 1
1 + 1 + 1 = 1 carry 1

8-Bit Binary Adder

Enter numbers (0–255) or click any bit cell
Number A (0–255):
2D
+
Number B (0–255):
16
=
Sum:
67 43
Place:
128
64
32
16
8
4
2
1
Denary
Carry:
0
0
0
0
0
0
0
-
Row A:
0
0
1
0
1
1
0
1
45
+ Row B:
0
0
0
1
0
1
1
0
22
Sum:
0
1
0
0
0
0
1
1
67
Overflow Error Detected!
The sum of these two numbers exceeds 255 (11111111₂). The final addition in the MSB (128 column) created a carry bit that spilled over into a 9th bit. Because this register only holds 8 bits (1 byte), this 9th bit is lost, causing an incorrect result.
Key concept: "Overflow occurs when a calculation's result requires more bits than the CPU register has allocated to store it."
Hardware Architecture Subtraction is Free Addition ($A - B = A + (-B)$)

CPUs don't waste silicon on separate subtraction circuits. Instead, the ALU flips Number B into its negative Two's Complement, and simply adds it to A! Subtraction is literally free addition.

8-Bit Two's Complement Subtraction

Enter custom numbers (0–255) or click any bit in Row A or Row B
Number A (0–255):
34
−
Number B (0–255):
13
=
Difference:
33 21
Quick Presets:
1 Step 1: Invert Number B (One's Comp) Flip every bit (0 ↔ 1)
11101100 Original B: 00010011 (19)
2 Step 2: Add 1 to get Two's Comp (-B) -B in 8 bits
11101101 Represents: -19
3 Step 3: Binary Addition [ Row A + (-B) ] 52 + (-19) = 33
Place:
128
64
32
16
8
4
2
1
Denary
Carry:
0
0
0
0
0
0
0
-
Row A:
0
0
1
1
0
1
0
0
52
Row B:
0
0
0
1
0
0
1
1
19
+ (-B):
1
1
1
0
1
1
0
1
-19
Result:
0
0
1
0
0
0
0
1
33
Final Carry Rule: In Two's Complement subtraction, when A ≥ B, an extra 9th carry bit spills out of the MSB. This final carry is ignored/discarded by the CPU! The 8 remaining bits give the correct answer.
Bitwise Logic: Operating on Individual Bits

CPUs frequently manipulate raw bits rather than whole arithmetic numbers. This is called Bitwise Logic. In GCSE exams, the most important use case is Bit Masking: isolating, testing, clearing, or setting specific bits in a byte.

Bitwise Logic

Enter numbers (0–255) or click any bit
Number A (0–255):
D6
Number B / Mask (0–255):
0F
=
Result:
6 06
Place:
128
64
32
16
8
4
2
1
Denary
Row A:
1
1
0
1
0
1
1
0
214
AND Row B:
0
0
0
0
1
1
1
1
15
Result:
0
0
0
0
0
1
1
0
6
AND Operation (&)

Output bit is 1 ONLY if BOTH Bit A and Bit B are 1. If either is 0, the output is 0.

Exam Masking Use: Apply a mask of 0s to clear bits, or 1s to inspect specific bits. For example, val AND 00000001 checks if a number is odd (result 1) or even (result 0).

Logical Binary Shifts

Multiplication & Division by Powers of 2

In computer architecture, a Logical Shift moves all bits inside a register to the left or right. Vacated positions are always padded with 0. Shifting left multiplies the number by 2 for each position shifted ($2^1 = 2, 2^2 = 4, 2^3 = 8$), while shifting right performs integer division by 2.

1 Original Byte (Input)
Denary: 14₁₆
2 Shifted Result (Output)
New Denary: 20 14₁₆
0 shifts (Original)
Arithmetic Operation:
20 × 1 = 20 (Unshifted)
✓ No data loss
Hardware Rule Vacated bit positions are always padded with 0 in logical shifts. When shifting left, if a 1 falls off past bit 7 (128), an overflow error occurs. When shifting right, if a 1 falls off past bit 0 (1), fractional precision is truncated/lost.

Units of Data & Prefixes

Digital storage is measured by counting individual binary bits and grouping them into 8-bit bytes. As file sizes increase, decimal prefixes (kB, MB, GB) and binary prefixes (KiB, MiB, GiB) express scale in powers of 10 or 2.

1 Bit (b) The smallest atomic unit of computer memory. Holds a single 0 or 1.
1 bit (b)
1 Nibble A group of 4 bits. Exactly represents 1 hexadecimal character (0 to F).
4 bits (1 hex digit)
1 Byte (B) A collection of 8 bits (2 nibbles). Stores 1 standard ASCII text character (e.g. 'A'). Remember: capital B = Byte, small b = bit!
8 bits (2 nibbles)
Official Syllabus

AQA Data Prefix Hierarchy: Byte to Petabyte

All values written out in full (no confusing shorthand)
Unit & Symbol Scale Name Decimal (SI) — All Zeros Written Out Binary (IEC) Prefix Binary (IEC) Value
Byte (B) Single Byte 1 Byte - 1 Byte
Kilobyte (kB) One Thousand 1,000 Bytes (103) Kibibyte (KiB) 1,024 Bytes (210)
Megabyte (MB) One Million 1,000,000 Bytes (106) Mebibyte (MiB) 1,048,576 Bytes (220)
Gigabyte (GB) One Billion 1,000,000,000 Bytes (109) Gibibyte (GiB) 1,073,741,824 Bytes (230)
Terabyte (TB) One Trillion 1,000,000,000,000 Bytes (1012) Tebibyte (TiB) 1,099,511,627,776 Bytes (240)
Petabyte (PB) One Quadrillion 1,000,000,000,000,000 Bytes (1015) Pebibyte (PiB) 1,125,899,906,842,624 Bytes (250)
Exam Guidance: In written exam calculation questions, calculations using either 1,000 (decimal) OR 1,024 (binary) are accepted for full marks, as long as you show your workings!

Scale of Data: How Big Is It in Real Life?

Click or slide to explore from seconds to thousands of years

It can be hard to picture what "1 Petabyte" actually means. Standard high-quality MP3 audio (128 kbps stereo) plays at roughly 16 kB per second (about 1 MB per minute). Explore how much continuous music and real-world media fits into each level!

Byte Petabyte
1 Gigabyte (GB)
One Billion Bytes
9 Zeros (10⁹)
Exact Decimal Value in Bytes (All Zeros Written Out):
1,000,000,000 Bytes
Binary (IEC Gibibyte): 1,073,741,824 Bytes (2³⁰)
Continuous MP3 Music Time:
62,500 seconds ≈ 17.4 Hours!

Enough for 17.4 hours of continuous non-stop music playback! Over 250 typical MP3 pop songs in a playlist without repeating.

Real-World Media Equivalent:
~250 MP3 songs or 1 episode of Netflix in HD

A single gigabyte holds a decent playlist or an hour of video streaming. Downloaded in about 15 seconds on superfast fibre broadband!

Deep Dive & Real World

Deep Dive: Why Do Both kB and KiB Exist? (The Hard Drive Storage Mystery)

The secret behind "missing" gigabytes

Why does a 1,000 GB drive show as 931 GB in your operating system?

1. Hardware Manufacturers sell in Decimal (SI): Hard drive and SSD makers count in standard everyday powers of 10. To them, 1 GB = 1,000,000,000 bytes (109).

2. Operating Systems calculate in Binary (IEC): Because computer memory (RAM) is wired in powers of 2, operating systems address storage using 1,024-byte multipliers: 1 GiB = 1,073,741,824 bytes (230).

The Result: When you plug in a 1,000 GB drive, Windows divides the 1,000,000,000,000 bytes by 1,073,741,824. The drive isn't faulty or secretly robbed of space — it's simply a difference between base-10 and base-2 math!

Live Storage Drive Capacity Calculator:
GB
Presets:
1,000,000,000,000 bytes ÷ 1,073,741,824 bytes/GiB ≈ 931.32 GiB
Apparent "missing" space: 68.68 GB (≈ 7% difference) due purely to base-10 vs base-2 definition!

Number Systems Revision & Exam Traps

Essential definitions, calculation rules, and exam traps for Paper 2 (§3.3.1 & §3.3.2). Master binary place values, two's complement, arithmetic overflow, logical shifts, and data units.

RULE 1: PLACE VALUE & HEX Paper 2 §3.3.1

Binary (Base 2) & Hexadecimal (Base 16)

• Binary Place Values: 128, 64, 32, 16, 8, 4, 2, 1 for an 8-bit byte. Range of an unsigned byte is 0 to 255.
• Hexadecimal: Uses digits 0–9 and letters A–F (A=10, B=11, C=12, D=13, E=14, F=15).
• Why Hex? Much easier for humans to read and remember than long binary strings; exactly 1 hex digit represents 4 bits (1 nibble), and 2 hex digits represent 1 full byte (8 bits).

Exam Tip: To convert binary to hex, split into 4-bit nibbles from the right, convert each nibble to denary, then write the hex symbols.
RULE 2: ADDITION & OVERFLOW Paper 2 §3.3.1

Binary Addition & Overflow Error

• Addition Rules: 0+0=0, 1+0=1, 1+1=0 carry 1, 1+1+1=1 carry 1.
• Overflow Error: Occurs when the sum exceeds the allocated number of bits (e.g. an 8-bit result > 255). The MSB carry has no storage slot and is dropped, causing incorrect results.
• Consequence: In software, overflow can cause silent bugs or security vulnerabilities (buffer wrap-arounds).

Exam Trap: If an exam question asks "What error occurs if 11111111 + 1 is stored in an 8-bit register?", the answer is Overflow Error.
RULE 3: UNITS & STORAGE SIZE Paper 2 §3.3.2

Decimal vs Binary Data Units

• Bit vs Byte: 1 bit = single 0 or 1. 1 byte (B) = 8 bits. 1 nibble = 4 bits.
• Decimal Prefixes (Powers of 10): 1 kB = 1,000 B, 1 MB = 1,000 kB, 1 GB = 1,000 MB, 1 TB = 1,000 GB.
• Binary Prefixes (IEC, Powers of 2): 1 KiB = 1,024 B (210), 1 MiB = 1,024 KiB (220), 1 GiB = 1,024 MiB (230).
• AQA Exam Note: AQA accepts decimal 1,000 multipliers for kB/MB unless specified otherwise in the question.

Watch Out: Small 'b' means bits (e.g. 100 Mbps network speed). Capital 'B' means bytes (e.g. 500 MB storage). Divide bits by 8 to get bytes.
RULE 4: NEGATIVE NUMBERS Paper 2 §3.3.1

Two's Complement & Sign Bits

• Two's Complement: The most significant bit (MSB) represents -128 instead of +128. Range of an 8-bit signed byte is -128 to +127.
• Negating a Value: To find the negative counterpart of any binary number, invert all bits (0→1, 1→0) and add 1.
• Sign & Magnitude: An alternative method where the MSB is simply 0 for positive and 1 for negative, but suffers from two zeros (+0 and -0).

Exam Trap: Two's complement range is asymmetrical (-128 to +127) because zero uses one of the positive bit combinations (00000000).
RULE 5: BINARY SHIFTS Paper 2 §3.3.1

Logical Shifts (Multiplication & Division)

• Logical Left Shift: Shifts bits left by n positions, inserting 0s at the right. Multiplies the value by 2n.
• Left Shift Risk: If 1 bits are shifted out of the MSB, overflow occurs and precision is lost.
• Logical Right Shift: Shifts bits right by n positions, inserting 0s at the left. Performs integer division by 2n.
• Right Shift Truncation: Any 1s shifted off the right boundary are dropped (integer truncation / loss of precision).

Exam Note: Shifting 00000101 (5) right by 1 bit gives 00000010 (2) because the fractional 0.5 is truncated.