You are on page 1of 18

Computer Arithmetic Amity Institute of Information Technology

• Arithmetic instructions in digital computers manipulate


data to produce results necessary for the solution of
computational problems.
• Four basic operations are addition, subtraction,
multiplication and division.
• Arithmetic processor is the part of a processor that
executes arithmetic operations.

1
Amity Institute of Information Technology

Binary Multiplication
Amity Institute of Information Technology

Hardware Implementation for Signed Magnitude data


Amity Institute of Information Technology

Flowchart for multiply


operation
Amity Institute of Information Technology

Example 23 × 19
Division Algorithms
Amity Institute of Information Technology

• Division of two fixed point binary numbers


in signed magnitude representation is
done with paper and pencil by a process
of successive compare, shift and subtract
operation.

6
Example of a Binary Division
Amity Institute of Information Technology

7
Flowchart for Division operation
Amity Institute of Information Technology

8
Binary Division with Digital
Amity Institute of Information Technology
Hardware

9
Example Question –Binary
Amity Institute of Information Technology

Division
• Divisor = 10100011
• Divisor = 1011
• Quotient = 01110
• Remainder = 01001

10
Amity Institute of Information Technology

• Dividend – 10100011
• Divisor - 1011
1010
+0101
1111 (Ans)
E=0 , A=1111
1111+1011 = 11010

11
Dividend in AQ A 1010 Q 0011 B 1011 B’+1 = 0101

E A Q
Amity Institute SC Technology
of Information
1 1010 0011 4

Shl EAQ 1 0100 0110

Add B’+1 0101

Qn =1 1 1001 0111 3

Shl EAQ 1 0010 1110

Add B’+1 0101

Qn =1 1 0111 1111 2

Shl EAQ 0 1111 1110

E=0 Add B’+1 0101

Qn =1 1 0100 1111 1

Shl EAQ 0 1001 1110

E=0 Add B’+1 0101

Solution after addition 0 1110

E=0 Add A+B 1011


1 1001(A) -rem 1110(Q)-quotient 0
12
Floating Point arithmetic
Amity Institute of Information Technology
operations
• Floating point representation –
Floating point representation of a number has two parts.

A signed fixed
point number
called mantissa
Floating point
representation
Designation of the
position of the
decimal point
called exponent

13
Registers for Floating point
Amity Institute of Information Technology

arithmetic operations

14
Floating Point multiplication
Amity Institute of Information Technology

15
Floating point multiplication
Amity Institute of Information Technology

Multiplicand (BR) Multiplier(QR)


1101.0 11.0
Fractional (8 bits) - 11010000 - B Fractional (8 bits) - 11000000 - Q
Exponent (6 bits) - 000100 - b Exponent (6 bits) 000010 - q
a = 000010+000100 =0000110
Multiplicand
11010000 =B
E A Q SC
Multiplier in Q 0 00000000 11000000 1000
Shr EAQ 0 00000000 01100000 0111
Shr EAQ 0 00000000 00110000 0110
Shr EAQ 0 00000000 00011000 0101
Shr EAQ 0 00000000 00001100 0100
Shr EAQ 0 00000000 00000110 0011
Shr EAQ 0 00000000 00000011 0010
16
Multiplicand Amity Institute of Information Technology
11010000 =B
E A Q SC
Multiplier in Q 0 00000000 11000000 1000
Shr EAQ 0 00000000 01100000 0111
Shr EAQ 0 00000000 00110000 0110
Shr EAQ 0 00000000 00011000 0101
Shr EAQ 0 00000000 00001100 0100
Shr EAQ 0 00000000 00000110 0011
Shr EAQ 0 00000000 00000011 0010
Qn =1 ,Add A+B 11010000
Add A+B 0 11010000 00000011 0010
Shr EAQ 0 01101000 00000001 0001
Qn =1 ,Add A+B 11010000
Add A+B 1 00111000 00000001 0001
Shr EAQ 0 10011100 00000000 0000 17
Amity Institute of Information Technology

• AQ 100111.0000000000

• 1101 * 11 = 100111

18

You might also like