Professional Documents
Culture Documents
Comp1411 Assign1
Comp1411 Assign1
Name
Kuantkhan Alibek
Student number
20041645d
Answer:
y = x*50 = x*(64 - 8 - 4 - 2)
Answer:
1. x = x>>18
x = x<<18
y = y<<14
y = y>>14
z=((not_z | (y | x)) & (z | (y | x))
x = x>>18 (00000000000000000000111011000110)
x = x<<18 (00111011000110000000000000000000)
y = y<<14(01101101001100011100000000000000)
y = y>>14(00000000000000011011010011000111)
Answer:
1 01111110 10110110000000000000000
sign = 1 => (-1)^1
exp = 126
bias = 127
e = 126 - 127 = -1
mantissa = 1 + 2^-1 + 2^-3 + 2^-4 + 2^-6 + 2^-7 = 1.7109375
result = -1 * 1.7109375 *1/2 = -0,85546875
Question 4. [25 marks]
Convert the decimal number 77.61328125 into IEEE single-precision floating point number (32-
bit).
Show your steps.
Answer:
dec = 77.61328125
sign = 0
bin = 1001101.10011101 = 1.00110110011101 * 2^6
e=6
exp = 6 + 127 = 133
133(bin) = 10000101
IEEE754 = 0 10000101 00110110011101000000000