Division
Division
Division
Division
dividend
Quotient q=
divisor
April 4, 2019
Division: Introduction
• Division Algorithm can be grouped into two classes:
following algorithms.
Long Division method
Subtractive Algorithms: Restoring Division, Non-
Restoring Division, SRT Division (Sweeney, Robertson,
and Tocher)
Multiplicative Algorithm: Newton Raphson, Goldschmidt
division
Division by Constant
Approximation Algorithms
Subtractive algorithms
• Restoring and Non-Restoring Binary Division
Slow: Execution time is proportional to the divisor length
Digit recurrence algorithms: retire a fixed number of quotient
bits in every iteration.
Low complexity, utilize small area, and have relatively large
latencies
Issues: radix, the choice of allowed quotient digits, and the
representation of the intermediate remainder.
Larger radices can reduce the latency, but increase the time
for each iteration.
Restoring Division Algorithm
• Restoring: value of register A is restored after
each iteration.
• register Q contain quotient and register A
contain remainder.
• N-bit dividend is loaded in Q and divisor is
loaded in M.
Restoring Division Algorithm
• Step-1: First the registers are initialized with corresponding values (Q =
Dividend, M = Divisor, A = 0, n = number of bits in dividend)
• Step-2: Then the content of register A and Q is shifted right as if they
are a single unit
• Step-3: Then content of register M is subtracted from A and result is
stored in A
• Step-4: Then the most significant bit of the A is checked if it is 0 the
least significant bit of Q is set to 1 otherwise if it is 1 the least
significant bit of Q is set to 0 and value of register A is restored i.e the
value of A before the subtraction with M
• Step-5: The value of counter n is decremented
• Step-6: If the value of n becomes zero we get of the loop otherwise we
repeat fro step 2
• Step-7: Finally, the register Q contain the quotient and A contain
remainder
Flowchart of Restoring Division Algorithm
Examples:
Dividend = 11 -> 1011
Divisor = 3 -> 0011
Examples:
Dividend = 11 -> 1011
Divisor = 3 -> 0011
Exercise 2: Convert (0.6)10 to its binary form: (0.6)10 = (0.1001 1001 1001
…)
– 0.6 x 2 = 1.2 extract 1
– 0.2 x 2 = 0.4 extract 0
– 0.4 x 2 = 0.8 extract 0
– 0.8 x 2 = 1.6 extract 1
Floating Point Number Representation
• IEEE Standard 754 is the representation of floating point used on
most computers.
1. Single precision (float) is 32 bits or 4 bytes with the following
configuration.
1 sign bit 8 exponent 23 fraction
• The sign field for mantissa is 0 for positive or 1 for negative
• In the mantissa, the decimal point is assumed to follow the first ‘1’.
Since the first digit is always a ‘1’, a hidden bit is used to
representing the bit. The fraction is the 23 bits following the first
‘1’. The fraction really represents a 24 bit mantissa.
• The exponent field has a bias of 127, meaning that 127 is added to
the exponent before it’s stored. 20 becomes 127, 21 becomes 128,
2-3 becomes 124, 2-1 becomes 126, etc. When the exponent
becomes -127 (all zeroes), the hidden bit is not used to allow
gradual underflow.
2. Double precision (double) is 64 bites or 8 bytes with the
following configuration.
• The definition of the fields matches single precision.