{"base":{"id":"cs10-12","subject":"Computer systems","title":"Processor performance and embedded systems","slug":"processors-and-embedded-systems","scene":"sys10","steps":[{"mode":"clockspeed","eyebrow":"Clock speed and cores","title":"How fast can it think?","body":"Clock speed is how many cycles a processor does each second, measured in GHz. More cores can work on separate tasks at the same time. Change both and watch the work get done.","controls":[{"id":"ghz","label":"Clock speed","min":1,"max":5,"step":0.5,"value":3,"unit":"GHz"},{"id":"cores","label":"Cores","min":1,"max":8,"step":1,"value":2}]},{"mode":"cache","eyebrow":"Cache memory","title":"Keep the useful things close","body":"Cache is a small amount of very fast memory inside the processor. Data used often is kept there, so the CPU doesn't wait for slower RAM. Make the cache bigger and run it.","controls":[{"id":"size","label":"Cache size","min":1,"max":8,"step":1,"value":4,"unit":"MB"}],"actions":[{"id":"run","label":"Run the program"}]},{"mode":"embedded","eyebrow":"Embedded systems","title":"A computer with one job","body":"Many devices contain a small computer that does one dedicated task. These embedded systems are cheap, reliable and use little power. Explore four of them.","actions":[{"id":"d0","label":"Washing machine"},{"id":"d1","label":"Car engine"},{"id":"d2","label":"Fitness tracker"},{"id":"d3","label":"Traffic lights"}]},{"mode":"quiz","look":"clockspeed","eyebrow":"Check yourself","title":"Compare two processors","body":"Processor A: 3.5 GHz, 2 cores. Processor B: 3.0 GHz, 8 cores. Both run a video editor that uses many cores.","question":"Which is likely to be faster for this task?","options":["Processor A","Processor B","They will be exactly the same"],"answer":1,"right":"Correct. Software that splits its work across cores benefits more from 8 cores than from a slightly higher clock speed.","wrong":"Not quite. Think about how many tasks can run at once."}],"more":[{"type":"cards","id":"worked","eyebrow":"Worked examples","title":"Step by step","items":[{"tag":"Compare","title":"2 GHz 4-core vs 4 GHz 2-core","body":"both: 8 billion cycles a second in total\nbut a single-thread task runs faster on 4 GHz\na task split 4 ways runs faster on 4 cores","code":true},{"tag":"Embedded example","title":"Microwave oven","body":"inputs: keypad, door sensor\nprocess: count down, check door\noutputs: magnetron, display, beep","code":true}]},{"type":"cards","id":"detail","eyebrow":"The ideas in detail","title":"The ideas in detail","items":[{"tag":"Clock speed","title":"More ticks per second","body":"Higher clock speed means more instructions per second, but also more heat. Over-heating limits how high it can go."},{"tag":"Cores","title":"More workers","body":"A quad-core CPU has four processing units. Doubling cores doesn't double speed unless the program can be split into parallel tasks."},{"tag":"Cache","title":"Levels of speed","body":"Level 1 cache is tiny and fastest; Level 2 and 3 are bigger and a little slower. All are much faster than RAM."},{"tag":"Instruction set","title":"The commands a CPU understands","body":"Each processor family has its own instruction set: the list of machine-code operations it can perform. Phone chips and laptop chips often use different sets."}]},{"type":"cards","id":"mistakes","eyebrow":"Common mistakes","title":"Watch out for these","items":[{"tag":"Mistake","title":"\"Twice the cores means twice as fast\"","body":"Only if the work can be split. Many tasks can't."},{"tag":"Mistake","title":"\"Clock speed is the only thing that matters\"","body":"Cores, cache and the instruction design matter too. A newer 3 GHz chip can beat an older 4 GHz one."},{"tag":"Mistake","title":"\"Embedded systems aren't computers\"","body":"They have a processor, memory and input/output: they are computers built into devices."},{"tag":"Mistake","title":"Confusing cache with RAM","body":"Cache is inside or right next to the CPU, small and faster; RAM is separate and bigger."}]},{"type":"bars","id":"data","eyebrow":"Data","title":"Typical processors (approximate)","intro":"","items":[{"label":"Smart thermostat chip","value":5,"display":"0.1 GHz, 1 core","color":"#0e9aa7"},{"label":"Budget phone","value":40,"display":"2 GHz, 8 cores","color":"#2f6fdb"},{"label":"Laptop","value":70,"display":"3–4 GHz, 8 cores","color":"#7c3aed"},{"label":"Gaming desktop","value":100,"display":"5 GHz, 16+ cores","color":"#e0463e"}],"facts":[{"title":"Why phones don't run at 5 GHz","body":"Faster clocks use more power and make more heat. Phones balance speed with battery life."},{"title":"Embedded everywhere","body":"A modern car can contain over 50 embedded computers."}]},{"type":"cards","id":"deeper","eyebrow":"Go deeper","title":"More than the lesson","items":[{"tag":"Real world","title":"Turbo boost","body":"Many CPUs raise their clock speed for a few seconds when busy, then slow down to stay cool."},{"tag":"Real world","title":"The Internet of Things","body":"Embedded systems now connect to the internet: smart lights, doorbells and fridges. This brings convenience and new security risks."},{"tag":"Careers","title":"Who builds embedded systems?","body":"Embedded software engineers program cars, medical devices, drones and appliances, often in C on tiny chips."},{"tag":"Coming next","title":"Where this leads","body":"Next: the input and output devices and sensors that these processors talk to."}]},{"type":"cards","id":"challenge","eyebrow":"Challenge yourself","title":"Stretch your brain","intro":"Try each one on paper before opening the card.","items":[{"tag":"Challenge","title":"A game runs at 40 frames per second on a 2-core CPU and uses both cores fully. Would 4 cores at the same speed reach 80 fps?","body":"Only if the game's work can be split into 4 parts and nothing else (like the graphics card) limits it. In practice the gain is usually smaller."},{"tag":"Challenge","title":"Name the inputs, process and output of an automatic hand dryer.","body":"Input: infrared proximity sensor.\nProcess: if hands detected, switch on; stop after they move away.\nOutput: motor and heater."}]},{"type":"activities","id":"try","eyebrow":"Try it at home","title":"Try it yourself","items":[{"title":"Embedded hunt","time":"15 minutes","need":["A notebook"],"steps":["List 10 devices at home that contain an embedded computer.","For each, write its main input and output.","Which ones connect to the internet?","Which would still work without one?"],"why":"Most electrical devices with buttons or displays contain an embedded system.","safety":"No safety risks."},{"title":"Task Manager","time":"10 minutes","need":["A Windows, Mac or Linux computer"],"steps":["Open Task Manager (Activity Monitor on Mac).","Look at the CPU graph for each core.","Open a video or game and watch the graphs.","Do all cores get used equally?"],"why":"You can see how the operating system spreads work across cores.","safety":"Don't close programs you don't recognise."}]},{"type":"quiz","id":"quiz","eyebrow":"Quiz","title":"Eight more questions","questions":[{"question":"Clock speed is measured in…","options":["GB","Mbps","GHz"],"answer":2,"right":"Correct.","wrong":"Not quite."},{"question":"What is cache?","options":["Small, fast memory near the CPU","A type of hard disk","A network cable"],"answer":0,"right":"Correct.","wrong":"Not quite."},{"question":"An embedded system…","options":["runs many apps","does one dedicated task","is always a laptop"],"answer":1,"right":"Correct.","wrong":"Not quite."},{"question":"Why might more cores not make a program faster?","options":["Cores slow each other down always","Cores only store data","The program can't be split into parallel tasks"],"answer":2,"right":"Correct.","wrong":"Not quite."},{"question":"Which is most likely an embedded system?","options":["A microwave controller","A desktop PC","A games console"],"answer":0,"right":"Correct.","wrong":"Not quite."},{"question":"A larger cache usually means…","options":["a slower CPU","fewer slow trips to RAM","more storage for files"],"answer":1,"right":"Correct.","wrong":"Not quite."},{"question":"3 GHz means…","options":["3 million instructions in total","3 GB of RAM","3 billion cycles per second"],"answer":2,"right":"Correct.","wrong":"Not quite."},{"question":"What limits how high clock speed can go?","options":["Heat","Screen size","Keyboard type"],"answer":0,"right":"Correct.","wrong":"Not quite."}]},{"type":"checklist","id":"check","eyebrow":"Self-check","title":"I can…","items":["explain how clock speed affects performance","explain how the number of cores affects performance","explain what cache is and why it helps","explain why comparing processors on one number can mislead","describe what an instruction set is","define an embedded system","give examples of embedded systems and their inputs and outputs","explain the advantages of embedded systems"]},{"type":"keywords","id":"words","eyebrow":"Key words","title":"Words to know","items":[{"word":"clock speed","meaning":"Cycles per second, in GHz."},{"word":"core","meaning":"A processing unit inside a CPU."},{"word":"cache","meaning":"Small, very fast memory near the CPU."},{"word":"multi-core","meaning":"Having more than one core."},{"word":"instruction set","meaning":"The commands a processor understands."},{"word":"embedded system","meaning":"A computer built into a device for one task."},{"word":"microcontroller","meaning":"A tiny computer on one chip used in embedded systems."},{"word":"performance","meaning":"How quickly a computer completes tasks."},{"word":"Internet of Things","meaning":"Everyday devices connected to the internet."},{"word":"parallel processing","meaning":"Doing several tasks at the same time."}]},{"type":"sources","id":"sources","title":"Sources","items":["BBC Bitesize, GCSE Computer Science: CPU performance","Isaac Computer Science: Embedded systems","Arm Education: What is an embedded system?","Intel: Understanding processor specifications"]}]},"overlay":null}