Your laptop shuts down halfway through a coding club project. Which changes survive?
You've made a quiz program for your school coding club. You saved it, then changed the score needed to win. Autosave was off, and your laptop shut down before you could save again. Which version will you find when you switch it back on?
The CPU runs instructions. Clock pulses time its work. The control unit fetches an instruction from memory using buses, which carry signals between components. A register holds the instruction inside the CPU. The control unit decodes it. The CPU executes it, using the ALU for arithmetic or logic when needed, then repeats.
When you launch your editor, the saved program stays in secondary storage. The instructions it needs are copied into RAM, the working part of main memory. In Von Neumann architecture, main memory holds both instructions and data. The CPU can fetch instructions from main memory without reading the saved file directly.
You launch the code editor. The computer copies the instructions it needs out of the saved program file. Pick where those instructions go so the CPU can fetch them from main memory.
RAM holds the programs and data you're using. It's volatile, so it loses its contents without power. ROM is also part of main memory. It keeps instructions such as start-up instructions without power, and you can read it without changing it. Secondary storage is non-volatile too. It keeps your saved files.
The saved quiz program sets the winning score to ten. When you open the file, that setting is copied into RAM. You change it to fifteen in the editor. When you click Save, the editor writes the updated program file to secondary storage.
This time, you save the quiz program with a winning score of twelve. With autosave off, you change it to eighteen and shut down without saving again. Pick the score you'll see when you reopen the file.
A higher clock speed gives more cycles each second. More cores can run work in parallel, but extra cores may do little if the work can't be split. A larger cache can keep more copies of instructions and data in fast memory close to the CPU, so it may access RAM less often.
If the exam asks you to explain why a computer needs secondary storage, start with what happens to RAM when you switch off: it loses its contents. Then explain that secondary storage keeps saved programs and data long term, so you can open them again after switching back on.