Skip to main content
EnglandComputer ScienceSyllabus dot point

How are signed integers, fractions and binary arithmetic represented?

Understand unsigned and signed binary using two's complement, binary addition and subtraction, fixed point and floating point representation of real numbers, and the effects of overflow and rounding.

A focused answer to AQA A-Level Computer Science 4.5.2 to 4.5.7, covering unsigned and signed binary using two's complement, binary addition and subtraction, fixed and floating point representation of real numbers, and overflow and rounding errors.

Generated by Claude Opus 4.89 min answer

Reviewed by: AI editorial process; not yet individually human-reviewed

Have a quick question? Jump to the Q&A page

Jump to a section
  1. What this dot point is asking
  2. Unsigned and signed (two's complement) integers
  3. Binary addition and subtraction
  4. Fixed point, floating point, overflow and rounding

What this dot point is asking

AQA wants you to represent unsigned and signed integers (two's complement), add and subtract in binary, represent real numbers in fixed and floating point, and explain overflow and rounding errors with worked arithmetic.

Unsigned and signed (two's complement) integers

To find the two's complement (the negative) of a number: invert all the bits and add 1. So +5=0000 0101+5 = 0000\,0101, inverted is 1111 10101111\,1010, add 1 gives 1111 1011=βˆ’51111\,1011 = -5. A quick check: a two's complement number is negative exactly when its most significant bit is 1, and the range of an nn-bit two's complement value is βˆ’2nβˆ’1-2^{n-1} to 2nβˆ’1βˆ’12^{n-1} - 1, so 8 bits cover βˆ’128-128 to +127+127. There is one more negative value than positive because zero takes a positive-looking pattern.

Binary addition and subtraction

Binary addition follows the carry rules (1+1=101 + 1 = 10, carry the 1; 1+1+1=111 + 1 + 1 = 11). Subtraction is performed by adding the two's complement of the number being subtracted, so Aβˆ’B=A+(βˆ’B)A - B = A + (-B), reusing the adder rather than building separate subtraction hardware.

  0011 (3)
+ 1110 (-2 in two's complement)
------
  0001 (1)   the final carry out is discarded

The carry out of the most significant column is simply discarded in two's complement subtraction; it is not an error. An error (overflow) is instead signalled when adding two numbers of the same sign yields a result of the opposite sign.

Fixed point, floating point, overflow and rounding

Overflow occurs when an arithmetic result is too large to fit in the available bits, producing an incorrect (often wrong-signed) answer. Underflow is the related problem when a floating point value is too small (too close to zero) to represent. Rounding errors occur because many decimal fractions (like 0.10.1) cannot be represented exactly in binary, so the stored value is slightly off, and these errors can accumulate over many calculations, which matters in long financial or scientific computations.

Exam-style practice questions

Practice questions written in the style of AQA exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.

AQA 20185 marksA real number is stored in an 8-bit floating point format with a 5-bit mantissa and a 3-bit exponent, both in two's complement. The stored value has mantissa 0.1010 and exponent 010. Calculate the denary value the number represents and explain why this format cannot store every real number exactly. Show your working.
Show worked answer β†’

The mantissa 0.10100.1010 in two's complement is positive, with fractional place values 12,14,18,116\tfrac12, \tfrac14, \tfrac18, \tfrac{1}{16}, giving 0.5+0.125=0.6250.5 + 0.125 = 0.625. The exponent 0102=2010_2 = 2. Shifting the binary point right by 2 turns 0.10100.1010 into 10.102=2.510.10_2 = 2.5.

So the value is 2.5102.5_{10}.

Many real numbers cannot be stored exactly because the mantissa has only a finite number of bits, so any value whose binary fraction needs more bits than are available (for example 0.1100.1_{10}) is rounded to the nearest representable value, introducing a rounding error.

Markers award working marks for converting the mantissa, reading the exponent, and shifting the point, then an accuracy mark for 2.52.5 and a mark for a correct precision explanation.

AQA 20203 marksExplain what is meant by overflow in two's complement addition and give an example using 4-bit numbers.
Show worked answer β†’

Overflow occurs when the result of an arithmetic operation is too large (or too small) to fit in the available bits, so the answer wraps to an incorrect, often wrong-signed, value. In two's complement it is detected when two numbers of the same sign produce a result of the opposite sign.

Example: 01100110 (+6) plus 00110011 (+3) gives 10011001, which in 4-bit two's complement is βˆ’7-7, not +9+9. Two positives produced a negative, signalling overflow.

Markers reward a correct definition (result exceeds the representable range) and a worked example that demonstrates the sign change.

Related dot points

Sources & how we know this