0% found this document useful (0 votes)
71 views8 pages

Coca Assignment

The document contains questions regarding binary, decimal, hexadecimal, and octal number conversions. It provides examples of adding, subtracting, and converting positive and negative binary numbers. Key steps include determining the sign bit, exponent, and mantissa for floating point numbers. Conversions include binary to decimal and vice versa, decimal to hexadecimal, octal, and binary.

Uploaded by

Amielia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
71 views8 pages

Coca Assignment

The document contains questions regarding binary, decimal, hexadecimal, and octal number conversions. It provides examples of adding, subtracting, and converting positive and negative binary numbers. Key steps include determining the sign bit, exponent, and mantissa for floating point numbers. Conversions include binary to decimal and vice versa, decimal to hexadecimal, octal, and binary.

Uploaded by

Amielia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

QUESTION 1

a) 1 1 1 1 1 1 1 1 1 1 1 1 1 1

1 1 0 0 1 1 0 1 0 1 1 1 0 1 1 0

0 0 1 1 0 0 1 1 1 1 1 0 1 0 1 1
+
1 0 0 0 0 0 0 0 1 0 1 1 0 0 0 0 1

= 0001 0000 0001 0110 0001 b

b)
2 2 2

0 0 0 1 1 0 2

1 1 1 0 0 1 0 1
_ 0 1 0 1 0 1 1 0
0 1 1 0 1 1 1 1
= 0110 1111 b

c)

CONVERSION DECIMAL TO HEXADECIMAL

400/16 = 25 remainder 0, continue divide

25/16 = 1 remainder 9, continue divide

1/16 =0 remainder 1

400 d = 190 h
1 1 1 1

B (11) A (10) F (15) E (14) 14 + 14 = 28 (12)


+ C (12) A (10) F (15) E (14) 15 + 15 + 1 = 31 (15)
1 8 5 F (15) C (12) 10 + 10 + 1 = 21 (5)
11 + 12 + 1 = 24 (8)

= 18662 h

1 8 5 F (15) C (12)
_
0 0 1 9 0
1 8 4 6 C (12)
= 1846C h
d) 1011 0101 b

CONVERSION BINARY TO DECIMAL

128 64 32 16 8 4 2 1

1 0 1 1 0 1 0 1

= (128 x 1) + (32 x 1) + (16 x 1) + (4 x 1) + (1 x 1)

1011 0101 b = 181 d

CONVERSION DECIMAL TO OCTAT

181/8 = 22 remainder 5, continue divide

22/8 = 2 remainder 6, continue divide

2/8 = 0 remainder 2.

181 d = 265 o

e) 0010 1011 1110 b

CONVERSION BINARY TO DECIMAL

2048 1024 512 256 128 64 32 16 8 4 2 1


0 0 1 0 1 0 1 1 1 1 1 0

= (512 x 1) + (128 x 1) + (32 x 1) + (16 x 1) + (8 x 1) + (4 x 1) + (2 x 1)

0010 1011 1110 b = 702 d

CONVERSION DECIMAL TO HEXADECIMAL

702/16 = 43 remainder 14 (E), continue divide

43/16 = 2 remainder 11 (B), continue divide

2/16 = 0 remainder 2

702 d = 2BE h
QUESTION 2

a)

CONVERSION DECIMAL TO BINARY

128 64 32 16 8 4 2 1
0 0 0 1 1 1 1 1
31 d = 0001 1111 b

+31 d

SIGN 7 BIT
0 0 0 1 1 1 1 1

+ 31 d = 0001 1111 b

b)

CONVERSION DECIMAL TO BINARY

128 64 32 16 8 4 2 1
0 0 0 1 1 1 1 1
31 d = 0001 1111 b

- 31 d

SIGN 7 BIT
1 0 0 1 1 1 1 1

- 31 d = 1001 1111 b

c)

CONVERSION DECIMAL TO BINARY

256 128 64 32 16 8 4 2 1
1 1 1 1 1 0 1 0 0
500 d = 1 1111 0100 b

-500 d

SIGN 11 BIT
1 0 0 1 1 1 1 1 0 1 0 0

-500 d = 1001 1111 0100 b


QUESTION 3

a)

-6

SIGN 7 BIT
0 0 0 0 0 1 1 0
1 1 1 1 1 0 0 (+1) 1
ADD 1 (+) 1
1 1 1 1 1 0 1 0

-6 + 23

SIGN 7 BIT
1 1 1 1 1 1
(-6)
1 1 1 1 1 0 1 0
(+23) + 0 0 0 1 0 1 1 1
10 0 0 1 0 0 0 1

-6 + 23 = 1 0001 0001 b

b)

-23

SIGN 7 BIT
0 0 0 1 0 1 1 1
1 1 1 0 1 0 0 0
ADD 1 (+) 1
1 1 1 0 1 0 0 1

6 - 23

SIGN 7 BIT

(6) 0 0 0 0 0 1 1 0
(-23) + 1 1 1 0 1 0 0 1
1 1 1 0 1 1 1 1

6 - 23 = 1110 1111 b
c)

-6

SIGN 7 BIT
0 0 0 0 0 1 1 0
1 1 1 1 1 0 0 (+1) 1
ADD 1 (+) 1
1 1 1 1 1 0 1 0

-23

SIGN 7 BIT
0 0 0 1 0 1 1 1
1 1 1 0 1 0 0 0
ADD 1 (+) 1
1 1 1 0 1 0 0 1

-6 - 23

SIGN 7 BIT
1 1 1 1
(-6) 1 1 1 1 1 0 1 0
+ 1 1 1 0 1 0 0 1
(-23)
11 1 1 0 0 0 1 1

-6 - 23 = 1 1110 0011 b
QUESTION 4

a) 1100 0001 1110 0000 0000 0000 0000 0000

SIGN BE Mantissa (M)


1----------------8 9-------------------------------------31

1 1000 0011 110 0000 0000 0000 0000 0000

BE = 1000 0011 b

128 64 32 16 8 4 2 1
1 0 0 0 0 0 1 1
= (128 x 1) + (2 x 1) + (1 X 1)

1000 0011 b = 131 d

BE = 131 d Mantissa = 11

e = 131 – 127 Sign = -

=4

NORMALIZE NUMBER = 1.11 x 24

CONVERT INTO DECIMAL NUMBER

From 1.11 x 24 -> 11100.0 x 20

CONVERT BINARY FRACTION TO DECIMAL (11100. 0 b)

16 8 4 2 1 0.5
1 1 1 0 0 0
= (16 x 1) + (8 x 1) + (4 x 1)

11100.0 b = 28 d

FINAL ANSWER = - 28 d (sign negative)


b) 0011 1111 0101 0000 0000 0000 0000 0000

SIGN BE Mantissa (M)


1----------------8 9-------------------------------------31

0 0111 1110 101 0000 0000 0000 0000 0000

BE = 0111 1110 b

128 64 32 16 8 4 2 1
0 1 1 1 1 1 1 0
= (64 x 1) + (32 x 1) + (16 x 1) + (8 x 1) + (4 x 1) + (2 x 1)

0111 1110 b = 126 d

BE = 126 d Mantissa = 101

e = 126 - 127 Sign = +

= -1

NORMALIZE NUMBER = 1.101 x 2(-1)

CONVERT INTO DECIMAL NUMBER

From 1.101 x 2(-1) -> 0.1101 x 20

CONVERT BINARY FRACTION TO DECIMAL (0.1101 b)

1 0.5 0.25 0.125 0.0625


0 1 1 0 1
= (0.5 x 1) + (0.25 x 1) + (0.0625 x 1)

0.1101 b = 0.8125 d

FINAL ANSWER = + 0.8125 d (sign positive)


QUESTION 5

455BAA00

4 5 5 B (11) A (10) A (10) 0 0

0100 0101 0101 1011 1010 1010 0000 0000

0100 0101 0101 1011 1010 1010 0000 0000

SIGN BE Mantissa (M)


1----------------8 9-------------------------------------31

0 1000 1010 101 1011 1010 1010 0000 0000

BE =1000 1010 b

128 64 32 16 8 4 2 1
1 0 0 0 1 0 1 0
= (128 x 1) + (8 x 1) + (2 x 1)

1000 1010 b = 138 d

BE = 138 d Mantissa = 10 1101 1101 0101

e = 138 - 127 Sign = +

= 11

NORMALIZE NUMBER = 1.10110111010101 x 211

CONVERT INTO DECIMAL NUMBER

From 1.10110111010101 x 211 -> 110110111010.101 x 20

CONVERT BINARY FRACTION TO DECIMAL (110110111010.101 b)

2048 1024 512 256 128 64 32 16 8 4 2 1 0.5 0.25 0.125


1 1 0 1 1 0 1 1 1 0 1 0 1 0 1
= (2048 x 1) + (1024 x 1) + (256 x 1) + (128 x 1) + (32 x 1) + (16 x 1) + (8 x 1) +

(2 x 1) + (0.5 x 1) + (0.125 x 1)

110110111010.101 b = 3514.625 d

FINAL ANSWER = + 3514.625 d (sign positive)

You might also like