AdvertisementYour brand could be hereYour brand hereOn every Darslab page · students, parents and teachersinfo@darslab.comAsk for pricesPricesinfo@darslab.com
☰ Year plan · Computing

One step at a time

Week 25 · 4.2 Computer architecture · 3 lessons
2

One core, many cores

Computing 9: Topic 4.2, pp. 312–319
GoalExplain what a core is, why a single core works through instructions one at a time, and how extra cores help and sometimes have to wait.
New words
core · a processing unit inside a CPU that carries out one instruction at a timemulti-core CPU · a CPU with two or more cores, such as a dual core (two) or a quad core (four)idle · waiting with no instruction to carry out
Explanation

A core is a processing unit inside the CPU. One core follows one instruction at a time, like one worker with one pair of hands. A multi-core CPU has several cores, and each core can work on a different instruction at the same moment. This saves time when the jobs do not depend on each other. Even so, a program’s instructions are still arranged in order, because the order changes the answer and because some computers have only one core. Sometimes a core needs a result that another core has not finished yet, so it must sit idle and wait. This is why four cores do not always finish a program four times faster.

Single coreDual coreQuad core
Cores124
Instructions at the same moment1up to 2up to 4
Can a core be idle?only if there is nothing to doyes, if it waits for a resultyes, if it waits for a result
Worked examples
CoresJobs for each coreTotal time (seconds)
11260
2630
3420
4315
Twelve jobs that do not depend on each other. Each job takes 5 seconds. With one core, the jobs go one after another: 12 × 5 = 60 seconds. With two cores, each core takes 6 jobs, so 6 × 5 = 30 seconds. With three cores each takes 4 jobs (20 seconds) and with four cores each takes 3 jobs (15 seconds).
Core0–2 s2–4 s4–7 s
Core 1AAC
Core 2Bidleidle
A job that has to wait. Job A takes 4 seconds, job B takes 2 seconds, and job C takes 3 seconds but needs the results of both A and B. On one core the total is 4 + 2 + 3 = 9 seconds. On two cores, A and B run together, and C can only start when A has finished at 4 seconds, so the total is 4 + 3 = 7 seconds. Core 2 is idle from 2 seconds onwards.
HelpersTotal time (minutes)
112
26
36
46
More cores, no more speed. Four poster jobs take 3 minutes each: write the title, draw a border, colour the title letters, and stick on a photo. Colouring can only start after the title is written. One helper needs 4 × 3 = 12 minutes. Two helpers need 6 minutes (one writes and colours the title, one draws and sticks). Three or four helpers still need 6 minutes, because the title must be written before it is coloured.
Class activity

Copying race (no computer). You need a pencil, paper, a timer and a partner. Write a list of 12 short words. Job 1: one person copies all 12 words onto a new sheet; time it. Job 2: two people each copy 6 words onto the same sheet; time it. Job 3: the second person must write a number beside each word, but only after the first person has written that word. Time it. Compare your three times and say in which job the second person had to wait, and what that waiting is called.

Practice
1
Eight jobs do not depend on each other and each takes 3 seconds. Complete the table.
CoresJobs for each coreTotal time (seconds)
1??
2??
4??
2
Job P takes 6 seconds and job Q takes 2 seconds, and they do not depend on each other. Job R takes 4 seconds and needs the results of both P and Q. Work out the total time on one core and on two cores. For how long is the second core idle?
JobTimeNeeds
P6 snothing
Q2 snothing
R4 sP and Q
3
Write true or false for each sentence and correct the false ones. (a) A quad core CPU always finishes a program four times faster than a single core. (b) A single core can carry out two instructions at the same moment. (c) A core may be idle while it waits for another core.
4
A learner says, “My new CPU has two cores, so every program will run in half the time.” Explain why this may not be true. Use an example from this lesson.