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.
Reviewed by: AI editorial process; not yet individually human-reviewed
Have a quick question? Jump to the Q&A page
Jump to a section
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 , inverted is , add 1 gives . A quick check: a two's complement number is negative exactly when its most significant bit is 1, and the range of an -bit two's complement value is to , so 8 bits cover to . 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 (, carry the 1; ). Subtraction is performed by adding the two's complement of the number being subtracted, so , 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 ) 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 in two's complement is positive, with fractional place values , giving . The exponent . Shifting the binary point right by 2 turns into .
So the value is .
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 ) 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 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: (+6) plus (+3) gives , which in 4-bit two's complement is , not . 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
- Understand the decimal, binary and hexadecimal number systems, why computers use binary and hexadecimal, and how to convert between the three bases.
A focused answer to AQA A-Level Computer Science 4.5.1, covering the decimal, binary and hexadecimal number systems, why computers use binary and hexadecimal, and how to convert between the three bases.
- Understand the bit and byte, the units of information capacity, binary and decimal prefixes (kibi versus kilo), and how the number of bits limits the range of values that can be represented.
A focused answer to AQA A-Level Computer Science 4.5.8, covering the bit and the byte, the units of information capacity, binary prefixes (kibi, mebi) versus decimal prefixes (kilo, mega), and how the number of bits limits the range of values.
- Use arithmetic operations including integer division, modulus and exponentiation, relational operators, and the Boolean operators AND, OR and NOT, and understand operator precedence.
A focused answer to AQA A-Level Computer Science 4.1.3, covering arithmetic operators including integer division and modulus, relational operators, the Boolean operators AND, OR and NOT, and operator precedence.
- Understand the built-in data types: integer, real or float, Boolean, character and string, and understand records, arrays and user-defined data types built from them.
A focused answer to AQA A-Level Computer Science 4.1.1, covering the built-in data types (integer, real, Boolean, character, string), how each is stored, and how records, arrays and user-defined types are built from them.
- Understand character encoding using ASCII and Unicode, the limitations of ASCII, why Unicode was introduced, and the relationship between a character set and a character code.
A focused answer to AQA A-Level Computer Science 4.5.9, covering character encoding using ASCII and Unicode, the limitations of ASCII, why Unicode was introduced, and the relationship between a character set and its codes.
Sources & how we know this
- AQA A-level Computer Science (7517) specification β AQA (2015)