Professional Documents
Culture Documents
1. Compute the final result of each of the following unsigned operations and for each determine whether there
is unsigned overflow or not. Give reasons for each of your answer. Note: For each question, perform the
calculations in the given base (binary, decimal or hexadecimal).
00111111
01111110 +
=======
10111101
No Overflow
DD91
7ECE +
======
15C5F --- Overflow, more 4-bit than 16-bit
EA9B
F2DE -
======
(b) F7BD unsatisfied borrow, so we have Overflow
DB7E
FEF6 +
======
1DA74 Overflow, more 4-bit than 16-bit
2. Compute the final result of each of the following signed r’s complement operations and for each determine
whether the operation will result in signed overflow or not. Show your steps, and give reason for your answer.
01110111
11101110 +
=========
101100101 the result in 9-bit which means Overflow
(+ve) 59EF
(+ve) 62CA +
======
(-ve) BCB9 Overflow, because the result has different sign
(+ve) 7C02
(+ve) 0426 +
=====
(-ve) 8028 Overflow, because the result has different sign
Page 2 of 7
(d) 124EH – 74ADH (16-bit operands)
(+ve) 124E
(-ve) 8B53 +
=====
(-ve) 9DA1
No Overflow, because we add different sign Hex number
3. Express the negative value -25 as a 2's complement integer, using eight bits. Repeat it for 16 bits and 32 bits.
What does this illustrate with respect to the properties of sign extension as they pertain to 2's complement
representation?
Step 1:
Sign = 1 because it’s a negative number
Step 2: convert the number to binary
114.625 1110010.101 1.110010101× 26
Fraction = 110010101
1100 0000 0101 1100 1010 1000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
C 0 5 C A 8 0 0 0 0 0 0 0 0 0 0
1100 0000 0000 0101 1100 1010 1000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
C 0 0 5 C A 8 0 0 0 0 0 0 0 0 0 0 0 0 0
5. Convert the floating-point number 85.45 into 32-bit IEEE 754 floating-point representation in hexadecimal.
Show all steps and computations.
STEP II:-
1.0101010111001100×26
STEP III:-
E = 6 + 127 = 133 = 1000 0101
M = 01010101110011001100110
S = +ve = 0
Result is :- 42AAE666
Page 4 of 7
6. Convert the IEEE 754 floating-point representation 88888000H into decimal. Your final answer must be in
the form ±1.xxx . . . x * 2n Show all steps and computations.
7. Convert the IEEE 754 floating-point representation C378C000H into decimal. Show all steps and computations.
8. Convert the IEEE 754 floating-point representation FF800000H into decimal. Show all steps and computations.
STEP II :-
E = 11111111 = 255
For E = 255 , N represents special values, such as ±∞ or NaN
In or case because of Mantissa = 0 , Exponent = 255 , Sign = 1 (-ve)
So, FF800000 = -∞
Page 5 of 7
9. Convert the IEEE 754 floating-point representation 00600000H into decimal. Show all steps and computations.
STEP II :-
E = 00000000 = 0
N = -126 , because it is denormalized number
S=0
M = 1100
10. Convert the IEEE 754 floating-point representation FFAB0000H into decimal. Show all steps and computations.
STEP II :-
E = 11111111 = 255
For E = 255 , N represents special values, such as ±∞ or ±NaN
In or case because of Mantissa = 01010110000000000000000 , Exponent = 255 , Sign = 1 (-ve)
So, FFAB0000 = -NaN
Page 6 of 7
11. What decimal number does the IEEE 754 hexadecimal representation D01D600000000000H of a
double value represent? Show all steps and computations.
#include <stdio.h>
#include <math.h>
int main(void) {
double side1, side2, hypotenuse;
printf_s("Enter side1 and side2[cm]: ");
scanf_s("%lf%lf", &side1, &side2);
hypotenuse = sqrt(side1 * side1 + side2 * side2);
printf_s("Hypotenuse = %0.2lf cm\n", hypotenuse);
return 0;
}
Page 7 of 7