What the Heck is a Micro-Operation?

When reading about Microprocessors, RISC and CISC, you will stumble upon this terminology. What does it mean?

If you have been reading my various microprocessor related stories, you have probably come across the term micro-operation more than once. Here I will try to go a bit deeper and explain better what a micro-operation is.

How is a Micro-Op Different From an Instruction?

In my illustration I am trying to get across two important points about micro-operations:

  1. They are wider. Meaning they consume more bytes than a regular instruction.

Interface vs Implementation

The key difference between instructions and micro-operations is still that instructions represent the interface to a CPU, while a micro-operation is part of the implementation.

A Simple RISC processor without micro-operations
A Simple RISC processor without micro-operations

Micro-ops and the Control Unit

With micro-operations this get more complicated. The control unit takes over the job of the decoder. In this setup the decoder only turns the instructions into micro-ops.

add r3, 7   ; r3 ← r3 + memory[7]
  1. Set register r3 and MDR to to be the two inputs to the ALU. Enable ALU and set it to perform addition.
  2. Store result of operation in register r3.
  1. The ALU gets configured to perform addition, while the LSU is disabled. There are potentially two general purpose registers which could serve as input, but we only pick one of them, number 3. MDR is enabled so it can be input to the ALU.
  2. MDR is disabled since we should not read from it. Instead we enable register 3, again to write result of ALU into it.

Why Do We Have Micro-Operations?

As I previously said, we don’t actually have to have micro-operations in a CPU. CPUs where made without them before and still are.

Are RISC instructions and Micro-Operations The Same?

This confusion frequently pops up. But from what I have covered thus far I hope it is clear that RISC instructions and micro-operations are not the same thing. RISC instructions tend to cleanly map to single micro-operations which may give this impression.

Final Remarks

I skipped over saying much about what pipelines are here, so I will attempt to give a similar more thorough coverage of pipelines in the future.

Geek dad, living in Oslo, Norway with passion for UX, Julia programming, science, teaching, reading and writing.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store