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
- 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
- 1Day 1-2: Master single-bit and multi-bit unsigned binary addition, ensuring fluency with multi-carry operations and explicit carry bit notation.
- 2Day 3-4: Practice binary long multiplication and logical bit-shifting (left for multiplication, right for integer division).
- 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)
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.
Provide a concise, direct answer without supporting explanation, such as identifying the binary result or stating 'Yes, an overflow error occurs'.
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)
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.Step 1: Align the binary numbers vertically: 10110110 (182 in denary) + 01101101 (109 in denary)
- 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.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.
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.Step 1: Align the multiplicand (1011) and the multiplier (0101): 1011 (11 in denary) x 0101 (5 in denary)
- 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.Step 3: Sum the non-zero partial products: 001011 + 101100 -------- 110111 in binary (which equals 32 + 16 + 4 + 2 + 1 = 55 in denary).