What you'll learn
- How number bases represent data, including binary, hexadecimal, signed numbers and floating point.
- How to carry out binary arithmetic and show your working clearly.
- How Boolean algebra describes logic circuits and conditions.
- How Big-O notation compares the efficiency of algorithms.
OCR H446 expects at least 10% mathematical skills. The maths itself may feel familiar, but you apply it in Level 3 Computer Science contexts: processors, data storage, logic circuits, algorithms and programming.
Number representation and bases
A computer stores data using bits, where a bit is a binary digit: 0 or 1. A number base tells you how many different digit symbols are used before place values move left.
Base / radix
A base or radix is the number of digit values available in a number system. Denary is base 10, binary is base 2, and hexadecimal is base 16.
Binary place values are powers of 2. In an 8-bit unsigned integer, the place values are:
128, 64, 32, 16, 8, 4, 2, 1
Hexadecimal is often used because one hex digit maps neatly to four binary bits: 1111₂ is F₁₆.

Converting hexadecimal to binary and denary
Convert 4F₁₆ into binary and denary.
-
Split the hexadecimal number into digits: 4 and F. The digit F means 15 in denary.
-
Convert each hex digit into four binary bits: 4₁₆ = 0100₂ and F₁₆ = 1111₂, so 4F₁₆ = 0100 1111₂.
-
Use hex place values to convert to denary: 4×161+15×160=64+15=794 \times 16^1 + 15 \times 16^0 = 64 + 15 = 794×161+15×160=64+15=79, so 4F₁₆ = 0100 1111₂ = 79₁₀.
Missing base labels
Always label bases when it matters. The string 1010 could mean 1010₁₀, 1010₂, or even 1010₁₆. In OCR answers, base subscripts remove ambiguity.
Binary arithmetic
Binary addition uses the same column method as denary, but each column can only hold 0 or 1.
The key carry rules are:
- 0 + 0 = 0
- 0 + 1 = 1
- 1 + 1 = 10₂, so write 0 and carry 1
- 1 + 1 + carry 1 = 11₂, so write 1 and carry 1
For subtraction, a common technique is to add the two’s complement of the number being subtracted.
Binary addition and subtraction
Work out 01011010₂ + 00110111₂, then work out 01011010₂ - 00110111₂.
-
Add the two numbers column by column, carrying whenever the total reaches 2 or 3.
carries: 111110 01011010 + 00110111 -------- 10010001So 01011010₂ + 00110111₂ = 10010001₂.
-
For subtraction, find the two’s complement of 00110111₂: invert the bits to get 11001000₂, then add 1 to get 11001001₂.
-
Add this to the first number and discard the final carry-out because we are working in 8 bits.
01011010 + 11001001 -------- 1 00100011Therefore 01011010₂ - 00110111₂ = 00100011₂, which is 35₁₀.
Signed numbers
An unsigned integer represents only zero and positive values. A signed integer can represent positive and negative values.
Two common signed representations are sign-and-magnitude and two’s complement.
Sign bit versus weighted bit
In sign-and-magnitude, the leftmost bit is only a sign marker. In two’s complement, the leftmost bit has a negative place value, such as -128 in an 8-bit number.
Representing -13 in 8 bits
Represent -13 using sign-and-magnitude and two’s complement.
-
Write positive 13 in binary: 13₁₀ = 00001101₂. For sign-and-magnitude, use sign bit 1 for negative and seven magnitude bits 0001101, giving 10001101₂.
-
For two’s complement, start with +13 as 00001101₂, invert the bits to get 11110010₂, then add 1 to get 11110011₂.
-
Check the two’s complement value using place values: -128 + 64 + 32 + 16 + 2 + 1 = -13, so 11110011₂ is correct.
Treating two’s complement like sign-and-magnitude
In two’s complement, do not read the first bit as “negative sign, then magnitude”. The first bit is a negative place value.
Floating-point representation
A floating-point number stores a real number using a mantissa and an exponent.
- The mantissa stores the significant digits.
- The exponent stores how far the binary point moves.
- Normalisation means shifting the mantissa into a standard form to maximise precision.
For OCR-style binary floating point, the mantissa is usually treated as signed two’s complement. A normalised positive mantissa begins 0.1, while a normalised negative mantissa begins 1.0.
Normalising a floating-point number
Represent 6.5₁₀ as a normalised binary floating-point value using an 8-bit mantissa and 4-bit exponent.
-
Convert 6.5₁₀ into binary: 6₁₀ is 110₂ and 0.5₁₀ is 0.1₂, so 6.5₁₀ = 110.1₂.
-
Move the binary point left until the positive mantissa starts 0.1: 110.12=0.11012×23110.1_2 = 0.1101_2 \times 2^3110.12=0.11012×23.
-
Store the mantissa as 0.1101000, giving 01101000, and store the exponent +3 as 0011. So the floating-point form is mantissa 01101000 and exponent 0011.
Range and precision
More exponent bits increase the range of values. More mantissa bits increase precision because more significant bits can be stored.
Boolean algebra
Boolean algebra is the mathematics of true and false values. In Computer Science, it describes logic gates, search conditions, validation rules and program decisions.
Boolean operators
OCR uses ∧ for AND, ∨ for OR, ¬ for NOT, ⊻ for XOR, and ≡ for logical equivalence. You may also see A.B for AND, A+B for OR, Ā for NOT A, and ⊕ for XOR.
Useful laws include:
- Commutation: A∧B≡B∧AA ∧ B ≡ B ∧ AA∧B≡B∧A
- Association: (A∧B)∧C≡A∧(B∧C)(A ∧ B) ∧ C ≡ A ∧ (B ∧ C)(A∧B)∧C≡A∧(B∧C)
- Distribution: A∧(B∨C)≡(A∧B)∨(A∧C)A ∧ (B ∨ C) ≡ (A ∧ B) ∨ (A ∧ C)A∧(B∨C)≡(A∧B)∨(A∧C)
- Double negation: ¬¬A≡A¬¬A ≡ A¬¬A≡A
- De Morgan’s Laws: ¬(A∧B)≡¬A∨¬B¬(A ∧ B) ≡ ¬A ∨ ¬B¬(A∧B)≡¬A∨¬B and ¬(A∨B)≡¬A∧¬B¬(A ∨ B) ≡ ¬A ∧ ¬B¬(A∨B)≡¬A∧¬B
Simplifying a Boolean expression
Simplify ¬(A∧B)∧A¬(A ∧ B) ∧ A¬(A∧B)∧A.
-
Apply De Morgan’s Law to the bracket: ¬(A∧B)∧A≡(¬A∨¬B)∧A¬(A ∧ B) ∧ A ≡ (¬A ∨ ¬B) ∧ A¬(A∧B)∧A≡(¬A∨¬B)∧A.
-
Distribute ∧ over ∨: (¬A∨¬B)∧A≡(A∧¬A)∨(A∧¬B)(¬A ∨ ¬B) ∧ A ≡ (A ∧ ¬A) ∨ (A ∧ ¬B)(¬A∨¬B)∧A≡(A∧¬A)∨(A∧¬B).
-
Use the fact that A∧¬AA ∧ ¬AA∧¬A is always false, so it disappears: the simplified expression is A∧¬BA ∧ ¬BA∧¬B.
A Karnaugh map is a grid used to simplify Boolean expressions by grouping adjacent 1s. Adjacent cells differ by only one variable, so variables that change within a group can be removed.

Karnaugh map grouping
Groups must be rectangles of size 1, 2, 4, 8 and so on. Edges can wrap around, so the left and right sides of a K-map can be adjacent.
Comparing algorithm complexity
Algorithmic complexity measures how resource use changes as input size grows. The input size is usually called nnn.
Big-O notation
Big-O notation describes the growth rate of an algorithm, usually for time or space. It ignores constants and smaller terms so you can compare scalability.
Common classes are:
- O(1)O(1)O(1) — constant time
- O(logn)O(\log n)O(logn) — logarithmic time
- O(n)O(n)O(n) — linear time
- O(nk)O(n^k)O(nk) — polynomial time, such as O(n2)O(n^2)O(n2)
- O(2n)O(2^n)O(2n) — exponential time

Comparing two algorithms
Compare the growth rate of these two core loops.
-
Algorithm A has one loop from 0 to n - 1, so its key statement runs n times. Its time complexity is linear: O(n)O(n)O(n).
total = 0 for i = 0 to n - 1 total = total + data[i] next i -
Algorithm B has one loop nested inside another. The inner statement runs n times for each of n outer iterations, giving n×n=n2n \times n = n^2n×n=n2 key operations. Its time complexity is polynomial: O(n2)O(n^2)O(n2).
matches = 0 for i = 0 to n - 1 for j = 0 to n - 1 if data[i] == data[j] then matches = matches + 1 endif next j next i -
For large inputs, O(n)O(n)O(n) scales better than O(n2)O(n^2)O(n2) because doubling n roughly doubles Algorithm A’s work but roughly quadruples Algorithm B’s work.
Assumptions matter
Binary search is O(logn)O(\log n)O(logn) only when the data is sorted and the algorithm can access the middle item efficiently.
In the exam
- Label number bases clearly, show place values, and show carries in binary arithmetic rather than jumping straight to an answer.
- For Boolean simplification, name the law you are applying, especially De Morgan’s Laws and distribution.
- For Big-O, explain growth in terms of input size n; ignore constants, but do not ignore nested loops.
Check yourself
- Can you convert 9A₁₆ into binary and denary, showing place values?
- Can you simplify a Boolean expression using De Morgan’s Laws?
- Can you explain why a nested loop is often O(n2)O(n^2)O(n2) rather than O(n)O(n)O(n)?
