Skip to topic
    ← Back to course topics

    Binary — Edexcel GCSE Computer Science

    Verified courseTeaching note checked against the official specification.

    Binary explained

    Binary covers 6 specification points, including Understand that computers use binary to… and Understand how computers represent and….

    Read the full explanation

    Open a point below for its explanation and revision guidance.

    2.1.1 understand that computers use binary to represent data (numbers, text, sound, graphics) and program instructions and be able to determine the maximum number of states that can be represented by a binary pattern of a given length

    Computers store and process everything as binary patterns of 0s and 1s, because each bit is a two-state signal that hardware can hold reliably. The same bit pattern can stand for different things depending on how it is interpreted: a number, a character of text, a sample of sound, a pixel colour in a graphic, or part of a program instruction. For example, the 8-bit pattern 01000001 can be the unsigned integer 65 or the character 'A', depending on context. The number of distinct patterns a group of n bits can form is 2ⁿ, so 4 bits give 2⁴ = 16 states, 8 bits give 2⁸ = 256 states, and 10 bits give 2¹⁰ = 1024 states. The maximum number of states is therefore found by raising 2 to the power of the bit length; the highest unsigned value is one less than that count.

    2.1.2 understand how computers represent and manipulate unsigned integers and two’s complement signed integers

    Unsigned integers use every bit for magnitude, so an 8-bit unsigned pattern ranges from 00000000 (0) to 11111111 (255). Two's complement signed integers reserve the most significant bit as a sign indicator: 0 means non-negative and 1 means negative. To form the negative of a value, invert all bits and add 1; for example, +5 in 8 bits is 00000101, so −5 is 11111011. In 8-bit two's complement the range is −128 to +127, because 10000000 represents −128 and 01111111 represents +127. Addition and subtraction use the same binary circuits for both representations, and overflow occurs when a result falls outside the representable range.

    2.1.3 be able to convert between denary and 8-bit binary numbers (0 to 255, -128 to +127)

    This topic teaches conversion between denary and 8-bit binary in two ranges: unsigned 0 to 255 and signed -128 to +127. For unsigned conversion, use place values 128, 64, 32, 16, 8, 4, 2, 1. To convert denary to binary, subtract the largest place value that fits, set that bit to 1, and repeat with the remainder until it is zero; fill remaining bits with 0. For example, 200 = 128 + 64 + 8, giving 11001000. To convert binary to denary, add the place values where the bit is 1. For signed numbers, the leftmost bit has place value -128; the other bits keep 64, 32, 16, 8, 4, 2, 1. For example, 10000001 = -128 + 1 = -127. Always state whether the pattern is unsigned or signed, because the same 8 bits can mean different values.

    2.1.4 be able to add together two positive binary patterns and apply logical and arithmetic binary shifts

    This topic covers adding two positive binary patterns and applying logical and arithmetic shifts. To add, align the bits and work from right to left using 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 0 carry 1. For example, 00101100 (44) + 00010111 (23) = 01000011 (67). A logical left shift moves every bit one place left, puts 0 in the least significant bit, and multiplies the unsigned value by 2; a logical right shift moves every bit one place right, puts 0 in the most significant bit, and divides the unsigned value by 2, discarding any remainder. An arithmetic left shift works in the same way as a logical left shift for positive patterns. An arithmetic right shift moves every bit right but copies the original most significant bit into the new most significant bit, preserving the sign of a signed pattern.

    2.1.5 understand the concept of overflow in relation to the number of bits available to store a value

    Overflow happens when a value needs more bits than the storage location provides, so the extra most significant bits cannot be held and the stored result is wrong. With n bits you can represent 2ⁿ distinct patterns; for unsigned integers these are 0 to 2ⁿ − 1. An 8-bit register holds 0 to 255, so adding 200 + 100 gives a true value of 300, which needs 9 bits (1 0010 1100₂); the register keeps only the low 8 bits, 0010 1100₂ = 44, and the carry out of the most significant bit is lost. A 4-bit register holds 0 to 15, so 12 + 7 = 19 overflows and stores 3. Overflow is therefore about the number of bits available, not about a calculation being mathematically impossible.

    2.1.6 understand why hexadecimal notation is used and be able to convert between hexadecimal and binary

    Hexadecimal is base 16, using 0–9 then A–F for 10–15. It is used because one hex digit maps exactly to four binary bits, so long binary strings become shorter and less error-prone to read and write; 1011 1110₂ is BE₁₆. This makes hex convenient for memory addresses, colour codes and machine-level data. To convert binary to hex, group the bits into nibbles of four from the right, pad the leftmost group with leading zeros if needed, then replace each nibble with its hex digit: 1101 0110₂ becomes D6₁₆. To convert hex to binary, replace each hex digit with its four-bit pattern: 3F₁₆ becomes 0011 1111₂.

    Your focus

    1. State that computers use binary to represent numbers, text, sound, graphics and program instructions.
    2. Calculate the number of states represented by a binary pattern of a given length using 2ⁿ.
    3. Distinguish between the number of states and the highest unsigned value for a given number of bits.
    Show all 18 objectives
    1. Represent unsigned integers in binary and state the range for a given number of bits.
    2. Convert between positive and negative values using the two's complement method of inverting bits and adding 1.
    3. Add and subtract two's complement integers and identify when overflow occurs.
    4. Convert an unsigned denary integer from 0 to 255 into an 8-bit binary pattern and back again.
    5. Convert a signed denary integer from -128 to +127 into an 8-bit two's complement pattern and back again.
    6. Explain why the same 8-bit pattern can represent different values depending on whether it is interpreted as unsigned or signed.
    7. Add two positive 8-bit binary patterns correctly, including carrying where required.
    8. Apply a logical left shift and a logical right shift to an 8-bit pattern and state the effect on the unsigned value.
    9. Apply an arithmetic right shift to a signed 8-bit pattern and explain how the sign bit is preserved.
    10. Define overflow as a result needing more bits than the storage location provides.
    11. Calculate the unsigned range of an n-bit field as 0 to 2ⁿ − 1.
    12. Identify the stored value when a sum exceeds the capacity of a given bit width.
    13. Explain why hexadecimal notation is used instead of long binary strings.
    14. Convert a binary value to hexadecimal by grouping bits into nibbles.
    15. Convert a hexadecimal value to binary by expanding each digit into four bits.

    Binary exam tips

    Marking Points
    • Binary uses only two symbols, 0 and 1, and each bit is a two-state unit that hardware can represent reliably.
    • The same binary pattern can represent different data types, such as numbers, text characters, sound samples, graphic pixels or program instructions, depending on how it is interpreted.
    • The number of distinct states for a pattern of n bits is 2ⁿ; for example 4 bits give 2⁴ = 16 states and 8 bits give 2⁸ = 256 states.
    • The maximum number of states is calculated by raising 2 to the power of the bit length, not by multiplying the bit length by 2.
    • The highest unsigned value representable by n bits is 2ⁿ − 1, which is one less than the number of states.
    • Unsigned integers use all bits for magnitude, so an 8-bit unsigned integer ranges from 0 to 255.
    • In two's complement, the most significant bit indicates the sign: 0 for non-negative values and 1 for negative values.
    • The negative of a two's complement value is formed by inverting all bits and adding 1, for example +5 as 00000101 becomes −5 as 11111011 in 8 bits.
    • An 8-bit two's complement integer ranges from −128 to +127, with 10000000 representing −128 and 01111111 representing +127.
    • Addition and subtraction can be performed directly on two's complement patterns, and overflow occurs when the result lies outside the representable range.
    • Unsigned denary-to-binary: subtract place values 128, 64, 32, 16, 8, 4, 2, 1 from the denary number, setting a 1 where each value fits and a 0 where it does not, until the remainder is zero.
    • Unsigned binary-to-denary: add the place values of the bits that are 1; for example 11001000 = 128 + 64 + 8 = 200.
    • Signed denary-to-binary: for a negative value, find the positive magnitude, convert it to 8 bits, invert every bit, then add 1 to the least significant bit; for example -127: 127 = 01111111, invert to 10000000, add 1 to get 10000001.
    • Signed binary-to-denary: treat the leftmost bit as -128 and add the place values of any other 1 bits; for example 10000001 = -128 + 1 = -127.
    • Range check: unsigned 8-bit patterns represent 0 to 255; signed 8-bit patterns represent -128 to +127; state which interpretation is being used.
    • Binary addition: add the two positive patterns column by column from right to left, writing 0 and carrying 1 when 1 + 1 occurs; for example 00101100 + 00010111 = 01000011.
    • Logical left shift: move each bit one place to the left, insert 0 as the least significant bit, and state that the unsigned value is multiplied by 2; for example 00001010 becomes 00010100.
    • Logical right shift: move each bit one place to the right, insert 0 as the most significant bit, and state that the unsigned value is divided by 2 with any remainder discarded; for example 00001010 becomes 00000101.
    • Arithmetic right shift: move each bit one place to the right but copy the original most significant bit into the new most significant bit, preserving the sign of a signed pattern; for example 10000010 becomes 11000001.
    • Arithmetic left shift: for positive patterns, shift each bit one place left and insert 0 as the least significant bit, which multiplies the value by 2.
    • Overflow occurs when the result of a calculation requires more bits than are available in the storage location.
    • With n bits there are 2ⁿ possible bit patterns; for unsigned values the range is 0 to 2ⁿ − 1.
    • An 8-bit unsigned register holds 0 to 255, so 200 + 100 = 300 overflows and stores 44 because the ninth bit is discarded.
    • A 4-bit unsigned register holds 0 to 15, so 12 + 7 = 19 overflows and stores 3.
    • The carry out of the most significant bit position is lost, so the stored value is incorrect.
    • Overflow depends on the fixed width of the register or field, not on the size of the numbers alone.
    • Hexadecimal is base 16 and uses the digits 0–9 and A–F, where A = 10, B = 11, C = 12, D = 13, E = 14 and F = 15.
    • One hexadecimal digit represents exactly four binary bits, so hex is a compact shorthand for binary.
    • Hex is used because it is shorter and less error-prone for humans to read and write than long binary strings, especially for memory addresses and colour codes.
    • To convert binary to hex, group bits into nibbles of four from the right, pad the leftmost group with leading zeros, then convert each nibble.
    • To convert hex to binary, replace each hex digit with its four-bit binary pattern.
    • Example: 1011 1110₂ = BE₁₆ and 3F₁₆ = 0011 1111₂.
    Examiner Tips
    • 💡Write the formula 2ⁿ before substituting the bit length, then evaluate the power carefully, for example 2⁶ = 64.
    • 💡Check whether the question asks for the number of states or the highest value; subtract 1 only when the highest unsigned value is required.
    • 💡Link each data type named in the question to a concrete example, such as 8 bits for a text character or a sound sample, to show understanding rather than just calculating.
    • 💡Show each step when converting to two's complement: write the positive pattern, invert every bit, then add 1.
    • 💡Check the sign bit first when reading a two's complement pattern, then evaluate the remaining bits to find the magnitude.
    • 💡When adding or subtracting, state whether the result fits the range; if it does not, identify it as overflow.
    • 💡Show your place-value working, especially for signed conversions, so the examiner can see how you reached the pattern.
    • 💡Check the range in the question: if it says -128 to +127, use two's complement; if it says 0 to 255, use unsigned place values.
    • 💡After converting, verify by converting back: add the place values of the 1 bits and check you get the original denary number.
    • 💡Line up the two binary patterns carefully before adding, and work from right to left so carries are not missed.
    • 💡For shifts, write the original pattern above the shifted pattern so you can see which bit has moved where.
    • 💡State the effect on the value, such as multiplied by 2 or divided by 2, as well as showing the shifted pattern.
    • 💡State the bit width and the unsigned range before deciding whether a sum overflows.
    • 💡Show the binary addition and identify the carry out of the most significant bit to justify your answer.
    • 💡Check the stored result by subtracting the modulus 2ⁿ from the true value, for example 300 − 256 = 44.
    • 💡Write the four-bit pattern for each hex digit before combining, to avoid misalignment.
    • 💡When converting binary to hex, mark the nibbles from the right and pad the leftmost group with leading zeros.
    • 💡Check your answer by converting back to the original form.
    Common Mistakes
    • Multiplying the number of bits by 2 instead of using powers of 2; the correct method is 2ⁿ, so 5 bits give 2⁵ = 32 states, not 10.
    • Confusing the number of states with the highest value; for 8 bits there are 256 states but the highest unsigned value is 255.
    • Assuming a binary pattern has only one fixed meaning; the same pattern can represent a number, a character, a sound sample or a graphic depending on the interpretation applied.
    • Treating the most significant bit as a simple minus sign; in two's complement the place value of the most significant bit is negative, which is why 10000000 represents −128.
    • Forgetting to add 1 after inverting the bits when negating a value; inversion alone gives the ones' complement, not the two's complement.
    • Assuming an 8-bit signed range is −127 to +127; the correct range is −128 to +127 because there is one more negative value than positive values.
    • Treating the leftmost bit as +128 in a signed pattern. Correction: in signed 8-bit two's complement, the leftmost bit has place value -128, so 10000000 is -128, not 128.
    • Forgetting to add 1 after inverting the bits when converting a negative denary number to binary. Correction: the two's complement method is invert all bits, then add 1 to the least significant bit.
    • Writing binary patterns with the wrong number of bits, such as 7 bits for 200. Correction: always pad to exactly 8 bits, so 200 is 11001000, not 1100100.
    • Confusing the unsigned and signed ranges. Correction: unsigned 8-bit values run from 0 to 255; signed 8-bit values run from -128 to +127.
    • Forgetting to carry 1 when adding 1 + 1. Correction: write 0 in that column and carry 1 to the next column to the left.
    • Using a logical right shift on a signed negative pattern and expecting the sign to be preserved. Correction: use an arithmetic right shift, which copies the original most significant bit into the new most significant bit.
    • Shifting in the wrong direction. Correction: a left shift moves bits towards the most significant end and multiplies by 2; a right shift moves bits towards the least significant end and divides by 2.
    • Ignoring overflow when a left shift pushes a 1 out of the 8-bit pattern. Correction: state that the bit shifted out is lost and the result may no longer fit in 8 bits.
    • Thinking overflow means the answer is mathematically impossible: it means the fixed number of bits is too few, so the stored result is truncated.
    • Believing a larger number always overflows: overflow depends on the bit width, so 300 overflows in 8 bits but not in 16 bits.
    • Forgetting that the range for n unsigned bits is 0 to 2ⁿ − 1, not 0 to 2ⁿ, so 8 bits give 255 as the maximum, not 256.
    • Assuming the extra bit is rounded rather than discarded: the most significant carry is simply lost.
    • Grouping binary digits from the left instead of from the right, which misaligns the nibbles; always group from the right and pad the leftmost group.
    • Using only three bits for a hex digit: every hex digit needs exactly four bits, so 7₁₆ is 0111₂, not 111₂.
    • Treating A–F as letters with no numeric value: A = 10 through F = 15.
    • Forgetting to pad the leftmost nibble, so 101₂ is written as 5₁₆ instead of 0101₂ = 5₁₆ with the correct four-bit grouping.