You are on page 1of 3

ITDR2102: Computer Organization – Tutorial Answers

Tutorial 2
From Lecture 2 (Data Representation – Part2)

1. Using 8-bits, convert -45 to excess-127 notation in binary.

Answer: 0101 0010

2. If 1001 0110 is a binary number in excess-127 form, what is the decimal number?

Answer: 23

3. Convert 97 to sign magnitude form using 8 bits.

Answer: 0110 0001

4. Convert -97 to sign magnitude form using 8 bits.

Answer: 1110 0001

5. Convert -97 to one’s complement form using 8 bits.

Answer: 1001 1110

6. Convert -89 to two’s complement form using 8 bits.

Answer: 1010 0111

7. If 1001 0111 is in two’s complement form, what is the decimal number?

Answer: -105

8. Using two’s complement form with 8 bits, perform the following arithmetic.

a. Add 34 and 27
34 0010 0010
27 0001 1011
---------
0011 1101 = 61

b. Add 78 and 64
78 0100 1110
64 0100 0000
---------
1000 1110 = Overflow

Page 1
ITDR2102: Computer Organization – Tutorial Answers

c. Subtract 45 from 78
78 0100 1110
-45 1101 0011
-----------
1 0010 0001 = 33 (Ignore the 9th bit)

d. Subtract -45 from 78


78 0100 1110
45 0010 1101
---------
0111 1011 = 123

e. Subtract 45 from -78


-78 1011 0010
-45 1101 0011
-----------
1 1000 0101 (Ignore the 9th bit)

f. Subtract -45 from -20


-20 1110 1100
45 0010 1101
-----------
1 0001 1001 = 25 (Ignore the 9th bit)

9. Convert -123.6875 to IEEE format.


a. Convert the decimal number to binary.
123.6875 = 111 1011.1011
b. Write the binary number in scientific notation using 20.
111 1011.1011 = 111 1011.1011 x 20
c. Normalize the number by moving the binary point and changing the exponent.
111 1011.1011 x 20 = 1.11 1011 1011 x 26
d. Write f by taking the fractional part add trailing zeroes to get 23 bits.
fractional part (f) = 1110 1110 1100 0000 0000 000
e. Determine the sign bit.
Negative number  s = 1
f. Add 127 to the exponent (from step 3) to get e.
e = 6 + 127 = 133
g. Convert e to an 8-bit binary number (add leading zeroes if needed).
133 = 128 + 4 + 1  = 1000 0101
h. Write in IEEE format by concatenating s, e, and f.
1 1000 0101 1110 1110 1100 0000 0000 000
Regrouping gives:
1100 0010 1111 0111 0110 0000 0000 0000
In hex form:
C2F76000

Page 2
ITDR2102: Computer Organization – Tutorial Answers

10. Convert 458D A600 from IEEE format to decimal form.


a. Convert the Hex number to binary:
458D A600  0100 0101 1000 1101 1010 0110 0000 0000
b. Regrouping to 1, 8 and 23 bits:
0 1000 1011 0001 1011 0100 1100 0000 000
S=0, e=1000 1011, f=0001 1011 0100 1100 0000 000
b. Convert e to a decimal number.
1000 1011 = 128 + 8 + 2 + 1 = 139
c. Subtract 127 to get the exponent.
139 - 127 = 12 (exponent)
d. Delete the trailing zeroes from f and write 1.f x 2exponent:
1.0001 1011 0100 11 x 212
e. Un-normalize the number by moving the binary point until the exponent is 0.
1.0001 1011 0100 11 x 212 = 1 0001 1011 0100.11 x 20
f. Convert the binary number to decimal.
1 0001 1011 0100.11 = 4096 + 256 + 128 + 32 + 16 + 4 + 0.5 + 0.25 = 4532.75
g. If s = 1, put a minus sign in front of the decimal number.
s = 0, therefore the number is positive.
The result is 4532.75

Page 3

You might also like