You are on page 1of 2

a. Convert the following two’s complement representation to its decimal representation.

11001010

Answer:

-Two’s complement again: (00110110)2

-Convert (00110110)2 to decimal: (54)10

-Put the negative sign: (-54)10

b. Convert the following binary number into its equivalent decimal number 0100. 0101

Answer:

(0×20 )+ ( 0×21 )+ ( 1×22 )+ ( 0×23 )+ ( 0×2-1 )+ ( 1×2-2 )+ ( 0×2-3 )+ ( 1×2-4 ) =

(0×1) + (0×2) + (1×4) + (0×8) + (0× 1/2) + (1×1/4) + (0×1/8) + (1×1/16) =

0+ 0+ 4+ 0+ 0+ 0.25+ 0+ 0.0625 = (4.3125)10

c. Convert the following decimal number 119.27 to binary, up to 4 decimal fraction only.
Show your work, for integer value and for fraction value up to 4 digits of precision
(which means: Fraction will be performed up to 4 places only, like .1101).

Answer: Division method. (For integer part)

119/2 59/2 29/2 14/2 7/2 3/2 1/2

Q: 59 29 14 7 3 1 0

R: 1 1 1 0 1 1 1

(For fraction part)

0.27 ×2 = 0.54 0.54 ×2= 1.08 0.08 ×2= 0.16 0.16 ×2= 0.32

0 1 0 0

0.27= (0.0100)2

Final answer: (1110111.0100)2


d. Using a 16-bit allocation, first convert each of the following decimal numbers to two’s
complement, do the operation, and then convert the result to decimal. 161 – 1023

Conversion:
161= 0000000010100001
-1023= 1111110000000001
Operation: 0000000010100001 + 00000001111111110 = 1111110010100010
Conversion to decimal: (-862)10

e. In 8-bit word, perform each of the following logical operations:

(99)16 OR (33)16 AND ((00)16 OR (FF)16 )

Answer:
First, we covert each number from hexadecimal to binary
(00)16 = (00000000)2
(FF)16 = (11111111)2
(33)16 = (00110011)2
(99)16 = (10011001)2
10011001 OR 00110011 AND (00000000 OR 11111111) =
10011001 OR 00110011 AND 11111111 =
10011001 OR 00110011 =
(10111011)2

You might also like