Micro Operations in Computer Architecture YASH PAL, October 8, 2025February 4, 2026 Micro Operations in Computer Architecture – A micro operation is an elementary operation executed on the information stored in one or more registers. A prespecified sequence of micro operations is performed on the stored information to complete a specified operation. The micro operations can be classified as follows: Arithmetic micro operation Logic micro operation shift micro operation Micro Operations Arithmetic micro operations Basic arithmetic micro operations are addition, subtraction, negation, increment, and decrement. Multiplication and division are also valid arithmetic operations, but not included in the basic set of micro operations. In most of the computer systems, the multiplication operation is implemented with a sequence of addition and shift micro operations. The division operation is implemented with a sequence of subtraction and shift micro operations. The table below shows the basic arithmetic micro operations. Register transfer languageDescriptionR3 ← R1 + R2Sum of R1 and R2 is copied to R3R3 ← R1 – R2Difference of R1 and R2 is copied R3R3 ← R3 + 12’s complement the contents of R3 (negate)R1 ← R1 + 1Increment the contents of R1R1 ← R1 – 1Decrement the contents of R1Basic Arithmetic Micro Operations The above table shows that the basic micro operations are addition and subtraction. The increment and decrement micro-operations are symbolized by plus-one and minus-one operations, respectively. The following circuits can be used to implement various arithmetic micro-operations: Binary Adder Binary Adder/Subtraction Binary Increments Arithmetic Circuit Binary Adder The digital circuit that results in the arithmetic sum of two binary numbers of any length is called a binary adder. The binary adder can be designed with full adders connected serially. In such a type of design, the output carry of one full adder is transferred to the input carry of the next full adder. The figure below shows the 3-bit binary adder, which is constructed with 3 full adders. 3 Bit Binary Adder Binary Adder/Subtractor The subtraction of a binary number can be performed by taking the 2’s complement of the second number and adding it to the first number. The 2’s complement can be obtained by taking the 1’s complement and adding one to the least significant bit. Whereas the addition of binary numbers can be done by performing a direct addition operation as discussed in pervious section. The addition and subtraction operations can be combined into a common circuit by including an Ex-OR gate with each full adder. A 3-bit adder/subtractor is shown in the figure below. 3 Bit Adder/Subtractor Mode selection input, as shown in the above figure, controls the operations. When mode selection input M=1, the circuit behaves as a subtractor, whereas for M=0, the circuit behaves as an adder. Binary Incrementer The binary increment micro operation is defined as the addition of one in a register. This can be achieved by means of half adders connected in a serial manner. The block diagram of a 3-bit binary incrementer is shown below. 3 Bit Binary Incrementer Arithmetic Circuit The basic arithmetic micro operations listed in the above table can be implemented in one composite arithmetic circuit. The basic component of an arithmetic circuit is the full adders with the multiplexer circuits. The 4-bit arithmetic circuit is shown in the figure below. 4-bit Arithmetic Circuit The 4-bit arithmetic circuit has four full adders to make a four-bit adder. Four 4:1 multiplexers are used to choose different operations. There are two 4-bit inputs (A and B) and one 4-bit output (D). Each bit of input B is connected to the corresponding Y input of the full adder through the multiplexer, whereas each bit of input A is connected directly to the X input of the full adder. The output of the circuit is calculated from the following arithmetic sum. D = X+Y+Cin Here, X input is always equal to A input wheres Y input can be B, B, 0, or 1 according to the selection lines (S1 and S0) of the multiplexer. Cin is the input carry, which can be equal to 0 or 1. By controlling the value of selection lines and input carry, it is possible to generate eight arithmetic micro operations shown in the table below. S1S0CinYD = X+Y+CinMicro Operations000BD = A + BAddition001BD = A + B + 1Addition with carry010BD = A + BSubtraction with borrow011BD = A + B + 1Subtraction1000D = ATransfer A1010D = A + 1Increment A1101D = A – 1Decrement A1111D = ATransfer AFunctions for a 4-bit arithmetic circuit When S1 S0 = 00, the output of the multiplexer is B and applied to the Y input of the full adder. if Cin = 0, the output D = A+B+0 (addition) and if Cin = 1, the output D = A+B+1 (addition with carry). When S1 S0 = 01, the output of the multiplexer is B and applied to the Y input of the full adder. if Cin = 0, the output D = A+B+0 = A+(B+1)-1 = A + (2’s complement of B) – 1 = A-B-1 (subtraction with borrow) and if Cin = 1, the output D = A+B+1 = A+(2’s complement of B) = A-B (subtraction). When S1 S0 = 10, the outputs of all multiplexers are 0 and applied to the Y inputs of all full adders. In Cin = 0, the output D=A + (0000)2 +0 = A (Transfer) and if Cin=1, the output D=A+(0000)2+1 = A+1 (Increment). When S1 S0 = 11, the outputs of all multiplexers are 1 and applied to the Y inputs of all full adders. If Cin = 0, the output D=A+(1111)2+0=A+(1’s complement of 0) + 1-1 = A+(2’s complement of 0)-1=A-0-1=A-1 (Decrement) and if Cin = 1, the output D=A+(1111)2+1 = A+(1’s complement of 0)+1=A+(2’s complement of 0) = A-0=A(Transfer). Note – The micro operation D = A (transfer) is generated twice, so there are only seven distinct micro operations in the arithmetic circuit. Logic Micro Operations The logic micro operations include the basic operations like AND, OR, EX-OR, NOT, etc. These operations consider each bit of the register separately and treat it as a binary variable. It means logic micro operations are bit-wise micro operations. If there are two binary variables, 16 different logic micro operations can be performed on them. The sixteen logic micro operations are derived from the truth table of logic functions, as shown in the table below. The bit-wise variables are represented by x (contents of register A) and y (Contents of register B). Each bit of the register is considered as a binary variable is micro operation is performed on the string of bits stored in the registers. All sixteen logic micro operations are shown in the table below. FunctionInput Bit VariablesInput Bit VariablesInput Bit VariablesInput Bit VariablesBooleanFunctionRegisterTransferLanguage(RTL)MicroOperationx yx yx yx y00011011F00000F0 = 0F ← 0CleanF10001F1 = xyF ← A ∧ BANDF20010F2 = xyF ← A ∧ BF30011F3 = xF ← ATransfer AF40100F4 = xyF ← A ∧ BF50101F5 = yF ← BTransfer BF60110F6 = x⊕yF ← A ⊕ BEx – ORF70111F7 = x+yF ← A ∨ BORF81000F8 = x+yF ← A ∨ BNORF91001F9 = x⊕yF ← A⊕BEx-NORF101010F10 = yF ← BComplement BF111011F11 = x+yF ← A ∨ BF121100F12 = xF ← AComplement AF131101F13 = x+yF ← A ∨ BF141110F14 = xyF ← A ∧ BNANDF151111F15 = 1F ← 1Set Hardware Implementation (Logic Circuit) Although there are sixteen logic micro-operations listed in the above table, most of the digital systems use only four micro operations (AND, OR, Ex-OR and complement). Other micro operations can be derived from the combination of these four. One stage of a logic circuit is shown in the figure below. One Stage of Logic Circuit S1S0OutputOperation00F = A ∧ BAND01F = A ∨ BOR10F = A⊕BEx-OR11F ← AComplementOne stage of a logic circuit functional table When S1S0=00, the input I0 will be at the output of the multiplexer. Hence Fi=I0=Ai ∧ Bi (AND). When S1S0=01, the input I1 will be at the output of the multiplexer. Hence Fi=I1=Ai ∧ Bi (OR). When S1S0=10, the I2 input will be available at the output of the multiplexer. Hence Fi=Ai ⊕ Bi (Ex-OR). In the same manner, when S1S0=11, I3, the input will be at the output of the multiplexer. Hence Fi=A (complement of A). Logic Circuit Application The logic micro operations are executed on the individual bits of the data stored in the register. The logic micro operations are rarely used in scientific computations, but they are useful for bit manipulation of binary data and for making logical decisions. It means that logic micro operations can be used to change bit values, delete a group of bits, or insert new bit values into a register. Therefore, a logic circuit can be used for the following operations. Selective Set Selective Reset Selective Complement Selective Insert Selective Set – The selective set operation sets (makes high) the selected bits of a register. Consider a register A that contains the data. This operation sets the bits in register A where there are corresponding 1’s in register B. It does not affect bit positions that have 0’s in register B. The truth table for the selective set operation is given in the table below. Bit of Register A(Before)CorrespondingBit of Register BBit of Register A(After)Operation000No Change011Set101No Change111SetSelective Set operation truth table From the above truth table, it can be noticed that the bits of register A after the operation are obtained from the logic-OR operation of bits in register B and the previous values of register A. Therefore, the OR micro operation can be used to selectively set bits of a register. Numeric example: 10110110 – Register A (Before)01101110 – Register B————————11111110 – Register A (After)———————– Selective Reset (Mask) – The selective reset operation resets (makes low) the selected bits of a register. Consider a register that contains the original data. This operation resets the bits in register A where there are corresponding 0’s in register B. It does not affect bit positions in register A that have corresponding 1’s in register B. The truth table for the selective reset operation is shown in the table below. Bit of Register A(Before)CorrespondingBit of Register BBit of Register A(After)Operation000Reset010No change100Reset111No changeSelective reset operation truth table From the above truth table, it can be noticed that the bits of register A after the operation are obtained from the logic-AND operation of bits in register B and the previous values of register A. Therefore, the AND micro operation can be used to selectively set bits of a register. Numeric example: 10110110 – Register A (Before)01101110 – Register B————————00100110 – Register A (After)———————– Selective Complement – The selective complement operation complements the selected bits of a register. Consider a register A that contains the data. This operation complements the bits of register A where there are corresponding 1’s in register B. It does not make any change to the bit positions that have 0’s in register B. The table below shows the truth table for the selective complement operation. Bit of Register A(Before)CorrespondingBit of Register BBit of Register A(After)Operation000No change011Complement101No change110ComplementSelective complement operational truth table It can be seen from the above truth table that the bits of register A after the operation are obtained from the logic Exclusive-OR operation of bits in register B and previous values in register A. Therefore, the Ex-OR micro operation can be used to selectively complement bits of a register. Numeric example: 1011 0110 – Register A (Before)0110 1110 – Register B————————0010 0110 – Register A (After)———————– Selective Insert – The selective insert operation inserts a new value into a group of bits. This operation is a combination of selective reset and selective set operations. This is performed by first selective reset the bits, and selective set them with the required value. Numeric example: – Let, in a group of eight bits (stored in register A), four most significant bits are required to be 1001. Step-I 1011 0110 – Register A (Before)0000 1111 – Register B————————0000 0110 – Register A (After selective reset)———————– Step-II 0000 0110 – Register A (Before)1001 0000 – Register B————————1001 0110 – Register A (After selective reset)———————– Shift Micro Operation Shift micro operations are used for serial transfer of data. The contents of a register can be shifted to the left or to the right in different ways. There are three types of shifts: Logical Shift Circular Shift Arithmetic Shift. Logical Shift The logical shift inserts 0 through the serial input. The symbols shl (Shift left) and shr (Shift right) are used. The figure shows examples of logical shift. Logical shift example The above two micro operations specify a 1-bit shift to the left of the contents of register A and a 1-bit shift to the right of the contents of register B. The bit inserted into the end position is to be 0 during logical shift. Circular Shift The circular shift rotates the bits of the register around the two ends without loss of information. This is also known as the rotate operation. Symbols cil (circular left shift) and cir (circular right shift) are used for circular shift. The figure below shows an example of circular shift. Circular shift example The above micro operations circulate the contents of register A in the left direction (1-bit) and the contents of register B in the right direction (1-bit) without loss of information. In circular left shift, the most significant bit will be copied to the least significant bit position, whereas in circular right shift, the least significant bit will be copied to the most significant bit position. Arithmetic Shift An arithmetic shift is a micro operation 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 of the number remains unchanged after an arithmetic shift. The symbols ashl (arithmetic shift left) and ashr (arithmetic shift right) are used for arithmetic shift. The examples of arithmetic shift are shown in the figure below. Arithmetic shift examples The above micro operation shows in the figure perform arithmetic shift left to the contents of register A. This inserts a 0 into A0 and shifts all other bits to the left. If An-1 and An-2 are not the same, an error may occur. In the micro operation shown in the above figure, the arithmetic shift leaves the sign bit unchanged, and the same Bn-2 receives the bit from Bn-1, and so on. The bit in B0 is lost. Hardware Implementation (shifter Circuit) RTLMicro OperationDescriptionA ← shl AShift left register AContents of A shift left by 1-bit position. A ‘0’ is inserted at right most bit. Left most bit is lost.A ← shr AShift right register AContents of A shift right by 1-bit position. A ‘0’ is inserted at left most bit. Right most bit is lost.A ← cil ACircular shift left register AContents of register A are circularly shifted right by 1-bit position, the right-most bit goes into left most bit.A ← cir ACircular shift right register AShifts the contents of A left by 1-bit position. ‘0’ is inserted at the right-most bit position, and the sign bit receives the most significant bit.A ← ashl AArithmetic shift left register AShifts the contents of A left by 1-bit position. ‘0’ is inserted at the right-most bit position, the sign bit receives the most significant bit.A ← ashr AArithmetic shift right register AShifts contents of A right by 1-bit position. The sign bit is circulated in at the leftmost bit position.Shift micro operations The shift micro operations given in the above table can be implemented using the circuit shown in the figure below. This is a 4-bit shifter, which has four data inputs A0 to A3, and four data outputs F0 to F3. There are two serial inputs, one for shift left (IL) and the other for shift right (IR). When S=0, the input data are shifted right, and when S=1, the input data are shifted left. The function table is also shown in the figure below. Shifter circuit logic diagram Select Input (S)Output F0Output F1Output F2Output F30 (Shift right)IRA0A1A21 (Shift left)A1A2A3ILShifter circuit functional table Related questions and answers What is Micro Operation? The operation performed on data stored in a register is called a microoperation. The result of a micro operation can be stored in the previous register, or it can be transferred to a new register. Give some examples of micro operations. Examples of micro operations are load, store, add, sub, shift, clear, etc. How can more than one micro operation be represented in RTL? In the RTL notation, if more than one micro operation is present, these are separated by commas, and the order in which they are written is unimportant. For example, if a system is to perform the transfers R2 ← R1 and R3 ← R4 Whenever control signal is high, this can be written as eitherα : R2 ← R1 , R3 ← R4orα : R3 ← R4 , R2 ← R1 Classify the micro operations. The micro operations can be classified as follows:(i) Arithmetic micro operation(ii) Logic micro operation(iii) Shift micro operation What are the logic circuit applications? A logic circuit can be used for the following applications:(i) Selective set(ii) Selective Reset(iii) Selective complement(iv) Selective Insert Why do we not include multiplication and division as basic arithmetic micro operations? Multiplication and division are also valid arithmetic operations, but not included in the basic set of micro operations. The reason for this is that in most of the computers, the multiplication operation is implemented with a sequence of addition and shift operations. The division operation is implemented with a sequence of subtraction and shift micro operations. Explain logic micro operations. Give five examples of logic micro operations. The logic micro operations include the basic operations like AND, OR, EX-OR, NOT, etc. These operations consider each bit of the register separately and treat it as a binary variable. Define the selective set and selective reset operation. The selective set operation sets (makes high) the selected bits of a register, whereas the selective rest operation resets (makes low) the selected bits of a register. What is a selective complement operation in logic micro operations? The selective complement operation complements the selected bits of a register. The EX-OR micro operation can be used to implement a selective complement operation on a register. Explain the selective insert operation. The selective insert operation inserts a new value into a group of bits. This operation is a combination of selective reset and selective set operations. This is performed by first selective reset the bits, and selective set them with the desired value. What is a shift micro operation? Write the different types of shifts. Shift micro operations are used for serial transfer of data. The contents of a register can be shifted to the left or the right in different ways. There are three types of shifts:(i) Logical Shift(ii) Circular shift(iii) Arithmetic shift Explain the logical shift The logical shift inserts 0 through the serial input. The symbols shl (shift left) and shr (shift right) are used. What is circular shift? The circular shift rotates the bits of the register around the two ends without loss of information. Symbols cil (circular left shift) and cir (circular right shift) are used for circular shift. Explain the arithmetic shift. An arithmetic shift is a micro operation that shifts a signed binary number to the left or right. The sign of the number remains unchanged after an arithmetic shift. The symbols ashl (arithmetic shift left) and ashr (arithmetic shift right) are used for arithmetic shift. Computer System Architecture engineering subjects Computer System Architectureengineering subjects