SlideShare a Scribd company logo
A Presentation On topic
‘Arithmetic Micro-operations’
Submitted By:-
Nitesh Bichwani
02224302013
B.C.A 3rd semester
Evening shift
Submitted To:-
Ms. Iti Batra
(Assistant professor)
Ms. Aditi Bhasin
(Assistant professor)
Submitted in the partial fulfilment for the award of degree of
Bachelor’s of Computer Application
SIRIFORT COLLEGE OF COMPUTER TECHNOLOGY AND MANAGEMENT
Plot no-8, Institutional area, Sector 25 Rohini, Delhi-110085
Definitions:-
A micro-operation is an elementary operation performed
with the data stored in registers. Arithmetic Micro-
operations perform arithmetic operation on numeric data
stored in registers.
The basic arithmetic micro operations are:-
 Addition
 Subtraction
 Increment
 Decrement
 The arithmetic add micro operation is given by
the statement.
 R3  R1+ R2
 It states that the contents of register R1 are
added with the contents of register R2 and the
result will be transferred to register R3.
C0C1C2C3
C4
S0S1S2S3
A0B0A1B1A2A3 B2B3
FAFA FA FA
4 - bit Binary Adder
Working
Add Micro operation can be implemented using Full adders.
Each full adder takes 2 inputs from 2 numbers and a third
input as a previous carry.
All the carries are connected in serial fashion to the next full
adder.
Number of full adders depends upon number of bits of data.
When A0 B0 are added and initially C0 is 0 then as a result
S0 gives the sum of A0 and B0 and so on.
 The arithmetic addition / subtract micro operation
is given by the statements,
 R3  R1 + R2+ 1
 R3  R1 + R2
 The addition and subtraction operations are
performed in one common circuit by including an
exclusive-OR gate with each full adder.
C0
C1C2C3
C4
S0S1S2S3
A0B0A1B1A2A3 B2B3
FAFA FA FA
M
4 – bit Adder - Subtractor
Working
The addition and subtraction operations can be
combined into one common circuit by including an XOR
gate with each full-adder.
With the help of a mode bit we can add or subtract.
• M = 0
When M is 0 then Cin will be 0 and 0 B0 gives B0
then S0 will be the sum of A0 and B0. hence by M =
0 will perform addition.
• M = 1
When M is 1 then Cin will be 1 and 1 B0 gives B0
then A0 + B0 + 1 = A0 – B0 hence M = 1 will
perform subtraction.
• The increment micro operation is given by the
statement,
• R1  R1 + 1
• The contents of register R1 are incremented
by one.
C0C1C2
C3 S0S1
S2S3
A0
A1
A2A3
HAHA HA HA
4 - bit Binary Incrementer
1
Working
The increment Micro operation adds 1 to a number in a
register.
This Micro operation easily carried out using half adders
as described in previous slide.
Each half adder needs 1 input and 1 carry. In the very
first half adder the carry is 1.
As this is the increment micro operation hence the carry
is forward to the next half adder if generated and as a
result sum bits S3 , S2 , S1 , S0 are generated along with a
possible carry out.
The basic arithmetic micro operations (addition,
subtraction, increment and decrement) can be performed
in one composite arithmetic circuit.
Select Input Output
Micro operation
S1 S0 Cin Y D = A + Y + Cin
0 0 0 B D = A + B Add
0 0 1 B D = A + B + 1 Add with Carry
0 1 0 B D = A + B Subtract with Borrow
0 1 1 B D = A + B + 1 Subtract
1 0 0 0 D = A Transfer A
1 0 1 0 D = A + 1 Increment A
1 1 0 1 D = A – 1 Decrement A
1 1 1 1 D = A Transfer A
FA
4 1
MUX
FA
FA
FA
S1
S0
0
1
2
3
S1
S0
0
1
2
3
S1
S0
0
1
2
3
S1
S0
0
1
2
3
S1
S0
Cin
A0
A1
A2
A3
4 1
MUX
4 1
MUX
4 1
MUX
B0
B1
B2
B3
0 1
Cout
D3
D0
D1
D2
X3
X0
X1
X2
Y3
Y0
Y1
Y2
C0
C1
C1
C2
C2
C3
C3
C4
Working
This arithmetic circuit can perform 8 operations among
them some are :-
Addition:-
When S1 S0 = 0 0, the value of B is applied to the Y inputs
of the adder. If Cin = 0, the output D = A + B. if Cin =1,
output D = A + B + 1. Both cases perform the add
microoperation with or without adding the input carry.
Subtraction:-
When S1 S0 = 0 1, the value of B is applied to the Y inputs
of the adder. If Cin = 1, then D = A + B + 1. this produces A
plus the 2’s complement of B, which is equivalent to a
subtraction of A – B. when Cin = 0, then D = A + B. this is
equivalent to a subtract with borrow, that is , A – B – 1.
Increment:-
When S1 S0 = 1 0, the inputs from B are neglected , and
instead, all 0’s are inserted into the y inputs. The output
becomes D = A + 0 + Cin. This gives D = A when Cin = 0
and D = A + 1 when Cin = 1. in the first case we have a
direct transfer from the input A to output D. in the second
case, the value of A is incremented by 1.
Decrement:-
When S1 S0 = 1 1, all 1’s are inserted into the Y inputs of
the adder to produce the decrement operation D = A – 1
when Cin = 0. this is because a number with all 1’s is equal
to the 2’s complement of 1 (the 2’s complement of binary
0001 is 1111). Adding number A to the 2’complement of 1
produces F = A + 2’s complement of 1 = A – 1 when Cin =
1, then D = A – 1 + 1 = A, which causes a direct transfer
from input A to output D.
NOTE :-
Microoperation D = A is generated twice , so there are only
7 distinct Microoperations in the arithmetic circuit.
Thank You
Presented by:-
Nitesh Bichwani

More Related Content

Arithmetic micro operations

  • 1. A Presentation On topic ‘Arithmetic Micro-operations’ Submitted By:- Nitesh Bichwani 02224302013 B.C.A 3rd semester Evening shift Submitted To:- Ms. Iti Batra (Assistant professor) Ms. Aditi Bhasin (Assistant professor) Submitted in the partial fulfilment for the award of degree of Bachelor’s of Computer Application SIRIFORT COLLEGE OF COMPUTER TECHNOLOGY AND MANAGEMENT Plot no-8, Institutional area, Sector 25 Rohini, Delhi-110085
  • 2. Definitions:- A micro-operation is an elementary operation performed with the data stored in registers. Arithmetic Micro- operations perform arithmetic operation on numeric data stored in registers. The basic arithmetic micro operations are:-  Addition  Subtraction  Increment  Decrement
  • 3.  The arithmetic add micro operation is given by the statement.  R3  R1+ R2  It states that the contents of register R1 are added with the contents of register R2 and the result will be transferred to register R3.
  • 5. Working Add Micro operation can be implemented using Full adders. Each full adder takes 2 inputs from 2 numbers and a third input as a previous carry. All the carries are connected in serial fashion to the next full adder. Number of full adders depends upon number of bits of data. When A0 B0 are added and initially C0 is 0 then as a result S0 gives the sum of A0 and B0 and so on.
  • 6.  The arithmetic addition / subtract micro operation is given by the statements,  R3  R1 + R2+ 1  R3  R1 + R2  The addition and subtraction operations are performed in one common circuit by including an exclusive-OR gate with each full adder.
  • 7. C0 C1C2C3 C4 S0S1S2S3 A0B0A1B1A2A3 B2B3 FAFA FA FA M 4 – bit Adder - Subtractor
  • 8. Working The addition and subtraction operations can be combined into one common circuit by including an XOR gate with each full-adder. With the help of a mode bit we can add or subtract. • M = 0 When M is 0 then Cin will be 0 and 0 B0 gives B0 then S0 will be the sum of A0 and B0. hence by M = 0 will perform addition. • M = 1 When M is 1 then Cin will be 1 and 1 B0 gives B0 then A0 + B0 + 1 = A0 – B0 hence M = 1 will perform subtraction.
  • 9. • The increment micro operation is given by the statement, • R1  R1 + 1 • The contents of register R1 are incremented by one.
  • 10. C0C1C2 C3 S0S1 S2S3 A0 A1 A2A3 HAHA HA HA 4 - bit Binary Incrementer 1
  • 11. Working The increment Micro operation adds 1 to a number in a register. This Micro operation easily carried out using half adders as described in previous slide. Each half adder needs 1 input and 1 carry. In the very first half adder the carry is 1. As this is the increment micro operation hence the carry is forward to the next half adder if generated and as a result sum bits S3 , S2 , S1 , S0 are generated along with a possible carry out.
  • 12. The basic arithmetic micro operations (addition, subtraction, increment and decrement) can be performed in one composite arithmetic circuit. Select Input Output Micro operation S1 S0 Cin Y D = A + Y + Cin 0 0 0 B D = A + B Add 0 0 1 B D = A + B + 1 Add with Carry 0 1 0 B D = A + B Subtract with Borrow 0 1 1 B D = A + B + 1 Subtract 1 0 0 0 D = A Transfer A 1 0 1 0 D = A + 1 Increment A 1 1 0 1 D = A – 1 Decrement A 1 1 1 1 D = A Transfer A
  • 13. FA 4 1 MUX FA FA FA S1 S0 0 1 2 3 S1 S0 0 1 2 3 S1 S0 0 1 2 3 S1 S0 0 1 2 3 S1 S0 Cin A0 A1 A2 A3 4 1 MUX 4 1 MUX 4 1 MUX B0 B1 B2 B3 0 1 Cout D3 D0 D1 D2 X3 X0 X1 X2 Y3 Y0 Y1 Y2 C0 C1 C1 C2 C2 C3 C3 C4
  • 14. Working This arithmetic circuit can perform 8 operations among them some are :- Addition:- When S1 S0 = 0 0, the value of B is applied to the Y inputs of the adder. If Cin = 0, the output D = A + B. if Cin =1, output D = A + B + 1. Both cases perform the add microoperation with or without adding the input carry.
  • 15. Subtraction:- When S1 S0 = 0 1, the value of B is applied to the Y inputs of the adder. If Cin = 1, then D = A + B + 1. this produces A plus the 2’s complement of B, which is equivalent to a subtraction of A – B. when Cin = 0, then D = A + B. this is equivalent to a subtract with borrow, that is , A – B – 1.
  • 16. Increment:- When S1 S0 = 1 0, the inputs from B are neglected , and instead, all 0’s are inserted into the y inputs. The output becomes D = A + 0 + Cin. This gives D = A when Cin = 0 and D = A + 1 when Cin = 1. in the first case we have a direct transfer from the input A to output D. in the second case, the value of A is incremented by 1.
  • 17. Decrement:- When S1 S0 = 1 1, all 1’s are inserted into the Y inputs of the adder to produce the decrement operation D = A – 1 when Cin = 0. this is because a number with all 1’s is equal to the 2’s complement of 1 (the 2’s complement of binary 0001 is 1111). Adding number A to the 2’complement of 1 produces F = A + 2’s complement of 1 = A – 1 when Cin = 1, then D = A – 1 + 1 = A, which causes a direct transfer from input A to output D. NOTE :- Microoperation D = A is generated twice , so there are only 7 distinct Microoperations in the arithmetic circuit.