5.2. Alu Lecture 1
5.2. Alu Lecture 1
5.2. Alu Lecture 1
-32 16 8 4 2 1
1 1 1 0 1 0
• -32+16+8+2 = -6
Sign Magnitude Representation
Range - (2n-1 - 1) to 2n-1 - 1
• Multiplication:
Multiplication involves generation of partial products one for each digit in the
Multiplier. These partial products are then summed to produce the final product.
Each Partial product is placed one place ahead (shifted one bit left) of the previous
one.
What about
Unsigned Binary Integer ?
• Unsigned Integers:
• Multiplication involves generation of partial products one for each bit (digit) in the
Multiplier. These partial products are then summed to produce the final product.
• Partial products can be easily defined for binary data:
When the Multiplier bit is 0, the partial product is 0
When the Multiplier bit is 1, the partial product is Multiplicand.
• The total product is produced by summing the partial products. Each successive partial
product is shifted one position to the left relative to the preceding partial product.
• Multiplication of two n bit integers results in a product of up to 2n bit in length.
• In computerized multiplication we perform running addition. This eliminates the need for
storage of all partial products.
• For each 1 on the Multiplier an Add & a Shift operation is required and for 0 a Shift
operation is required.
End of Break
Return back to Two Complement (Integer) Arithmetic
2’s Complement (Integer) Arithmetic (Cont.…)
• Twos Complement Multiplication:
Addition and Subtraction on Twos complement are performed by treating them
unsigned integer, but this cannot be done with multiplication.
For Multiplication of two numbers represented in Twos Complement notation
Booth’s Algorithm is used:
Arithmetic Shift Right preserves the sign bit by not only shifting An-1 to An-2 but
also keeping it there.
ASSIGNMENT
• Take Two Integers:
First Integer: For B21 take -21, B20 take -20, B19 -19 and so on
Second Integer: For Starting Seat Numbers from 1-9, add 100 in last Two
digits of your Seat Number.
Other: Last two digits of your seat number.
• Convert them to Binary format (Twos Complement Notation) using a
suitable bit length size.