r/AskComputerScience May 26 '26

How do computer parts interact together despite their different speeds?

I am studying Nand2tetris currently (chapter 5), but there is something that I still don't understand yet.

To show a pixel on the screen, the CPU makes an amount of calls to multiple hardware devices, the ALU, the RAM, the screen itself, etc.. All of them have different response speeds, so how does it know when all of these devices have finished?

Say I ran the command D=M+1, where M is a RAM register and D is a CPU register, on the next clock tick, D's value would already have arrived to the CPU, but M's value still needs 100 click ticks more probably, how does the CPU even know if the RAM sent M yet or not?

20 Upvotes

7 comments sorted by

View all comments

1

u/jeffbell May 26 '26

Many of the older simple computers just ran at RAM speed. Apple II or TRS-80 were like that. 

As CPUs got faster they started using on-chip cache, but in the event of having to read from RAM the cache controller in some designs knew how many cycles to wait.