Logic Microoperations - Notes
Logic Microoperations - Notes
Logic Microoperations - Notes
Logic Micro-operations
Introduction
instructions to perform some operations like add, subtract, multiply, divide etc. To
perform these operations, the system stores the data in registers. Now, to operate
performed on the data stored in one or more registers. They transfer the data
Register micro-operations
Arithmetic micro-operations
Logic micro-operations
Shift micro-operations
Logic micro-operations are used on the bits of data stored in registers. These micro-
operations treat each bit independently and create binary variables from them.
There are a total of 16 micro-operations available. This are shown in the truth table.
Before discussing these logic micro-operations, let’s discuss their truth tables.
The below diagram shows the truth table for all the 16 logic micro-operations
mentioned above. Here, x and y are the variables or registers in which the data is
stored and F0, F1, ….., F15 are the outputs that occur after performing these logic
micro-operations
Jhulan Kumar
Assistant Professor
Lovely Professional University
CSE211: COMPUTER ORGANIZATION AND DESIGN
Jhulan Kumar
Assistant Professor
Lovely Professional University
CSE211: COMPUTER ORGANIZATION AND DESIGN
1. Clear
The Clear logic micro-operation is used to clear the register or set the bits of the
above truth table, F0 represents the truth table of Clear logic micro-operation.
For example, F <- 0 means the value of the register F is set to 0 or is cleared. The
Boolean expression-
2. AND
The AND logic micro-operation performs the logical AND between the bits of the
data stored in the two registers. The symbol to represent the logical AND is ∧.
In the first case, if the values of both two registers are true then the result of AND
For example, F <- A ∧ B means the registers A and B value will undergo AND micro-
Boolean expression-
The boolean expression for the AND logic micro-operation will be F1 = x.y
Jhulan Kumar
Assistant Professor
Lovely Professional University
CSE211: COMPUTER ORGANIZATION AND DESIGN
The logical AND operation we discussed above gives output 1 when both x and y
are true. There is also another AND operation which includes x but not y. Also
known as inhibition, here for performing the AND operation, the first value is taken
from the x variable or register. The second value is taken as the complement of the y
variable or register. If the value of the x register is true and of the y register is false,
F2 represents the truth table of inhibition AND logic micro-operation in the above
truth table.
For example, F <- A ∧ B’ means the value of the registers A and complement B will
Boolean expression-
The boolean expression for the AND logic micro-operation will be F2 = x.y’
The third case of logical AND operation includes y but not x. Also known
as inhibition, here for performing the AND operation, the first value is taken as
the complement of the x variable or register, and the second value is taken from the
y variable or register. If the value of the x register is false and of the y register is true,
F4 represents the truth table of inhibition AND logic micro-operation in the above
truth table.
For example, F <- A’ ∧ B means the value of the complement register A and as it is B
will undergo AND micro-operation, and the output will be stored in register F.
Jhulan Kumar
Assistant Professor
Lovely Professional University
CSE211: COMPUTER ORGANIZATION AND DESIGN
Boolean expression-
The boolean expression for the AND logic micro-operation will be F4 = x’.y
3. Transfer A
F3 represents the truth table of Transfer A logic micro-operation in the above truth
table. Since there is a transfer of data from the first register to the output register in
this micro-operation, its truth table is the same as the taken values of the x variable
(0, 0, 1, 1).
For example, F <- A means the value of register A is moved to register F. The
Boolean expression-
4. Transfer B
F5 represents the truth table of Transfer B logic micro-operation in the above truth
table. Since there is a transfer of data from the second register to the output register
in this micro-operation, its truth table is the same as the taken values of the y
For example, F <- B means the value of register B is moved to register F. The
Boolean expression-
5. Exclusive OR
Also known as XOR, this logic micro-operation performs the logical XOR between
the data bits stored in the two registers. The logical XOR means either x should be
For example, F <- A ⊕ B means the registers A and B value will undergo XOR micro-
Boolean expression-
The boolean expression for the Exclusive OR logic micro-operation will be F6 = x.y’ +
x’.y
6. OR
The OR logic micro-operation performs the logical OR between the data bits stored
In the first case, if either the value of x register is true and y register is false, or the
value of x register is false, and y register is true, or both the values of x and y
registers are true, then the result of OR operation is 1 else it is 0. F7 represents the
Jhulan Kumar
Assistant Professor
Lovely Professional University
CSE211: COMPUTER ORGANIZATION AND DESIGN
For example, F <- A ∨ B means the registers A and B value will undergo OR micro-
Boolean expression-
In the second case, the output for 1 follows the condition that
If the value of the y register is true, then the value of the x register must be
If the value of the y register is false, then we don’t need to look for the value
In the above truth table, F11 represents the truth table of this logic micro-operation.
For example, F <- A ∨ B’ means the value of the registers A and complement B will
Boolean expression-
In the second case, the output for 1 follows the condition that
Jhulan Kumar
Assistant Professor
Lovely Professional University
CSE211: COMPUTER ORGANIZATION AND DESIGN
If the value of the x register is true, then the y register's value must be true. If
If the value of the x register is 0, then we don’t need to look for the value of
In the above truth table, F13 represents the truth table of this logic micro-operation.
For example, F <- A’ ∨ B means the complemented register A and B value will
Boolean expression-
7. NOR
As the name suggests, it is Not OR. The output of OR micro-operation is 1 when the
value of either x register or y register or both x and y registers are true. In contrast, in
NOR, the output is 0 when the value of either x register or y register or both x and y
registers are true, and it is 1 when both x and y registers are false. In the above truth
For example, F <- (A ∨ B)’ means the registers A and B value will undergo NOR
Boolean expression-
Jhulan Kumar
Assistant Professor
Lovely Professional University
CSE211: COMPUTER ORGANIZATION AND DESIGN
8. Exclusive NOR
If we perform the Exclusive NOR micro-operation, the output will be 1 when the
values of both the x and y registers will be the same. They can be true or false, but
F9 represents the truth table of Exclusive NOR logic micro-operation in the above
For example, F <- (A ⊕B)’ means the registers A and B value will undergo Exclusive
Boolean expression-
The boolean expression for the Exclusive NOR logic micro-operation will be F9 = x.y
+ x’.y’
9. Complement B
register B (second register) to the output register. First, the content of the register is
In the above truth table, F10 represents the truth table of Complement B logic micro-
operation. Since there is a transfer of complemented data from the second register to
the output register in this micro-operation, its truth table is just the opposite of the
Jhulan Kumar
Assistant Professor
Lovely Professional University
CSE211: COMPUTER ORGANIZATION AND DESIGN
Boolean expression-
10. Complement A
register A (first register) to the output register. First, the content of the register is
F12 represents the truth table of Complement A logic micro-operation in the above
truth table. Since there is a transfer of complemented data from the first register to
the output register in this micro-operation, its truth table is just the opposite of the
Boolean expression-
11. NAND
The NAND logic micro-operation is simply the opposite of AND logic micro-
operation. As the name suggests, it is Not AND. The output of AND micro-operation
is 1 when the value of both the x register and y register is true. In contrast, in NAND,
the output is 0 when the value of both x register and y register is true, and it is 1
In the above truth table, F14 represents the truth table of NAND logic micro-
operation.
Jhulan Kumar
Assistant Professor
Lovely Professional University
CSE211: COMPUTER ORGANIZATION AND DESIGN
For example, F <- (A ∧ B)’ means the registers A and B value will undergo NAND
Boolean expression-
The boolean expression for the NAND logic micro-operation is F14 = (x.y)’
The set to all 1’s logic micro-operations is used to set all the register bits to 1. To use
this micro-operation, we just need to feed 1 to the register. In the above truth table,
F15 represents the truth table of Set to all 1’s logic micro-operation.
For example, F <- 1 means the value of the register F is set to 1. The previous value of
Boolean expression-
computation.
and DEMUX (Demultiplersers). MUX is used in address decoding, data routing, etc.
converter.
Jhulan Kumar
Assistant Professor
Lovely Professional University
CSE211: COMPUTER ORGANIZATION AND DESIGN
They are used in machine learning algorithms for manipulating the data and for
making decisions according to the patterns in the dataset. The algorithms are further
Logical microoperations are used for masking purposes. The AND microoperation is
Logical microoperations are used to build arithmetic circuits such as adders and
subtracters. They are formed by the combination of XOR, AND, and OR for
Logic micro-operations are very fast and allow efficient processing of huge amounts
of data. Logical micro-operations are very flexible and can be combined in multiple
Jhulan Kumar
Assistant Professor
Lovely Professional University
CSE211: COMPUTER ORGANIZATION AND DESIGN
Logical microoperations are used in digital circuits, arithmetic logic units, MUX
AND, NOT, OR, and EXOR for each individual bit or pair of bits. The basic logic
Logical microoperations play an essential role in digital electronics. They are used to
frame a way in which the information flows through the circuits. Logical
consumption systems. They are easy to scale and can hold larger amounts of
datasets.
Conclusion
discussed each micro-operation along with their truth tables and boolean
expressions.
Jhulan Kumar
Assistant Professor
Lovely Professional University
CSE211: COMPUTER ORGANIZATION AND DESIGN
Shift Micro-Operations
What are Shift Micro-Operations in Computer Architecture?
Circular Shift
Shift micro-operations are used when the data is stored in registers. These micro-
operations are used for the serial transmission of data. Here, the data bits are shifted
from left to right. These micro-operations are also combined with arithmetic and
1. Logical Shift
2. Arithmetic Shift
Logical Shift: - The logical shift micro-operation moves the 0 through the serial
Logical Shift Left: - Each bit in the register is shifted to the left one by one in this shift
micro-operation. The most significant bit (MSB) is moved outside the register, and
For example, in the below data, there are 8 bits 00001010. When we perform a logical
shift left on these bits, all these bits will be shifted towards the left. The MSB or the
Jhulan Kumar
Assistant Professor
Lovely Professional University
CSE211: COMPUTER ORGANIZATION AND DESIGN
leftmost bit i.e. 0 will be moved outside, and at the rightmost place or LSB, 0 will be
To implement the logical shift left micro-operation, we use the shl symbol.
This command means the 8 bits present in the R1 register will be logically shifted
Moreover, the logical shift left microoperation denotes the multiplication of 2. The
example we’ve taken above when converted into decimal forms the number 10. And
the result after the logical shift operation when converted to decimal forms the
number 20.
Jhulan Kumar
Assistant Professor
Lovely Professional University
CSE211: COMPUTER ORGANIZATION AND DESIGN
Logical Shift Right:- Each bit in the register is shifted to the right one by one in this
shift micro-operation. The least significant bit (LSB) is moved outside the register,
and the place of the most significant bit (MSB) is filled with 0.
For example, in the below data, there are 8 bits 00000101. When we perform a logical
shift right on these bits, all these bits will be shifted towards the right. The LSB or the
rightmost bit i.e. 1 will be moved outside, and at the leftmost place or MSB, 0 will be
To implement the logical shift right micro-operation, we use the shr symbol.
This command means the 8 bits present in the R1 register will be logically shifted
Logical right shift micro-operation generally denotes division by 2. The inputted bits
when converted into decimal form the number 5. And the outcome when converted
Arithmetic Shift
The arithmetic shift micro-operation moves the signed binary number either to the
left or to the right position. There are two ways to implement the arithmetic shift.
Arithmetic Shift Left:- The arithmetic shift left micro-operation is the same as the
logical shift left micro-operation. Each bit in the register is shifted to the left one by
one in this shift micro-operation. The most significant bit (MSB) is moved outside the
register, and the place of the least significant bit (LSB) is filled with 0.
For example, in the below data, there are 8 bits 00100011. When we perform the
arithmetic shift left on these bits, all these bits will be shifted towards the left. The
MSB or the leftmost bit i.e. 0 will be moved outside, and at the rightmost place or
Jhulan Kumar
Assistant Professor
Lovely Professional University
CSE211: COMPUTER ORGANIZATION AND DESIGN
The given binary number (00100011) represents 35 in the decimal system. And the
binary number after logical shift left (01000110) represents 70 in a decimal system.
Since 35 * 2 = 70. Therefore, we can say that the arithmetic shift left multiplies the
number by 2.
To implement the arithmetic shift left micro-operation, we use the ashl symbol.
This command means the 8 bits present in the R1 register will be arithmetic shifted
Arithmetic Shift Right:- Each bit in the register is shifted to the right one by one in
this shift micro-operation. The least significant bit (LSB) is moved outside the
register, and the place of the most significant bit (MSB) is filled with the previous
value of MSB.
For example, in the below data, there are 8 bits 10100011. When we perform an
arithmetic shift right on these bits, all these bits will be shifted towards the right. The
LSB or the rightmost bit i.e. 1 will be moved outside, and at the leftmost place or
MSB, the previous MSB value, i.e. 1, will be inserted as shown below.
Jhulan Kumar
Assistant Professor
Lovely Professional University
CSE211: COMPUTER ORGANIZATION AND DESIGN
To implement the arithmetic shift right micro-operation, we use the ashr symbol.
This command means the 8 bits present in the R1 register will be arithmetic shifted
Circular Shift
The circular shift, also known as the rotate shift, moves the bits in the register's
sequence around both ends, thus ensuring no loss of information. There are two
Circular Shift Left: - Each bit in the register is shifted to the left one by one in this
shift micro-operation. After shifting, the least significant bit (LSB) place becomes
empty, so it is filled with the value at the most significant bit (MSB).
For example, in the below data, there are 8 bits 00010100. When we perform a
circular shift left on these bits, all these bits will be shifted towards the left. The MSB
or the leftmost bit i.e. 0 will be placed at the rightmost place or LSB as shown below.
Jhulan Kumar
Assistant Professor
Lovely Professional University
CSE211: COMPUTER ORGANIZATION AND DESIGN
To implement the circular shift left micro-operation, we use the cil symbol.
This command means the 8 bits present in the R1 register will be circular shifted left,
Circular Shift Right: - Each bit in the register is shifted to the right one by one in this
shift micro-operation. After shifting, the most significant bit (MSB) place becomes
empty, so it is filled with the value at the least significant bit (LSB).
For example, in the below data, there are 8 bits 00010100. When we perform a
circular shift right on these bits, all these bits will be shifted towards the right. The
LSB or the leftmost bit, i.e. 0, will be placed at the rightmost place or MSB.
Jhulan Kumar
Assistant Professor
Lovely Professional University
CSE211: COMPUTER ORGANIZATION AND DESIGN
To implement the circular shift right micro-operation, we use the cir symbol.
This command means the 8 bits present in the R1 register will be circular shifted
Important Questions:-
Shift micro-operations are used when the data is stored in registers. These micro-
operations are used for the serial transmission of data. The contents of a register can
be shifted to the left or the right. There are three types of shift micro-operations-
There are three types of shift micro operations: Logical Shift, Arithmetic Shift and
Circular Shift. Logical shift transfers zero through serial input. Arithmetic shift
Jhulan Kumar
Assistant Professor
Lovely Professional University
CSE211: COMPUTER ORGANIZATION AND DESIGN
micro-operation shifts a signed binary number to the left or to the right position. The
circular shift micro operation circulates the bits in the sequence of the register
Logic micro operations operate on individual bits of data. Bit operations through
logic micro-operation are useful for making bits-based decisions. Shift micro
Jhulan Kumar
Assistant Professor
Lovely Professional University