SlideShare a Scribd company logo
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

What's hot

Arithmetic micro operations
Arithmetic micro operationsArithmetic micro operations
Arithmetic micro operations
lavanya marichamy
 
bus and memory tranfer (computer organaization)
bus and memory tranfer (computer organaization)bus and memory tranfer (computer organaization)
bus and memory tranfer (computer organaization)
Siddhi Viradiya
 
Computer architecture data representation
Computer architecture  data representationComputer architecture  data representation
Computer architecture data representation
Anil Pokhrel
 
Instruction format
Instruction formatInstruction format
Instruction format
Sanjeev Patel
 
Control Units : Microprogrammed and Hardwired:control unit
Control Units : Microprogrammed and Hardwired:control unitControl Units : Microprogrammed and Hardwired:control unit
Control Units : Microprogrammed and Hardwired:control unit
abdosaidgkv
 
Computer Organization and Architecture.
Computer Organization and Architecture.Computer Organization and Architecture.
Computer Organization and Architecture.
CS_GDRCST
 
Stack organization
Stack organizationStack organization
Stack organization
chauhankapil
 
Program control
Program controlProgram control
Program control
Rahul Narang
 
Signed Addition And Subtraction
Signed Addition And SubtractionSigned Addition And Subtraction
Signed Addition And Subtraction
Keyur Vadodariya
 
Memory Organization
Memory OrganizationMemory Organization
Memory Organization
Kamal Acharya
 
Data transfer and manipulation
Data transfer and manipulationData transfer and manipulation
Data transfer and manipulation
Sanjeev Patel
 
Register transfer and micro-operation
Register transfer and micro-operationRegister transfer and micro-operation
Register transfer and micro-operation
Nikhil Pandit
 
Expression and Operartor In C Programming
Expression and Operartor In C Programming Expression and Operartor In C Programming
Expression and Operartor In C Programming
Kamal Acharya
 
CISC & RISC Architecture
CISC & RISC Architecture CISC & RISC Architecture
CISC & RISC Architecture
Suvendu Kumar Dash
 
Microprogrammed Control Unit
Microprogrammed Control UnitMicroprogrammed Control Unit
Microprogrammed Control Unit
PreethiSureshkumar1
 
Addressing Modes
Addressing ModesAddressing Modes
Addressing Modes
Mayank Garg
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
karthiga selvaraju
 
Memory Reference Instructions
Memory Reference InstructionsMemory Reference Instructions
Memory Reference Instructions
Rabin BK
 

What's hot (20)

Instruction cycle
Instruction cycleInstruction cycle
Instruction cycle
 
Lecture 3 instruction set
Lecture 3  instruction setLecture 3  instruction set
Lecture 3 instruction set
 
Arithmetic micro operations
Arithmetic micro operationsArithmetic micro operations
Arithmetic micro operations
 
bus and memory tranfer (computer organaization)
bus and memory tranfer (computer organaization)bus and memory tranfer (computer organaization)
bus and memory tranfer (computer organaization)
 
Computer architecture data representation
Computer architecture  data representationComputer architecture  data representation
Computer architecture data representation
 
Instruction format
Instruction formatInstruction format
Instruction format
 
Control Units : Microprogrammed and Hardwired:control unit
Control Units : Microprogrammed and Hardwired:control unitControl Units : Microprogrammed and Hardwired:control unit
Control Units : Microprogrammed and Hardwired:control unit
 
Computer Organization and Architecture.
Computer Organization and Architecture.Computer Organization and Architecture.
Computer Organization and Architecture.
 
Stack organization
Stack organizationStack organization
Stack organization
 
Program control
Program controlProgram control
Program control
 
Signed Addition And Subtraction
Signed Addition And SubtractionSigned Addition And Subtraction
Signed Addition And Subtraction
 
Memory Organization
Memory OrganizationMemory Organization
Memory Organization
 
Data transfer and manipulation
Data transfer and manipulationData transfer and manipulation
Data transfer and manipulation
 
Register transfer and micro-operation
Register transfer and micro-operationRegister transfer and micro-operation
Register transfer and micro-operation
 
Expression and Operartor In C Programming
Expression and Operartor In C Programming Expression and Operartor In C Programming
Expression and Operartor In C Programming
 
CISC & RISC Architecture
CISC & RISC Architecture CISC & RISC Architecture
CISC & RISC Architecture
 
Microprogrammed Control Unit
Microprogrammed Control UnitMicroprogrammed Control Unit
Microprogrammed Control Unit
 
Addressing Modes
Addressing ModesAddressing Modes
Addressing Modes
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
Memory Reference Instructions
Memory Reference InstructionsMemory Reference Instructions
Memory Reference Instructions
 

Viewers also liked

Arithmetic micro operations
Arithmetic micro operationsArithmetic micro operations
Arithmetic micro operations
Nitesh Bichwani
 
Register transfer and micro operation
Register transfer and micro operationRegister transfer and micro operation
Register transfer and micro operation
Kamal Acharya
 
Micro operation control of processor
Micro operation control of processorMicro operation control of processor
Micro operation control of processorMuhammad Ishaq
 
Computer organiztion4
Computer organiztion4Computer organiztion4
Computer organiztion4Umang Gupta
 
Bca 2nd sem-u-2.2-overview of register transfer, micro operations and basic c...
Bca 2nd sem-u-2.2-overview of register transfer, micro operations and basic c...Bca 2nd sem-u-2.2-overview of register transfer, micro operations and basic c...
Bca 2nd sem-u-2.2-overview of register transfer, micro operations and basic c...
Rai University
 
Shift Microoperations by Pir Sarfraz RSDT larkana
Shift Microoperations by Pir Sarfraz RSDT larkanaShift Microoperations by Pir Sarfraz RSDT larkana
Shift Microoperations by Pir Sarfraz RSDT larkana
Pir Sarfraz Ahmed
 
Ch4
Ch4Ch4
Shift rotate
Shift rotateShift rotate
Shift rotate
fika sweety
 
Logic, shift and rotate instruction
Logic, shift and rotate instructionLogic, shift and rotate instruction
Logic, shift and rotate instructionkashif Shafqat
 
Lecture 2
Lecture 2Lecture 2
Lecture 2GIKI
 
Arithmetic Logic Unit (ALU)
Arithmetic Logic Unit (ALU)Arithmetic Logic Unit (ALU)
Arithmetic Logic Unit (ALU)
Student
 
Instruction codes and computer registers
Instruction codes and computer registersInstruction codes and computer registers
Instruction codes and computer registers
Sanjeev Patel
 
Error Detection And Correction
Error Detection And CorrectionError Detection And Correction
Error Detection And Correction
Renu Kewalramani
 
IS 139 Lecture 4
IS 139 Lecture 4IS 139 Lecture 4
IS 139 Lecture 4
wajanga
 

Viewers also liked (20)

Arithmetic micro operations
Arithmetic micro operationsArithmetic micro operations
Arithmetic micro operations
 
Register transfer and micro operation
Register transfer and micro operationRegister transfer and micro operation
Register transfer and micro operation
 
Instruction code
Instruction codeInstruction code
Instruction code
 
Micro operation control of processor
Micro operation control of processorMicro operation control of processor
Micro operation control of processor
 
Computer organiztion4
Computer organiztion4Computer organiztion4
Computer organiztion4
 
Bca 2nd sem-u-2.2-overview of register transfer, micro operations and basic c...
Bca 2nd sem-u-2.2-overview of register transfer, micro operations and basic c...Bca 2nd sem-u-2.2-overview of register transfer, micro operations and basic c...
Bca 2nd sem-u-2.2-overview of register transfer, micro operations and basic c...
 
Shift Microoperations by Pir Sarfraz RSDT larkana
Shift Microoperations by Pir Sarfraz RSDT larkanaShift Microoperations by Pir Sarfraz RSDT larkana
Shift Microoperations by Pir Sarfraz RSDT larkana
 
Ch4
Ch4Ch4
Ch4
 
Shift rotate
Shift rotateShift rotate
Shift rotate
 
Logic, shift and rotate instruction
Logic, shift and rotate instructionLogic, shift and rotate instruction
Logic, shift and rotate instruction
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
 
Arithmetic Logic Unit (ALU)
Arithmetic Logic Unit (ALU)Arithmetic Logic Unit (ALU)
Arithmetic Logic Unit (ALU)
 
Instruction codes and computer registers
Instruction codes and computer registersInstruction codes and computer registers
Instruction codes and computer registers
 
Co ppt
Co pptCo ppt
Co ppt
 
Error Detection And Correction
Error Detection And CorrectionError Detection And Correction
Error Detection And Correction
 
Al2ed chapter18
Al2ed chapter18Al2ed chapter18
Al2ed chapter18
 
4_BIT_ALU
4_BIT_ALU4_BIT_ALU
4_BIT_ALU
 
IS 139 Lecture 4
IS 139 Lecture 4IS 139 Lecture 4
IS 139 Lecture 4
 
Lec20
Lec20Lec20
Lec20
 
RTL
 RTL RTL
RTL
 

Similar to Logic microoperations

Logic Micro Operation
Logic Micro OperationLogic Micro Operation
Logic Micro Operation
mahesh kumar prajapat
 
12 Logic Microoperations.pptertryrtytrgrtgtrgtrgtrgtr
12 Logic Microoperations.pptertryrtytrgrtgtrgtrgtrgtr12 Logic Microoperations.pptertryrtytrgrtgtrgtrgtrgtr
12 Logic Microoperations.pptertryrtytrgrtgtrgtrgtrgtr
agamgmsc23
 
Logical, Shift, and Rotate Instruction
Logical, Shift, and Rotate InstructionLogical, Shift, and Rotate Instruction
Logical, Shift, and Rotate Instruction
Badrul Alam
 
C bitwise operators
C bitwise operatorsC bitwise operators
C bitwise operatorsSuneel Dogra
 
CA UNIT II.pptx
CA UNIT II.pptxCA UNIT II.pptx
CA UNIT II.pptx
ssuser9dbd7e
 
Mba admission in india
Mba admission in indiaMba admission in india
Mba admission in india
Edhole.com
 
B sc cs i bo-de u-ii logic gates
B sc cs i bo-de u-ii logic gatesB sc cs i bo-de u-ii logic gates
B sc cs i bo-de u-ii logic gates
Rai University
 
Digital logic
Digital logicDigital logic
Digital logic
Md Shohel Rana
 
Arithmetic instructions
Arithmetic instructionsArithmetic instructions
Arithmetic instructions
Robert Almazan
 
Chapter 3_Boolean Algebra _ Logic Gate (3).pptx
Chapter 3_Boolean Algebra _ Logic Gate (3).pptxChapter 3_Boolean Algebra _ Logic Gate (3).pptx
Chapter 3_Boolean Algebra _ Logic Gate (3).pptx
sujenizswaranrajan
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...
Bilal Amjad
 
Binary operations
 Binary operations Binary operations
Binary operations
NicolaMorris21
 
Synchronous Sequential Logic Unit 4
Synchronous Sequential Logic Unit 4Synchronous Sequential Logic Unit 4
Synchronous Sequential Logic Unit 4
Asif Iqbal
 

Similar to Logic microoperations (20)

Logic Micro Operation
Logic Micro OperationLogic Micro Operation
Logic Micro Operation
 
12 Logic Microoperations.pptertryrtytrgrtgtrgtrgtrgtr
12 Logic Microoperations.pptertryrtytrgrtgtrgtrgtrgtr12 Logic Microoperations.pptertryrtytrgrtgtrgtrgtrgtr
12 Logic Microoperations.pptertryrtytrgrtgtrgtrgtrgtr
 
Booth Multiplier
Booth MultiplierBooth Multiplier
Booth Multiplier
 
Lecture 9
Lecture 9Lecture 9
Lecture 9
 
Logical, Shift, and Rotate Instruction
Logical, Shift, and Rotate InstructionLogical, Shift, and Rotate Instruction
Logical, Shift, and Rotate Instruction
 
Shift register
Shift registerShift register
Shift register
 
lec41.ppt
lec41.pptlec41.ppt
lec41.ppt
 
C bitwise operators
C bitwise operatorsC bitwise operators
C bitwise operators
 
CA UNIT II.pptx
CA UNIT II.pptxCA UNIT II.pptx
CA UNIT II.pptx
 
Mba admission in india
Mba admission in indiaMba admission in india
Mba admission in india
 
B sc cs i bo-de u-ii logic gates
B sc cs i bo-de u-ii logic gatesB sc cs i bo-de u-ii logic gates
B sc cs i bo-de u-ii logic gates
 
Digital logic
Digital logicDigital logic
Digital logic
 
Arithmetic instructions
Arithmetic instructionsArithmetic instructions
Arithmetic instructions
 
Chapter 3_Boolean Algebra _ Logic Gate (3).pptx
Chapter 3_Boolean Algebra _ Logic Gate (3).pptxChapter 3_Boolean Algebra _ Logic Gate (3).pptx
Chapter 3_Boolean Algebra _ Logic Gate (3).pptx
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...
 
Dpsd lecture-notes
Dpsd lecture-notesDpsd lecture-notes
Dpsd lecture-notes
 
Hemanth143
Hemanth143 Hemanth143
Hemanth143
 
UNIT-1_CSA.pdf
UNIT-1_CSA.pdfUNIT-1_CSA.pdf
UNIT-1_CSA.pdf
 
Binary operations
 Binary operations Binary operations
Binary operations
 
Synchronous Sequential Logic Unit 4
Synchronous Sequential Logic Unit 4Synchronous Sequential Logic Unit 4
Synchronous Sequential Logic Unit 4
 

More from Nitesh Singh

Risk taking and emotions
Risk taking and emotionsRisk taking and emotions
Risk taking and emotionsNitesh Singh
 
Project report RAILWAY TICKET RESERVATION SYSTEM SAD
Project report RAILWAY TICKET RESERVATION SYSTEM SADProject report RAILWAY TICKET RESERVATION SYSTEM SAD
Project report RAILWAY TICKET RESERVATION SYSTEM SAD
Nitesh Singh
 
The real comedy behind comedy
The real comedy behind comedyThe real comedy behind comedy
The real comedy behind comedy
Nitesh Singh
 
Project report Rs Dry celaners
Project report Rs Dry celaners Project report Rs Dry celaners
Project report Rs Dry celaners Nitesh Singh
 
Routing protocols-network-layer
Routing protocols-network-layerRouting protocols-network-layer
Routing protocols-network-layerNitesh Singh
 
Ta 104-topology (1)
Ta 104-topology (1)Ta 104-topology (1)
Ta 104-topology (1)Nitesh Singh
 

More from Nitesh Singh (20)

Risk taking and emotions
Risk taking and emotionsRisk taking and emotions
Risk taking and emotions
 
Project report RAILWAY TICKET RESERVATION SYSTEM SAD
Project report RAILWAY TICKET RESERVATION SYSTEM SADProject report RAILWAY TICKET RESERVATION SYSTEM SAD
Project report RAILWAY TICKET RESERVATION SYSTEM SAD
 
The real comedy behind comedy
The real comedy behind comedyThe real comedy behind comedy
The real comedy behind comedy
 
Project report Rs Dry celaners
Project report Rs Dry celaners Project report Rs Dry celaners
Project report Rs Dry celaners
 
BIG DATA ANALYSIS
BIG DATA ANALYSISBIG DATA ANALYSIS
BIG DATA ANALYSIS
 
Udp vs-tcp
Udp vs-tcpUdp vs-tcp
Udp vs-tcp
 
Routing protocols-network-layer
Routing protocols-network-layerRouting protocols-network-layer
Routing protocols-network-layer
 
Routers vs-switch
Routers vs-switchRouters vs-switch
Routers vs-switch
 
New udp
New udpNew udp
New udp
 
I pv4 format
I pv4 formatI pv4 format
I pv4 format
 
I pv4 addressing
I pv4 addressingI pv4 addressing
I pv4 addressing
 
Hub vs-switch
Hub vs-switchHub vs-switch
Hub vs-switch
 
Ftp
FtpFtp
Ftp
 
Email ftp
Email ftpEmail ftp
Email ftp
 
Www and http
Www and httpWww and http
Www and http
 
Transmission main
Transmission mainTransmission main
Transmission main
 
Ta 104-topology
Ta 104-topologyTa 104-topology
Ta 104-topology
 
Ta 104-topology (1)
Ta 104-topology (1)Ta 104-topology (1)
Ta 104-topology (1)
 
Ta 104-tcp
Ta 104-tcpTa 104-tcp
Ta 104-tcp
 
Ta 104-media-3
Ta 104-media-3Ta 104-media-3
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