Arithmetic Unit: Dr. Sowmya BJ
Arithmetic Unit: Dr. Sowmya BJ
Arithmetic Unit: Dr. Sowmya BJ
Dr. Sowmya BJ
UNIT 2 – Arithmetic unit & Processing unit
Multiplication of two Numbers
A Signed Operand Multiplication
oBooth algorithm
Fast Multiplication
oBit pair recoding
oCarry Save Addition(CSA)
Integer Division
oRestoring Division
oNo restoring Division
IEEE standard for floating point numbers
Multiplication of unsigned numbers
Algorithm for multiplying unsigned
number and positive signed
numbers.
The product of two n-digit number
can be accommodated in 2n digits
n=4 digits 2*4= 8 digits
Multiplication of unsigned numbers
Algorithm for multiplying unsigned number
If the multiplier bit is 1, the multiplicand is entered in the
appropriate position to be added to the partial product.
If the multiplier bit is 0, then 0s are entered in the appropriate
position to be added to the partial product.
2 13
2 6 1
13 (Multiplicand M) * 11 (Multiplier Q) =143
1101 1011 2 3
M 1 1 0 1 1
Q 1 0 1 1
P
2 13
2 6 1
13 (Multiplicand M) * 11 (Multiplier Q) =143
1101 1011 2 3
M 1 1 0 1 1
Q 1 0 1 1
1 1 0 1
P
2 13
2 6 1
13 (Multiplicand M) * 11 (Multiplier Q) =143
1101 1011 2 3
M 1 1 0 1 1
Q 1 0 1 1
1 1 0 1
1 1 0 1
P
2 13
2 6 1
13 (Multiplicand M) * 11 (Multiplier Q) =143
1101 1011 2 3
M 1 1 0 1 1
Q 1 0 1 1
1 1 0 1
1 1 0 1
0 0 0 0
P
2 13
2 6 1
13 (Multiplicand M) * 11 (Multiplier Q) =143
1101 1011 2 3
M 1 1 0 1 1
Q 1 0 1 1
1 1 0 1
1 1 0 1
0 0 0 0
1 1 0 1
P
2 13
2 6 1
13 (Multiplicand M) * 11 (Multiplier Q) =143
1101 1011 2 3
M 1 1 0 1 1
Q 1 0 1 1
1 1 0 1
1 1 0 1
0 0 0 0
1 1 0 1
P 1
2 13
2 6 1
13 (Multiplicand M) * 11 (Multiplier Q) =143
1101 1011 2 3
M 1 1 0 1 1
Q 1 0 1 1
1 1 0 1
1 1 0 1
0 0 0 0
1 1 0 1
P 1 1
2 13
2 6 1
13 (Multiplicand M) * 11 (Multiplier Q) =143
1101 1011 2 3
M 1 1 0 1 1
Q 1 0 1 1
1 1 0 1
1 1 0 1
0 0 0 0
1 1 0 1
P 1 1 1
2 13
2 6 1
13 (Multiplicand M) * 11 (Multiplier Q) =143
1101 1011 2 3
M 1 1 0 1 1
Q 1 0 1 1
1 1 1 0 1
1 1 0 1
0 0 0 0
1 1 0 1
P 1 1 1 1
2 13
2 6 1
13 (Multiplicand M) * 11 (Multiplier Q) =143
1101 1011 2 3
M 1 1 0 1 1
Q 1 0 1 1
1 1 1 0 1
1 1 1 0 1
0 0 0 0
1 1 0 1
P 0 1 1 1 1
2 13
2 6 1
13 (Multiplicand M) * 11 (Multiplier Q) =143
1101 1011 2 3
M 1 1 0 1 1
Q 1 0 1 1
1 1 1 0 1
1 1 1 0 1
1 0 0 0 0
1 1 0 1
P 0 0 1 1 1 1
2 13
2 6 1
13 (Multiplicand M) * 11 (Multiplier Q) =143
1101 1011 2 3
M 1 1 0 1 1
Q 1 0 1 1
1 1 1 0 1
1 1 1 0 1
1 0 0 0 0
1 1 0 1
P 1 0 0 0 1 1 1 1
2 13
2 6 1
13 (Multiplicand M) * 11 (Multiplier Q) =143
1101 1011 2 3
M 1 1 0 1 1
Q 1 0 1 1
1 1 1 0 1
1 1 1 0 1 P 1 0 0 0 1 1 1 1
1 0 0 0 0 27 26 25 24 23 22 21 20
1 1 0 1 128 8 4 2 1
P 1 0 0 0 1 1 1 1 128+8+4+2+1 = 143
Implementation of Multiplication
1. Array multiplier
2. Sequential multiplier
3. Booth multiplier
Multiplication of Positive Numbers
Simple algorithm
Multiplication of Positive Numbers
m3 m2 m1 m0
q0
m3 m2 m1 m0
q1
Multiplication of Positive Numbers
m3 m2 m1 m0
q0
m3 m2 m1 m0
q1
FA FA FA FA
Multiplication of Positive Numbers
Binary multiplication of positive
operands can be implemented in a Multiplicand
q0
0
PP1 p0
q1
0
PP2 p1
q2
0
PP3 p2
q3
0
,
p7 p6 p5 p4 p3
Implementation of Multiplication
The main component in each cell Multiplicand
is a full adder 0 m3 0 m2 0 m1 0 m0
(PP0)
q0
0
PP1 p0
q1
0
PP2 p1
q2
0
PP3 p2
q3
0
,
p7 p6 p5 p4 p3
Implementation of Multiplication
The AND gate in each cell determines Multiplicand
whether a multiplicand bit mj, is added 0 m3 0 m2 0 m1 0 m0
to the incoming partial- product bit, (PP0)
q0
based on the value of the multiplier bit 0
PP1
qi q1
p0
0
PP2
p1
q2
0
PP3 p2
q3
0
,
p7 p6 p5 p4 p3
Combinatorial array multiplier
Combinatorial array multipliers are:
◦ Extremely inefficient.
◦ Have a high gate count for multiplying numbers of practical size such as 32-bit
or 64-bit numbers.
◦ Perform only one function, namely, unsigned integer product.
Improve gate efficiency by using a mixture of combinatorial array techniques and
sequential techniques requiring less combinational logic.
Sequential multiplication
Recall the rule for generating partial products:
◦ If the ith bit of the multiplier is 1, add the appropriately shifted multiplicand
to the current partial product.
◦ Multiplicand has been shifted left when added to the partial product.
However, adding a left-shifted multiplicand to an unshifted partial product is
equivalent to adding an unshifted multiplicand to a right-shifted partial
product.
Sequential multiplication procedure
1. Multiplicand(M) and Multiplier(Q) bits are loaded into register, C is initially
set to 0, Register A is initially set to 0
2. 0th Bit of Multiplier is checked
3. If 0th bit = 1
• Multiplicand and partial product is added
• All bits of Q, A and C registers are shifted to right one bit
4. If 0th bit = 0
• No addition is performed, only shift operation is carried out
Step 2, 3 and 4 are repeated n times to get desired result in A and Q registers
Sequential multiplication
Multiply using sequential circuit multiplier 13 x 11
M
1 1 0 1
Initial configuration
0 0 0 0 0 1 0 1 1
C A Q
0 1 1 0 1 1 0 1 1 Add
Shift First cycle
0 0 1 1 0 1 1 0 1
1 0 0 1 1 1 1 0 1 Add
Shift Second cycle
0 1 0 0 1 1 1 1 0
0 1 0 0 1 1 1 1 0 No add
Shift Third cycle
0 0 1 0 0 1 1 1 1
1 0 0 0 1 1 1 1 1 Add
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ples
Multiply following numbers using sequential circuit multiplier
1. 24 x 16
2. 45 x 12
Illustrate a sequential circuit binary multiplier with a neat
diagram.
1 0 0 1 1 - 13
0 1 0 1 1 ( + 11)
1 1 1 1 1 1 0 0 1 1
1 1 1 1 1 0 0 1 1
Sign extension is
shown in blue 0 0 0 0 0 0 0 0
1 1 1 0 0 1 1
0 0 0 0 0 0
1 1 0 1 1 1 0 0 0 1 - 143
1 1 0 1 0 0
0 -1 +1 -1 0
Booth Algorithm
Recode the multiplier 101100
1 0 1 1 0 0 0
-1 +1 0 -1 0 0
Booth Algorithm
1. Compute +13 x -6 using Booth algorithm
0 1 1 0 1
Booth multiplication with a negative multiplier.
0 - 1 +1 - 1 0
0 1 1 0 1 ( + 13) 0 0 0 0 0 0 0 0 0 0
X1 1 0 1 0 - 6 1 1 1 1 1 0 0 1 1
0 0 0 0 1 1 0 1
1 1 1 0 0 1 1
0 0 0 0 0 0
1 1 1 0 1 1 0 0 1 0 - 78
2 13 2 6
2 6 1 2 3 0
Booth Algorithm 2 3 1
1 M= 1 1 0 1
Represent in 1
Binary form
+13 -6 = 2’s complement
Q= -6 0 1 1 0 0 1 1 0
1 0 0 1
2 M= 1 1 0 1 1
Take 2’s
complement of +13
Negative value
Q= -6 1 0 1 0 1 0 1 0
3 M= 0 1 1 0 1 4 Q= -6 1 1 0 1 0 0
Add Sign bit +13 Recode
Multiplier
Q= -6 1 1 0 1 0 0 -1 +1 -1 0
Booth Algorithm
M 0 1 1 0 1
Q 0 -1 1 -1 0
0 0 0 0 0
P
Booth Algorithm
M 0 1 1 0 1
Q 0 -1 1 -1 0
0 0 0 0 0 0 0 0 0 0
P
Booth Algorithm
M 0 1 1 0 1
+13 = 2’s complement
Q 0 -1 1 -1 0
0 1 1 0 1
0 0 0 0 0 0 0 0 0 0 1 0 0 1 0
1
1 0 0 1 1
1 0 0 1 1
P
Booth Algorithm
M 0 1 1 0 1
+13 = 2’s complement
Q 0 -1 1 -1 0
0 1 1 0 1
0 0 0 0 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1 +1 0 -1 0
1 1 1 0 1 0 0 1
0 0 0 0 0 0 0
P
A 0 1 0 1 1 1
Booth Algorithm B 0 -1 +1 0 -1 0
1 1 1 0 1 1 1
1+ 1 = 10
0 0 0 0 0 0 0 0 0 0 0 0
1+1+1 = 11
1 1 1 1 1 1 0 1 0 0 1
1+1+1+1 = 100
0 0 0 0 0 0 0 0 0 0
1+1+1+1+1 = 101 0 0 0 0 1 0 1 1 1
1+1+1+1+1+1 = 110 1 1 1 0 1 0 0 1
Carry 0 0 0 0 0 0 0
ignore
P 1 1 1 1 1 0 0 0 1 1 0 1 0
Examples for Booth Algorithm
1. Compute 45 x -24 using Booth algorithm
5. Multiply each of the following pairs of signed 2’s complement numbers using booth
algorithm (Assume A is the Multiplicand and B is the Multiplier)
• A = 110011 B = 101100
• A = 110101 B = 011011
• A = 001111 B = 001111
• A = 10101 B = 10101
UNIT 2 – Arithmetic unit
Multiplication of two Numbers
A Signed Operand Multiplication
◦ Booth algorithm
Fast Multiplication
◦ Bit-Pair algorithm
◦ Carry Save Addition(CSA)
Integer Division
IEEE standard for floating point numbers
Bit-Pair algorithm
Bit-pair recoding halves the maximum number of
summands (versions of the multiplicand).
Sign extension Implied 0 to right of LSB
1 1 1 0 1 0 0
0 0 1 + 1 1 0
0 1 2
1 0 1 1 0 0 0
-1 -1 0
Bit-Pair algorithm
Recode the multiplier 011011
0 1 1 0 1 1 0
+2 -1 -1
Bit-Pair algorithm
Recode the multiplier 1 1 0 1 0
Add sign
extended 1 1 1 0 1 0 0
bit
0 -1 -2
Bit-Pair algorithm
0 1 1 0 1
0 - 1 +1 - 1 0
0 0 0 0 0 0 0 0 0 0
1 1 1 1 1 0 0 1 1
0 0 0 0 1 1 0 1
1 1 1 0 0 1 1
0 1 1 0 1 ( + 13) 0 0 0 0 0 0
´ 1 1 0 1 0 - 6 1 1 1 0 1 1 0 0 1 0 - 78
0 1 1 0 1
0 -1 -2
1 1 1 1 1 0 0 1 1 0
1 1 1 1 0 0 1 1
0 0 0 0 0 0
1 1 1 0 1 1 0 0 1 0
2 13 2 6
2 6 1 2 3 0
Bit-Pair algorithm 2 1
3
1. Compute +13 x -6 using Bit Pair Recoding
technique. 1
1 M= 1 1 0 1 -6 = 2’s complement
Represent in
Binary form +13
0 1 1 0
Q= -6 0 1 1 0 1 0 0 1
1
2 M= 1 1 0 1
Take 2’s
complement of +13 1 0 1 0
Negative value
Q= -6 1 0 1 0
4 1 1 1 0 1 0 0
3 M= 0 1 1 0 1
Recode
Multiplier
Add Sign bit
+13
Q= -6 1 1 0 1 0 0 -1 -2
M 0 1 1 0 1
Bit-Pair algorithm Q 0 -1 -2
M= 0 1 1 0 1
1 0 0 1 0
1
1 0 0 1 1 X 10
0 0 0 0 0
1 0 0 1 1
1 0 0 1 1 0
P
M 0 1 1 0 1
Bit-Pair algorithm Q 0 -1 -2
1 0 0 1 1
P
M 0 1 1 0 1
Bit-Pair algorithm Q 0 -1 -2
P
M 0 1 1 0 1
Bit-Pair algorithm Q 0 -1 -2
2 M= 1 0 1 0 1 1 0 1 0 1
Take 2’s
complement of -11
Negative value
Q=
27 4 0 1 1 0 1 1 0
3 Recode
Multiplier
Add Sign bit
M= 1 1 0 1 0 1
-11 +2 -1 -1
Q= 0 1 1 0 1 1
27
M 1 1 0 1 0 1
Bit-Pair algorithm Q +2 -1 -1
1 1 0 1 0 1
0 0 1 0 1 0
1
0 0 1 0 1 1
P
M 1 1 0 1 0 1
Bit-Pair algorithm Q +2 -1 -1
1 1 0 1 0 1
0 0 1 0 1 0
1
0 0 1 0 1 1
P
M 1 1 0 1 0 1
Bit-Pair algorithm Q +2 -1 -1
0 0 1 0 1 1
P
M 1 1 0 1 0 1
Bit-Pair algorithm Q +2 -1 -1
P
M 1 1 0 1 0 1
Bit-Pair algorithm Q +2 -1 -1
P
M 1 1 0 1 0 1
Bit-Pair algorithm Q +2 -1 -1
2. Write Booth multiplier recoding table and explain good, ordinary and worst-case multiplier with suitable examples.
4. Multiply each of the following pairs of signed 2’s complement numbers using bit pairing of the multiplier (Assume A
is the Multiplicand and B is the Multiplier)
i) A=010111 B=110110
ii) A=110011 B=101100.
Carry-Save Addition(CSA) of Summands
Multiplication requires the addition of several
summands
CSA speeds up the addition process
Consider the array for 4 x 4 multiplication
Carry-Save Addition of Summands
Consider the addition of many summands:
Group the summands in threes and perform carry-save addition on each of these groups in
parallel to generate a set of S and C vectors in one full-adder delay
Group all of the S and C vectors into threes, and perform carry-save addition on them,
generating a further set of S and C vectors in one more full-adder delay
Continue with this process until there are only two vectors remaining
They can be added in a RCA or CLA to produce the desired product
Carry-Save Addition(CSA) of Summands
1+ 1 = 10
1+1+1 = 11
1+1+1+1 = 100
1+1+1+1+1 = 101
1+1+1+1+1+1 = 110
Carry-Save Addition(CSA) of Summands
Carry-Save Addition(CSA) of Summands
Carry-Save Addition(CSA) of Summands
Carry-Save Addition(CSA) of Summands
Carry-Save Addition(CSA) of Summands
Carry-Save Addition(CSA) of Summands
Examples for CSA
1. Write the schematic representation of carry save addition and perform 47 x 60 using CSA
2. Illustrate the working of CSA with 45 and 63 as the Multiplicand and Multiplier
respectively.
UNIT 2 – Arithmetic unit
Multiplication of two Numbers
A Signed Operand Multiplication
◦ Booth algorithm
Fast Multiplication
◦ Bit pair recoding
◦ Carry Save Addition(CSA)
Integer Division
◦ Restoring Division
◦ Nonrestoring Division
IEEE standard for floating point numbers
Integer Division
Algorithm to perform restoring division
1. Initialize Register A = n+1 bits with 0’s and Register Q with Dividend bits and M with
Divisor bits, Count = n
2. Shift A and Q left one binary position
3. Subtract M from A, and place the answer back in A ( A = A-M)
4. Observe the sign bit of A
oIf the sign bit of A is 1, set q0 = 0 and add M back to A( A=A+M) restoration is done
oIf the sign bit of A is 0, set q0 = 1 ,norestoration is done
5. Count = Count – 1
6. Repeat step 2,3,4,5 until count = 0
1. Compute 10/3 using restoring division 1 1 0 1
Dividend Q=10
Divisor M=3 0 0 1 1
A Q
0 0 0 0 0 1 0 1 0 M 0 0 0 1 1
1. Compute 10/3 using restoring division 1 1 0 1
Dividend Q=10
Divisor M=3 0 0 1 1
Count =4 A Q
0 0 0 0 0 1 0 1 0 M 0 0 0 1 1
Shift 0 0 0 0 1 0 1 0
1. Compute 10/3 using restoring division 1 1 0 1
Dividend Q=10
Divisor M=3 0 0 1 1
Count =4 A Q
0 0 0 0 0 1 0 1 0 M 0 0 0 1 1
Shift 0 0 0 0 1 0 1 0
Subtract 1 1 1 0 1 2’s complement of M
M= 0 0 0 1 1
1 1 1 0 0
1
1 1 1 0 1
1. Compute 10/3 using restoring division 1 1 0 1
Dividend Q=10
Divisor M=3 0 0 1 1
Count =4 A Q
0 0 0 0 0 1 0 1 0 M 0 0 0 1 1
Shift 0 0 0 0 1 0 1 0
Subtract 1 1 1 0 1
1 1 1 1 0
1. Compute 10/3 using restoring division 1 1 0 1
Dividend Q=10
Divisor M=3 0 0 1 1
Count =4 A Q
0 0 0 0 0 1 0 1 0 M 0 0 0 1 1
Shift 0 0 0 0 1 0 1 0
Subtract 1 1 1 0 1
Set q0 1 1 1 1 0
0 1 0 0
1. Compute 10/3 using restoring division 1 1 0 1
Dividend Q=10
Divisor M=3 0 0 1 1
Count =4 A Q
0 0 0 0 0 1 0 1 0 M 0 0 0 1 1
Shift 0 0 0 0 1 0 1 0
Subtract 1 1 1 0 1
M 0 0 0 1 1
Set q0 1 1 1 1 0
Restore 1 0 0 0 0 1 0 1 0 0 A 1 1 1 1 0
A+M 1 0 0 0 0 1
1. Compute 10/3 using restoring division 1 1 0 1
Dividend Q=10
Divisor M=3 0 0 1 1
Count = 3 A Q
0 0 0 0 1 0 1 0 0 M 0 0 0 1 1
Shift 0 0 0 1 0 1 0 0
1. Compute 10/3 using restoring division 1 1 0 1
Dividend Q=10
Divisor M=3 0 0 1 1
Count =3 A Q
0 0 0 0 1 0 1 0 0 M 0 0 0 1 1
Shift 0 0 0 1 0 1 0 0
Subtract 1 1 1 0 1 2’s complement of M
M= 0 0 0 1 1
1 1 1 0 0
1
1 1 1 0 1
1. Compute 10/3 using restoring division 1 1 0 1
Dividend Q=10
Divisor M=3 0 0 1 1
Count =3 A Q
0 0 0 0 1 0 1 0 0 M 0 0 0 1 1
Shift 0 0 0 1 0 1 0 0
Subtract 1 1 1 0 1
1 1 1 1 1
1. Compute 10/3 using restoring division 1 1 0 1
Dividend Q=10
Divisor M=3 0 0 1 1
Count =3 A Q
0 0 0 0 1 0 1 0 0 M 0 0 0 1 1
Shift 0 0 0 1 0 1 0 0
Subtract 1 1 1 0 1
Set q0 1 1 1 1 1
1 0 0 0
1. Compute 10/3 using restoring division 1 1 0 1
Dividend Q=10
Divisor M=3 0 0 1 1
Count =3 A Q
0 0 0 0 1 0 1 0 0 M 0 0 0 1 1
Shift 0 0 0 1 0 1 0 0
Subtract 1 1 1 0 1
M 0 0 0 1 1
Set q0 1 1 1 1 1
Restore 1 0 0 0 1 0 1 0 0 0 A 1 1 1 1 1
A+M 1 0 0 0 1 0
1. Compute 10/3 using restoring division 1 1 0 1
Dividend Q=10
Divisor M=3 0 0 1 1
Count =2 A Q
0 0 0 1 0 1 0 0 0 M 0 0 0 1 1
Shift 0 0 1 0 1 0 0 0
1. Compute 10/3 using restoring division 1 1 0 1
Dividend Q=10
Divisor M=3 0 0 1 1
Count =2 A Q
0 0 0 1 0 1 0 0 0 M 0 0 0 1 1
Shift 0 0 1 0 1 0 0 0
Subtract 1 1 1 0 1 2’s complement of M
M= 0 0 0 1 1
1 1 1 0 0
1
1 1 1 0 1
1. Compute 10/3 using restoring division 1 1 0 1
Dividend Q=10
Divisor M=3 0 0 1 1
Count =2 A Q
0 0 0 1 0 1 0 0 0 M 0 0 0 1 1
Shift 0 0 1 0 1 0 0 0
Subtract 1 1 1 0 1
0 0 0 1 0
1. Compute 10/3 using restoring division 1 1 0 1
Dividend Q=10
Divisor M=3 0 0 1 1
Count =2 A Q
0 0 0 1 0 1 0 0 0 M 0 0 0 1 1
Shift 0 0 1 0 1 0 0 0
Subtract 1 1 1 0 1
Set q0 1 0 0 0 1 0
0 0 0 1
1. Compute 10/3 using restoring division 1 1 0 1
Dividend Q=10
Divisor M=3 0 0 1 1
Count =2 A Q
0 0 0 1 0 1 0 0 0 M 0 0 0 1 1
Shift 0 0 1 0 1 0 0 0
Subtract 1 1 1 0 1
Set q0 1 0 0 0 1 0
NoRestore 0 0 0 1
1. Compute 10/3 using restoring division 1 1 0 1
Dividend Q=10
Divisor M=3 0 0 1 1
Count =1 A Q
0 0 0 1 0 0 0 0 1 M 0 0 0 1 1
Shift 0 0 1 0 0 0 0 1
1. Compute 10/3 using restoring division 1 1 0 1
Dividend Q=10
Divisor M=3 0 0 1 1
Count =1 A Q
0 0 0 1 0 0 0 0 1 M 0 0 0 1 1
Shift 0 0 1 0 0 0 0 1
Subtract 1 1 1 0 1 2’s complement of M
M= 0 0 0 1 1
1 1 1 0 0
1
1 1 1 0 1
1. Compute 10/3 using restoring division 1 1 0 1
Dividend Q=10
Divisor M=3 0 0 1 1
Count =1 A Q
0 0 0 1 0 0 0 0 1 M 0 0 0 1 1
Shift 0 0 1 0 0 0 0 1
Subtract 1 1 1 0 1
1 0 0 0 0 1
1. Compute 10/3 using restoring division 1 1 0 1
Dividend Q=10
Divisor M=3 0 0 1 1
Count =1 A Q
0 0 0 1 0 0 0 0 1 M 0 0 0 1 1
Shift 0 0 1 0 0 0 0 1
Subtract 1 1 1 0 1
Set q0 1 0 0 0 0 1
0 0 1 1
1. Compute 10/3 using restoring division 1 1 0 1
Dividend Q=10
Divisor M=3 0 0 1 1
Count =1 A Q
0 0 0 1 0 0 0 0 1 M 0 0 0 1 1
Shift 0 0 1 0 0 0 0 1
Subtract 1 1 1 0 1
Set q0 0 0 0 0 1
Norestore 0 0 1 1
Initially0 0 0 0 0 1 0 0 0
0 0 0 1 1
Shift 0 0 0 0 1 0 0 0
Subtract 1 1 1 0 1 First cycle
Set q0 1 1 1 1 0
Restore 1 1
0 0 0 0 1 0 0 0 0
1 0 Shift 0 0 0 1 0 0 0 0
1 1 10 0 0 Subtract 1 1 1 0 1
1 1 Set q0 1 1 1 1 1 Second cycle
Restore 1 1
1 0 0 0 0 1 0 0 0 0 0
Shift 0 0 1 0 0 0 0 0
Subtract 1 1 1 0 1
Set q0 0 0 0 0 1 Third cycle
Shift 0 0 0 1 0 0 0 0 1
Subtract 1 1 1 0 1 0 0 1
Set q0 1 1 1 1 1 Fourth cycle
Restore 1 1
0 0 0 1 0 0 0 1 0
Remainder Quotient
Restoring division - Circuit Arrangement
Shift left
an an-1 a0 qn-1 q0
Dividend Q
A Quotient
Setting
0 mn-1 m0
Divisor M
Examples for Restoring Division
1. Perform the following using restoring division algorithm.
i)20/5 ii) 12/3
2. Give an Algorithm for Restoring division method.
3. Compute 22/5 using restoring division
Algorithm to perform Nonrestoring division
1. Initialize Register A = n+1 bits with 0’s and Register Q with Dividend bits and M with
Divisor bits, Count = n
2. Shift A and Q left one binary position
3. After left shift ,if the sign bit of A is 0 , then
Then if Sign bit of A=1 Set Q0=0
Perform A=A-M Then if Sign bit of A =0 Set Q0=1
Shift 1 1 1 1 0 0 0 0
1 1 1 1 1 Add 0 0 0 1 1 Third cycle
Restore
0 0 0 1 1 Set q 0 0 0 0 1 0 0 0 1
remainder 0
Add 0 0 0 1 0
Remainder Shift 0 0 0 1 0 0 0 1
Subtract 1 1 1 0 1 Fourth cycle
Set q 1 1 1 1 1 0 0 1 0
0
Quotient
Examples for Nonrestoring division
1. State and apply non-restoring division algorithm to perform integer division 59/5.
• Normalize
Example
1.Represent (1259.125)10 in single and double precision IEEE floating point format.
Solution
Solution
(1259)10 10011101011
(0.125)10 0.125 x 2 = 0.25 0 001
0.25 x 2 = 0.5 0
0.5 x 2 = 1 1
(1259.125)10 = (10011101011.001)
Example
1.Represent (1259.125)10 in single and double precision IEEE floating point format.
Solution
1.0011101011001 x 210
Example
1.Represent (1259.125)10 in single and double precision IEEE floating point format.
Solution
1.0011101011001 x 210
210 0 10001001 0011101011001000000000
E’ - 127 = 10
S-1bit E’ -8bits M- 23bits
E’ = 10+ 127
Solution
1.0011101011001 x 210
210 0 10000001001 001110101100100…..0000
E’ - 1023 = 10
S-1bit E’ -11bits M- 52bits
E’ = 10+ 1023
Solution
1.110110101 x 26
Example
2.Compute the single precision IEEE 754 binary representation of the number
(−118.625)10.
1.110110101 x 26
26
1 10000101 110110101000…000000
E’ - 127 = 6
E’ = 6+ 127 S-1bit E’ -8bits M- 23bits
Solution
(85)10 1010101
(0.125)10 0.125 x 2 = 0.25 0 001
0.25 x 2 = 0.5 0
0.5 x 2 = 1 1
(85.125)10 = (1010101.001)
Example
3.Represent (85.125)10 in single and double precision IEEE floating point format.
1.010101001 x 26
10000101
Example
3.Represent (85.125)10 in single and double precision IEEE floating point format.
1.010101001 x 26
26 0 10000101 01010100100000..0000
E’ - 127 = 6
S-1bit E’ -8bits M- 23bits
E’ = 6+ 127
1.010101001 x 26
26 0 10000000101 01010100100………..0000
Solution
1.00000111010011001…… x 28
Example
4.Represent (1259.125)10 in single precision IEEE floating point format.
Solution
1.00000111010011001…… x 28
28 0 10000111 00000111010011001……
E’ - 127 = 8
E’ = 8+ 127 S-1bit E’ -8bits M- 23bits