Tutorial 09
Tutorial 09
Tutorial 09
Question:
9.1 Briefly explain the following representations: sign magnitude, twos
complement, biased.
Sign–Magnitude Representation: In an N-bit word, the left-most bit is the sign (0
= positive, 1 = negative) and the remaining N – 1 bits comprise the magnitude of
the number. Twos Complement Representation: A positive integer is represented
as in sign magnitude. A negative number is represented by taking the Boolean
complement of each bit of the corresponding positive number, then adding 1 to
the resulting bit pattern viewed as an unsigned integer. Biased representation: A
fixed value, called the bias, is added to the integer.
9.4 How can you form the negation of an integer in twos complement
representation?
Take the Boolean complement of each bit of the positive number, then adding 1
to the resulting bit pattern viewed as an unsigned integer.
Problems:
9.1 Represent the following decimal numbers in both binary sign/magnitude and
twos complement using 16 bits: +512; -29.
Sign Magnitude: 512 = 0000 0010 0000 0000
–29 = 1000 0000 0001 1101
Two’s Complement: 512 = 0000 0010 0000 0000
–29 = 1111 1111 1110 0011
A Q Q–1 M
0000 1010 0 010 1 Initial
0000 0101 0 010 1 Shift
1011 0101 0 010 1 A←A–M
1101 1010 1 010 1 Shift
0010 1010 1 010 1 A←A+M
0001 0101 0 010 1 Shift
1100 0101 0 010 1 A←A–M
1110 0010 1 010 1 Shift
Result = 11100010 which equal -30