Tutorial n° 5 for students
Exercise 1
a. Using 6 bits, subtract 3 from 8 using the one’s complement method.
b. Using 6 bits, subtract 4 from 7 using the one’s complement method.
c. Using 6 bits, subtract 8 from 3 using the one’s complement method.
d. Using 6 bits, subtract 11 from 7 using one’s complement method.
e. Using 4 bits, so this subtraction using one’s complement method: 110 - 101
f. Find Subtraction of 010110 and 011101 (010110 - 011101) using 1's complement
g. Using 5 bits, subtract 7 from –3 using the one’s complement method.
h. Using 8 bits, subtract 9 from –5 using the one’s complement method.
Exercise 2
a. Using 6 bits, subtract 13 from 15 using the two’s complement method.
b. Using 6 bits, subtract 4 from 8 using two’s complement method.
c. Using 6 bits, subtract 7 from 9 using two’s complement method.
d. Using 6 bits, subtract 17 from 5 using two’s complement method.
e. Find Subtraction of 010110 and 011101 (010110 – 011101) using 2's complement
f. Find Subtraction of 011010 and 010101 (011010 - 010101) using 2's complement
g. Using 6 bits, subtract 3 from –12 using two’s complement method.
h. Using 5 bits, subtract 9 from –3 using two’s complement method.
Exercise 3
Represent the following real numbers in IEEE 754 single-precision floating-point format:
-78.56, +43.02, -0.33
Exercise 4
On a machine, positive integers are encoded on 3 Bytes in SVA, negative integers in two's
complement on 24 bits, and fractional numbers in floating-point format on 32 bits as
follows: the most significant bit is reserved for the sign (S: 1 for negative, 0 for positive);
the next 10 bits are reserved for an exponent (E) encoded in 2's complement; the rest of
the bits are used to store a mantissa (m) (the number is of the form S 0.01 m * 2^E).
Convert the following numbers to their respective representations in this machine's
format:
(+471)10, (+475)8, (-83)10, (-0.05)10, (+0.125)10.
What is the largest positive integer that can be represented on this machine?