Unit 3 Partial
Unit 3 Partial
COMPUTER
ARITHMATIC
The Arithmetic and Logic Unit
• 0011
• + 1
--11---
• 0100
Two’s Complement Representation
• Two’s complement representation uses the most significant bit
as a sign bit, making it easy to test whether an integer is positive
or negative.
• Consider an n-bit integer, A,
• If A is positive, then the sign bit, a n-1 is zero.
• The remaining bits represent the magnitude of the number same
as for sign magnitude:
Two’s Complement Representation
±S * 𝐵±𝐸
• This number can be stored in a binary word with three fields:
• Sign: plus or minus
• Significand S
• Exponent E
• The base B is implicit and need not be stored because it is the
same for all numbers
• Typical 32-bit floating-point format.
• The leftmost bit stores the sign of the number (0= positive and 1= negative)
• The exponent value is stored in the next 8 bits.
• The representation used is known as a biased representation.
• To simplify operations on floating-point numbers, it is
typically required that they be normalized.
• A normalized number is one in which the most significant
digit of the significand is nonzero.
• Thus, a normalized nonzero number is one in the form
• There are four basic phases of the algorithm for addition and
subtraction: