You are on page 1of 16

Arithmetic Microoperations

Amity Institute of Information Technology

• The microoperations most often


encountered in digital computers are
classified into four categories:
– Register transfer microoperations
– Arithmetic microoperations (on numeric data
stored in the registers)
– Logic microoperations (bit manipulations on
non-numeric data)
– Shift microoperations
1
Arithmetic Microoperations cont.
Amity Institute of Information Technology

• The basic arithmetic microoperations are:


addition, subtraction, increment,
decrement, and shift
• Addition Microoperation:
R3 ←R1+R2
• Subtraction Microoperation:
R3 ←R1-R2 or : 1’s complement

R3 ←R1+R2+1
2
Arithmetic Micro operations cont.
Amity Institute of Information Technology

• One’s Complement Microoperation:


R2 ←R2
• Two’s Complement Microoperation:
R2 ←R2+1
• Increment Microoperation:
R2 ←R2+1
• Decrement Microoperation:
R2 ←R2-1
3
Half Adder/Full Adder
Amity Institute of Information Technology
Half Adder x y c s x
0 0 0 0 c = xy s = xy’ + x’y c
y
0 1 0 1 =x  y
1 0 0 1 s
1 1 1 0
Full Adder
y y
x y cn-1 cn s
0 0 0 0 0 0 0 0 1
0 0 1 0 1 0 1 c 1 0 c
n-1 n-1
0 1 0 0 1 x 1 1 x 0 1
0 1 1 1 0 0 1 1 0
1 0 0 0 1 cn s
1 0 1 1 0
1 1 0 1 0 cn = xy + xcn-1+ ycn-1
1 1 1 1 1 = xy + (x  y)cn-1

x s = x’y’cn-1+x’yc’n-1+xy’c’n-1+xycn-1
y = x  y  cn-1 = (x  y)  cn-1
S
cn-1
cn
4
Amity Institute of Information Technology

• Full Adder(FA) – The digital circuit that forms the arithmetic


sum of two bits and a previous carry is called as a full adder.
• Binary Adder(BA) - The digital circuit that forms the
arithmetic sum of two binary numbers of any length is called
as a binary adder.
• A Binary adder is constructed with a full adder circuits
connected in cascade with the output carry from one FA
connected to the input carry of the next full adder. An n bit
BA requires n full adders. The n data bits for the A inputs
come from one register (such as R1) and the n data bits for
the B inputs come from another register(such as R2).
• The sum can be transferred to a third register (R3) or to one
of the source register(R1 or R2 ) replacing the previous
contents.
5
Arithmetic Micro operations Amity Institute of Information Technology
Binary Adder

B3 A3 B2 A2 B1 A1 B0 A0

C3 C2 C1
FA FA FA FA C0

C4 S3 S2 S1 S0

4-bit binary adder


(connection of FAs)

6
Arithmetic Microoperations Binary
Amity Institute of Information Technology
Adder-Subtractor
B3 A3 B2 A2 B1 A1 B0 A0

B’

C3 C2 C1 C0
FA FA FA FA
1

C4 S3 S2 S1 S0

4-bit adder-subtractor

7
Amity Institute of Information Technology

• The addition and Subtraction operation can be combined


into one common circuit by including an exclusive-OR
gate with each full adder.
• The mode input M controls the operation
• When M=0, the circuit is an adder and when M=1 the
circuit is a subtractor.
• Each exclusive-OR gate receives input M and one of the
inputs of B.
• When M=0 we have B 0 = B. The full adder receives
the value of B , the input carry is 0 and the circuit
performs A plus B.
• When M=1 we have B 1 = B’. The full adder receives
the value of B’ , the input carry is 1 and the circuit
performs A plus 2’s complement of B. 8
Example Amity Institute of Information Technology

• Suppose A = 1011 (Decimal Equivalent 11)


• B = 1001 (Decimal Equivalent 9)

• (Adder) When M = 0 ,then Circuit performs


1011 + 1001 +0 (i.e.C0) = 10100 (Decimal Equivalent 20)

(Subtractor) When M = 1 ,then Circuit performs


1011 + 0110 (i.e. B’) +1 (i.e.C1) = 10010 (Decimal Equivalent 2)

Ignore / Drop

9
Subtraction by 2’s
Amity Institute of Information Technology

Complement -Example

10
Amity Institute of Information Technology

Arithmetic Circuit
• The basic component of an arithmetic circuit is the parallel
adder.
• The diagram of a 4-bit arithmetic circuit is shown in next
figure
Arithmetic Microoperations –
Amity Institute of Information Technology
Binary Incrementer
• One of the inputs to the least significant half
adder(HA) is connected to logic 1 and the other input
is connected to LSB of the number to be
incremented.
• The output carry from one HA is connected to one of
the inputs to the next high order HA.
• The circuit receives the four bits from A0 to A3, add 1
to it and generate the incremented output in S0 to S3.
• The output carry C4 will be 1 only after incrementing
binary 1111.This also causes output S0 to S3 to go to
0.
12
Arithmetic Microoperations Binary
Amity Institute of Information Technology
Incrementer
A3 A2 A1 A0 1

x y x y x y x y

HA HA HA HA

C S C S C S C S

C4 S3 S2 S1 S0

4-bit Binary Incrementer

13
Arithmetic Circuit
Amity Institute of Information Technology

• This circuit performs seven distinct


arithmetic operations and the basic
component of it is the parallel adder
• The output of the binary adder is
calculated from the following arithmetic
sum:
• D = A + Y + Cin

14
Amity Institute of Information Technology
Amity Institute of Information Technology

Arithmetic circuit function table

Select Input Output


Microoperation
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 D= A+B’ Subtract with borrow
0 1 1 D= A+B’+1 Subtract
1 0 0 D=A Transfer A
0 Increment A
1 0 1 0 D=A+1
1 1 0 D=A-1 Decrement A
1 Transfer A
1 1 1 1 D=A

You might also like