📄 Paper 2 · 4.5 Data Representation
4.5.4a Binary Integers & Arithmetic
AQA 7517 · A-Level Computer Science · ~16 min read

Binary Integer Representation

Unsigned integers use pure binary with positional (place) value. For an 8-bit byte, columns are:

Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
1286432168421

Range for an n-bit unsigned integer: 0 to 2ⁿ − 1. For 8 bits: 0 to 255.

Converting Between Bases

Binary → Decimal

Multiply each bit by its positional value and sum them.

Example: 10110011₂ = 128+32+16+2+1 = 179₁₀

Decimal → Binary

Repeated division by 2 — record remainders from bottom to top.

DivisionQuotientRemainder
75 ÷ 2371
37 ÷ 2181
18 ÷ 290
9 ÷ 241
4 ÷ 220
2 ÷ 210
1 ÷ 201

Reading remainders bottom-up: 75₁₀ = 1001011₂

Binary Addition

Four rules:

  • 0 + 0 = 0, carry 0
  • 0 + 1 = 1, carry 0
  • 1 + 0 = 1, carry 0
  • 1 + 1 = 0, carry 1
  • 1 + 1 + 1 = 1, carry 1

Worked example

Column1286432168421
A01101010
B00111001
Sum10100011

A (106) + B (57) = 163 = 10100011₂. Verify: 128+32+2+1 = 163 ✓

Overflow

Overflow occurs when the result of an arithmetic operation exceeds the number of bits available. In an 8-bit unsigned system, 200 + 100 = 300, but 300 > 255 — the result wraps around or raises an error.

Overflow in addition: when a carry-out is generated from the most significant bit position.

Binary Multiplication & Shifts

Shifting binary left or right is equivalent to multiplying or dividing by powers of 2:

OperationEffectExample
Shift left 1× 200001010 → 00010100 (10→20)
Shift left 2× 400000011 → 00001100 (3→12)
Shift right 1÷ 2 (integer)00010100 → 00001010 (20→10)

Bits shifted off the end are lost; zeros fill in from the other end (logical shift).

Exam tip: Show all carry bits when performing binary addition — examiners look for working. Know that overflow occurs when a carry exits the MSB in unsigned addition. Bit shifts are fast multiplications/divisions by 2 — essential for optimised code. For 8-bit, max unsigned value = 255; overflow means wrapping at 256.
Click through the slides at your own pace. Use arrow keys or click to advance.
Click slide or press arrow keys to navigate

Worksheet — 4.5.4a Binary Integers & Arithmetic

8 questions · instantly marked · AQA 7517 standard

Q1Convert the binary number 10110101 to decimal. Show your working.[2]
✅ Mark scheme
Mark scheme
Positional values: 128+32+16+4+1 = 181 [1]; correct working shown (e.g. table or calculation) [1].
Q2Convert the decimal number 209 to 8-bit binary. Show your method.[2]
✅ Mark scheme
Mark scheme
11010001₂ [1]; correct method shown — either repeated division by 2 or subtraction of positional values (128+64+16+1=209) [1].
Q3Perform the binary addition 10101010 + 01110111. Show all carry bits and the result in binary.[3]
✅ Mark scheme
Mark scheme
10101010 (170) + 01110111 (119) = 100100001₂ but as 8-bit: 00100001 (33) with overflow carry of 1 from MSB [1]; all carry bits correctly shown [1]; overflow identified — result exceeds 8-bit range [1].
Q4Explain what overflow is in the context of binary addition. Give an 8-bit example.[3]
✅ Mark scheme
Mark scheme
Overflow occurs when the arithmetic result is too large to fit in the number of available bits [1]; produces a carry-out from the most significant bit position [1]; example: 200 + 100 = 300, which exceeds 255 (max 8-bit unsigned), generating overflow [1].
Q5A logical left shift of 3 is applied to the binary value 00000101. What is the result in binary and decimal?[2]
✅ Mark scheme
Mark scheme
00101000₂ [1]; decimal value = 40 (5 × 2³ = 5 × 8 = 40) [1].
Q6What is the maximum unsigned integer that can be stored in a 16-bit register?[2]
✅ Mark scheme
Mark scheme
Maximum = 2¹⁶ − 1 [1] = 65,535 [1].
Q7A logical right shift of 2 is applied to 10111100. What is the result in binary? What is the decimal equivalent?[2]
✅ Mark scheme
Mark scheme
00101111₂ [1]; 32+8+4+2+1 = 47 (original 188 ÷ 4 = 47) [1].
Q8Perform the addition 00111010 + 00101101 in binary, and convert your result to decimal. Show all working.[3]
✅ Mark scheme
Mark scheme
58 + 45 = 103; binary: 01100111₂ [1]; carries correctly shown [1]; decimal 64+32+4+2+1 = 103 [1].
Topic Quiz
Question 1 of 15
You scored
out of 15
Card 1 of 8
Click to reveal definition
🎉
All cards reviewed!
TermDefinition
🎯

Mini Test — Binary Integers

10 questions · 10 minutes

← 4.5.3 Units of Information
37 of 70 · AQA 7517
4.5.4b Two's Complement →