Skip to the page
Year 10 · Computer Science · Summer 2 · Databases and the Year 10 mock

Revision: Paper 1 topics 1 to 3

Exam practicePresent ▶

What this lesson covers

1.1 Number systems

Cambridge IGCSE Computer Science 0478 · Topic 1: Data representation · Paper 1

2.2 Methods of error detection

Cambridge IGCSE Computer Science 0478 · Topic 2: Data transmission · Paper 1

3.1 Computer architecture

Cambridge IGCSE Computer Science 0478 · Topic 3: Hardware · Paper 1

You will learn to

  • Use the command word to decide what kind of answer a question needs.
  • Answer a timed section of Paper 1 questions on topics 1 to 3.
  • Calculate how long to spend on a question from its marks.
  • Evaluate your answers with the mark scheme and update your RAG list.

Success criteria

  • I can say the difference between State, Describe and Explain.
  • I can finish a timed section at about 1.4 minutes per mark.
  • I can mark my own answers and colour each syllabus point red, amber or green.
The syllabus points for these sections
  • Convert positive whole numbers between binary, denary and hexadecimal, both ways.
  • Explain why hexadecimal is used and give real uses.
  • Add two 8-bit binary numbers and spot overflow.
  • Carry out logical left and right shifts and explain their effect.
  • Use 8-bit two's complement for positive and negative numbers.
  • State the largest number that 8 bits and 16 bits can hold.
  • Explain why errors happen during transmission.
  • Use odd and even parity, a parity byte and a parity block.
  • Describe checksum and echo check.
  • Calculate and use a check digit, such as ISBN-13.
  • Describe automatic repeat query (ARQ) with acknowledgements and timeouts.
  • Describe the role of the CPU and what a microprocessor is.
  • Name the parts of the von Neumann architecture: ALU, CU, registers and buses.
  • Describe the fetch–decode–execute cycle, step by step.
  • Explain how cores, cache and clock speed affect performance.
  • Explain what an instruction set is.
  • Describe embedded systems and how they differ from general-purpose computers.

Key words

Say each word, then read what it means. Every one is in the glossary too.

Bit
A single binary digit, 0 or 1.
Nibble
A group of 4 bits, which matches one hexadecimal digit.
Byte
A group of 8 bits.
Denary
The base 10 number system we use every day, with digits 0 to 9.
Binary
The base 2 number system computers use, with digits 0 and 1.
Hexadecimal
The base 16 number system, with digits 0 to 9 and A to F, used to write binary in a short form.
Overflow
An error when a result is too big to fit in the number of bits available.
Logical shift
Moving all the bits left or right, losing bits off one end and filling the other end with 0s.
Two's complement
A way to store negative numbers, where the leftmost bit has a negative place value (−128 in 8 bits).
Colour depth
The number of bits used to store the colour of each pixel.
Packet
A small piece of data sent across a network, with a header, payload and trailer.
Packet switching
Sending each packet separately, possibly by different routes, then reordering them at the destination.
Interference
Unwanted outside signals that can corrupt data on the way.
Parity bit
An extra bit that makes the number of 1s in a byte odd or even.
Checksum
A value calculated from a block of data, recalculated by the receiver to check for errors.
Echo check
The receiver sends the data back so the sender can compare it with the original.
Check digit
A digit calculated from the other digits of a number, used to catch typing errors.
ARQ
Automatic repeat query: acknowledgements and timeouts make the sender re-send data that is wrong or lost.
CPU
The central processing unit, which processes instructions and data by fetching, decoding and executing them.
Microprocessor
A CPU made as an integrated circuit on a single chip.
Von Neumann architecture
A computer design where instructions and data are stored together in the same memory.
ALU
Arithmetic logic unit: does calculations and logical comparisons.
Control unit
Manages the fetch–decode–execute cycle and sends control signals.
Register
A tiny, very fast store inside the CPU that holds one item.
Bus
A set of parallel wires that carries addresses, data or control signals.
Cache
Small, very fast memory in or near the CPU that holds frequently used data and instructions.
Clock speed
The number of cycles the CPU does each second, measured in hertz.
Core
A complete processing unit; a multi-core CPU can process several instructions at once.
Instruction set
The list of all the instructions a particular CPU can carry out.
Embedded system
A computer system inside a larger device that does one dedicated job.
Sensor
An input device that measures a physical property and sends the reading to a computer.
NIC
Network interface card: the hardware that connects a device to a network.
MAC address
A unique 48-bit address given to a NIC at manufacture, written in hex.
IP address
An address given to a device on a network so data can be sent to it.

The explanation

Read it here, or open the study page below to go one step at a time with things to try.

Command words: what the question wants

Every exam question starts with a command word. It tells you what kind of answer earns the marks.

Command wordWhat it asks forExample
State or GiveA short fact. No reason needed.State one register in the CPU. The MAR.
IdentifyName or pick out one thing.Identify the register that holds the next address. The PC.
DefineThe exact meaning of a term.A bit is one binary digit: 0 or 1.
DescribeWhat something is like, or what happens, in order.The file is split into packets. Each packet may take a different route.
ExplainWhy or how. Give a reason, joined with 'because' or 'so'.Hex is shorter than binary, so there are fewer mistakes when reading it.
CompareHow two things are alike or different. Mention both things in each point.Serial sends one bit at a time, but parallel sends several bits at once.
CalculateWork out a number. Show the working and the units.800 × 600 × 24 = 11 520 000 bits
EvaluateJudge how good something is. Give points for and against, then a conclusion.Cloud storage: access anywhere, but needs the internet. Overall …
SuggestUse what you know in a new situation. Several answers can be right.Suggest a sensor for a car park: infra-red.
★Remember

As a rough guide, one mark needs one clear, separate point. A 4-mark question needs about four.

!Watch out

'Describe' does not ask for reasons. 'Explain' does. A description given for an 'explain' question often loses marks.

Marks per minute

Paper 1 (Computer Systems) lasts 1 hour 45 minutes. It has 75 marks.

105 minutes ÷ 75 marks = 1.4 minutes per mark. Use this to plan each question.

Marks for the questionWorkingTime to spend
22 × 1.4 = 2.8about 3 minutes
44 × 1.4 = 5.6about 6 minutes
66 × 1.4 = 8.4about 8 minutes
★Remember

Stuck? Leave a gap, mark the question number, and move on. Come back at the end.

!Watch out

Check the paper length on the current Cambridge 0478 syllabus for the year your pupils sit the exam.

Mark it, then RAG it

A RAG list is the syllabus written as a checklist. Pupils colour each point red, amber or green.

ColourIt meansWhat to do next
RedI cannot do this yet.Revise it first. Ask for help.
AmberI can do it, but I make mistakes.Practise past-paper questions on it.
GreenI can do it under time.Keep it fresh with a short quiz.
  1. Do the timed section in silence.
  2. Mark it with the real mark scheme.
  3. Write each missing point in a different colour.
  4. Update the RAG list from the marks, not from feelings.
  5. Revise the reds first.
?Why?

Why mark with the real mark scheme?

It shows the exact points that earn marks. Pupils see what a full answer looks like.

1.1 Number systems

Why computers use binary

A computer is made of billions of tiny switches called transistors. Each switch is either off or on.

We write off as 0 and on as 1. A number system with only two digits is called binary.

One binary digit is a bit. Eight bits together make a byte.

Every extra bit doubles the number of different patterns you can make.

e.g.Example
1 bit: 0, 1 → 2 patterns 2 bits: 00, 01, 10, 11 → 4 patterns 3 bits: 000, 001, 010, 011, 100, 101, 110, 111 → 8 patterns 8 bits: 2 × 2 × 2 × 2 × 2 × 2 × 2 × 2 = 256 patterns
?Why?

Two states are very reliable. A switch is clearly on or clearly off, so the computer rarely misreads a value.

Place value: denary and binary

Denary is our everyday number system. It has ten digits, 0 to 9, and each column is worth 10 times the column to its right.

Binary works the same way, but each column is worth 2 times the column to its right.

For 8 bits the column values, from left to right, are 128, 64, 32, 16, 8, 4, 2, 1.

To turn binary into denary, add up the column values that have a 1 under them.

Try the toy: switch on the 128 bit. What happens to the denary value? Now make 255.

1286432168421
01011010
e.g.Example
Binary 01011010 to denary. The 1s sit under 64, 16, 8 and 2. 64 + 16 + 8 + 2 = 90
!Watch out

Always write the column values above the bits first. Most mistakes come from adding the wrong column.

There is something to try for this step in the IGCSE library.

Denary to binary

Start at the left column, 128. Ask: does 128 fit into my number?

If it fits, write 1 and take 128 away. If it does not fit, write 0.

Move to the next column and repeat with what is left. Stop when you reach the 1 column.

Always write all 8 bits, including the 0s at the front.

e.g.Example
Denary 150 to binary. 128 fits → 1. Left: 150 − 128 = 22 64 does not fit → 0 32 does not fit → 0 16 fits → 1. Left: 22 − 16 = 6 8 does not fit → 0 4 fits → 1. Left: 6 − 4 = 2 2 fits → 1. Left: 0 1 does not fit → 0 Answer: 10010110 Check: 128 + 16 + 4 + 2 = 150
?Why?

Each column is used once at most, so taking away the biggest column first always gives the right pattern.

The biggest number n bits can hold

With n bits you get 2ⁿ patterns. One of those patterns is 0.

So the biggest number is one less than the number of patterns: 2ⁿ − 1.

8 bits hold 0 to 255. 16 bits hold 0 to 65,535.

A register is a small store inside the processor. An 8-bit register cannot hold anything bigger than 255.

e.g.Example
8 bits: 2⁸ = 256 patterns. Biggest = 256 − 1 = 255 (11111111) 16 bits: 2¹⁶ = 65,536 patterns. Biggest = 65,536 − 1 = 65,535 (1111111111111111, or FFFF in hex) Quick check for 8 bits: 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255
!Watch out

8 bits give 256 different values, but the largest value is 255, because counting starts at 0.

Hexadecimal: base 16

Hexadecimal (hex) has sixteen digits. It uses 0 to 9, then the letters A to F for 10 to 15.

Each hex column is worth 16 times the column to its right. Two-digit hex has columns 16 and 1. Three digits add a 256 column.

One hex digit stands for exactly four bits. Four bits are called a nibble.

DenaryBinary (nibble)Hex
000000
100011
200102
300113
401004
501015
601106
701117
810008
910019
101010A
111011B
121100C
131101D
141110E
151111F
?Why?

16 is 2 × 2 × 2 × 2. That is why one hex digit matches four bits exactly, with nothing left over.

Hex to denary and denary to hex

Hex to denary: multiply each digit by its column value, then add. Change letters to numbers first (B = 11, F = 15).

Denary to hex: divide by 16. The whole-number answer is the left digit. The remainder is the right digit.

Change any digit from 10 to 15 into its letter.

e.g.Example
Hex B7 to denary: B = 11, so 11 × 16 = 176 7 × 1 = 7 176 + 7 = 183 Denary 200 to hex: 200 ÷ 16 = 12 remainder 8 12 = C, so the answer is C8 Check: 12 × 16 + 8 = 192 + 8 = 200 Three digits, hex 1A3 to denary: 1 × 256 = 256 A = 10, so 10 × 16 = 160 3 × 1 = 3 256 + 160 + 3 = 419
!Watch out

A remainder of 10 to 15 must be written as a letter. Writing "128" for C8 is a common slip.

Binary and hex using nibbles

Binary to hex: split the binary into groups of 4 bits, starting from the right. Change each group into one hex digit.

Hex to binary: change each hex digit into its 4-bit nibble. Write them side by side.

Each nibble uses the small column values 8, 4, 2, 1. This keeps the sums easy.

The fastest route between denary and hex is often through binary.

e.g.Example
Binary 10110110 to hex: Split: 1011 | 0110 1011 = 8 + 2 + 1 = 11 = B 0110 = 4 + 2 = 6 Answer: B6 Hex 4E to binary: 4 = 0100 E = 14 = 8 + 4 + 2 = 1110 Answer: 01001110 12 bits, 000110100011 to hex: 0001 | 1010 | 0011 → 1, A, 3 → 1A3
!Watch out

Always group from the right. If the left group is short, add 0s at its front. Keep the leading 0s when you change hex to binary, so each digit gives four bits.

Why hexadecimal is used

Computers do not use hex. Inside, everything is still binary. Hex is for people.

Hex is shorter: 8 bits become 2 hex digits. It is easier to read, remember and type.

People make fewer mistakes copying hex than long strings of 0s and 1s.

It converts to binary very easily, because each digit is one nibble.

UseReal exampleWhat the hex means
MAC address00:1A:2B:3C:4D:5EThe unique number of a network card. 12 hex digits instead of 48 bits.
HTML colour code#FF8800Red FF = 255, green 88 = 136, blue 00 = 0. This is orange.
Error codes0x80070005A Windows error code (access denied). The 0x means "hex follows".
URLsmy%20file.html%20 is hex 20 = denary 32, the code for a space.
Memory dumps3F A7 00 B6The contents of memory shown for a programmer finding a bug.
IPv6 addresses2001:0db8::7334Long network addresses written in hex groups.
!Watch out

Do not write "hex takes up less memory". It does not. The computer stores the same binary. Hex is only a shorter way for humans to write it.

Adding binary: the four rules

You add binary in columns, from right to left, like denary addition.

In binary, 1 + 1 makes 2, and 2 is written 10. So you write 0 and carry 1 to the next column.

If a column has 1 + 1 plus a carry of 1, the total is 3. Three is 11: write 1 and carry 1.

Try the toy: it starts with 91 + 54. Press Step to add one column at a time and watch where each carry goes. Then press Overflow example.

Column adds up toDenary totalWriteCarry
0 + 0000
0 + 1 or 1 + 0110
1 + 1201
1 + 1 + carry 1311

There is something to try for this step in the IGCSE library.

A full 8-bit addition

Write the two numbers one under the other, with the column values on top.

Write each carry above the next column on the left. Then add that column, including the carry.

Check your answer by changing everything to denary.

1286432168421
Carry11111
10901101101
+ 5400110110
= 16310100011
e.g.Example
Column 1: 1 + 0 = 1 Column 2: 0 + 1 = 1 Column 4: 1 + 1 = 10 → write 0, carry 1 Column 8: 1 + 0 + carry 1 = 10 → write 0, carry 1 Column 16: 0 + 1 + carry 1 = 10 → write 0, carry 1 Column 32: 1 + 1 + carry 1 = 11 → write 1, carry 1 Column 64: 1 + 0 + carry 1 = 10 → write 0, carry 1 Column 128: 0 + 0 + carry 1 = 1 Answer: 10100011 Check: 128 + 32 + 2 + 1 = 163, and 109 + 54 = 163
!Watch out

Show your carries in the exam. A wrong answer with clear carries can still earn a working mark.

Overflow

An 8-bit register can hold 0 to 255. Sometimes an addition gives more than 255.

Then the last column makes a carry that has nowhere to go. It would need a 9th bit.

This is called an overflow error. The 9th bit is lost, so the stored answer is wrong.

The processor sets an overflow flag so the program can deal with it.

Lost1286432168421
Carry11
20011001000
+ 10001100100
Stored100101100
e.g.Example
200 + 100 = 300. But 300 is more than 255. The full answer needs 9 bits: 1 00101100. The register keeps only the right 8 bits: 00101100 = 32 + 8 + 4 = 44. 300 − 256 = 44, because the lost 9th bit was worth 256.
?Why?

A register has a fixed number of bits. Anything that does not fit is lost, so the computer cannot store a value above 2ⁿ − 1.

Logical left shift

A logical shift moves every bit left or right by a number of places.

In a left shift, bits fall off the left end and are lost. 0s fill the gaps on the right.

Each place shifted left multiplies the number by 2. Two places is × 4. Three places is × 8.

If a 1 falls off the left end, the answer is wrong. This is a kind of overflow.

Try the toy: load 22 (00010110), choose 2 places and press Shift left. Then load 53 (00110101) and shift it left 3 places. Which answer is wrong?

1286432168421Denary
Before0001011022
Left 20101100088
e.g.Example
22 shifted left 2 places: 00010110 → 01011000 0 and 0 fall off the left. Two 0s come in on the right. 01011000 = 64 + 16 + 8 = 88. And 22 × 4 = 88. Correct. 53 shifted left 3 places: 00110101 → 10101000 0, 0 and 1 fall off the left. The lost 1 was important. 10101000 = 128 + 32 + 8 = 168. But 53 × 8 = 424. Wrong answer, because 424 is too big for 8 bits.
?Why?

Moving a bit one column left puts it in a column worth twice as much. So the whole number doubles.

There is something to try for this step in the IGCSE library.

Logical right shift

In a right shift, bits fall off the right end and are lost. 0s fill the gaps on the left.

Each place shifted right divides the number by 2. Two places is ÷ 4. Three places is ÷ 8.

If a 1 falls off the right end, the remainder is lost. The answer is rounded down, so accuracy is lost.

1286432168421Denary
Before0001011022
Right 2000001015
e.g.Example
180 shifted right 1 place: 10110100 → 01011010 = 64 + 16 + 8 + 2 = 90. And 180 ÷ 2 = 90. Exact. 22 shifted right 2 places: 00010110 → 00000101 = 4 + 1 = 5 But 22 ÷ 4 = 5.5. The bits 1 and 0 fell off the right end. The lost 1 was worth 0.5 after dividing, so the answer is not exact.
!Watch out

In a logical shift the new bits are always 0. Do not copy the old end bit back in, and do not wrap bits round to the other end.

Two's complement: negative numbers

So far 8 bits only held positive numbers, 0 to 255. Two's complement is a way to store negative numbers too.

The only change: the leftmost column is worth −128 instead of 128. All other columns stay the same.

If the leftmost bit is 0, the number is positive. If it is 1, the number is negative.

8-bit two's complement holds −128 to +127.

Try the toy: press Smallest (−128) so only the −128 bit is on. Then tap the 64 bit. Watch the value climb towards 0.

−1286432168421Denary
0100110164 + 8 + 4 + 1 = 77
10110110−128 + 32 + 16 + 4 + 2 = −74
11111111−128 + 127 = −1
e.g.Example
Two's complement 10110110 to denary. The 1s are under −128, 32, 16, 4 and 2. −128 + 32 + 16 + 4 + 2 = −128 + 54 = −74
?Why?

With a −128 column, normal binary addition still works for negative numbers. The processor needs only one adding circuit.

There is something to try for this step in the IGCSE library.

Denary to two's complement

Positive number: write it in normal 8-bit binary. The leftmost bit will be 0.

Negative number, method 1: write the positive version in binary. Flip every bit (0 becomes 1, 1 becomes 0). Then add 1.

Negative number, method 2: start with −128. Work out what you must add to reach your number. Put that in the other 7 columns.

Use one method and check with the other, or check by adding the column values.

e.g.Example
Change −45 into 8-bit two's complement. Method 1 (flip and add 1): +45 = 00101101 Flip every bit: 11010010 Add 1: 11010011 Method 2 (start at −128): −45 = −128 + 83 83 = 64 + 16 + 2 + 1 So: 1 in the −128 column, then 1010011 Answer: 11010011 Check: −128 + 64 + 16 + 2 + 1 = −45
!Watch out

+45 and −45 are not the same pattern with a different first bit. 10101101 is −83, not −45. Always flip and add 1, or use the −128 method.

2.2 Methods of error detection

Why errors happen

Bits travel as electrical pulses, light or radio waves. These can be disturbed on the way.

Interference is unwanted signal from outside, such as from a motor, a microwave oven or lightning.

Because of interference, data can suffer data loss (bits go missing), data gain (extra bits appear) or data change (a 1 becomes a 0, or a 0 becomes a 1).

?Why?

One wrong bit can change a whole number. If 01000001 (65) becomes 01000011 (67), a bank amount or a letter changes. So the receiver must be able to spot errors.

Parity check: odd and even

A parity check adds one extra bit, the parity bit, to each byte. Usually it is the leftmost bit.

In even parity, the total number of 1s in the byte must be even. In odd parity, the total must be odd.

The sender and receiver agree the type first. The receiver counts the 1s. If the count is wrong, there is an error.

e.g.Example
Data bits (7): 1011001. Count the 1s: 1+0+1+1+0+0+1 = 4. Even parity: 4 is already even, so the parity bit is 0 → 01011001 Odd parity: 4 is even, so the parity bit is 1 to make 5 → 11011001 Try it in the toy: choose Even parity, then press Send with noise (1 bit flips). The count becomes odd and the error is found. Then try Send with 2 bits flipped.
!Watch out

Parity cannot find an error if two bits flip. The count changes by 2, so it stays even (or odd). It also cannot say which bit is wrong.

There is something to try for this step in the IGCSE library.

Parity byte and parity block

To find which bit is wrong, we send a block of bytes, each with its own parity bit.

Then we add a parity byte at the end. Each bit of the parity byte gives parity for one column.

If one bit flips, one row fails and one column fails. The wrong bit is where they cross, so the receiver can even correct it.

e.g.Example
Even parity. Four bytes, parity bit first: Byte 1: 0 1 0 1 1 0 0 1 Byte 2: 0 1 1 0 0 0 1 1 Byte 3: 1 0 1 1 0 1 0 0 Byte 4: 0 1 0 0 1 1 1 0 Parity byte: 1 1 0 0 0 0 0 0 (each column now has an even number of 1s) Now bit 5 of byte 3 flips from 0 to 1: byte 3 becomes 1 0 1 1 1 1 0 0. Row check: byte 3 has five 1s (odd) → error in row 3. Column check: column 5 has three 1s (odd) → error in column 5. The error is at row 3, column 5. Flip it back.
?Why?

Rows and columns work like grid references on a map. One wrong row plus one wrong column points to a single square.

Checksum

A checksum is a value calculated from all the data in a block, using an agreed method.

The sender calculates the checksum and sends it with the data.

The receiver calculates the checksum again from the data it received. If the two values match, the data is probably correct. If not, it asks for the data again.

e.g.Example
One simple method: add the byte values, and keep the remainder after dividing by 256 (so it fits in one byte). Data bytes: 150, 200, 75, 30 Total: 150 + 200 + 75 + 30 = 455 455 ÷ 256 = 1 remainder 199 → checksum = 199 If 75 arrives as 77, the receiver gets 457 → remainder 201. 201 ≠ 199, so there is an error.
!Watch out

Cambridge does not ask for one exact checksum method. In the exam, describe the process: calculate at the sender, send, recalculate at the receiver, compare.

Echo check

In an echo check, the receiver sends a copy of the data straight back to the sender.

The sender compares the copy with the original. If they are the same, the data arrived correctly. If not, the sender sends it again.

!Watch out

An echo check doubles the traffic. Also, if the copies differ, you cannot tell if the error happened on the way there or on the way back.

Check digits

A check digit is an extra digit added to the end of a number, such as an ISBN (book number) or a supermarket barcode.

It is calculated from the other digits. It catches data entry errors: a digit typed wrongly, or two digits swapped (transposed).

This is different from parity and checksums. Those catch errors in transmission; a check digit catches human errors when a number is typed or scanned.

e.g.Example
ISBN-13 for the first 12 digits 978030640615: Step 1: multiply digits by 1, 3, 1, 3, … in turn 9×1=9, 7×3=21, 8×1=8, 0×3=0, 3×1=3, 0×3=0, 6×1=6, 4×3=12, 0×1=0, 6×3=18, 1×1=1, 5×3=15 Step 2: add them: 9+21+8+0+3+0+6+12+0+18+1+15 = 93 Step 3: 93 MOD 10 = 3 Step 4: 10 − 3 = 7 → check digit is 7. Full ISBN: 9780306406157 Check: weighted total of all 13 digits = 93 + 7 = 100, and 100 MOD 10 = 0, so it is valid. Try it in the toy: the first 12 digits above are already filled in. Under Check a full ISBN-13, press Make a typo or change one digit yourself, and see the check fail.
?Why?

The weights 1 and 3 mean that swapping two neighbouring digits usually changes the total. So swaps are caught as well as wrong digits.

!Watch out

If the remainder in step 3 is 0, the check digit is 0, not 10. That is why the rule is (10 − remainder) MOD 10.

There is something to try for this step in the IGCSE library.

Automatic repeat query (ARQ)

ARQ uses an error check (such as a checksum) plus messages back to the sender.

If the data arrives correctly, the receiver sends a positive acknowledgement. If it finds an error, it sends a negative acknowledgement and the sender sends the data again.

The sender also starts a timeout: a set time to wait. If no acknowledgement arrives before the time runs out, the sender re-sends the data automatically.

e.g.Example
Packet 7 is sent. The sender starts a 2-second timer. Case A: packet arrives fine → receiver sends a positive acknowledgement → sender sends packet 8. Case B: checksum fails → receiver sends a negative acknowledgement → sender re-sends packet 7. Case C: packet is lost → nothing comes back → after 2 seconds the timeout ends → sender re-sends packet 7.
?Why?

The timeout handles the case where the data, or the acknowledgement, is lost completely. Without it, the sender would wait forever.

3.1 Computer architecture

The CPU and the microprocessor

The CPU (central processing unit) is the part of the computer that processes instructions and data. It carries out the instructions of every program.

It does this by fetching an instruction from memory, decoding it, then executing it. Then it repeats, billions of times a second.

A microprocessor is a CPU built as an integrated circuit on a single chip. An integrated circuit is a whole electronic circuit made on one small piece of silicon.

e.g.Example
The chip inside a laptop, a phone or a games console is a microprocessor. A microprocessor also sits inside a microwave oven, running its timer.

Von Neumann architecture

Most computers follow the von Neumann architecture. Its key idea is the stored program: instructions and data are both stored in the same main memory.

The CPU has a control unit (CU). The CU manages the fetch–decode–execute cycle. It decodes instructions and sends control signals to the other parts.

The CPU has an arithmetic logic unit (ALU). The ALU does calculations (such as add and subtract) and logic operations (such as comparing two numbers).

The CPU also has registers: very small, very fast stores inside the CPU. The CPU is joined to memory by three buses (sets of wires).

?Why?

Keeping instructions and data in one memory means the computer can run any program you load. Change the program in memory and the same hardware does a new job.

There is a diagram for this step in the IGCSE library.

The five registers

A register holds one item at a time: an address, an instruction or a piece of data.

An address is the number of a location in memory, like a locker number in a school corridor.

RegisterFull nameWhat it holds
PCProgram counterThe address of the next instruction to be fetched
MARMemory address registerThe address of the memory location about to be read from or written to
MDRMemory data registerThe data or instruction that has been fetched from memory, or about to be written to memory
CIRCurrent instruction registerThe instruction that is being decoded and executed right now
ACCAccumulatorThe result of calculations done by the ALU
!Watch out

PC and MAR hold addresses. MDR and CIR hold instructions or data. Mixing these up is the most common error in FDE answers.

The three buses

The address bus carries addresses from the CPU (the MAR) to memory. It is one-way (unidirectional), because only the CPU chooses addresses.

The data bus carries data and instructions between the CPU (the MDR) and memory. It is two-way (bidirectional), because data is both read and written.

The control bus carries control signals from the control unit, such as 'read', 'write' and the clock signal. It is two-way, because devices also send signals back.

!Watch out

Exam answers often say 'the address bus carries data'. It carries addresses only. Data and instructions travel on the data bus.

The fetch–decode–execute cycle

Every instruction goes through the same three stages. Learn the fetch stage in order: it is worth most marks.

Fetch: the address in the PC is copied to the MAR, using the address bus. The PC is incremented (1 is added), so it points to the next instruction. The instruction at that address is sent along the data bus to the MDR. It is then copied from the MDR to the CIR.

Decode: the control unit decodes the instruction in the CIR. It works out what the instruction means and what needs to happen.

Execute: the instruction is carried out. The control unit sends signals on the control bus. If there is a calculation, the ALU does it and the result goes in the ACC. Then the cycle starts again.

e.g.Example
PC = 100. The instruction at address 100 is LOAD 105 (put the value at address 105 into the ACC). Fetch: 100 is copied from PC to MAR → PC becomes 101 → LOAD 105 travels from address 100 to the MDR → copied to the CIR. Decode: the CU sees 'load the value at address 105'. Execute: 105 goes into the MAR → the value at 105 (say 7) comes back on the data bus to the MDR → it is copied to the ACC. ACC = 7. Try it in the toy: its tiny program starts at address 0 (LOAD 5, ADD 6, STORE 7, HALT). Press Step and watch each register change. Notice when the PC goes up by 1.
?Why?

The PC is incremented during fetch, so the CPU always knows where the next instruction is, even while it is busy with the current one.

There is something to try for this step in the IGCSE library.

The instruction set

An instruction set is the list of all the instructions (commands) that a particular CPU can understand and carry out.

Each instruction is a binary code, called machine code. Examples are load, add, store, compare and jump.

The CU decodes instructions using this set. Different CPU families have different instruction sets.

e.g.Example
Most laptops use x86 processors. Most phones use ARM processors. A program compiled for one will not run directly on the other, because their instruction sets are different.

Cores, cache and clock speed

Clock speed is the number of fetch–decode–execute cycles the CPU can do per second, measured in hertz (Hz). A 3.5 GHz CPU has 3,500,000,000 clock ticks per second. Higher clock speed means more instructions per second.

Cache is a small amount of very fast memory inside or next to the CPU. It stores instructions and data that are used often, so the CPU does not have to wait for slower RAM. More cache means fewer slow trips to RAM.

A core is a complete processing unit (with its own ALU, CU and registers). A quad-core CPU has four cores, so it can process four instructions at the same time.

?Why?

All three let the CPU get through more instructions in a given time. That is what 'better performance' means.

!Watch out

Doubling the cores does not double the speed. Cores must communicate with each other, and some programs cannot be split into parts. Raising clock speed also makes the CPU hotter, and cache is expensive, so there are limits.

Embedded systems

An embedded system is a small computer system built inside a larger device, to do one dedicated job.

It uses a microprocessor (or a microcontroller) and usually runs one fixed program stored in ROM.

A general-purpose computer, like a laptop, can run many different programs and do many jobs.

Embedded system examplesWhat it controls
Washing machineWater level, temperature, drum speed for each wash programme
Microwave ovenTimer and power level
Central heatingTurns the boiler on and off using a temperature sensor
Car engine managementFuel and air mix, using many sensors
Traffic lightsThe light sequence and timing
?Why?

Embedded systems are small, cheap to mass-produce and use very little power, because they only do one job. The drawbacks: they are hard to update or change, and they can only do the task they were built for.

Study it

Open the study page and go one step at a time.

Check yourself

One question at a time. The reason shows after each answer.

Saved on this device.