Tutorial Sheet1
Tutorial Sheet1
Exercise I
1. Count from one to twenty in the following bases:
a) 8 b) 6 c) 5 d) 3
2. Order the numbers (1.1)2, (1.4)10 and (1.5)16 from smallest to biggest.
3. Perform the indicated base conversions:
a) 548 to base 5 b) 3124 to base 7 c) 5206 to base 7 d) 122123 to base 9
4. Convert the following binary numbers to their decimal equivalents:
a) 001100 b) 000011 c) 011100 d) 111100 e) 101010
5. Convert the following binary numbers to their decimal equivalents:
a) 11100.011 b) 110011.10011 c) 1010101010.1
6. Convert the following decimal numbers to their binary equivalents:
a) 64 b) 100 c) 111 d) 145 e) 255
7. Convert the following decimal numbers to their binary equivalents:
a) 34.75 b) 25.25 c) 27.1875
8. Express the following octal numbers(numbers with radix 8) in hexadecimal notation:
a) 12 b) 5655 c) 2550276 d) 76545336 e) 3726755
9. Convert the following hexadecimal numbers to their decimal equivalents:
a) C b) 9F c) D52 d) 67E e) ABCD
10. Convert the following hexadecimal numbers to their decimal equivalents:
a) F.4 b) D3.E c) 1111.1 d) 888.8 e) EBA.C
11. Convert the following decimal numbers to their hexadecimal equivalents:
a) 16 b) 80 c) 2560 d) 3000 e) 62500
12. Convert the following decimal numbers to their hexadecimal equivalents:
a) 204.125 b) 255.875 c) 631.25 d) 10000.00390625
13. Convert the following hexadecimal numbers to their binary equivalents:
a) E b) 1C c) A64 d) 1F.C e) 239.4
14. Convert the following binary numbers to their hexadecimal equivalents:
a) 1001.1111 b) 110101.011001 c) 10100111.111011
Exercise II
1. Briefly explain how to determine if a number is negative in the following
representations:
a) sign magnitude b) one’s complement c) two’s complement
2. What are the four essential elements of a number in floating-point notation?
3. What is the benefit of using biased representation for the exponent portion of a floating-
point number?
4. What are the differences among positive overflow, exponent overflow and significand
overflow?
5. Represent the following numbers in sign magnitude, one’s complement and two’s
complement using 16 bits:
a) +512 b) -29 c)
6. Find the equivalent decimal number given the following IEEE-754 32-bit floating-point
representation pattern:
a) 0 10000000 110 0000 0000 0000 0000 0000
b) 1 01111110 100 0000 0000 0000 0000 0000
c) 1 01111110 000 0000 0000 0000 0000 0001
7. Give the 16 bit signed (twos complement) representation of the following decimal
numbers, and convert to hexadecimal:
a) 3012 b) -435
8. For each of the following bit strings: a) 0100100101 b) 1111101001
i) Which decimal number is represented, assuming the bit string is a signed integer?
ii) Which decimal number is represented, assuming the bit string is an unsigned
integer?
iii) Convert the bit string to hexadecimal.
9. Represent the following two decimal numbers as single precision float.
(a) 15.0625 (b) −35.6875 (c) 86.5625
Show:
• a scientific notation representation
• the significand, exponent, and sign bits (32 bits total)
• a hexadecimal representation of these 32 bits
10. What are the largest and smallest positive, finite, normalized numbers that can be
represented as IEEE single precision float? It is sufficient for you to write the answer
using scientific notation.
11. Assume numbers are represented in 8-bit twos complement representation. Show the
calculation of the following:
a) 6 + 13 b) -6 + 13 c) 6- 13 d) -6- 13
12. Find the following differences using twos complement arithmetic: a) 111000-110011
b) 11001100-101110 c) 111100001111-110011110011 d) 11000011-11101000
13. Consider a floating-point format with 8 bits for the biased exponent and 23 bits for the
significand. Show the bit pattern for the following numbers in this format:
a) -720 b) 0.645
14. It is said that a 32-bit format can represent a maximum of 232 different numbers. How
many different numbers can be represented in the IEEE 32-bit format? Explain.
15. Express the following numbers in IBM’s 32-bit floating-point format, which uses a 7-bit
exponent with an implied base of 16 and an exponent bias of 64 (40 hexadecimal). A
normalized floating-point number requires that the leftmost hexadecimal digit be
nonzero; the implied radix point is to the left of that digit. a) 1.0 b) 0.5 c) 1/64
d) 0.0 e) - 15.0 f) 5.4 x 10-79 g) 7.2 x 1075 h) 65535
16. Any floating-point representation used in a computer can represent only certain real
numbers exactly; all others must be approximated. If A′ is the stored value approximating
the real value A, then the relative error, r, is expressed as
𝐴 − 𝐴′
𝑟=
𝐴
Represent the decimal quantity + 0.4 in the following floating-point format: base = 2;
exponent: biased, 4 bits; significand, 7 bits. What is the relative error?
“Chop your own wood and it will warm you twice.” – Henry Ford