Skip to topic
    ← Back to course topics

    Unsigned binary arithmetic — AQA A-Level Computer Science

    Unsigned binary arithmetic involves carrying out fundamental operations such as addition and multiplication on non-negative integers represented in base-2. In AQA A-Level Computer Science, mastering these mechanics is essential for understanding processor ALU operations, bit-level data manipulation, and hardware overflow conditions.

    Unsigned binary arithmetic explained

    The statement 'Be able to:' is a lead-in with no performance criteria of its own; the specific skills listed beneath it in the specification are what students must demonstrate.

    Read the full explanation

    Within unsigned binary arithmetic, those skills centre on performing addition and understanding how overflow occurs when results exceed the fixed number of bits available. Students should add binary numbers column by column from the right, carrying a 1 when two 1s sum to 2 (binary 10). For example, 0110 + 0111 = 1101, which is 6 + 7 = 13. Overflow happens when the carry out of the most significant bit is 1, or the result cannot be represented in the given bit length. In an 8-bit register, 11111111 + 00000001 produces a carry out and the stored result 00000000, which is incorrect as an unsigned sum of 256. Recognising overflow is the key idea assessed in this area.

    Your focus

    1. Be able to:

    Which command word is this?

    Perform mathematical operations showing clear intermediate workings (such as carries or partial products) and provide a final answer in the requested format or bit length.

    Unsigned binary arithmetic exam tips

    Topic Overview

    Unsigned binary arithmetic is the fundamental numerical system underpinning low-level computation, representing strictly non-negative integers. In base-2, each place value corresponds to an ascending power of two, and operations such as addition, subtraction, multiplication, and logical bit-shifting mirror classical base-10 mathematics using minimal logic gates.

    Within the AQA A-Level specification, students must demonstrate full competence in performing hand-calculated operations on arbitrary bit-lengths. Understanding unsigned representation forms the stepping stone to more complex representations, including two's complement, fixed-point, and floating-point systems, while reinforcing the hardware constraints of CPU registers and ALU flag management.

    Key Concepts
    • →Place value weighting: An n-bit unsigned integer assigns each bit position i (from 0 to n-1) a weight of 2^i, with a total representable range of 0 to 2^n - 1.
    • →Binary addition rules: 0+0=0; 0+1=1; 1+1=0 (carry 1); 1+1+1=1 (carry 1).
    • →Hardware overflow: Occurs when a calculation generates a carry out of the most significant bit that cannot be accommodated within the allocated register width.
    • →Multiplication via shift-and-add: Multiplying two binary numbers by evaluating each bit of the multiplier, shifting the multiplicand left accordingly, and accumulating the sum.
    Marking Points
    • Adds binary digits column by column from the least significant bit, applying the carry rule correctly
    • Applies the rule that 1 + 1 gives 0 with a carry of 1
    • Identifies that a result is incorrect when a carry is generated beyond the most significant bit of the register
    • Recognises that an 8-bit unsigned register can only store values from 0 to 255
    • Explains that overflow leaves a stored result that does not match the true sum
    Examiner Tips
    • 💡Write the carry digits above the columns before adding to avoid losing them
    • 💡Compare the true decimal sum with the register's maximum value to decide whether overflow has occurred
    • 💡Explain overflow in terms of the number of bits available, not just that the answer looks wrong
    • 💡Always align columns carefully and clearly annotate carry bits above or below your working to avoid transposition errors.
    • 💡Verify your answers by converting binary operands to denary, performing the decimal calculation, and converting back to confirm your binary output matches.
    • 💡Explicitly state 'overflow error occurs' if asked to evaluate an addition that yields a bit beyond the specified fixed bit-depth.
    Common Mistakes
    • Treats 1 + 1 as 1 with no carry; the sum is 10 in binary, so write 0 and carry 1
    • Assumes a result is always correct when no visible error appears; check for a carry out of the top bit
    • Describes overflow as a calculation error in the software; it is a limit of the fixed bit length
    • Assuming an overflow error alters the math: Students often believe that overflow makes the calculation impossible to write down; in reality, the hardware drops the carry bit or stores it in a carry flag, leaving the register with an incorrect, truncated value.
    • Mixing up signed and unsigned ranges: Students often mistakenly assume the MSB in an unsigned integer represents a sign; in unsigned arithmetic, the MSB has a positive weight of 2^(n-1).
    • Thinking binary multiplication requires a special algorithm: Students forget that binary multiplication is simpler than decimal multiplication because each partial product is either zero or exactly the multiplicand shifted.
    Revision Plan
    1. 1Day 1-2: Master single-bit and multi-bit unsigned binary addition, ensuring fluency with multi-carry operations and explicit carry bit notation.
    2. 2Day 3-4: Practice binary long multiplication and logical bit-shifting (left for multiplication, right for integer division).
    3. 3Day 5: Complete timed past paper questions from AQA Paper 1, focusing on register overflow questions and clear step-by-step layout.
    Exam Question Types
    • 📋Direct calculation: Straightforward 1-2 mark questions asking to add two 8-bit unsigned integers or multiply two 4-bit values.
    • 📋Explain and justify overflow: 2-3 mark questions providing an addition problem within a fixed-size register and asking why the result is inaccurate.
    • 📋Logical shift operations: Questions asking students to state the effect of applying logical left or right shifts by n positions on an unsigned byte.
    Command Word Expectations (AQA)
    Calculate

    Perform mathematical operations showing clear intermediate workings (such as carries or partial products) and provide a final answer in the requested format or bit length.

    State

    Provide a concise, direct answer without supporting explanation, such as identifying the binary result or stating 'Yes, an overflow error occurs'.

    Explain

    Set out the causes or reasons behind a computational outcome, such as explaining why the sum of two 8-bit values cannot be stored without data loss.

    How Students Lose Marks (Examiner Pitfalls)
    Pitfall: Failing to recognize overflow errors when adding two n-bit unsigned integers whose sum exceeds the maximum representable value (2^n - 1).
    ❌ Weak Answer (Loses Marks):The student performs binary addition on two 8-bit numbers, writes down a 9-bit answer, and fails to state that an overflow error occurred or ignores the carry bit completely.
    Example improved answer:For an 8-bit unsigned integer system, the maximum value is 255 (11111111 in binary). When the sum produces a 9th bit carry-out of the most significant bit (MSB), the result cannot be stored in an 8-bit register, resulting in an overflow error. The final 8-bit register value wraps, and the processor sets an overflow/carry flag.
    Examiner Tip: Always check the specified bit-width in the question stem. If you are asked to give an 8-bit result and there is a carry out of the most significant bit, explicitly state that an overflow error has occurred.
    Pitfall: Confusing logical shifts with arithmetic shifts when performing binary multiplication or division on unsigned integers.
    ❌ Weak Answer (Loses Marks):Students state that an arithmetic shift right is required for unsigned numbers, accidentally preserving or replicating sign bits.
    Example improved answer:For unsigned binary numbers, multiplication by 2^n is achieved using a logical shift left by n places, inserting zeros into the vacated least significant bits. Division by 2^n is achieved using a logical shift right by n places, inserting zeros into the most significant bits.
    Examiner Tip: Remember that unsigned data has no sign bit; therefore, shifts on unsigned numbers are strictly logical (always zero-filled) rather than arithmetic.
    Step-by-Step Worked Solutions

    Question: Add the following two 8-bit unsigned binary integers: 10110110 and 01101101. State whether an overflow error occurs in an 8-bit register.

    1. 1.Step 1: Align the binary numbers vertically: 10110110 (182 in denary) + 01101101 (109 in denary)
    2. 2.Step 2: Add column by column from right to left (LSB to MSB), accounting for carries: - Column 0 (2^0): 0 + 1 = 1 - Column 1 (2^1): 1 + 0 = 1 - Column 2 (2^2): 1 + 1 = 0 (carry 1) - Column 3 (2^3): 0 + 1 + 1 (carry) = 0 (carry 1) - Column 4 (2^4): 1 + 0 + 1 (carry) = 0 (carry 1) - Column 5 (2^5): 1 + 1 + 1 (carry) = 1 (carry 1) - Column 6 (2^6): 0 + 1 + 1 (carry) = 0 (carry 1) - Column 7 (2^7): 1 + 0 + 1 (carry) = 0 (carry 1 out to 2^8)
    3. 3.Step 3: Evaluate the result and bit-width. The resulting sum is 100100011 (9 bits, which equals 291 in denary). Because an 8-bit register can only store values up to 255 (2^8 - 1), the final 8-bit stored value is 00100011, and the carry out of the MSB signifies that an overflow error has occurred.
    Final Answer: Result: 100100011 (stored as 00100011 in an 8-bit register). An overflow error has occurred because the result exceeds 255 and cannot fit into 8 bits.

    Question: Calculate the result of multiplying the unsigned 4-bit binary integer 1011 by the unsigned 4-bit binary integer 0101 using binary long multiplication. Show all intermediate workings.

    1. 1.Step 1: Align the multiplicand (1011) and the multiplier (0101): 1011 (11 in denary) x 0101 (5 in denary)
    2. 2.Step 2: Multiply 1011 by each bit of the multiplier from right to left, shifting each partial product: - Bit 0 is 1: 1011 * 1 = 1011 (shift 0) - Bit 1 is 0: 1011 * 0 = 00000 (shift 1) - Bit 2 is 1: 1011 * 1 = 101100 (shift 2) - Bit 3 is 0: 1011 * 0 = 0000000 (shift 3)
    3. 3.Step 3: Sum the non-zero partial products: 001011 + 101100 -------- 110111 in binary (which equals 32 + 16 + 4 + 2 + 1 = 55 in denary).
    Final Answer: 00110111 (or 110111 without leading zeros), which equals denary 55.
    Active Recall Memory Test
    What is the maximum denary value that can be represented by an n-bit unsigned binary number?
    Key Fact: 2^n - 1
    What are the four fundamental addition rules for two binary digits?
    Key Fact: 0 + 0 = 0; 0 + 1 = 1; 1 + 0 = 1; 1 + 1 = 10 (0 with a carry of 1).
    What hardware event occurs when the addition of two unsigned 8-bit numbers produces a 9-bit result?
    Key Fact: An overflow error (the carry out of the MSB cannot fit into the 8-bit register).
    What operation is mathematically equivalent to logically shifting an unsigned binary number 3 places to the left?
    Key Fact: Multiplication by 8 (since 2^3 = 8), assuming no overflow occurs.
    Frequently Asked Questions
    What is the difference between signed and unsigned binary numbers?
    Unsigned binary numbers represent only non-negative integers (zero and positive values), where every bit position contributes a positive power of two. In contrast, signed binary systems, such as two's complement, allocate the most significant bit as a negative weight to represent both positive and negative values within the same bit length.
    How do you detect an overflow in unsigned binary addition?
    In unsigned binary addition, an overflow occurs exclusively when a carry is generated out of the most significant bit (MSB) that cannot fit within the designated register size. For example, if you are adding two 8-bit numbers and the operation requires a 9th bit to express the sum, an overflow condition is triggered.
    Can you use logical shifts to multiply and divide any unsigned binary number?
    Logical shifts can only multiply or divide by powers of two (2, 4, 8, 16, etc.). Shifting left by n places multiplies the number by 2^n, provided no 1 bits are shifted out of the MSB. Shifting right by n places divides the number by 2^n, truncating any fractional remainder.
    What is the range of values for an 8-bit unsigned binary integer?
    An 8-bit unsigned integer has a range of 0 to 255 in denary. The minimum value is represented by 00000000 (0) and the maximum value is represented by 11111111 (128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255).