Homework 01
0,987648*5=4,93824; 0,93824*5=4,6912; 0,6912*5=3,456; 0,456*5=2,28;
0,28*5=1,4; 0,4*5=2; 0*5=0
base-5 is
d)BCD is
2. a) Unsigned 16-bit binary is 0000000001101011. Hexadecimal is 6B
b) Unsigned 16-bit binary is 0000000010110101. Hexadecimal is B5
3. a) Signed two's complement 16-bit binary is 0000000001101011.
Hexadecimal is 6B.
b) Signed two's complement 16-bit binary is 1111111110110101. Hexadecimal
is FFB5
4. a) 1111001
+1111111101000111
1111111111000000
b) 10111010
+ 10101000
1111111101100010 16-bits is suitable.
1
5. +=
(9+D=16; A+4+1= F; 3+2=5)
6. Y=X shl 3
7. (A and B) or ((not A) and (not B))
8. Y = true
for i from 1 to 20
for j from 1 to 8, excluding 3
bitindex = j + (i-1)*8
if S1[bitindex] S2[bitindex]
Y = false
Exit loop
end
end
end
9