What are micro-operations? Explain different types of micro-operations.
What are micro-operations? Explain different types of micro-operations.
Quick answer
A micro operation is a basic operation on the data stored in registers, done in one clock pulse. A machine instruction is carried out as a sequence of micro operations. They fall into four types.
1. Register transfer micro operations. They copy data from one register to another. For example, $R2 \leftarrow R1$ copies R1 into R2, and $AR \leftarrow PC$ moves the program counter to the address register. Memory transfers are written as $DR \leftarrow M[AR]$ (read) and $M[AR] \leftarrow DR$ (write). A transfer may happen only under a condition, such as $P: R2 \leftarrow R1$.
2. Arithmetic micro operations. They do arithmetic on the numbers in registers.
| Micro operation | Meaning |
|---|---|
| $R3 \leftarrow R1 + R2$ | Add |
| $R3 \leftarrow R1 - R2$ | Subtract |
| $R1 \leftarrow R1 + 1$ | Increment |
| $R1 \leftarrow R1 - 1$ | Decrement |
| $R2 \leftarrow \overline{R2}$ | Complement |
| $R2 \leftarrow \overline{R2} + 1$ | 2's complement (negate) |
3. Logic micro operations. They work on each bit of the registers separately. Examples are AND, OR, XOR and NOT. For instance, $R1 \leftarrow R1 \wedge R2$ is used to clear selected bits (masking). XOR can be used to find the bits that differ, and OR can set bits.
4. Shift micro operations. They move the bits of a register to the left or right. A logical shift puts in a zero. A circular shift (rotate) puts the bit that goes out back at the other end. An arithmetic shift keeps the sign bit. A left arithmetic shift multiplies by 2, and a right arithmetic shift divides by 2. For example, shifting 0110 (6) to the left by one gives 1100, and logical right shift of 0110 gives 0011 (3).
Use in the control unit. The control unit makes the control signals that run the micro operations in the right order. For example, the fetch cycle is the sequence of micro operations $AR \leftarrow PC$, then $IR \leftarrow M[AR]$ and $PC \leftarrow PC + 1$. In a microprogrammed unit, each microinstruction names one or more micro operations. So all work of a computer finally reduces to these four types.
Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.
Up nextExplain the memory hierarchy with diagram. A memory chip has a capacity of 64K x 8. i. Fin