SlideShare a Scribd company logo
5
Most read
6
Most read
18
Most read
Logic Microoperations 
Tarunpreet Bhatia 
CSED, Thapar University
LIST OF LOGIC MICROOPERATIONS 
• List of Logic Microoperations - 16 different logic operations with 2 binary variables. - n binary variables → functions 
2 
2 
n 
• Truth tables for 16 functions of 2 variables and the corresponding 16 logic micro-operations 
Boolean Function 
Micro- 
Operations 
Name 
x 0 0 1 1 y 0 1 0 1 
0 0 0 0 F0 = 0 F  0 Clear 
0 0 0 1 F1 = xy F  A  B AND 
0 0 1 0 F2 = xy' F  A  B’ 
0 0 1 1 F3 = x F  A Transfer A 
0 1 0 0 F4 = x'y F  A’ B 
0 1 0 1 F5 = y F  B Transfer B 
0 1 1 0 F6 = x  y F  A  B Exclusive-OR 
0 1 1 1 F7 = x + y F  A  B OR 
1 0 0 0 F8 = (x + y)' F  A  B)’ NOR 
1 0 0 1 F9 = (x  y)' F  (A  B)’ Exclusive-NOR 
1 0 1 0 F10 = y' F  B’ Complement B 
1 0 1 1 F11 = x + y' F  A  B 
1 1 0 0 F12 = x' F  A’ Complement A 
1 1 0 1 F13 = x' + y F  A’ B 
1 1 1 0 F14 = (xy)' F  (A  B)’ NAND 
1 1 1 1 F15 = 1 F  all 1's Set to all 1's
HARDWARE IMPLEMENTATION OF LOGIC MICROOPERATIONS 
0 0 F = A  B AND 
0 1 F = AB OR 
1 0 F = A  B XOR 
1 1 F = A’ Complement 
S1 S0 
Output 
-operation 
Function table 
B 
A 
S 
S 
F 
1 
0 
i 
i 
i 
0 
1 
2 
3 
4 X 1 
MUX 
Select
APPLICATIONS OF LOGIC MICROOPERATIONS 
•Logic microoperations can be used to manipulate individual bits or a portions of a word in a register 
•Consider the data in a register A. In another register, B, is bit data that will be used to modify the contents of A 
Selective-set A  A + B 
Selective-complement A  A  B 
Selective-clear A  A • B’ 
Mask (Delete) A  A • B 
Clear A  A  B 
Insert A  (A • B) + C 
Compare A  A  B
SELECTIVE SET 
•In a selective set operation, the bit pattern in B is used to set certain bits in A 
1 1 0 0 At 
1 0 1 0 B 
1 1 1 0 At+1 (A  A + B) 
•If a bit in B is set to 1, that same position in A gets set to 1, otherwise that bit in A keeps its previous value. 
•OR microoperation can be used to selectively set bits of a register.
SELECTIVE COMPLEMENT 
•In a selective complement operation, the bit pattern in B is used to complement certain bits in A 
1 1 0 0 At 
1 0 1 0 B 
0 1 1 0 At+1 (A  A  B) 
•If a bit in B is set to 1, that same position in A gets complemented from its original value, otherwise it is unchanged. 
•The exclusive-OR microoperation can be used to selectively complement bits of a register.
SELECTIVE CLEAR 
•In a selective clear operation, the bit pattern in B is used to clear certain bits in A 
1 1 0 0 At 
1 0 1 0 B 
0 1 0 0 At+1 (A  A  B’) 
•If a bit in B is set to 1, that same position in A gets set to 0, otherwise it is unchanged
MASK OPERATION 
•In a mask operation, the bit pattern in B is used to clear certain bits in A 
1 1 0 0 At 
1 0 1 0 B 
1 0 0 0 At+1 (A  A  B) 
•If a bit in B is set to 0, that same position in A gets set to 0, otherwise it is unchanged
CLEAR OPERATION 
•In a clear operation, if the bits in the same position in A and B are the same, they are cleared in A, otherwise they are set in A. 
1 1 0 0 At 
1 0 1 0 B 
0 1 1 0 At+1 (A  A  B) 
•It compares words in A and B and produces all 0’s result if the two numbers are equal. This operation is achieved by XOR microoperation.
INSERT OPERATION 
•An insert operation is used to introduce a specific bit pattern into A register, leaving the other bit positions unchanged 
•This is done as 
–A mask operation to clear the desired bit positions, followed by 
–An OR operation to introduce the new bits into the desired positions
–Example 
•Suppose you wanted to introduce 1010 into the low order four bits of A: 1101 1000 1011 0001 A (Original) 1101 1000 1011 1010 A (Desired) 
•1101 1000 1011 0001 A (Original) 
1111 1111 1111 0000 Mask 
1101 1000 1011 0000 A (Intermediate) 
0000 0000 0000 1010 Added bits 
1101 1000 1011 1010 A (Desired)
SHIFT MICROOPERATIONS 
•Shift microoperations are used for serial transfer of data. 
•The information transferred through the serial input determines the type of shift. There are three types of shifts 
–Logical shift 
–Circular shift 
–Arithmetic shift 
Serial input 
• A right shift operation 
• A left shift operation 
Serial input
LOGICAL SHIFT 
•In a logical shift the serial input to the shift is a 0. 
•A right logical shift operation: 
•A left logical shift operation: 
•In a Register Transfer Language, the following notation is used 
–shl for a logical shift left 
–shr for a logical shift right 
–Examples: 
•R2  shr R2 
•R3  shl R3 
0 
0
CIRCULAR SHIFT 
•In a circular shift the serial input is the bit that is shifted out of the other end of the register. 
•A right circular shift operation: 
•A left circular shift operation: 
•In a RTL, the following notation is used 
–cil for a circular shift left 
–cir for a circular shift right 
–Examples: 
•R2  cir R2 
•R3  cil R3
ARITHMETIC SHIFT 
•An arithmetic shift is meant for signed binary numbers (integer) 
•An arithmetic left shift multiplies a signed number by two 
•An arithmetic right shift divides a signed number by two 
•The main distinction of an arithmetic shift is that it must keep the sign of the number the same as it performs the multiplication or division 
•A right arithmetic shift operation: 
•A left arithmetic shift operation: 
0 
sign bit 
sign bit
ARITHMETIC SHIFT 
•An left arithmetic shift operation must be checked for the overflow 
0 
V 
Before the shift, if the leftmost two bits differ, the shift will result in an overflow 
•In a RTL, the following notation is used 
–ashl for an arithmetic shift left 
–ashr for an arithmetic shift right 
–Examples: 
•R2  ashr R2 
•R3  ashl R3 
sign bit
ARITHMETIC LOGIC SHIFT UNIT 
S3 S2 S1 S0 Cin Operation Function 0 0 0 0 0 F = A Transfer A 0 0 0 0 1 F = A + 1 Increment A 0 0 0 1 0 F = A + B Addition 0 0 0 1 1 F = A + B + 1 Add with carry 0 0 1 0 0 F = A + B’ Subtract with borrow 0 0 1 0 1 F = A + B’+ 1 Subtraction 0 0 1 1 0 F = A - 1 Decrement A 0 0 1 1 1 F = A TransferA 0 1 0 0 X F = A  B AND 0 1 0 1 X F = A B OR 0 1 1 0 X F = A  B XOR 0 1 1 1 X F = A’ Complement A 1 0 X X X F = shr A Shift right A into F 1 1 X X X F = shl A Shift left A into F 
Arithmetic 
Circuit 
Logic 
Circuit 
C 
C 
4 x 1 
MUX 
Select 
0 
1 
2 
3 
F 
S3 
S2 
S1 
S0 
B 
A 
i 
A 
D 
A 
E 
shr 
shl 
i+1 
i 
i 
i 
i+1 
i-1 
i 
i
Example 
Register A holds 8-bit operand 11011001. Determine the operand B and logic microoperation to be performed in order to change the value of A to 
a)01101101 
b)11111101 
A = 11011001 A = 11011001 
B = 10110100 ⊕ B = 11111101 (OR) 
A’ = 01101101 A’ ← A ⊕ B A’ = 11111101 A’ ← AVB

More Related Content

PPTX
Microoperations
PPTX
Arithmetic micro operations
PPTX
Arithmetic micro operations
PPTX
Register transfer language & its micro operations
PPTX
Logical and shift micro operations
PPTX
Types of Instruction Format
PPT
Unit 3 basic processing unit
PDF
Ch8 (1) morris mano
Microoperations
Arithmetic micro operations
Arithmetic micro operations
Register transfer language & its micro operations
Logical and shift micro operations
Types of Instruction Format
Unit 3 basic processing unit
Ch8 (1) morris mano

What's hot (20)

PPT
File handling in c
PPTX
Timing and control
PPS
Timing and-control-unit
PPTX
Single pass assembler
PDF
loaders and linkers
PPT
RECURSION IN C
PPT
Assembler
PPTX
Pointer arithmetic in c
PPTX
Unit 4 sp macro
PPTX
Polymorphism In c++
PPTX
Linker and Loader
PPS
Computer instructions
PDF
Addressing modes in computer organization
PPT
Class and object in C++
PDF
Symbol table in compiler Design
PPTX
bus and memory tranfer (computer organaization)
PPS
Cache memory
PPTX
Register transfer and micro-operation
PPTX
Combinational circuits
File handling in c
Timing and control
Timing and-control-unit
Single pass assembler
loaders and linkers
RECURSION IN C
Assembler
Pointer arithmetic in c
Unit 4 sp macro
Polymorphism In c++
Linker and Loader
Computer instructions
Addressing modes in computer organization
Class and object in C++
Symbol table in compiler Design
bus and memory tranfer (computer organaization)
Cache memory
Register transfer and micro-operation
Combinational circuits
Ad

Viewers also liked (20)

PPTX
Register transfer and micro operation
PDF
Instruction code
PPTX
Register transfer language
PPTX
Micro operation control of processor
PDF
Computer organiztion4
PPTX
Logical micro-operations
PPT
Bca 2nd sem-u-2.2-overview of register transfer, micro operations and basic c...
PPT
Instruction cycle
PPTX
Shift Microoperations by Pir Sarfraz RSDT larkana
PPT
Shift rotate
PPT
Logic, shift and rotate instruction
PDF
Lecture 2
PPT
Arithmetic Logic Unit (ALU)
PPT
Instruction codes and computer registers
PPTX
Co ppt
PPT
Error Detection And Correction
PPT
Al2ed chapter18
RTF
4_BIT_ALU
PPT
IS 139 Lecture 4
Register transfer and micro operation
Instruction code
Register transfer language
Micro operation control of processor
Computer organiztion4
Logical micro-operations
Bca 2nd sem-u-2.2-overview of register transfer, micro operations and basic c...
Instruction cycle
Shift Microoperations by Pir Sarfraz RSDT larkana
Shift rotate
Logic, shift and rotate instruction
Lecture 2
Arithmetic Logic Unit (ALU)
Instruction codes and computer registers
Co ppt
Error Detection And Correction
Al2ed chapter18
4_BIT_ALU
IS 139 Lecture 4
Ad

Similar to Logic microoperations (20)

PPTX
Micro operations ,arithemetic ,logic ,shift and Register Transefer Operations
PPTX
Register transfer and microoperations part 2
PPTX
CS304PC:Computer Organization and Architecture Session 4 Arithmetic shift log...
PPT
12 Logic Microoperations.pptertryrtytrgrtgtrgtrgtrgtr
PPT
Logic Micro Operation
PPTX
Logicmicrooperations in design and analysis.pptx
PPT
CAO 3 Unit 1 best of one presentation.ppt
PPT
RTL,Instruction set _
PPTX
Lecture 9
PPT
Mba admission in india
PPT
Free video lectures for mca
PPT
Admissions in india 2015
PDF
Lect3 organization 2
PPTX
arithmeticmicrooperations-180130061637.pptx
PPT
Register transfer & microoperations moris mano ch 04
PPTX
CS304PC:Computer Organization and Architecture Session 3 micro operations.pptx
PPT
Module 5 part1
PPTX
UNIT-3 Complete PPT.pptx
PPT
Top schools in faridabad
PPTX
Registers in coa
Micro operations ,arithemetic ,logic ,shift and Register Transefer Operations
Register transfer and microoperations part 2
CS304PC:Computer Organization and Architecture Session 4 Arithmetic shift log...
12 Logic Microoperations.pptertryrtytrgrtgtrgtrgtrgtr
Logic Micro Operation
Logicmicrooperations in design and analysis.pptx
CAO 3 Unit 1 best of one presentation.ppt
RTL,Instruction set _
Lecture 9
Mba admission in india
Free video lectures for mca
Admissions in india 2015
Lect3 organization 2
arithmeticmicrooperations-180130061637.pptx
Register transfer & microoperations moris mano ch 04
CS304PC:Computer Organization and Architecture Session 3 micro operations.pptx
Module 5 part1
UNIT-3 Complete PPT.pptx
Top schools in faridabad
Registers in coa

More from Nitesh Singh (20)

PPTX
Risk taking and emotions
PDF
Project report RAILWAY TICKET RESERVATION SYSTEM SAD
PPTX
The real comedy behind comedy
PDF
Project report Rs Dry celaners
PPTX
BIG DATA ANALYSIS
DOCX
Udp vs-tcp
PPT
Routing protocols-network-layer
DOCX
Routers vs-switch
PPT
New udp
PPT
I pv4 format
PPT
I pv4 addressing
DOCX
Hub vs-switch
PPTX
PPT
Email ftp
PPTX
Www and http
PDF
Transmission main
PPT
Ta 104-topology
PPT
Ta 104-topology (1)
PPT
Ta 104-tcp
PPT
Ta 104-media-3
Risk taking and emotions
Project report RAILWAY TICKET RESERVATION SYSTEM SAD
The real comedy behind comedy
Project report Rs Dry celaners
BIG DATA ANALYSIS
Udp vs-tcp
Routing protocols-network-layer
Routers vs-switch
New udp
I pv4 format
I pv4 addressing
Hub vs-switch
Email ftp
Www and http
Transmission main
Ta 104-topology
Ta 104-topology (1)
Ta 104-tcp
Ta 104-media-3

Logic microoperations

  • 1. Logic Microoperations Tarunpreet Bhatia CSED, Thapar University
  • 2. LIST OF LOGIC MICROOPERATIONS • List of Logic Microoperations - 16 different logic operations with 2 binary variables. - n binary variables → functions 2 2 n • Truth tables for 16 functions of 2 variables and the corresponding 16 logic micro-operations Boolean Function Micro- Operations Name x 0 0 1 1 y 0 1 0 1 0 0 0 0 F0 = 0 F  0 Clear 0 0 0 1 F1 = xy F  A  B AND 0 0 1 0 F2 = xy' F  A  B’ 0 0 1 1 F3 = x F  A Transfer A 0 1 0 0 F4 = x'y F  A’ B 0 1 0 1 F5 = y F  B Transfer B 0 1 1 0 F6 = x  y F  A  B Exclusive-OR 0 1 1 1 F7 = x + y F  A  B OR 1 0 0 0 F8 = (x + y)' F  A  B)’ NOR 1 0 0 1 F9 = (x  y)' F  (A  B)’ Exclusive-NOR 1 0 1 0 F10 = y' F  B’ Complement B 1 0 1 1 F11 = x + y' F  A  B 1 1 0 0 F12 = x' F  A’ Complement A 1 1 0 1 F13 = x' + y F  A’ B 1 1 1 0 F14 = (xy)' F  (A  B)’ NAND 1 1 1 1 F15 = 1 F  all 1's Set to all 1's
  • 3. HARDWARE IMPLEMENTATION OF LOGIC MICROOPERATIONS 0 0 F = A  B AND 0 1 F = AB OR 1 0 F = A  B XOR 1 1 F = A’ Complement S1 S0 Output -operation Function table B A S S F 1 0 i i i 0 1 2 3 4 X 1 MUX Select
  • 4. APPLICATIONS OF LOGIC MICROOPERATIONS •Logic microoperations can be used to manipulate individual bits or a portions of a word in a register •Consider the data in a register A. In another register, B, is bit data that will be used to modify the contents of A Selective-set A  A + B Selective-complement A  A  B Selective-clear A  A • B’ Mask (Delete) A  A • B Clear A  A  B Insert A  (A • B) + C Compare A  A  B
  • 5. SELECTIVE SET •In a selective set operation, the bit pattern in B is used to set certain bits in A 1 1 0 0 At 1 0 1 0 B 1 1 1 0 At+1 (A  A + B) •If a bit in B is set to 1, that same position in A gets set to 1, otherwise that bit in A keeps its previous value. •OR microoperation can be used to selectively set bits of a register.
  • 6. SELECTIVE COMPLEMENT •In a selective complement operation, the bit pattern in B is used to complement certain bits in A 1 1 0 0 At 1 0 1 0 B 0 1 1 0 At+1 (A  A  B) •If a bit in B is set to 1, that same position in A gets complemented from its original value, otherwise it is unchanged. •The exclusive-OR microoperation can be used to selectively complement bits of a register.
  • 7. SELECTIVE CLEAR •In a selective clear operation, the bit pattern in B is used to clear certain bits in A 1 1 0 0 At 1 0 1 0 B 0 1 0 0 At+1 (A  A  B’) •If a bit in B is set to 1, that same position in A gets set to 0, otherwise it is unchanged
  • 8. MASK OPERATION •In a mask operation, the bit pattern in B is used to clear certain bits in A 1 1 0 0 At 1 0 1 0 B 1 0 0 0 At+1 (A  A  B) •If a bit in B is set to 0, that same position in A gets set to 0, otherwise it is unchanged
  • 9. CLEAR OPERATION •In a clear operation, if the bits in the same position in A and B are the same, they are cleared in A, otherwise they are set in A. 1 1 0 0 At 1 0 1 0 B 0 1 1 0 At+1 (A  A  B) •It compares words in A and B and produces all 0’s result if the two numbers are equal. This operation is achieved by XOR microoperation.
  • 10. INSERT OPERATION •An insert operation is used to introduce a specific bit pattern into A register, leaving the other bit positions unchanged •This is done as –A mask operation to clear the desired bit positions, followed by –An OR operation to introduce the new bits into the desired positions
  • 11. –Example •Suppose you wanted to introduce 1010 into the low order four bits of A: 1101 1000 1011 0001 A (Original) 1101 1000 1011 1010 A (Desired) •1101 1000 1011 0001 A (Original) 1111 1111 1111 0000 Mask 1101 1000 1011 0000 A (Intermediate) 0000 0000 0000 1010 Added bits 1101 1000 1011 1010 A (Desired)
  • 12. SHIFT MICROOPERATIONS •Shift microoperations are used for serial transfer of data. •The information transferred through the serial input determines the type of shift. There are three types of shifts –Logical shift –Circular shift –Arithmetic shift Serial input • A right shift operation • A left shift operation Serial input
  • 13. LOGICAL SHIFT •In a logical shift the serial input to the shift is a 0. •A right logical shift operation: •A left logical shift operation: •In a Register Transfer Language, the following notation is used –shl for a logical shift left –shr for a logical shift right –Examples: •R2  shr R2 •R3  shl R3 0 0
  • 14. CIRCULAR SHIFT •In a circular shift the serial input is the bit that is shifted out of the other end of the register. •A right circular shift operation: •A left circular shift operation: •In a RTL, the following notation is used –cil for a circular shift left –cir for a circular shift right –Examples: •R2  cir R2 •R3  cil R3
  • 15. ARITHMETIC SHIFT •An arithmetic shift is meant for signed binary numbers (integer) •An arithmetic left shift multiplies a signed number by two •An arithmetic right shift divides a signed number by two •The main distinction of an arithmetic shift is that it must keep the sign of the number the same as it performs the multiplication or division •A right arithmetic shift operation: •A left arithmetic shift operation: 0 sign bit sign bit
  • 16. ARITHMETIC SHIFT •An left arithmetic shift operation must be checked for the overflow 0 V Before the shift, if the leftmost two bits differ, the shift will result in an overflow •In a RTL, the following notation is used –ashl for an arithmetic shift left –ashr for an arithmetic shift right –Examples: •R2  ashr R2 •R3  ashl R3 sign bit
  • 17. ARITHMETIC LOGIC SHIFT UNIT S3 S2 S1 S0 Cin Operation Function 0 0 0 0 0 F = A Transfer A 0 0 0 0 1 F = A + 1 Increment A 0 0 0 1 0 F = A + B Addition 0 0 0 1 1 F = A + B + 1 Add with carry 0 0 1 0 0 F = A + B’ Subtract with borrow 0 0 1 0 1 F = A + B’+ 1 Subtraction 0 0 1 1 0 F = A - 1 Decrement A 0 0 1 1 1 F = A TransferA 0 1 0 0 X F = A  B AND 0 1 0 1 X F = A B OR 0 1 1 0 X F = A  B XOR 0 1 1 1 X F = A’ Complement A 1 0 X X X F = shr A Shift right A into F 1 1 X X X F = shl A Shift left A into F Arithmetic Circuit Logic Circuit C C 4 x 1 MUX Select 0 1 2 3 F S3 S2 S1 S0 B A i A D A E shr shl i+1 i i i i+1 i-1 i i
  • 18. Example Register A holds 8-bit operand 11011001. Determine the operand B and logic microoperation to be performed in order to change the value of A to a)01101101 b)11111101 A = 11011001 A = 11011001 B = 10110100 ⊕ B = 11111101 (OR) A’ = 01101101 A’ ← A ⊕ B A’ = 11111101 A’ ← AVB