1.Lesson overview

Syllabus focus
Cambridge IGCSE syllabus reference
  • 1.1 Number systems
Edexcel IGCSE syllabus reference
  • 3.1 Binary
AQA IGCSE syllabus reference
  • 3.1 Number bases
  • 3.2 Converting between number bases
  • 3.4 Binary arithmetic
By the end of this lesson you should be able to
  • Understand how and why computers use binary to represent all forms of data.
  • Understand the denary, binary and hexadecimal number systems.
  • Convert between positive denary and binary, denary and hexadecimal, and hexadecimal and binary.
  • Understand how and why hexadecimal is a beneficial method of data representation.
  • Add two positive 8-bit binary integers.
  • Understand the concept of overflow and why it occurs in binary addition.
  • Perform a logical binary shift on a positive 8-bit binary integer and understand its effect.
  • Use the two's complement number system to represent positive and negative 8-bit binary integers.
  • Understand how sign-and-magnitude represents positive and negative 8-bit integers, and explain why two's complement is preferred.
  • Perform an arithmetic shift on an 8-bit two's complement integer and explain how it differs from a logical shift.

Every photograph, song and document inside a computer is ultimately a string of ones and zeros. That is not a design choice made for elegance — it follows from the hardware. A transistor is either conducting or not, and a circuit is reliably either on or off, so a system with exactly two states is the one that can be built.

Working directly in binary is painful for people, though: one byte takes eight digits to write. Hexadecimal exists to solve that human problem, and the reason it works so neatly is that one hex digit is exactly four binary digits.

How this chapter fits together
  • Section 2 covers why computers use binary.
  • Section 3 covers the three number systems.
  • Sections 4–6 cover the conversions.
  • Section 7 covers why hexadecimal is useful.
  • Section 8 covers binary addition and overflow.
  • Section 9 covers logical shifts.
  • Section 10 covers two's complement.
  • Sections 11–13 consolidate with worked examples, misconceptions and a summary.

2.Why Computers Use Binary

Two states are reliable

Computers use binary because their components have two easily distinguished states:

  • A transistor is either conducting or not conducting.
  • A circuit either carries a voltage or does not.
  • A region of a hard disk is magnetised in one direction or the other.

Each state is represented by a 1 or a 0, and all forms of data — numbers, text, images, sound, instructions — are represented using them.

Why not ten states

A circuit could in principle use ten voltage levels to store a denary digit directly. It is not done because distinguishing ten levels reliably is far harder: small fluctuations in voltage, temperature or component quality could push one level into another and corrupt the data.

With only two states there is a huge margin between them, so a circuit can be built cheaply and still be accurate. Binary trades a longer representation for reliability — and reliability is what matters.

Put numbers on it: a typical digital circuit might treat anything below as a firm 0 and anything above as a firm 1, leaving a wide gap in between that the circuit is never allowed to settle in. Splitting the same – range into ten equal bands for a denary digit would leave barely half a volt per digit and almost no safety margin either side — a small voltage dip caused by a long wire or a warm component could flip a reading from a into a . With only two widely separated states, the same cheap, imperfect components can be trusted completely.

Two pieces of vocabulary follow: a single binary digit is a bit, and eight bits make one byte.

3.The Three Number Systems

The three number systems, all showing the same value
SystemBaseDigits usedExample
Denary10–
Binary2 and
Hexadecimal16– then A–F
Place values

Every system works the same way: each column is worth the base times the column to its right.

  • Denary columns: , , , .
  • Binary columns: , , , , , , , — these eight are worth memorising, since they cover one byte.
  • Hexadecimal columns: , , .

Formally, the column places from the right (counting the units column as ) is worth . That is why denary columns are powers of ten (, , ), binary columns are powers of two (, , ) and hexadecimal columns are powers of sixteen (, , ). Once this pattern is fixed, converting any whole number in any base to denary is the same two-step recipe: multiply each digit by its column's power of the base, then add the results — the method used throughout this chapter is really only ever this one idea applied three times.

The hexadecimal letters

Hexadecimal needs sixteen different digits, but only ten symbols exist, so letters are used for the remaining six:

The six letter digits
HexABCDEF
Denary

Note that F is 15, not 16. Counting starts at zero, so the sixteen digits run from to — the commonest error in hex conversion.

4.Converting Between Denary and Binary

An eight-bit binary number with place values above the bits; the set bits add to denary 90.
Figure 1: Add the place values represented by the bits set to 1 to convert binary to denary.
Convert between denary, binary and hexadecimalOpen full screen
Choosing the right conversion method
  1. 1
    Identify what you have and want
    Denary, binary or hexadecimal — and which direction.
  2. 2
    Hex and binary?
    Use the four-bit rule — direct substitution, no arithmetic. Group from the right.
  3. 3
    Denary to binary?
    Work down from 128, subtracting each place value that fits.
  4. 4
    Denary to hex?
    Divide by 16 — the quotient is the first digit, the remainder the second.
  5. 5
    Check the answer
    Binary should be 8 bits; remainders of 10–15 become letters A–F.
Binary to denary

Write the place values above the digits and add up the values where there is a 1.

Converting 10011100 to denary
Place value1286432168421
Binary digit10011100

Add the place values above the columns containing 1: .

Denary to binary

Work from the largest place value downwards. At each column ask: does this value fit into what is left?

Converting 156 to binary
  1. 1
    Stage 1
    Convert 156 to binary.
  2. 2
    Stage 2
    128 fits into 156? Yes -> write 1, remainder 156 - 128 = 28
  3. 3
    Stage 3
    64 fits into 28? No -> write 0
  4. 4
    Stage 4
    32 fits into 28? No -> write 0
  5. 5
    Stage 5
    16 fits into 28? Yes -> write 1, remainder 28 - 16 = 12
  6. 6
    Stage 6
    8 fits into 12? Yes -> write 1, remainder 12 - 8 = 4
  7. 7
    Stage 7
    4 fits into 4? Yes -> write 1, remainder 4 - 4 = 0
  8. 8
    Stage 8
    2 fits into 0? No -> write 0
  9. 9
    Stage 9
    1 fits into 0? No -> write 0
  10. 10
    Answer
    10011100

The remainder must reach exactly zero by the end. If it does not, an error has been made somewhere — a useful built-in check.

Answers should normally be given as 8 bits, padding with leading zeros if necessary: is , not .

Three conversion moves, then a signed-place-value check
  1. 1
    Write +100
    01100100 · 8-bit width
  2. 2
    Invert every bit
    10011011 · 0 ↔ 1
  3. 3
    Add one
    10011100 · candidate −100
  4. 4
    Check signed values
    −128 + 16 + 8 + 4 = −100

For 8 bits the place values are −128, 64, 32, 16, 8, 4, 2, 1.

5.Converting Between Denary and Hexadecimal

Hexadecimal to denary

Multiply each digit by its place value and add.

Converting 9C to denary
  1. 1
    Convert 9C to denary.
  2. 2
    Place value: 16 1
  3. 3
    Hex digit: 9 C
  4. 4
    9 x 16 = 144
  5. 5
    , and 12 x 1 = 12
  6. 6
    144 + 12 = 156
Denary to hexadecimal

Divide by 16. The quotient is the first digit and the remainder is the second.

Converting 156 to hexadecimal
  1. 1
    Stage 1
    Convert 156 to hexadecimal.
  2. 2
    Stage 2
    156 / 16 = 9 remainder 12
  3. 3
    Stage 3
    First
  4. 4
    Stage 4
    Second
  5. 5
    Answer
    9C

Remember to convert any remainder of or more into its letter. A remainder of is written C, not .

6.Converting Between Hexadecimal and Binary

One byte is split into two four-bit nibbles, with each nibble converting to one hexadecimal digit.
Figure 2: Split a byte into two nibbles, then convert each four-bit group to one hexadecimal digit.
The four-bit rule

This is the easiest conversion of the three, because one hexadecimal digit is exactly four binary digits. There is no arithmetic — only substitution.

Converting between hex and binary
  1. 1
    Hex to binary
    replace each hex digit with its 4 bits.
  2. 2
    Stage 2
    9 -> 1001
  3. 3
    Stage 3
    C -> 1100
  4. 4
    Stage 4
    9C -> 1001 1100 -> 10011100
  5. 5
    Binary to hex
    split into groups of 4 from the RIGHT, then convert each.
  6. 6
    Stage 6
    10011100 -> 1001 1100
  7. 7
    Stage 7
    | |
  8. 8
    Stage 8
    9 C
  9. 9
    Answer
    9C

Split from the right, and pad the leftmost group with leading zeros if it is short. splits as , giving — splitting from the left would give the wrong answer.

Using this as a shortcut

Because hex and binary convert so easily, awkward denary-to-binary conversions can be routed through hex:

  1. 1
    Denary hex by dividing by 16.
  2. 2
    Hex binary by substituting four bits per digit.

For a large value this is often quicker and less error-prone than working down eight binary place values.

7.Why Hexadecimal Is Used

The benefits of hexadecimal
Shorter to write
fewer characters
One byte needs eight binary digits but only two hex digits — a quarter of the length.
Easier for people
fewer mistakes
Long strings of 1s and 0s are easy to miscopy or misread; short hex strings are far less error-prone.
Easy to convert
no arithmetic
Conversion to and from binary is direct substitution, four bits per digit — unlike denary, which needs division.
Widely used
Used for MAC addresses, IPv6 addresses, HTML colour codes, memory addresses and dumps, error codes and assembly language.
The point that earns the mark

The examinable idea is that hexadecimal is used for the benefit of people, not machines. The computer still works entirely in binary; hex is simply a shorthand for displaying that binary to a human.

So the strongest answer pairs the two facts: hex is shorter and less error-prone to read and write, and it converts to binary trivially because each digit maps to exactly four bits.

You meet this every day without necessarily noticing. A web colour written #2E86C1 is three hexadecimal byte values placed side by side — , and — giving the red, green and blue brightness of a shade of blue, each running from (none) to (full, in denary). A crash report or debugger showing a memory address such as 0x7FFE2A10 is doing the same job: a 32-bit binary address compressed into eight readable hex digits instead of thirty-two error-prone binary ones.

8.Binary Addition and Overflow

Two eight-bit binary numbers are added with carries, producing a ninth bit that cannot fit in eight bits.
Figure 3: An answer that needs a ninth bit has overflowed an eight-bit representation.
The four rules
Binary addition rules
  1. 1
    0 + 0 = 0
  2. 2
    0 + 1 = 1
  3. 3
    1 + 0 = 1
  4. 4
    1 + 1 = 0 carry 1
  5. 5
    1 + 1 + 1 = 1 carry 1 (when a carry comes in)

Work from right to left, exactly as in denary addition, carrying into the next column.

Adding two 8-bit numbers
  1. 1
    0 1 0 1 1 0 1 0 (90)
  2. 2
    + 0 0 1 1 0 1 1 0 (54)
  3. 3
    ---------------
  4. 4
    1 0 0 1 0 0 0 0 (144)
  5. 5
    carries: 1 1 1 1
8-bit addition: show the carry and the stored result
  1. 1
    Write the addends
    11000000₂ = 192 · 01000000₂ = 64
  2. 2
    Add in columns
    Carry leaves the MSB · Final
  3. 3
    Read the true sum
    1 00000000₂ = 256₁₀
  4. 4
    Apply register width
    Stored: 00000000 · Overflow flag: set

Overflow is the final carry beyond the fixed 8-bit boundary; it is not every carry.

Overflow
Overflow
When the result of a calculation is too large to be represented in the number of bits available.

With 8 bits the largest value that can be stored is , which is 255. Adding two 8-bit numbers whose total exceeds 255 produces a ninth bit, and there is nowhere to put it.

An addition that overflows
  1. 1
    1 1 0 0 1 0 0 0 (200)
  2. 2
    + 0 1 0 0 0 0 1 1 (67)
  3. 3
    ---------------
  4. 4
    1 0 0 0 0 1 0 1 1 (267 needs 9 bits)
  5. 5
    ^
  6. 6
    carry out of the 8-bit
  7. 7
    The register keeps only: 00001011 = 11
  8. 8
    The answer is WRONG.

The consequence matters: the stored result is not merely inaccurate, it is completely wrong — becomes . This is why programs must check for overflow rather than trusting the result.

To state the cause in an exam: overflow occurs because the result requires more bits than the register has available, so the extra bit is lost.

This is not just an exam abstraction — fixed-width overflow has caused real, well-documented failures. The Ariane 5 rocket's guidance software famously failed seconds after launch in 1996 when a value too large for the 16-bit space allocated to it could not be converted, triggering a shutdown that destroyed the rocket. On a smaller scale, any fixed-width counter — a ticket-sale total, an old odometer — will silently wrap back towards zero once its maximum value is passed, unless the software explicitly checks for it. Choosing how many bits to give a register is really choosing the largest number the system can ever safely represent.

9.Logical Binary Shifts

What a shift does

A logical shift moves every bit a given number of places left or right. Bits shifted off the end are lost, and zeros are shifted in at the other end.

Logical shifts on an 8-bit integer
  1. 1
    Start: 0 0 0 1 0 1 1 0 = 22
  2. 2
    Logical shift LEFT by 1: 0 0 1 0 1 1 0 0 = 44 (x 2)
  3. 3
    Logical shift LEFT by 2: 0 1 0 1 1 0 0 0 = 88 (x 4)
  4. 4
    Start: 0 0 0 1 0 1 1 0 = 22
  5. 5
    Logical shift RIGHT by 1: 0 0 0 0 1 0 1 1 = 11 (/ 2)
  6. 6
    Logical shift RIGHT by 2: 0 0 0 0 0 1 0 1 = 5 (/ 4, remainder lost)
The eight-bit number 01001011 (75) shifted two places left. Zeros are shifted in at the right, and the bits pushed off the left are lost, so the result is 44 rather than 300.
Figure 4: Every bit moves the same number of places, zeros fill in behind, and a bit pushed off the end is gone for good.
The effect on the value
  • A shift left by places multiplies the value by .
  • A shift right by places divides the value by .

This is exactly why shifting is used: multiplying or dividing by a power of two is a single fast operation in hardware, much cheaper than a general multiply.

Two consequences to note. Shifting right loses any remainder — shifted right twice gives , not . And shifting left can push a 1 off the end, losing it entirely and giving a badly wrong answer. In the example above, one more left shift would drop the leading 1.

This is why shifts appear so often behind the scenes: when a compiler translates code that multiplies an integer variable by a power of two, it will often silently replace the multiplication with a shift, because a processor completes a shift in a single clock cycle while a general multiplication can take several. The programmer never sees this substitution — it is one of the simplest examples of a compiler making code faster without changing what it does.

Logical shifts move bits inside a fixed-width register
  1. 1
    Start
    00110110₂ = 54 · 8-bit register
  2. 2
    Left shift one
    01101100₂ = 108 · zero fills on right
  3. 3
    Right shift one
    00011011₂ = 27 · zero fills on left
  4. 4
    Check lost bits
    A bit leaving the MSB can change or overflow

Multiplication or division by 2 only works as expected when lost bits and truncation are accounted for.

10.Two's Complement

An eight-bit two's complement byte with place values from -128 to 1; 10011011 is -128 + 16 + 8 + 2 + 1 = -101. Below, +101 becomes -101 by inverting every bit and adding one.
Figure 5: Only the left-hand place value changes sign, and inverting every bit then adding one turns a number negative or positive again.
Explore two's complement and signed binary arithmeticOpen full screen
Representing negative numbers

Two's complement allows both positive and negative integers to be stored in 8 bits. The key change is that the leftmost bit is worth instead of .

Reading a two's complement number
Place value-1286432168421
Positive number01100100
Negative number10011100

For the positive value, . For the negative value, .

  • If the leftmost bit is 0, the number is positive.
  • If the leftmost bit is 1, the number is negative.
  • The 8-bit range is to .
Converting a positive number to its negative

There are two standard methods, and both give the same answer:

Two methods for the same conversion
  1. 1
    Find -100 in two's complement.
  2. 2
    METHOD 1 - flip and add one
  3. 3
    100 = 0 1 1 0 0 1 0 0
  4. 4
    flip all bits: 1 0 0 1 1 0 1 1
  5. 5
    add 1: 1 0 0 1 1 1 0 0 = -100
  6. 6
    METHOD 2 - place values
  7. 7
    Need -100, and the sign bit gives -128
  8. 8
    -128 + ? = -100, so ? = 28
  9. 9
    28 = 16 + 8 + 4
  10. 10
    1 0 0 1 1 1 0 0 = -100

Method 1 is quicker and works in either direction — applying it to a negative number gives back the positive. Method 2 is a useful check, and makes clear why the pattern is what it is.

Why the leftmost bit is negative

Making the top bit worth looks arbitrary, but it has a valuable consequence: ordinary binary addition then works correctly on negative numbers, with no special handling.

Adding and in two's complement gives once the carry out is discarded — the right answer, from the same adder circuit used for positive numbers. That is why two's complement is used in practice rather than simply reserving a sign bit.

Arithmetic shifts on signed numbers

The logical shift from Section 9 always fills the vacated end with zero. That is fine for a positive or unsigned value, but it breaks a negative two's complement value: shifting () one place right logically gives , which is — the sign has flipped and the answer is nonsense.

An arithmetic shift fixes this. On a right shift, it copies the sign bit into each vacated position instead of using zero, so a negative number stays negative and is correctly divided by a power of two:

Arithmetic shift right on -16
  1. 1
    Start: 1 1 1 1 0 0 0 0 = -16
  2. 2
    Arithmetic shift RIGHT by 1: 1 1 1 1 1 0 0 0 = -8 (sign bit copied in)
  3. 3
    Arithmetic shift RIGHT by 2: 1 1 1 1 1 1 0 0 = -4 (sign bit copied in twice)

An arithmetic left shift is identical to a logical left shift — zero is still shifted in at the right-hand end, since there is no sign bit to protect at that end. The distinction only ever matters for a right shift.

So the rule is: use a logical shift on an unsigned value, and an arithmetic shift on a two's complement (signed) value. Applying a logical shift to a negative number by mistake is a common source of error.

The same byte shifted one place right two ways. A logical shift brings in a 0 and turns -42 into 107; an arithmetic shift copies the sign bit in and gives -21.
Figure 6: A right shift only halves a signed number if the sign bit is copied back in, which is what an arithmetic shift does.
Sign-and-magnitude: the simpler-looking alternative

The most obvious way to store a negative number is to keep the leftmost bit purely as a plus/minus sign (0 for positive, 1 for negative) and store the number's size in the remaining seven bits, exactly as in ordinary written arithmetic. This is called sign-and-magnitude.

Sign-and-magnitude compared with two's complement
ValueSign-and-magnitudeTwo's complement

Positive values look the same under both schemes, but the two disagree completely on negative ones. Sign-and-magnitude looks simpler, but it has two serious weaknesses that explain why two's complement is used instead:

  • Two representations of zero. is and is — a wasted bit pattern, and a program that checks value == 0 must handle both.
  • Ordinary addition does not work. A normal binary adder cannot simply add two sign-and-magnitude patterns; it would need extra circuitry to compare the signs and subtract the smaller magnitude from the larger when they differ. Two's complement needs none of this — the same adder that adds two positive numbers also gives the correct answer when one or both are negative.
-5 written in eight bits both ways. Sign and magnitude has two zero patterns and gives -10 when +5 and -5 are added as plain binary; two's complement has one zero and gives 0 once the carry out is discarded.
Figure 7: Two's complement is used because ordinary binary addition then works on negative numbers with no special case.

11.Exam-Style Worked Examples

Worked example 1 — conversions (4 marks)

Question. (a) Convert the denary number to 8-bit binary. (b) Convert your answer to hexadecimal. (c) Convert the hexadecimal value to denary.

  1. 1
    (a) fits, remainder ; fits, remainder ; and do not; fits, remainder ; fits, remainder ; fits, remainder . So .
  2. 2
    (b) Split into fours from the right: . and , giving .
  3. 3
    (c) : the is in the sixteens column, so ; .
  4. 4
    .

Marking. 1 mark per point. Give binary answers as 8 bits, and remember that F is 15, not 16.

Worked example 2 — addition and overflow (4 marks)

Question. Add the 8-bit binary integers and . (a) Show the addition. (b) State the denary values of both numbers and of the result. (c) State whether overflow occurs and explain.

  1. 1
    (a) — a 9-bit result.
  2. 2
    (b) and ; .
  3. 3
    (c) Overflow does occur.
  4. 4
    The result is greater than , the largest value storable in 8 bits, so it requires more bits than the register has available and the extra bit is lost.

Marking. 1 mark per point. The explanation must refer to the result needing more bits than are available — 'the number is too big' alone is weak.

Worked example 3 — logical shifts (4 marks)

Question. An 8-bit register contains . (a) State its denary value. (b) Perform a logical shift left of 2 places and give the new denary value. (c) State the effect of this shift on the value. (d) State one problem that can occur with a left shift.

  1. 1
    (a) .
  2. 2
    (b) Shifting left 2 places gives , which is .
  3. 3
    (c) The value has been multiplied by 4, since a left shift of places multiplies by .
  4. 4
    (d) Bits shifted off the left-hand end are lost, so if a 1 is pushed out the result is badly wrong.

Marking. 1 mark per point. Zeros are shifted in at the vacated end — a shift never wraps around.

Worked example 4 — two's complement (4 marks)

Question. (a) Give the 8-bit two's complement representation of . (b) State the denary value of in two's complement. (c) State the range of an 8-bit two's complement number.

  1. 1
    (a) . Flip the bits: . Add 1: .
  2. 2
    (b) The leftmost bit is 1, so the number is negative. Using place values: .
  3. 3
    (c) to .
  4. 4
    The range is asymmetric because zero occupies one of the positive patterns, leaving one fewer positive value than negative.

Marking. 1 mark per point. Check (a) by adding and : the result is zero once the carry out is discarded.

12.Exam Tips & Common Misconceptions

Exam tips
  • Learn the eight binary place values: .
  • Give binary answers as 8 bits, padding with leading zeros.
  • A–F are 10–15. F is 15, not 16.
  • When splitting binary into hex, group in fours from the right.
  • Justify hexadecimal by shorter and less error-prone for people, plus trivial conversion to binary.
  • Explain overflow as the result needing more bits than the register has.
  • A left shift of multiplies by ; a right shift divides and loses the remainder.
  • In two's complement the leftmost bit is worth , and the range is to .
  • Check a two's complement conversion by adding it to the positive — the result should be zero.
  • On a right shift, use a logical shift for unsigned values and an arithmetic shift (sign bit copied in) for two's complement values; left shifts are identical either way.
  • Sign-and-magnitude just flags the sign and stores the size; two's complement is preferred because it has one representation of zero and works with ordinary addition.
Common misconceptions
  • Common misconception: computers use binary because it is faster. They use it because components have two reliably distinguishable states.
  • Common misconception: hexadecimal is what the computer stores. The computer stores binary; hex is a shorthand for people.
  • Common misconception: F is 16. The digits run –, so F is 15.
  • Common misconception: binary is grouped into fours from the left. Group from the right, padding the left with zeros.
  • Common misconception: overflow just makes the answer slightly wrong. The lost bit makes it completely wrong — becomes .
  • Common misconception: a logical shift wraps bits around. Bits shifted off the end are lost and zeros are shifted in.
  • Common misconception: shifting right always halves the value exactly. Any remainder is lost.
  • Common misconception: in two's complement the first bit is just a sign flag. It is a place value of , which is what makes normal addition work.
  • Common misconception: the 8-bit range is to . It is to .
  • Common misconception: a right shift always fills with zero. That is only true for a logical shift; an arithmetic shift copies the sign bit in so a negative value stays negative.
  • Common misconception: sign-and-magnitude and two's complement are just two ways of writing the same pattern. They differ completely for negative values, and sign-and-magnitude has two patterns for zero.

13.Summary

Chapter summary
  • Computers use binary because components have two reliably distinguishable states; all data is represented with 1s and 0s. A bit is one digit; a byte is eight.
  • Denary is base 10, binary base 2, hexadecimal base 16 using digits – then A–F for –.
  • Binary to denary: add the place values where there is a 1. Denary to binary: work down from , subtracting as you go.
  • Hex to denary: multiply each digit by its place value. Denary to hex: divide by 16, quotient then remainder.
  • Hex to binary: each hex digit is exactly four bits. Group from the right when converting back.
  • Hexadecimal is used because it is shorter and less error-prone for people and converts to binary by direct substitution — used in MAC and IPv6 addresses, colour codes and memory dumps.
  • Binary addition follows four rules, with carry .
  • Overflow occurs when a result needs more bits than the register has; the extra bit is lost and the stored answer is wrong.
  • A logical shift left of places multiplies by ; a shift right divides by and loses any remainder. Bits shifted off the end are lost; zeros are shifted in.
  • In two's complement the leftmost bit is worth , so a leading 1 means negative and the range is to . Convert by flipping all bits and adding 1.
  • An arithmetic shift behaves like a logical shift except on a right shift of a signed value, where it copies the sign bit in instead of zero, so a negative value stays negative.
  • Sign-and-magnitude stores a sign flag plus a magnitude but has two patterns for zero and cannot use ordinary addition — which is why two's complement is used in practice.
Check your understanding
  • I can explain why computers use binary rather than denary.
  • I can convert in both directions between denary and binary.
  • I can convert in both directions between denary and hexadecimal.
  • I can convert between hexadecimal and binary using the four-bit rule.
  • I can justify the use of hexadecimal and give real examples.
  • I can add two 8-bit binary integers and identify overflow with a reason.
  • I can perform logical shifts and state their effect on the value.
  • I can represent positive and negative numbers in two's complement and state the range.
  • I can perform an arithmetic shift and explain how it differs from a logical shift.
  • I can represent a value in sign-and-magnitude and explain why two's complement is preferred.