Micro Operation (Computer Architecture)
In computer CPU the micro-operations are
detailed low-level instructions which is used in some designs to implement
complex machine instructions. Usually, micro-operations perform basic
operations on data stored in one or more register, including transferring data
between registers or between registers and external buses of the CPU and
performing arithmetic or logical operations on registers. The execution of
micro-operations is performed under control of the CPU’s control unit which decides
on their execution while performing various optimizations such as reordering,
fusion and caching of the operations.
The operations executed on data stored
in registers are called micro-operations. A micro-operation is an elementary
operation performed on the information stored in one or more registers. The
functions built into registers are examples of micro operations, They are
Shift, Load, Clear, Increment, add, subtract, complement, and, or, xor etc ..
There are Four Types of Micro Operations
1.
Register transfer micro-operations
2.
Arithmetic micro-operations
3.
Logic micro-operations
4.
Shift micro operations
1) Register transfer micro operation
Register transfer language is a kind of intermediate
representation (IR) that is very close to assembly language, such as that which
is used in a compiler. It is used to describe data flow at the register
transfer level of an architecture. It is a convenient tool for describing the internal
organization of digital computers in concise and precise manner. These types of
micro operations are used to transfer binary information from one register to
another. Often the names indicate function:
- MAR – Memory Address Register
- PC - Program Counter
- IR - Instruction Register
In this case
the contents of register R1 are copied (loaded) into register R2
2) Arithmetic Micro-Operations
These
micro-operations are used to perform some arithmetic operations on numeric data
stored in the registers. A micro operation is an elementary operation performed
on the information stored in one or more registers. The micro operation in
digital computers is of 4 types: Addition,
Subtraction, Increment, and Decrement
- Addition:-
R1 = A + B
R3 = R1 + R2
- Subtraction: -
R1 = R2 – R3
Subtraction operation also can be performed on 2’s complement R = R1 + R2’ + 1
- Increment:-
R1 = R1 + 1, R2 = R2 + 1
- Decrement:-
R1 = R1 – 1, R2 = R2 – 1
3) Logic Micro-Operations
These micro
operations are used to perform bit style operations or manipulations on non-numeric
data. In computer CPU, micro-operations are the functional or atomic
operations of a processor. Logic micro operations are bit-wise operations,
i.e., they work on the individual bits of data. These are useful for bit
manipulations on binary data and also useful for making logical decisions
based on the bit value.
R1 = R1 XOR
R2
R2 = R3 AND
R4
4) Shift Micro-Operations
These are used for serial transfer of data. That
means we can shift the contents of the register to the left or right. In the shift
left operation the serial input transfers a bit to the right most position
and vice versa.
There are three types of shifts as follows:
a) Logical Shift
It transfers 0 through the serial input. The symbol "shl" is used for logical shift left and "shr" is used for logical shift right.
R1 ← she R1
R1 ← she R1
The register symbol must be same on both sides of arrows.
b) Circular Shift
This circulates or rotates the bits of register around the two ends without any loss of data or contents. In this, the serial output of the shift register is connected to its serial input. "cil" and "cir" is used for circular shift left and right respectively.
R1 = cir R1
R2 = cil R2
c) Arithmetic Shift
This shifts a signed binary number to left or
right. An arithmetic shift left multiplies a signed binary number by 2
and shift left divides the number by 2. Arithmetic shift micro-operation
leaves the sign bit unchanged because the signed number remains same when it is
multiplied or divided by 2.
R ← ashl R (arithmetic shift left R (register))
R ← ashr R
(arithmetic shift right R (register))