1.Lesson overview

Syllabus focus
Cambridge IAL syllabus reference
  • 1.1 Data Representation
AQA IAL syllabus reference
  • 5.1 Number bases
  • 5.2 Units of information
  • 5.3 The binary number system
AP Computer Science Principles syllabus reference
  • 2.1 Binary Numbers
By the end of this lesson you should be able to
  • Distinguish decimal and binary prefixes in storage calculations.
  • Convert positive integers between denary, binary and hexadecimal.
  • Represent values using BCD, one's complement and two's complement.
  • Add and subtract fixed-width two's-complement values.
  • Multiply unsigned binary integers using the shift-and-add method and state the width the exact product needs.
  • Identify and explain signed binary overflow.
  • Justify the use of BCD and hexadecimal in practical applications.
A computer does not store a denary number, a temperature or a price as an idea. It stores a fixed pattern of bits. The pattern becomes meaningful only when a representation, a width and sometimes a unit have been agreed.
The same bits can be interpreted in more than one way. For example, 11011011 can be an unsigned integer, a negative two's-complement integer, or two BCD digits if the surrounding system says so. Begin every calculation by identifying the convention.
The learning route
  1. 1
    Name the quantity

    Identify the unit, radix, signed convention and width.

  2. 2
    Convert the representation

    Use place values, repeated division or four-bit hexadecimal groups.

  3. 3
    Operate at fixed width

    Use complement methods and retain exactly the stated number of bits.

  4. 4
    Interpret the result

    Check validity, range, overflow and the practical requirement.

2.Why computers use binary: bits, bytes and magnitude

Two states are reliable
Digital components are designed around two distinguishable states. A transistor can be conducting or not conducting; a circuit can be treated as carrying a high or low signal; a magnetic region can be magnetised in one direction or the other. These states are represented by 1 and 0.
  • Two states give a large tolerance to small changes in voltage, temperature and component behaviour.

  • Signals can be regenerated as they pass through logic gates, so a slightly weakened state can become a firm 0 or 1 again.

  • Arithmetic and logical circuits can be built from predictable combinations of two-state gates.

A system could attempt to distinguish ten voltage levels directly, but each level would have a smaller safety margin. Binary uses more digits to represent a quantity, but gains reliability and simpler hardware.
A bit pattern has a width and a meaning
A bit is one binary digit. A byte is eight bits. In an unsigned binary integer, the rightmost bit has value 1, the next has value 2, then 4, 8 and so on. The width fixes how many different patterns exist and therefore fixes the maximum value.
An 8-bit unsigned value ranges from 00000000, which is 0, to 11111111, which is 255. A bit pattern without its width and representation is incomplete information.
Units of information

Unit or prefix

Meaning

Example

bit

One binary digit

0 or 1

byte

Eight bits

1 bits

kilo, mega, giga, tera

Decimal powers of 1000

1 bytes

kibi, mebi, gibi, tebi

Binary powers of 1024

1 bytes

Capacity and transmission calculations
A manufacturer may label a drive as 500 GB using decimal units. The byte count is 500 × 1000³ bytes. If the same count is displayed in GiB, the numerical value is smaller because a GiB contains 1024³ bytes. The storage has not lost data; the unit has changed.
Network speeds are commonly expressed in bits per second, such as 100 Mb/s, whereas file sizes are commonly expressed in bytes, such as 100 MB. Converting between them requires accounting for the factor of 8 as well as the prefix.
Read the prefix exactly

Do not silently replace kB with KiB, or Mb with MB. Copy the unit into the working before calculating.

3.The three number systems and place value

Different notation, same value

System

Base

Digits

Example for 45

Denary

10

0 to 9

45

Binary

2

0 and 1

101101

Hexadecimal

16

0 to 9 and A to F

2D

The place-value rule
Every positional system works in the same way: each column is worth the base multiplied by the column immediately to its right. The rightmost whole-number column has power 0.
  • Denary columns are powers of 10: 1000, 100, 10 and 1.

  • Binary columns are powers of 2: 128, 64, 32, 16, 8, 4, 2 and 1 for one byte.

  • Hexadecimal columns are powers of 16: 256, 16 and 1 for a three-digit value.

To convert any whole number to denary, multiply each digit by its place value and add. Only the base and the digit symbols change.
Hexadecimal letter digits
Hexadecimal needs sixteen symbols. After 0 to 9, A to F represent denary 10 to 15. Counting starts at zero, so F is 15, not 16.
A to F

Hex

A

B

C

D

E

F

Denary

10

11

12

13

14

15

For example, 2D means 2 × 16 + 13 × 1 = 45. The D is one digit with value 13; it is not the denary number 13 written beside a 2.
Binary to denary example
For 101101₂, the 1 bits contribute 32, 8, 4 and 1. The zero bits contribute nothing.
Writing a base subscript is useful when a question contains several representations. If the base is omitted, use the surrounding wording and the allowed digit symbols to identify it.

4.Place value and width determine the interpretation

A bit pattern has no numeric meaning until its base, width and signedness are specified. In unsigned binary, positions have weights 1, 2, 4 and so on. In n-bit two's complement, the leading bit has weight , giving range through . Overflow occurs when the mathematical answer lies outside that range, even if a fixed-width adder produces a bit pattern. Hexadecimal groups four bits and is a compact notation, not a different stored value.

5.Converting denary and binary

Binary to denary: add selected place values
For a positive binary integer, write the place values from left to right and add the values above the columns containing 1. For example, 10011100 has 1s in the 128, 16, 8 and 4 columns.
Converting 10011100 to denary

Place value

128

64

32

16

8

4

2

1

Binary digit

1

0

0

1

1

1

0

0

Denary to binary: subtract place values
For a positive value that fits in one byte, work from 128 down to 1. Write 1 when the place value fits into the remaining value and subtract it; write 0 when it does not fit.
Converting 156 to 8-bit binary
  1. 1
    Use 128
    128

    128 fits into 156. Write 1; .

  2. 2
    Check 64
    64

    64 does not fit into 28. Write 0; remainder stays 28.

  3. 3
    Check 32
    32

    32 does not fit into 28. Write 0; remainder stays 28.

  4. 4
    Use 16
    16

    16 fits into 28. Write 1; .

  5. 5
    Use both
    8 and 4

    12 − 8 = 4, then 4 − 4 = 0. Write 1 and 1.

  6. 6
    Finish the width
    2 and 1

    Neither fits into zero. Write 0 and 0. The answer is 10011100.

The remainder must reach exactly zero. If the question expects eight bits, include leading zeroes: denary 12 is 00001100, not simply 1100.
Denary to binary: repeated division
An alternative is to divide repeatedly by 2 and record the remainder at every step. Read the remainders from the last division back to the first.
Converting 45
  1. 1
    45 divided by 2 gives quotient 22, remainder 1.
  2. 2
    22 divided by 2 gives quotient 11, remainder 0.
  3. 3
    11 divided by 2 gives quotient 5, remainder 1.
  4. 4
    5 divided by 2 gives quotient 2, remainder 1.
  5. 5
    2 divided by 2 gives quotient 1, remainder 0.
  6. 6
    1 divided by 2 gives quotient 0, remainder 1.
  7. 7
    Read upward: 101101. Pad to a byte if required: 00101101.
Use subtraction when a fixed width is already shown; use repeated division when the value is larger or no place-value row has been supplied. Both methods must give the same result.

6.Converting denary and hexadecimal

Hexadecimal to denary
Multiply each hexadecimal digit by its power-of-16 place value and add. In 9C, the 9 is in the 16s column and C is 12 in the units column.
For a three-digit value, the place values are 256, 16 and 1. For example, 112 is 1 × 256 + 1 × 16 + 2 = 274 in denary.
Denary to hexadecimal: divide by 16
Divide by 16. The quotient gives the next digit to the left and the remainder gives the next digit to the right. If a remainder is 10 or more, replace it with A to F.
Converting 274 to hexadecimal
  1. 1
    First division

    274 divided by 16 gives quotient 17 and remainder 2. The rightmost digit is 2.

  2. 2
    Divide the quotient

    17 divided by 16 gives quotient 1 and remainder 1. The middle digit is 1.

  3. 3
    Read the final quotient

    The remaining quotient is 1, so the leftmost digit is 1.

  4. 4
    Check

    112 is 256 + 16 + 2 = 274, so the conversion is consistent.

Why the quotient and remainder matter
Dividing by 16 separates a value into a multiple of 16 and a remainder from 0 to 15. The remainder becomes the units hex digit; dividing the quotient again finds the next digit. This is the same idea as repeated division by 2, but it produces one hexadecimal digit at a time.
A remainder of 12 must be written C, not the two characters 12. If the answer has more than one digit, read the final quotient and remainders from left to right.

7.Converting hexadecimal and binary

The byte 11010110 split into two four-bit nibbles: 1101 is 13, written D, and 0110 is 6, written 6, so the byte is D6 in hexadecimal and 214 in denary.
Figure 1: Because one hexadecimal digit is exactly one nibble, a byte converts in two separate four-bit steps with no arithmetic on the whole byte.
The hexadecimal-to-binary conversion is direct because 16 is 2⁴. One hexadecimal digit represents exactly one four-bit group, called a nibble. No arithmetic is needed: substitute the matching nibble for each digit.
The four-bit substitution rule

Hex

0

1

2

3

4

5

6

7

Binary

0000

0001

0010

0011

0100

0101

0110

0111

Hex

8

9

A

B

C

D

E

F

Binary

1000

1001

1010

1011

1100

1101

1110

1111

Convert in either direction
  1. 1
    Hex to binary

    Replace each digit with four bits: D6 becomes 1101 0110.

  2. 2
    Binary to hex

    Group from the right in fours: 11010110 becomes 1101 0110, then D6.

  3. 3
    Pad the left group

    If the leftmost group is short, add zeroes on its left. 110101 becomes 0011 0101, so the answer is 35.

  4. 4
    Preserve every nibble

    Do not remove zeroes inside a group. Each hex digit must still represent exactly four bits.

Route a conversion through hexadecimal
For a large positive denary value, a useful route is denary to hexadecimal, then hexadecimal to binary. The first conversion uses division by 16; the second uses direct substitution. This reduces the number of binary place-value decisions and gives a check because the final binary groups must match the hexadecimal digits.
Grouping must begin at the right because the units column is at the right. Starting from the left can move the nibble boundaries and produce a different value.

8.Binary Coded Decimal (BCD)

Binary Coded Decimal stores each denary digit separately in a four-bit nibble. Denary 59 is encoded as 0101 1001: the first nibble represents 5 and the second represents 9. This is different from converting 59 as one whole binary number, which gives 111011₂.
Whole-number binary versus BCD

Representation

Bit pattern for 59

How it is decoded

Unsigned binary

111011

One positional number: 32 + 16 + 8 + 2 + 1.

BCD

0101 1001

Two separate digits: 5 then 9.

Valid and invalid BCD nibbles
For ordinary decimal BCD, only 0000 through 1001 are valid digit codes. The patterns 1010 through 1111 do not represent decimal digits and must not be treated as valid BCD input.
BCD uses more bits than packed binary for many values, but it avoids repeated binary-to-decimal conversion when decimal digits must be displayed or preserved exactly. It is therefore a representation chosen for an interface requirement, not a general replacement for binary arithmetic.
Encode a decimal value as BCD
  1. 1
    Separate the digits

    For 708, identify the decimal digits 7, 0 and 8. Do not convert 708 as one binary integer.

  2. 2
    Encode each digit

    7 becomes 0111, 0 becomes 0000 and 8 becomes 1000.

  3. 3
    Join the nibbles

    The BCD pattern is 0111 0000 1000.

  4. 4
    Check validity

    Every four-bit group must be between 0000 and 1001.

9.One's complement, two's complement and signed range

Unsigned binary represents only non-negative values. A signed representation gives patterns a meaning that includes negative values. The bit width is part of the representation: changing from eight bits to sixteen bits changes the range and can change how a leading bit is interpreted.
Signed representations compared

Representation

Negative construction

Important consequence

Unsigned

Negative values are not represented.

Range is 0 to 2ⁿ − 1.

One's complement

Invert every bit of the positive magnitude.

There are two encodings of zero.

Two's complement

Invert every bit, then add 1.

There is one zero; range is −2ⁿ⁻¹ to 2ⁿ⁻¹ − 1.

Why two's complement is preferred
Two's complement lets the same binary adder support positive and negative operations. It also has one zero rather than a positive and negative zero. The trade-off is an asymmetric range: in eight bits there is room for −128 but not +128, so the range is −128 to +127.
For eight bits the place values are −128, 64, 32, 16, 8, 4, 2 and 1. Thus 10000000 represents −128, while 11111111 represents −1.
Read the leading bit correctly
If the leading bit is 0, add the ordinary positive place values. If it is 1, include the negative leading weight and then add the remaining positive weights. For 11011011, the value is −128 + 64 + 16 + 8 + 2 + 1 = −37.
The leading bit is therefore not merely a sign label that can be ignored during arithmetic. Its weight is part of the value.

10.Constructing and checking two's-complement values

Convert a negative denary value to two's complement
  1. 1
    Choose the width

    Use the width stated in the question. For eight bits, the valid signed range is −128 to +127.

  2. 2
    Write the magnitude

    Write the positive magnitude in the same width. For 37: 00100101.

  3. 3
    Invert every bit

    Change 0 to 1 and 1 to 0: 11011010.

  4. 4
    Add one

    Add one at the least-significant end: 11011011.

  5. 5
    Verify

    Use signed weights: −128 + 64 + 16 + 8 + 2 + 1 = −37.

Boundary values in eight bits

Denary

Pattern

Reason

+127

01111111

Largest value with a leading sign bit of 0.

0

00000000

The one zero representation.

−1

11111111

−128 + 127 = −1.

−128

10000000

The negative leading weight with the other bits zero.

Do not change the width halfway through

Invert all the stated bits, add one within the stated width, and retain the width before interpreting the result. Leading zeroes are part of the working.

When a signed value is widened, sign extension copies the old sign bit into the new positions. This is why a negative value cannot be widened by blindly adding zeroes to the left.

11.Binary addition, subtraction and multiplication at fixed width

Binary addition rules

Bits and carry

Write

Carry

0 + 0

0

0

0 + 1 or 1 + 0

1

0

1 + 1

0

1

1 + 1 + 1

1

1

Positive addition
Work from the least-significant bit to the left, carrying into the next column when the column total is 2 or 3. For a result that fits, the stored value agrees with the denary total.
The operands are 54 and 13; the retained result is 67. Keep leading zeroes because the same eight bits may later need a signed interpretation.
Subtraction through two's complement
A processor can calculate A minus B by adding A to the two's-complement representation of negative B. In eight bits, +7 is 00000111. Invert to 11111000 and add 1 to obtain −7, 11111001.
This performs 18 minus 7. A carry beyond the eighth bit is discarded only after the eight-bit addition has been shown.
A subtraction trap
Do not invert without adding one. In two's complement, inversion and addition of one are one complete operation. Forgetting the one produces one's complement and gives the wrong result.
Binary multiplication by shift-and-add
Two unsigned binary integers multiply using the same idea as denary long multiplication: take each bit of the multiplier in turn, starting from the least significant bit, form a partial product that is either the multiplicand (if that bit is 1) or all zeroes (if that bit is 0), shift the partial product one place further left for every bit position moved, then add all the partial products together.
Multiplying 101₂ (5) by 011₂ (3)
  1. 1
    Bit 0 of the multiplier

    011 has a 1 in bit 0, so the first partial product is 101 shifted zero places: 00101.

  2. 2
    Bit 1 of the multiplier

    011 has a 1 in bit 1, so the second partial product is 101 shifted one place left: 01010.

  3. 3
    Bit 2 of the multiplier

    011 has a 0 in bit 2, so the third partial product is all zeroes and contributes nothing: 00000.

  4. 4
    Add the partial products

    00101 + 01010 + 00000 = 01111.

  5. 5
    Check

    5 × 3 = 15, and 01111₂ is 8 + 4 + 2 + 1 = 15, so the result is confirmed.

Widen the result before multiplying

The exact product of two n-bit unsigned values can need up to 2n bits, not n bits. Multiplying two 4-bit values can need an 8-bit result, so state or reserve the width the answer requires rather than reusing the operand width automatically.

12.Signed overflow and range failure

Overflow is a range failure. The processor has performed a bit operation, but the mathematical result is outside the range representable in the selected fixed width. The retained pattern may look like a valid number, yet it does not represent the true answer.
The signed-overflow test

Operands

Retained sign

Conclusion

Positive + positive

1, so result appears negative

Signed overflow

Negative + negative

0, so result appears positive

Signed overflow

One positive and one negative

Either sign

No signed overflow from the addition

Positive overflow
The mathematical sum is 127 + 1 = 128, but the largest 8-bit signed value is 127. The retained pattern begins with 1 and is interpreted as −128. Two positive operands have produced a negative result, so signed overflow is certain.
Carry out is not signed overflow
For unsigned arithmetic, a carry leaving the most-significant bit can show that the unsigned range has been exceeded. For signed two's-complement arithmetic, a carry out alone is not enough. Inspect the signs of the operands and the retained result. A signed overflow can occur without a final carry, as 127 + 1 demonstrates.
A complete explanation includes the true mathematical answer, the allowed range, the retained bit pattern and the sign relationship. Do not write only 'there is a carry' or 'the answer is negative'.

13.Worked example 1: conversions, units and BCD

Question

A sensor sends the unsigned binary value 10101101.

(a) Convert it to denary.

(b) Convert it to hexadecimal.

(c) Encode the denary value 45 in BCD.

(d) A file is labelled 2 KiB. How many bytes and how many bits is this?

Numbered solution
  1. 1
    Part (a): binary to denary

    Use the place values: 128 + 32 + 8 + 4 + 1 = 173. Therefore 10101101 is 173 in denary.

  2. 2
    Part (b): binary to hex

    Group from the right: 1010 1101. The nibbles are A and D, so the hexadecimal value is AD.

  3. 3
    Part (c): BCD

    Encode each decimal digit separately: 4 is 0100 and 5 is 0101. The BCD result is 0100 0101.

  4. 4
    Part (d): units

    2 × 1024 = 2048 bytes. Each byte has 8 bits, so 2048 × 8 = 16384 bits.

Marking note. Part (a) needs place-value working, part (b) needs correct four-bit grouping, part (c) needs separate nibbles for 4 and 5, and part (d) needs the binary prefix before the byte-to-bit conversion. Writing 101101 for part (c) would be ordinary binary, not BCD.

What the checks tell you
The binary result and the hexadecimal result are two notations for the same 8-bit pattern. The BCD result is longer because it preserves the decimal digits individually. The unit answer is independent of the bit pattern: KiB is a binary capacity prefix, and a byte-to-bit conversion still requires a factor of 8.

14.Worked example 2: two's-complement subtraction

Question

Use 8-bit two's-complement arithmetic to calculate 18 − 7. Show the representation of −7, the addition and the denary check.

Numbered solution
  1. 1
    Write both magnitudes

    18 is 00010010 and 7 is 00000111 in eight bits.

  2. 2
    Construct −7

    Invert 00000111 to get 11111000; add 1 to get 11111001.

  3. 3
    Add the complement

    00010010 + 11111001 = 1 00001011. Discard the carry beyond eight bits.

  4. 4
    Interpret the retained bits

    The result is 00001011, which is 8 + 2 + 1 = 11. Therefore 18 − 7 = 11.

Marking note. The carry outside the register is discarded only after the eight-bit addition has been shown. If the width is omitted, the reader cannot tell whether the complement and the discarded carry were handled correctly.

Why the method works
In two's complement, a number and its negative add to zero within the chosen register width. The processor therefore needs an adder and a way to form the complement; it does not need a separate subtraction circuit for every integer operation. This is a hardware consequence of the representation, not just an exam trick.

15.Worked example 3: identify signed overflow

Question

An 8-bit processor adds 01100100 and 00111100 as two's-complement integers. State the retained pattern and decide whether signed overflow occurs.

Numbered solution
  1. 1
    Interpret the operands

    Both sign bits are 0, so the operands are positive: 100 and 60.

  2. 2
    Add at fixed width

    01100100 + 00111100 = 10100000. Only the eight retained bits are stored.

  3. 3
    Check the true total

    The mathematical total is 160, but the 8-bit signed range ends at 127.

  4. 4
    State the conclusion

    Overflow occurs. Two positive operands have produced a result with sign bit 1, which is interpreted as negative.

Marking note. Compare the mathematical total with the range as well as comparing signs. The retained pattern 10100000 is a stored bit pattern, not a correct representation of +160 in eight-bit two's complement.

Contrast case: no overflow from different signs
Adding a positive value and a negative value cannot produce signed overflow merely from the addition: the true total lies between the two operand values. The result may still need to be checked for other errors, but the signed-overflow condition is absent because the operands have different signs.

16.Extended worked example: reason through the method

Problem

Add 0111 and 0011 as 4-bit two's-complement values. Interpret the result.

Solution with reasoning
  1. 1

    Both operands are positive: 0111 is 7 and 0011 is 3. Their mathematical sum is 10.

  2. 2

    The 4-bit adder yields 1010, which represents -6 in two's complement.

  3. 3

    The permitted range is -8 to +7, so this is signed overflow; 1010 is not the correct signed result.

Interpret and check

Two positive inputs producing a negative sign bit is a quick overflow indicator. A wider 5-bit result would represent +10 correctly.

17.Choosing a representation for a real system

Representation by requirement

Requirement

Suitable choice

Reasoned justification

Perform signed integer arithmetic in an ALU

Two's complement

It represents positive and negative values in a fixed width and lets the same adder support addition and subtraction.

Drive a decimal clock or calculator display

BCD

Each four-bit group corresponds to one decimal digit, so the display interface can decode digits directly. It uses more bits for many values.

Show a memory value to a technician

Hexadecimal

It is shorter and easier to read than binary, while each digit preserves an exact four-bit group.

Case study: a digital temperature controller
A controller measures temperatures below and above zero, calculates an offset, shows the result to a user and sends diagnostics to an engineer. One representation need not serve every interface.
Follow the data through the system
  1. 1
    Receive the reading
    Input

    The sensor interface declares the bit width and signed convention so the controller can decode the reading consistently.

  2. 2
    Calculate internally
    Compute

    The processor uses two's complement for signed arithmetic, then checks the allowed range before accepting the result.

  3. 3
    Show decimal digits
    Display

    The display interface can use BCD when it expects one decimal digit per nibble.

  4. 4
    Report the pattern
    Debug

    The diagnostic output can use hexadecimal so an engineer can inspect the exact stored bits compactly.

The choices are justified by the required operation or audience. Calling BCD 'more accurate' is incomplete; the relevant benefit is direct decimal-digit handling. Calling hexadecimal 'smaller' is incomplete; the underlying bits are unchanged, but the displayed notation is shorter and less error-prone.

18.Exam tips and common misconceptions

A reliable exam routine
  1. 1

    Underline the target: denary, binary, hexadecimal, BCD, one's complement or two's complement.

  2. 2

    Write down the width. Keep leading zeroes and discard a carry only when the fixed-width operation is complete.

  3. 3

    Label units explicitly: bits, bytes, kB, KiB, MB, MiB or another stated unit.

  4. 4

    For hexadecimal conversion, group binary from the right and use exactly four bits per digit.

  5. 5

    For BCD, separate the decimal digits before encoding. For overflow, state operand signs, retained sign and allowed range.

  6. 6

    For a justification, connect the representation to the system requirement and include a consequence or trade-off.

Repair the idea before the exam

Incorrect idea

Accurate correction

“A kilobyte is always 1024 bytes.”

1 kB is 1000 bytes; 1 KiB is 1024 bytes. Use the prefix in the question.

“Hexadecimal is another form of BCD.”

Hexadecimal treats the whole value as base 16; BCD encodes each decimal digit separately.

“The leading bit is just a sign flag.”

In two's complement it has negative place value and participates in the numerical result.

“A carry out always means signed overflow.”

Signed overflow depends on operand and result signs. A carry out is mainly an unsigned-range clue.

“The stored hex value uses fewer bits.”

Hex is compact notation for people; the underlying bit pattern is unchanged.

“Invert bits to make two's complement.”

Invert every bit and then add one, all within the specified width.

Command words

State or give usually requires a precise result. Describe requires the relevant features or steps. Explain requires a cause, mechanism or consequence. Justify requires a reason tied to the stated situation, often including a trade-off.

19.Synoptic worked example: from specification to bit pattern

Question, method and marking logic

A lift controller stores a signed floor offset in an 8-bit register, sends diagnostic values to an engineer, and drives a two-digit decimal display. Explain a suitable representation for each use. Then represent the offset −6 in the processor.

Solution
  1. 1
    Processor arithmetic

    Use 8-bit two's complement because the offset may be negative and the processor needs fixed-width signed addition and subtraction.

  2. 2
    Engineer diagnostics

    Use hexadecimal for the displayed bit pattern because it is compact, easier for a person to compare and maps directly to four-bit groups.

  3. 3
    Decimal display

    Use BCD when the display interface expects separate decimal digits. It is convenient for digit decoding but not as storage-efficient as ordinary binary.

  4. 4
    Encode −6

    +6 is 00000110; invert to 11111001; add one to get 11111010. Check: −128 + 64 + 32 + 16 + 8 + 2 = −6.

Why this scores well: every representation is tied to a requirement, and the numerical answer shows the width, construction method and verification. A list of three names without consequences would not be a justification.

20.Summary and self-check

Chapter summary
  • Binary uses two reliable states. A bit is one binary digit and a byte is eight bits.

  • Decimal prefixes use powers of 1000; binary prefixes use powers of 1024. Bits and bytes are different units.

  • Binary uses powers of 2, denary uses powers of 10 and hexadecimal uses powers of 16.

  • Hexadecimal is compact human-readable notation because each digit maps to four binary bits.

  • BCD encodes each decimal digit separately. Its direct digit handling is useful, but it may use more bits.

  • One's complement inverts bits and has two zeroes. Two's complement inverts and adds one, giving one zero and a range of −2ⁿ⁻¹ to 2ⁿ⁻¹ − 1.

  • Two's-complement subtraction adds the complement of the subtrahend and retains the selected width.

  • Unsigned binary multiplication uses shift-and-add: each multiplier bit selects the multiplicand or zero as a partial product, shifted into place and then summed. The exact product of two n-bit values can need up to 2n bits.

  • Signed overflow occurs when the mathematical result is outside the signed range. A carry out alone does not prove signed overflow.

Self-check
  1. 1

    Why are two-state digital components more reliable than a component that must distinguish ten voltage levels?

  2. 2

    Convert 11101010 to denary and hexadecimal. Show the place values and nibble groups.

  3. 3

    Write denary 204 as an 8-bit unsigned binary value, then state its hexadecimal form.

  4. 4

    Encode denary 708 in BCD. Why is the result not the same as converting 708 as one binary integer?

  5. 5

    State the 8-bit two's-complement range and explain why 10000000 represents −128 rather than −0.

  6. 6

    Use 8-bit two's complement to calculate 25 − 9. Show the complement and the retained result.

  7. 7

    Multiply 110₂ (6) by 101₂ (5) using shift-and-add. Show every partial product and state how many bits the exact result needs.

  8. 8

    Does 01111111 + 00000001 overflow as signed addition? State the operand values, retained pattern and reason.

  9. 9

    A user needs exact decimal digits, a technician needs a compact view of memory, and an ALU needs signed arithmetic. Which representation fits each requirement, and why?

If a self-check answer is incomplete, return to the specific method: stable units for capacity, place values or repeated division for base conversion, four-bit groups for hexadecimal, separate nibbles for BCD, invert-and-add-one for two's complement, and sign comparison plus range checking for overflow.

21.Detailed revision focus — representation, width and signed overflow

What this topic requires you to connect

This lesson is about representation, width and signed overflow. In a strong answer, name the relevant representation or mechanism, apply it to the stated evidence, then give a conclusion that fits the conditions of the question.

Syllabus-aligned checkpoints
Checkpoint 1
Secure this before moving on

Distinguish decimal and binary prefixes in storage calculations.

Checkpoint 2
Secure this before moving on

Convert positive integers between denary, binary and hexadecimal.

Checkpoint 3
Secure this before moving on

Represent values using BCD, one's complement and two's complement.

22.Worked Example 3 — representation, width and signed overflow

Question

Using 8-bit two's complement, calculate 00110101 + 11011011 and state whether overflow has occurred.

Method
  1. 1
    Interpret the first pattern as +53.
  2. 2
    Interpret the second pattern as −37 because its leading bit is 1; equivalently, invert it and add 1 to find its magnitude.
  3. 3
    Add at the stated 8-bit width: 00110101 + 11011011 = 1 00010000.
  4. 4
    Discard the ninth carry and check whether two numbers of the same sign produced an answer with a different sign.
Answer and why it earns credit

00010000, which is +16. There is no signed overflow because the addends have different signs.

23.High-value distinction — A carry out and signed overflow

Use the precise term
TermMeaningWhy the distinction matters
A carry outa bit leaving the fixed width during additionUse A carry out only for its specific role; it is not interchangeable with signed overflow.
signed overflowa result outside the signed range; it is detected from the signs of the operands and result, not merely from a carryUse signed overflow when this is the mechanism, condition or property the question actually describes.
Exam wording

When comparing these ideas, state one difference in purpose or mechanism before giving an example. A pair of definitions with no comparison does not fully answer a “compare” question.

24.Mark-ready route — representation, width and signed overflow

Reasoning sequence
  1. 1
    Identify the rule or representation
    Step 1

    Interpret the first pattern as +53.

  2. 2
    Apply it to the evidence
    Step 2

    Interpret the second pattern as −37 because its leading bit is 1; equivalently, invert it and add 1 to find its magnitude.

  3. 3
    Keep the condition visible
    Step 3

    Add at the stated 8-bit width: 00110101 + 11011011 = 1 00010000.

  4. 4
    Check the conclusion
    Step 4

    Discard the ninth carry and check whether two numbers of the same sign produced an answer with a different sign.

Quality check

Before finalising, check the command word, any stated width, unit, order or condition, and whether your conclusion answers the exact scenario rather than a similar one.

25.Targeted correction and transfer — representation, width and signed overflow

Common trap

Calling every carry overflow. Mixed-sign addition can produce a carry without signed overflow.

Independent transfer

New situation: A register stores an 8-bit signed temperature. Explain why 01111111 + 00000001 is invalid even though the output bit pattern is a legal 8-bit pattern.

Retrieval prompt

Without notes, explain the difference between A carry out and signed overflow, then outline the method from the worked example in four or fewer steps.