How your CPU works like a Restaurant during Rush Hour

I turn computer science into stories, and narration, my goal and intention isn't to teach the how. It is to help people see why the Algorithms, Data Structures, and Flows exist through visualisation by connecting the systems.
In the last blog, we discussed how in one tick, clock synchronizes the works of control unit fetching and decoding the instruction, memory unit fetching the data, arithmetic logic unit executing the task
and now we’ll see, how they’ll parallelly doing in one tick of clock.
When you’re ordering food during rush hours!! you’re not the only one who would be ordering right!, there are 10-20’s of people ordering parallelly right,
does chef’s assistant wait until the previous order to get ready to take your order?
no right!!
he keeps taking out new orders, even if chef is still cooking.
That’s why every role will be having separate counters in a restaurant:
Chef to Cook.
Assistant to take order.
helper to roll out new(chapati, poori, naan flour).
the food which waiter serve’s.
The Same way!! each stage of the instruction cycle has its own counter:
Instruction Fetch(IF) - control unit fetching new orders.
Instruction decode(ID) - control unit decoding what command signals to give.
Memory Access(MEM) - storage fetching new ingredients(data).
Execute(EX) - the AL Unit(Chef) Cooks.
Writing back(WB) - the final result is served(stored or displayed).
So, In a single tick of clock:
while Chef(ALU) is executing the previous task,
Control unit would be fetching new order or decoding the new order,
helper would roll out new data(Ingredients),
Waiter would be serving the food.
It is not new cycle. It’s the same instruction cycle but divided into stages and got parallelly synchronized by the clock
Let’s have a look at one example:
In the restaurant, you just gave the order, and its 4th order, there are 3 people before you
If AL Unit is executing(EX) the task of first person, the Memory Unit would be accessing(MEM) the data of the second person, and Instruction decoder(ID) would be decoding the third person’s order, and Instruction Fetch(IF) is taking your order.
This is called Instruction Level Parallelism(ILP) in computer architecture.
In our restaurant, the assistant isn’t just taking orders right, he’s also reading them, understanding and shouting what chef has to cook, and helper has to roll out new doughs.
but our Control Unit isn’t a human, how does it read, understand and command like that?
That’s what we’ll uncover next.
In our next blogs, we’ll discover each of our kitchen’s characters
how Control Unit decodes and commands,
how the Memory Unit fetches,
how Arithmetic Logic Unit Executes.



