Year 12

AQA A level Computer Science [P1] Data Representation Notes

Data Representation

— Computer Science · AS Level (9618) · Chapter 1: Information Representation —
★ Exam Tip: No calculators in, AS or A2 papers — only simple additions needed. You must memorise the list 128 64 32 16 8 4 2 1 and the prefix conversion tables. You do not have to memorise ASCII codes (syllabus says so). These conversions are repeated every session; theory questions are usually “describe + give an example”.

1. What is Data Representation?

Definition: Data representation refers to the form in which data is stored, processed and transmitted inside a computer.

Computers only understand binary (only 0s and 1s) — the “computer-understandable language”. A group of 8 bits = 1 byte.

Binary magnitude = first (left-most) bit10001100↑ 1 → negative number01100011↑ 0 → positive number
the first bit (“binary magnitude”) tells you the sign at a glance
Careful: “1 = negative” is only true for signed / two’s complement numbers. In an unsigned binary integer a leading 1 is just a normal bit (see §6).

2. Prefixes — Binary vs Decimal

You already know prefixes from physics (kilo, milli, centi, nano, pico…). Data has its own units too. At AS/A Level the data prefixes are split into two families:

Trick: binary prefix = first two letters of the decimal one + “bi” → Ki·bi, Me·bi, Gi·bi, Te·bi
Binary prefixes Decimal prefixes
1st Kibibyte Kilobyte
2nd Mebibyte Megabyte
3rd Gibibyte Gigabyte
4th Tebibyte Terabyte
factor × / ÷ 1024 × / ÷ 1000

Why two families? (the 1024 / 1000 confusion)

In you were allowed to use either 1024 or 1000 when converting units (1000 was popular — no calculator, easy to multiply). That caused confusion: which one was used? — and it makes a big difference, especially for large numbers:

5 × 1000 = 50005 × 1024 = 5120

So the units were given separate names: binary prefixes → 1024, decimal prefixes → 1000.

Rule: the question names the unit. Says kibibyte / mebibyte / gibibyte / tebibyte → use 1024. Says kilobyte / megabyte / gigabyte / terabyte → use 1000. (Used a lot later in multimedia — images & sound.)
Binary Prefixes• Kibibyte• Mebibyte• Gibibyte• Tebibyte× 1024÷ 1024× 1024÷ 1024× 1024÷ 1024Decimal Prefixes• Kilobyte• Megabyte• Gigabyte• Terabyte× 1000÷ 1000× 1000÷ 1000× 1000÷ 1000
bigger unit → smaller unit: multiply (going up the arrows) · smaller → bigger: divide. e.g. 1 TB → GB: × 1000; 1 MiB → KiB: × 1024
Sir: learn the two tables in this exact order (or just be able to redraw them — you have time in the exam). Practice comes in the Multimedia chapter.

Basic unit facts (write these down)

  • Smallest unit of data = bit (a single 0 or a single 1)
  • One byte contains 8 bits
  • 4 bits are known as a nibble (half a byte)
  • 1 kilobyte = 1000 bytes  |  1 kibibyte = 1024 bytes
  • 1 megabyte = 1000 kilobytes  |  1 mebibyte = 1024 kibibytes
  • Same pattern for giga/gibi and tera/tebi (gibi = 1024 mebi, etc.)
10101110nibblenibble8 bits = 1 byte = 2 nibbles
Exam-style Qdraw ONE line from each binary value to its equal · [5]

Match: 8 bits · 8000 bits · 1000 kilobytes · 1024 mebibytes · 8192 bits → to 1 kibibyte / gigabyte / byte / kilobyte / gibibyte / megabyte / mebibyte.

Trick: if the value is in bits, first ÷ 8 to get bytes. Then check: factor 1000 or 1024?

Binary value Working Equals
8 bits 8 ÷ 8 = 1 byte 1 byte
8000 bits ÷ 8 = 1000 bytes (factor 1000) 1 kilobyte
1000 kilobytes ÷ 1000 1 megabyte
1024 mebibytes ÷ 1024 1 gibibyte
8192 bits ÷ 8 = 1024 bytes (factor 1024) 1 kibibyte

Careful: 8192 bits ≠ 1024 bits — convert bits → bytes first (÷ 8). “1 gigabyte” and “1 mebibyte” are the unused decoys.

8 bits8000 bits1000 kilobytes1024 mebibytes8192 bits1 kibibyte1 gigabyte1 byte1 kilobyte1 gibibyte1 megabyte1 mebibyte
the five correct matches (board answer)

3. Number Systems & Conversions

  • Binary — base 2 (only 0, 1) — the computer’s own language
  • Denary (decimal) — base 10 — normal maths numbers: 15, 16, 17…
  • Hexadecimal — base 16 (0–9 then A–F)

Base = just the way of representing a number. The exam gives you a number in one system and asks you to convert to another: binary→denary, denary→binary, binary→hex, hex→binary, denary→hex… Only these appear in the syllabus.

★ Memorised list (write it at the start of EVERY question)128   64   32   16   8   4   2   1
1×22×24×28×216×232×264×2128
start from the RIGHT with 1 and keep doubling (1+1=2, 2+2=4, 4+4=8 …). Forgot? Just double!
Remember: AS, and A2 all depend on this list. If asked “which list?” you should be able to say 1, 2, 4, 8, 16, 32, 64, 128 instantly.

Case 1 — Denary → Binary

Q: Convert 65 into 8-bit binary. (8-bit = 1 byte)

  1. Step 1: Write down the memorised list.
  2. Step 2: Place 1 on specific places so the total is the same as the denary number given. Every other place gets 0.
place value12806413201608040201164 + 1 = 65 → 01000001
1s at 64 and 1 → everything else 0

Ans: 01000001

How to pick the 1s: go left → right; put a 1 only if that place value still “fits” in what is left.

Exam-style Qdenary → 8-bit binary · [1]

Convert the denary integer 55 into 8-bit binary.

55 < 64 → no 1 under 64 (0)32 fits → 55 − 32 = 2316 fits → 23 − 16 = 78 too big (0) · 4, 2, 1 fit → 7 − 4 − 2 − 1 = 032 + 16 + 4 + 2 + 1 = 550 0 1 1 0 1 1 1
place value12806403211618041211132 + 16 + 4 + 2 + 1 = 55
55 = 32 + 16 + 4 + 2 + 1
Sir: no need for a 12-bit method here — such Qs have never appeared; numbers usually stay within 0–255 (256 values with 8 bits).

Case 2 — Binary → Denary

Q: Convert 01000001 to denary. (Same number as before, reversed.)

  1. Step 1: Write the memorised list under the binary number (right-aligned).
  2. Step 2: Add only the numbers that have a 1 above them.
place value12806413201608040201164 + 1 = 65
64 + 1 = 65 → Ans = 65
Exam-style Q8-bit binary → denary · [1]

Convert the 8-bit binary integer 01001101 into denary.

64 + 8 + 4 + 1= 77
place value12806413201608141201164 + 8 + 4 + 1 = 77
01001101 → 77
Common mistake: read the question carefully — is it binary or BCD? If it is BCD and you treat it as plain binary (128 64 32 …) the whole answer is wrong.

Case 3 — Binary → Hexadecimal

Value box
A = 10 D = 13
B = 11 E = 14
C = 12 F = 15
Memory: only remember A = 10 — the rest just go up by 1 (B=11, C=12 …). Hex is like denary but the digits 10–15 are written as letters.

Q: Convert 11011001 into hexadecimal.

  1. Step 1: From the right, divide the binary value into groups of four (missing bits → add 0s on the left). Hex ⇒ always groups of 4!
  2. Step 2: Write the memorised list (8 4 2 1) separately for each group.
  3. Step 3: Add the numbers with 1. If the total is greater than 9 → use the value box.
181402118+4+1 = 13> 9 → value box: 13 = DD180402118+1 = 99
1101 → 8+4+1 = 13 → D · 1001 → 8+1 = 9 ⇒ D9
Exam-style Qregister contents · [1]

General purpose register X holds 1111 0010 (unsigned binary integer).

1111 → 8+4+2+1 = 15 → F0010 → 2Hex = F2denary (as the printed question asks): 128+64+32+16+2 = 242
Board note: the question printed on the board asks “convert to denary”, but the teacher wrote F2 (the hex answer). Don’t be confused by the wording — read what the question really asks. Correct denary answer = 242.

Case 4 — Denary → Hexadecimal

Q: Convert 195 to hexadecimal.

  1. Step 1: First convert the denary number into binary.
  2. Step 2: Repeat the steps of Case 3 (groups of 4 → 8 4 2 1 → value box).

(There is a direct method but it is long — we always go via binary: one extra step, much easier.)

place value128164132016080402111128 + 64 + 2 + 1 = 195
195 in binary
181402018+4 = 12> 9 → value box: 12 = CC080412112+1 = 33
1100 → 8+4 = 12 → C · 0011 → 2+1 = 3 ⇒ C3
Exam-style Qhexadecimal → denary · [1]

Convert the hexadecimal number 4E into denary. (board: E = 14)

E = 14 · 2 digits → two groups of 4 bits4 → 0100   (4 only)E (14) → 1110   (8 + 4 + 2)0100 1110 → 0 1 0 0 1 1 1 0 under 128 … 164 + 8 + 4 + 2 = 78
081402014 = 44181412018+4+2 = 14> 9 → value box: 14 = EE
reading it backwards: 4 = 0100, E = 14 = 1110 → 01001110 = 78

Tip: hex → binary is the “reverse working” of Case 3. A 3-digit hex like 4EF has three 4-bit groups. Each hex digit ↔ one nibble.

(Uses of hexadecimal — MAC addresses, colour codes — were to be dictated separately by sir; not on the board.)

4. Binary Coded Decimal (BCD)

Definition: BCD uses a 4-bit code to represent each denary digit. Another way of representing data.

Any number is made of digits 0–9. BCD gives every single digit its own 4-bit binary code (use 8 4 2 1 and put 1s to make the digit).

Trick: don’t memorise the table — write 8 4 2 1 and put 1s that add up to the digit (7 = 4+2+1 → 0111).
Digit BCD Digit BCD
0 0000 5 0101
1 0001 6 0110
2 0010 7 0111
3 0011 8 1000
4 0100 9 1001
Note: a digit greater than 9 can not go in one 4-bit BCD group. e.g. 13 is not 1101 (8+4+1) — wrong! Instead split into digits: 1 → 0001 and 3 → 0011 → 0001 0011.

Case 1 — Denary → BCD

Q: Convert 54 into BCD.

Step 1: convert each digit into BCD format, then write them side by side.

081402115081402014
5 → 0101 · 4 → 0100 ⇒ 0101 0100
Exam-style Qdenary → BCD · [1]

Convert the denary integer 653 into BCD.

6 → 4+2 → 01105 → 4+1 → 01013 → 2+1 → 00110110 0101 0011

Leave a small gap between the groups so the examiner isn’t confused.

081412016081402115080412113
653 → 0110 0101 0011

Case 2 — BCD → Denary

Q: Convert 0101 0100 (BCD) to denary.

  1. Step 1: Make groups of 4 (from the right).
  2. Step 2: Write 8 4 2 1 on each group and add the numbers with 1.
081402114+1 = 55081402014 = 44
0101 → 4+1 = 5 · 0100 → 4 ⇒ 54 (just join the digits — no letters because BCD digits are ≤ 9)
Common mistake: read carefully whether the question says BCD or binary. If you wrongly treat BCD as plain binary (128, 64, 32 …) your answer is completely wrong.
Exam-style QBCD → denary · [1]

Convert the BCD number 10000011 into denary.

1000 | 00118 | 2 + 1 = 383

Groups are made from the right side, always.

BCD — theory questions (wording to copy)

2 marks: 1 for “describe”, 1 for the example

Q: Describe how denary integers larger than 9 can be converted into BCD. Give an example in your answer.

Each denary digit is written as a 4-bit binary number.

Example: 46 = 0100 0110

Q: Describe how an 8-bit BCD can be converted into a denary integer. Give an example in your answer.

Binary number is split into groups of 4 bits (starting from the right). Each group of 4 bits is converted to a denary digit.

Example: 0011 0111 = 37

★ Exam Tip: in Computer Science examples earn marks — even if the question doesn’t say “give an example”, 90% of mark schemes contain one. If you’re unsure how to word it, show an example!

Q: Identify practical applications where BCD is used.

Any scenario where a single digit needs to be transmitted / displayed. e.g. calculator / digital clock

Also: timer, traffic signal, ATM — anything that shows single digits.

5. Binary Addition

Each column gives a Sum (S) and a Carry (C). (The proper working — logic gates / “adders” — is in A2; for now just learn these 5 results.)

Adding S C
0 + 0 0 0
0 + 1 1 0
1 + 0 1 0
1 + 1 0 1
1 + 1 + 1 1 1
Tips: • fill empty places with 0 first • 1+1 = 0, carry 1 • three 1s = 1, carry 1 • adding 3–4 numbers? add two at a time

Practice questions (basic)

110011+1
① 10 + 11 = 101
10011111110+
② 011 + 011 = 110
100111001111110011+
③ 01110 + 00111 = 10101
10011100110011000+
④ 01100 + 00110 = 10010
101011001111110011+1
⑤ 01110 + 10111 = 100101
1111111111111100110+1
⑥ 11111 + 11101 = 111100

Green 1s on top = carries. Faded 0s = padding added to fill the empty places. (Check ①: 2+3 = 5 = 101 ✓)

9618 recent paperbinary addition · [3]

The amount of green in binary is 00100011. The denary number 15 is added to it. Add 15 to 00100011 and give the answer in binary — show working.

First convert 15 to binary (you need binary to add): 8+4+2+1 → 00001111. Then add.

place value1280640320160814121118 + 4 + 2 + 1 = 15
0000001011001101010101111110+= 50
Answer: 00110010
9618 Exam-style Qbinary addition · [2]

Perform the binary addition. Show your working.

10110011111101011001010110011+170+55=225
10101010 + 00110111 = 11100001

6. Negative Numbers — Two’s Complement

Only two cases come up: (1) given a negative denary → write its binary form; (2) given a binary (two’s complement) → find the denary value. (Sometimes then hex — you already know that.)

Case 1 — Negative denary → binary

Q: Convert −125 to binary form.

  1. Step 1: Ignore the negative sign and convert +125 to binary.
  2. Step 2: Apply two’s complement: ① one’s complement = inverse (1→0, 0→1) ② then add binary 1.
place value12806413211618141201164 + 32 + 16 + 8 + 4 + 1 = 125
Step 1: +125
01111101+125 (ignore the sign)100000101's complement = inverse (flip every bit)00000001+ binary 110000011−125 in two’s complement

Answer: 10000011

Two’s complementtwo’s complement = one’s complement (inverse) + binary 1
Exam rule: you cannot just write the answer directly — showing the one’s complement is 1 mark, showing the two’s complement is another. Same in A2 (floating point, e.g. −14.75). There is a shortcut (copy from the right up to and including the first 1, flip the rest) but show the full working to be safe.
Note: all two’s complement numbers that start with 1 are negative (first bit = 1 → negative; 0 → positive).
Exam-style Q12-bit two’s complement · [1]

Convert the denary number −194 into 12-bit two’s complement.

Only ~1 in 10 students get this right!

First write +194 in 12 bits (pad zeros on the left before inverting), then apply two’s complement.

place value204801024051202560128164132016080402110128 + 64 + 2 = 194 (in 12 bits)
+194 in 12 bits
000011000010+194 (12 bits)1111001111011's complement = inverse (flip every bit)000000000001+ binary 1111100111110−194

Answer: 1111 0011 1110

Common mistake: converting to 8 bits first, doing two’s complement, then adding 0s at the end is wrong — the extra zeros wouldn’t be inverted, so the answer changes and it is only an 8-bit two’s complement padded out. The question says 12-bit → start with 12 bits.

Case 2 — Binary (two’s complement) → Denary

Exam-style Q (register H)unsigned vs two’s complement · 4 parts

Register H holds 1 1 0 0 0 0 0 1.

Important: “unsigned binary integer” = no sign at all, so a leading 1 does not mean negative. Same for 8-bit or 12-bit.

(i) H unsigned → denary: add the place values with 1.

place value128164132016080402011128 + 64 + 1 = 193
(i) 193 — not negative!

(ii) H → hexadecimal: groups of 4 from the right.

181402018+4 = 12> 9 → value box: 12 = CC080402111 = 11
(ii) 1100 = 8+4 = 12 → C · 0001 = 1 ⇒ C1

(iii) H is a two’s complement integer → denary. First bit is 1 → negative, so apply two’s complement to find the size:

11000001H001111101's complement = inverse (flip every bit)00000001+ binary 100111111= 00111111 → magnitude 63
00111111 → 32 + 16 + 8 + 4 + 2 + 1 = 63but H started with 1 → negative−63
Self-check only: MSB counts as −128 → −128 + 64 + 1 = −63 ✓ (don’t use this as your working — marks are for one’s & two’s complement).
Always: to reverse a negative two’s complement or to create one, you always ADD binary 1 after inverting. If the first bit is 0 (positive) you don’t need two’s complement at all — just add the place values.

(iv) State why register H does not currently contain a BCD.

The first 4 bits would be 12 (1100) which is greater than 9 (which is not valid for BCD).

Sir’s answer wording: “first 4 bits = 12, greater than 9, not valid for BCD”. (Negative numbers aren’t the reason — e.g. 10000011 is valid BCD = 83.)

Exam-style Q (register X)X = 1 0 1 1 1 0 1 0
(i) unsigned → denary: 128 + 32 + 16 + 8 + 2= 186(ii) hexadecimal: 1011 = 11 → B · 1010 = 10 → A= BA(iii) two’s complement → denary: inverse 01000101, +1 → 0100011064 + 4 + 2 = 70, started with 1 → −70
10111010X010001011's complement = inverse (flip every bit)00000001+ binary 101000110−(70) magnitude: 01000110 → −70
Practice (3c)board left unanswered

X = 1 1 0 0 0 0 0 1: (i) unsigned → denary 193 · (ii) hexadecimal C1 · (iii) two’s complement → denary −63 (same value as register H above)

Practiceboard left blank · [1]

Express −17 in 8-bit two’s complement form.

17 = 00010001 → inverse 11101110 → +1 → 11101111

00010001+17111011101's complement = inverse (flip every bit)00000001+ binary 111101111−17 (8-bit two’s complement)

7. Binary Subtraction

Subtracting is the same as adding a negative number:

40 − 15 = 25   OR   40 + (−15) = 25
Note: Apply two’s complement to the number being subtracted, and then do the same working as binary addition.
9618 (new topic)binary subtraction · [3]

Hexadecimal 23 in two’s complement representation is 00100011. The denary number 10 needs to be subtracted from this value. Give your answer in binary and show your working.

23 − 10 ≡ 23 + (−10). Show every step — 3 marks!

00001010+10 (8 + 2)111101011's complement = inverse (flip every bit)00000001+ binary 111110110−10 in two’s complement
1010101011001110011010110101+1overflow bit — ignore
Subtracting: 00100011 + 11110110

Answer (in binary): 00011001

Note: both numbers are 8-bit but the sum needs 9 bits — the extra carry is the overflow bit. Don’t write it; the answer is only 8 bits wide (see §8).
Extra (teacher practice)

00100011 − 20 → 20 = 00010100 → −20 = 11101100 → 00100011 + 11101100 = (1) 00001111 (overflow bit dropped).

8. Concept of Overflow

Idea: more bits to store, but less space. A memory location holds a fixed number of bits — if the answer needs more, the extra bit(s) don’t fit → error called overflow. The data isn’t fully saved, so accuracy can suffer.

OS = 64 bit means each memory location stores 64 bits; a 65-bit answer overflows by 1 bit. (Don’t confuse 32-/64-bit OS labels — they just state how many bits per location.) Here we use 8-bit locations: a 9th bit = overflow bit; a 10-bit answer → the last two bits overflow.

Spot it: a carry comes out of the left-most column — that extra 1 is the overflow bit.
11010011111101011001010110011+1OVERFLOW (9th bit)
170 + 183 = 353 needs 9 bits, but only 8 fit
past paper

Q: State how an overflow can occur when adding two binary integers.

The result is a larger number than can be stored in the given number of bits.

Remember: in answers, ignore the overflow bit (don’t write it) unless the question gives more bits (e.g. “answer in 9 bits”). Exam only asks basics: what overflow means.

9. ASCII, Extended ASCII & Unicode

Basic concept: numbers are easy to convert to binary. e.g. 67:

place value12806413201608040211164 + 2 + 1 = 67
67 → 01000011 (67 is the code for capital C)

But what about A, B, [ ] or Enter, Backspace, Delete…? The computer only understands 0s and 1s, and there was no way to represent alphabets / characters / symbols. So a standard code was set: every character gets its own denary value, which is stored in binary.

Character Denary code 8-bit binary
A 65 01000001
B 66 01000010
[ 91 01011011
] 93 01011101

The board left A, B and [ ] as “?” — filled in here using A = 65 and the ASCII table (B = 65 + 1).

149denary code00110001A65denary code01000001Delete127denary code01111111
press a key → its code (denary) → stored/sent in binary; computer matches it with the ASCII table to know which key it was
Only learn: A = 65 and a = 97. Then B = 66, C = 67 … b = 98 (add 1 each letter). “No need to memorise” the table!

Table columns: Dec / Hex / Oct / Char — e.g. 49 = hex 31 = ‘1’; 65 = hex 41 = ‘A’; 97 = hex 61 = ‘a’; 127 = Delete.

key pressedASCII code (denary)binary → computermatched to ASCII table

ASCII

  • 7 bits per code
  • 128 characters can be represented (values 0–127, one byte used)
  • Full form: American Standard Code for Information Interchange (no need to memorise)
16403201608040211= A
1000001 (64+1 = 65) = A — only 7 bits needed

Why 128? 64+32+16+8+4+2+1 = 127; add 1 for the all-zero code → 128 characters. (Same trick: 1+2+…+128 = 255, +1 = 256.)

Extended ASCII

  • 8 bits (place values 128 … 1)
  • ASCII codes were 7 bits long but then it was extended to have a bit length of 8
  • 256 characters can be represented

Unicode

Problem: Arabic, Greek, Hindi, Urdu … — every language has its own characters and 256 is far too few → no representation.

Solution — Unicode: uses 16, 24 or 32 bits per code, so most characters of other languages can be represented.

Unicode (16 / 24 / 32 bits)ASCII (0 – 127)A=65 B=66 C=67 …Arabic, Greek,Hindi, Urdu …
Unicode is a superset of ASCII (ASCII is a subset of Unicode) — codes 0–127 are the same in both

(Extra concept from the lecture — sets & Venn idea: B ⊃ A means B contains all of A’s values. Sir said not to put it in the notes, but it explains “superset”.)

ASCIIExt. ASCIIUnicode7 bits → 128 chars8 bits → 256 chars16 / 24 / 32 bits(Unicode shown at 16 bits; 24 & 32 bits are even longer)

Comparison table

ASCII Extended ASCII Unicode
Bits 7 8 16, 24, 32
Characters 128 256 most of the world’s languages
Range / note 0–127, same on every system 128–255 coded differently on different systems superset of ASCII
theory (past paper)

Q: What are the disadvantages of using ASCII code?

  • Only 128 characters can be represented
  • Uses value 0 to 127 / one byte
  • Many characters used in other languages cannot be represented
  • In extended ASCII the characters from 128 to 255 may be coded differently in different systems

Why “differently”? 0–127 is fixed on all systems (65 is always A), but 128–255 has no standard — e.g. Arabic “Alif” could be 129 on one system and another value on another. Customisable = not compatible.

Q: How is Unicode designed to overcome the disadvantages of ASCII?

  • Uses 16, 24, 32 bits
  • Unicode is designed to be a superset of ASCII
  • Designed so that most characters in other languages can be represented
9618 recent papera whole question on ASCII / Unicode — first time this happened (sir thinks May/June 2021)

6. A computer uses the ASCII character set.

(a) State the number of characters represented by ASCII and extended ASCII [2]

ASCII: 128  |  Extended ASCII: 256

(not 127 — 127 + 1 for the all-zero code = 128)

(b) Explain how a word such as ‘HOUSE’ is represented by the ASCII character set. [2]

  • Each character has its own unique code
  • Each character in the word is replaced by its code
  • The codes are stored in the order in the word

e.g. H, O, U, S, E each get their own binary code, stored one after another in the same order as the word.

(c) Unicode is a different character set. The Unicode value for the character ‘1’ is denary value 49.

(i) Write the hexadecimal value for the Unicode character ‘1’. [1]

49 = 32 + 16 + 1 → 0011 00010011 = 3 · 0001 = 131

(ii) Write the denary value for the Unicode character ‘5’. [1]

‘1’ = 49 → ‘2’ = 50 → ‘3’ = 51 → ‘4’ = 52‘5’ = 53

Digits are consecutive in the code — write the count-up to avoid confusion. (Binary code is not asked here — Unicode value = denary/hex.)

place value12806403211618040201132 + 16 + 1 = 49 → hex 31
‘1’ = 49 = 0011 0001 = 31 in hex
Syllabus: you are not expected to memorise any particular character codes. The Data Representation part of Chapter 1 is now complete; next come multimedia (images, sound) and compression.

10. Quick Recap — Full Chapter Cheat-Sheet

✓ Units & prefixes
  • bit (smallest) · 4 bits = nibble · 8 bits = 1 byte
  • Binary prefixes (÷/× 1024): kibi · mebi · gibi · tebi — Decimal (÷/× 1000): kilo · mega · giga · tera
  • bigger → smaller: multiply · smaller → bigger: divide · bits → bytes: ÷ 8 first
✓ Conversions (always write 128 64 32 16 8 4 2 1)
  • Denary → binary: put 1s so the place values add to the number
  • Binary → denary: add only the place values with a 1
  • Binary → hex: groups of 4 from the right → 8 4 2 1 → > 9 use A=10 … F=15
  • Denary → hex: denary → binary → hex  |  Hex → denary: hex → binary → denary
✓ BCD
  • 4-bit code for each denary digit (digits ≤ 9) · 54 = 0101 0100 · 653 = 0110 0101 0011
  • BCD → denary: groups of 4 from right → digits · uses: calculators, digital clocks (single digits)
  • Always check: is it BCD or binary?
✓ Binary addition / negatives / subtraction / overflow
  • 0+0=0 · 0+1=1 · 1+1=0 carry 1 · 1+1+1=1 carry 1 · fill gaps with 0
  • Negative: ignore sign → binary → invert (1’s) → +1 (2’s) · first bit 1 ⇒ negative · unsigned: no sign
  • Subtract: apply 2’s complement to the number being subtracted, then add (drop overflow bit)
  • Overflow: result larger than can be stored in the given number of bits
✓ Character sets
  • ASCII: 7 bits · 128 chars (0–127) · Extended ASCII: 8 bits · 256 chars (128–255 not standard)
  • Unicode: 16/24/32 bits · superset of ASCII · most world languages
  • A = 65 · a = 97 (add 1 per letter) · ‘1’ = 49, ‘5’ = 53 · word = each character’s code in order
★ Exam Tip: read the question wording (BCD? unsigned? 12-bit? kibibyte or kilobyte?), show one’s & two’s complement, and give examples in theory answers.