Computer Science I / Integrated Computer-System Reasoning
Practice question · Put in order

Order the stages of the task 'read a number from the keyboard, add one, and store the result' as the information flows through the machine.

Hints
  1. Nothing can be computed until the value exists somewhere the CPU can reach.
  2. The instruction that performs the addition must itself be fetched before it can run.
Show the answer
  1. A keypress arrives as an I/O event and raises an interrupt
  2. The character is encoded as bits and placed in main memory
  3. The CPU fetches the add instruction, checking the cache first
  4. The ALU performs the addition inside the data path
  5. The result is stored back to main memory
Why

Every layer of the course appears once, in order: I/O, encoding, the memory hierarchy, the data path and ALU, then memory again. Expecting the addition before the fetch skips the fact that the add instruction is itself data that has to be brought in.

Read the lesson: Integrated Computer-System Reasoning →

Practise Integrated Computer-System Reasoning

The app has 6 more questions on this lesson, and keeps your place in the course. Computer Science I is free to start.

More questions on Integrated Computer-System Reasoning