Study · Pearson Edexcel 1CP2 · 2.1.1–2.1.6
Interpret bit patterns, calculate with them and recognise overflow.
About 90 minutes. Predict each figure, then try the green checks before you open them. The Quiz tab is the chapter check. Resources holds the long written questions.
Your learning route
Computers store patterns of bits. A pattern does not mean a number until you say how to read it. This chapter teaches that reading: unsigned binary, hexadecimal, two's complement, addition, overflow, and shifts.
Work in three sittings. First, bits, place value and hex. Second, negative numbers and addition. Third, shifts and the practice questions. Use the figures. Predict the result, then change a bit and see whether you were right.
The teaching follows Pearson Edexcel GCSE Computer Science 1CP2, sections 2.1.1–2.1.6. The final section says where OCR J277 and AQA 8525 ask for less, or for something different. Every calculation on this page is original practice, not a copied exam paper.
Learning objectives
By the end of the chapter you should be able to:
- State how many patterns n bits can hold, and the largest unsigned value those patterns can store
- Convert between denary, 8-bit binary and hexadecimal, including leading zeros
- Read and write 8-bit two's complement, including −128
- Add two binary patterns and decide whether unsigned or signed overflow has happened
- Apply logical and arithmetic shifts and say which bit was lost
10.1 A bit pattern needs an interpretation
One pattern, two readings
Turn bits on and off. Predict both the unsigned value and the two's complement value before you read the result.
Unsigned 77. Two's complement 77. Hex 4D.
Definition: A bit is a single binary digit, 0 or 1. A pattern of n bits has 2ⁿ different patterns. Eight bits have 2⁸ = 256 patterns. Those patterns can stand for unsigned numbers, signed numbers, characters, colours or part of an instruction. The pattern alone does not choose.
Key terms:
- Unsigned integer: a whole number from zero upward. Eight bits store 0 to 255.
- Place value: the weight of each bit. From the left of an eight-bit unsigned pattern the weights are 128, 64, 32, 16, 8, 4, 2 and 1.
- Two's complement: a signed interpretation. The leftmost weight becomes −128. The range is −128 to +127.
- Nibble: four bits. A byte is eight bits.
Why This Matters: 11111111 is unsigned 255 and signed −1. It could also be part of a bitmap. An exam answer that calculates before naming the width and the interpretation is guessing. Use the bit figure. Turn on only the leftmost bit and explain why the two readings differ. Then turn on the other seven bits and check both readings again.
Common Misconception: "Eight bits go up to 256." They provide 256 patterns. If zero is one of them, the largest unsigned value is 255. Forgetting zero is a lost mark.
Examiner tip
Write the weights above the bits before you add. If the question says "eight-bit", keep all eight digits, including leading zeros.
Check yourself: How many patterns do 8 bits give, and what is the largest unsigned value?
Retrieval answer
256 patterns, because 2⁸ = 256. The largest unsigned value is 255, which is the pattern 11111111. Zero uses one of the 256 patterns, so the count of values and the largest value are different numbers.
10.2 Convert between binary, denary and hexadecimal
Binary, denary and hexadecimal
Type a denary or hex value, or edit the bits. Check the result by adding the weights that are switched on.
77 is 64 + 8 + 4 + 1. Unsigned 77. Signed 77.
Definition: To convert unsigned binary to denary, add the weights whose bits are 1. To convert denary to binary, take the largest weight that is not bigger than the number, subtract it, and repeat. Hexadecimal is base 16. The digits are 0–9 and then A–F for 10–15. One hex digit is exactly one nibble.
Key terms:
- Denary: base 10, the ordinary numbers you write in maths.
- Hexadecimal: base 16, used because long binary strings are easy to mistype. The computer still stores bits. Hex does not compress the file.
Use the converter. For 77, the weights that fit are 64, then 8, then 4, then 1. The bits are 01001101. Check: 64 + 8 + 4 + 1 = 77. The nibbles 0100 and 1101 are hex 4 and D, so the hex value is 4D.
| Binary nibble | Hex | Denary |
|---|---|---|
| 0000 | 0 | 0 |
| 1001 | 9 | 9 |
| 1010 | A | 10 |
| 1101 | D | 13 |
| 1111 | F | 15 |
Why This Matters: People use hex to write colours, memory addresses and error codes without a page of bits. A question can ask for the hex of an eight-bit pattern, or the binary of a two-digit hex value. Group the bits in fours from the right if the length is not already a multiple of four, and pad the left with zeros.
Worked hex check: A7 is nibble 1010 then nibble 0111, so the eight-bit pattern is 10100111. The unsigned value is 128 + 32 + 4 + 2 + 1 = 167. Do not read 01001101 as "one million and something". Those digits are bits, not denary columns of thousands.
Common Misconception: "Hexadecimal stores more information than binary." It is a shorter way of writing the same bits. Two hex digits and eight bits can represent the same 256 patterns.
Examiner tip
If the answer line says "8-bit binary", 1001101 is incomplete for 77. The full pattern is 01001101.
Check yourself: Convert 91 to eight-bit binary and to hex.
Retrieval answer
91 = 64 + 16 + 8 + 2 + 1, so the bits are 01011011. The nibbles are 0101 and 1011, which are 5 and B. The hex value is 5B.
10.3 Two's complement for negative integers
Definition: In eight-bit two's complement the weights are −128, 64, 32, 16, 8, 4, 2 and 1. The leftmost bit is not a separate minus sign parked in front of a positive number. It contributes −128, and the other bits still add their usual positive weights.
Key terms:
- Sign bit: the leftmost bit. When it is 1, the value is negative in this representation.
- Range: −128 through +127. Positive 128 does not fit, even though −128 does.
- Invert and add one: a second method. Write the positive version, flip every bit, then add 1.
Worked reading: 11101100 = −128 + 64 + 32 + 8 + 4 = −20. The invert-and-add check: flip to 00010011, add 1 to get 00010100, which is 20, so the original pattern is −20.
Worked encoding: −37. Positive 37 is 00100101. Invert to 11011010. Add 1 to get 11011011. Check: −128 + 64 + 16 + 8 + 2 + 1 = −37. Inverting without the +1 gives a different value. Both steps use the full eight bits.
Why This Matters: Edexcel 1CP2 expects you to encode and decode signed integers and to notice when a result leaves the range −128 to +127. The bit figure’s signed reading is the same rule.
Common Misconception: "10000000 is −0, or it is −128 with the other bits meaning something extra." It is −128. Every other weight is off, so nothing is added back.
Examiner tip
Show the −128 weight in the working. An answer that only says "the first bit means negative" does not show how −20 was calculated.
Check yourself: What is 10000000 as an unsigned number and as an eight-bit two's complement number?
Retrieval answer
Unsigned, the pattern is 128. In eight-bit two's complement it is −128. The same bits, a different agreed meaning.
10.4 Binary addition and overflow
Add two eight-bit patterns
Predict the column result and whether it still means the true total. Unsigned overflow and signed overflow are different tests.
No unsigned overflow. The eight-bit total matches 68. No signed overflow under the same-sign test.
Definition: Binary addition uses the same columns as denary addition, but a column holds only 0 or 1. 1 + 1 is 10 in binary: write 0 and carry 1. 1 + 1 + a carry of 1 is 11: write 1 and carry 1. Overflow means the true result cannot be stored in the available bits under the interpretation the question named.
Key terms:
- Carry: the extra value passed to the next column on the left.
- Unsigned overflow: the true total is greater than 255 for eight bits. A carry out of the leftmost column shows this.
- Signed overflow: the true total is outside −128 to +127. A useful test is that two operands with the same sign produce a result with the opposite sign.
Use the addition figure. Try 45 + 23:
00101101 45
+ 00010111 23
----------
01000100 68
There is no carry out of the left column, and 68 fits both readings.
Now try unsigned 200 + 100. The true total is 300. The nine-bit sum is 1 00101100. Keeping eight bits leaves 00101100, which is 44. The stored result is not 300, and it is not "only 44 events happened".
Signed +100 + +40 is also outside +127. The stored pattern’s sign bit becomes 1, so a positive-looking addition has produced a negative reading. That is signed overflow, even though 140 would fit in eight unsigned bits.
Why This Matters: Questions often give a counter, a register or a total and ask why the stored value is wrong. Name the range, the true total, and the bits that remain.
Common Misconception: "Any carry means overflow." A carry between columns is normal. Overflow is about the final width and the interpretation. Unsigned overflow looks at the carry leaving the pattern. Signed overflow looks at the sign of the result.
Examiner tip
Say which interpretation you are using. "It overflowed" without 255, or without −128 to +127, is too vague for the top marks.
Check yourself: An unsigned eight-bit counter holds 250. Five events add 2 each. What is the true total, and what eight bits are stored?
Retrieval answer
The true total is 260. That is greater than 255, so unsigned overflow occurs. 260 in binary is 1 00000100. The low eight bits are 00000100, which read as 4. The counter has not recorded only four events.
10.5 Logical and arithmetic shifts
See which bit is lost
Shift the pattern and name the bit that falls off the end. A left shift multiplies by two only while the result still fits the interpretation you were asked for.
Started as 01001101 (unsigned 77, signed 77). Discarded 0. Now unsigned 154, signed -102.
Definition: A shift moves every bit a stated number of places. Bits that leave the pattern are discarded. A logical shift fills the empty end with 0. An arithmetic right shift copies the sign bit into the empty left positions. An arithmetic left shift inserts 0 on the right, the same fill as a logical left shift.
Key terms:
- Logical left shift: the pattern moves left. For a non-overflowing unsigned value this multiplies by 2 for each place.
- Logical right shift: the pattern moves right and a 0 enters on the left. For a non-negative integer this is division by 2, with the remainder discarded.
- Arithmetic right shift: used so a negative two's complement value stays negative.
Worked shifts:
- Logical left, one place,
00101100: result01011000. Unsigned 44 becomes 88. - Logical right, one place,
00101101: result00010110. Unsigned 45 becomes 22, not 22.5. The 1 that fell off the right was the remainder. - Arithmetic right, two places,
11101100(−20): result11111011, which is −5. - Logical right of that same −20 pattern gives
00111011, a different number. The fill bit changed the meaning. - One arithmetic right shift of −3 (
11111101) gives −2 (11111110). The result moves toward negative infinity, not toward zero.
A left shift can destroy the sign or push a 1 off the end. Multiplication by two is only a safe description when the result still fits the representation you were told to use. Always write the fixed-width pattern first.
Why This Matters: Shift questions are method marks plus an interpretation mark. The figure lets you see the discarded bit. Name it in the written answer.
Common Misconception: "A right shift always divides by two and keeps the sign." A logical right shift of a negative pattern fills with 0 and usually stops being negative. Only the arithmetic right shift copies the sign bit.
Examiner tip
State logical or arithmetic, the direction, and the number of places. Then give the bits. Then give the denary meaning if it was asked for.
Check yourself: Arithmetic right shift 11101110 by one place. Give the bits and the signed value.
Retrieval answer
11101110 is −18. One arithmetic right shift copies the 1 into the left and discards the final 0, giving 11110111. That is −9.
Independent practice
Original practice · 8 marks. Convert 91 to eight-bit binary and hexadecimal. Encode −18 in eight-bit two's complement. Apply an arithmetic right shift by one to your −18 pattern and interpret the result.
Working and 8-mark scheme
91 = 64 + 16 + 8 + 2 + 1, so 01011011 [2]. Nibbles 0101 1011 give 5B [2]. +18 is 00010010; invert and add one to obtain 11101110 [2]. Arithmetic right shift gives 11110111, representing −9 [2]. Award correct intermediate working where an earlier arithmetic mistake is carried consistently, within the task's allocation.
Homework
Original practice · 4 marks. An unsigned eight-bit counter holds 250. Five events add two each. Explain why the final mathematical count cannot be stored, and state the low eight bits of the mathematical result.
Four-mark feedback
The true count is 260 [1], which exceeds the maximum 255 [1], so overflow occurs [1]. Its low eight bits are 00000100, or 4 [1]. A wraparound result does not mean only four events happened.
Build a table for the patterns of 0, 1, 127, 128 and 255. Give the unsigned reading and the eight-bit two's complement reading of each pattern. Explain why +128 cannot be stored in this signed format even though −128 can. Finish with one shift that discards a 1, and say what information that 1 was carrying.
How the exam boards differ
This chapter is written for Pearson Edexcel 1CP2. You need unsigned binary, hexadecimal, two's complement, binary addition, overflow, and both logical and arithmetic shifts.
OCR J277 asks you to convert whole numbers from 0 to 255 between denary, binary and hexadecimal, to add two 8-bit binary integers, to explain overflow, and to use binary shifts. Those shifts are the multiply-by-two and divide-by-two kind. OCR does not require two's complement or a separate arithmetic shift at GCSE. If you are sitting OCR, the signed sections are useful extra reading, not a required method.
AQA 8525 asks for binary, denary and hexadecimal, addition of binary integers, binary shifts, and overflow of a fixed number of bits. Like OCR, the GCSE course does not require two's complement. AQA shift questions are about moving bits and the effect on an unsigned value, including bits that are lost.
Use the method your question names. Do not explain an OCR unsigned shift with two's complement unless the paper asks for a signed representation.
Sources and further practice
Practice questions and point allocations on this page are original Proof Academy material unless a question is explicitly identified as a past-paper bridge.
- Pearson Edexcel 1CP2 specification, topic 2.1
- OCR GCSE Computer Science J277, section 1.2
- AQA GCSE Computer Science 8525, section 3.3
- PMT Paper 1 and Paper 2 papers and mark schemes for practice of the style, not as text to memorise
When you use an original paper, open its matching mark scheme. A short classroom exercise is not a substitute for a full official task.
Keep your evidence
Export your notes before changing devices.
Notes stay in this browser. The Quiz tab records the chapter check, and Resources holds the long-answer questions.