### Computer Architecture : Micro Operations

Micro-Operations are the basic operations that can be performed by a system on data stored in registers. Each micro operation is an elementary operation, performed on data in one or more registers. Micro-Operations are are used to create assembly language instruction. The micro-operations in computers are classified into the following categories:

• Register Transfer Micro-Operation
• Arithmetic Micro-Operation
• Logical Micro-Operation
• Shift Micro-operation

1. Register Transfer Micro-Operation :

The Register Transfer Micro-Operations are used to transfer binary information from one register to another. The register transfer micro operation does not change the value of the information. For example, R1 and R2 are two registers

R2 <- R1

Here, information transfer from R1 to R2 register without change the content of R1 register. If the transfer is to occur only under a predetermined control condition, designate it by

If(P = 1) then R2 <- R1 or P.R2 <- R1

Here P is control function that can be 0 or 1.

2. Arithmetic Micro-Operation :

The Arithmetic Micro-Operations are used to performs arithmetic operations on numeric data stored in the registers. For example : Addition, Subtraction, Increment, decrement, Negation, Complement etc.

R3 <- R1 + R2

At the above operation, data presented in R1 register is added with data in R2 register and result will be stored in R3 register.

Subtraction :

R3 <- R1 + (R2)' + 1

Note : At above (R2)' means 1's complement of R2, and (R2)' + 1 means 2's complement of R2. Data presented in R2 register is subtracted from data in R1 register and result will be stored in R3 register.

Increment and Decrement :

R1 <- R1 + 1

Increment of R1.

R1 <- R1 - 1

Decrement of R1.

3. Logical Micro-Operation :

The logical Micro-operations are used to perform bit style operations and manipulations on non-numeric data stored in the registers. Some examples of Logical micro instructions are OR, AND, NOT, XOR etc. For example let register A is 4 bit long, and register B is also 4 bit long. Now AND operation between A and B register bits.

A = 0110
B = 1100

OR micro-operation  ( v ) :

C <-  A v B
1110         0110        1100

AND micro-operation  ( ^ ) :

C <- A ^ B
0100         0110       1100

XOR micro-operation ( ) :

C <-    A B
1010       0110        1100

4. Shift micro-operation :

The Shift micro-operation is used to perform the shift operations on data stored in the registers. Shift operations are the operations in which the contents of the registers can be shifted to left or right. There are three types of shift operations :
• Logical shift
• Circular shift
• Arithmetic shift

Logical Shift :

Logical shift can be defined as the shift of the bits to the right or left serially. Thee symbol for logical right shift as shr and for logical left shift as shl.

R1 <- shl R1 A 1-bit shift to left of content of register R1
R2 <- shr R2 A 1-bit shift to right of content of register R2

Circular shift :

Circular shift also named as rotate shift circulates the bits among the ends of the register without losing information. They also shifts only one bit at a single time. For example :

R <- cir R Cir : circular right shift
R <- cil R Cil : circular left shift

Arithmetic Shift :

The Arithmetic shift is a micro-operations that shifts a signed binary number to the left or right. An arithmetic shift-left multiplies a signed binary number by 2. An Arithmetic shift right divides the number by 2. The sign bit 0 for positive and 1 for negative.

R <- ashl R Arithmetic shift-left R
R <- ashr R Arithmetic shift-left R

Next Topic :