You are on page 1of 5

Numeric Systems – tutorial 2 (answers)

Numeric Systems – tutorial 2 (answers)


1. Convert the hexadecimal number FACE to binary and octal.

a. Binary:

FACE16 = 1111 1010 1100 11102

b. Octal:

FACE16 = 001 111 101 011 001 110 = 1753168

2. Convert the following decimal numbers to the indicated bases (assume 2nd complement):
a. 68.625 to binary.
b. 68.625 to hex.
c. 68.625 to octal.
d. 54.6875 to binary.
e. 54.6875 to hex.
f. 54.6875 to octal.
g. -68.625 to binary.
h. -68.625 to hex.
i. -68.625 to octal.
j. 7562.45 to octal.

(a)

68.62510 to binary:

now 68 = s 64 32 16 8 4 2 1
0 1 0 0 0 1 0 0

.625 =

.625 x 2 = 1.25
.25 x 2 = 0.5
.5 x 2 = 1.0
.0 x 2 = 0.0

thus 68.625 = 01000100.10102

(b)
68.62510 to hex:

68.625 = 01000100.1010
68.625 = 0100 0100. 1010

68.625 = 4 4 . A

68.625 = 44.A16

©Gerald Sammut Page 1


Numeric Systems – tutorial 2 (answers)

(c)
68.62510 to octal:

68.625 = 01000100.1010
68.625 = 001 000 100 . 101 000
68.625 = 1 0 4 . 5
68.625 = 104.58

(d)

54.687510 to binary:

now 54 = s 64 32 16 8 4 2 1
0 0 1 1 0 1 1 0

.6875 =

.6875 x 2 = 1.375
.375 x 2 = 0.75
.75 x 2 = 1.5
.5 x 2 = 1.0
.0 x 2 = 0

thus 54.6875 = 00110110.101102

(e)
54.687510 to hex:

54.6875 = 00110110.10110
54.6875 = 0011 0110.1011 0000
54.6875 = 3 6 .B
54.6875 = 36.B16

(f)
54.687510 to octal:

54.6875 = 00110110.10110
54.6875 = 000 110 110.101 100
54.6875 = 6 6 .5 4
54.6875 = 66.548

(g)

-68.62510 to binary(2nd complement):

now 68 = s 64 32 16 8 4 2 1
0 1 0 0 0 1 0 0

.625 =

.625 x 2 = 1.25
.25 x 2 = 0.5
.5 x 2 = 1.0
.0 x 2 = 0.0

thus 68.625 = 01000100.10102

©Gerald Sammut Page 2


Numeric Systems – tutorial 2 (answers)

thus -68.625, using quick method = 10111011.01102

(h)
-68.62510 to hex:

-68.625 = 10111011.0110
-68.625 = 1011 1011. 0110
-68.625 = B B . 6
-68.625 = BB.616

(i)
-68.62510 to octal:

-68.625 = 10111011.0110
-68.625 = 010 111 011. 011 000
-68.625 = 2 7 3 . 3
-68.625 = 273.38

(j)

7562.4510 to octal:

now 7562 = s 4096 2048 1024 512 256 128 64 32 16 8 4 2 1


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

= 001 110 110 001 010


= 1 6 6 1 2
= 166128
Note : we are doing x8 so that we get octal
fraction digits directly.
.45 = We could have done x2 to get binary fraction
bits, then group in 3-bit and convert to octal.
The latter would have taken us more time.
.45 x 8 = 3.6
.6 x 8 = 4.8
.8 x 8 = 6.4
.4 x 8 = 3.2
.2 x 8 = 1.6 (recurring)

thus 7562.45 = 16612.34631 8~

3. Perform the arithmetic operations (+42) + (-13) and (-42) - (-13) in binary using the signed 2nd
complement representation for negative numbers.

a. (+42) + (-13) = 29

s 64 32 16 8 4 2 1
0 0 1 0 1 0 1 0 +
- (0 0 0 0 1 1 0 1)

s 64 32 16 8 4 2 1
0 0 1 0 1 0 1 0 +
1 1 1 1 0 0 1 1
------------------
0 0 0 1 1 1 0 1 (29) note : in addition we drop any carry

©Gerald Sammut Page 3


Numeric Systems – tutorial 2 (answers)

b. (-42) - (-13) = -29

s 64 32 16 8 4 2 1
- (0 0 1 0 1 0 1 0) +
0 0 0 0 1 1 0 1

s 64 32 16 8 4 2 1
1 1 0 1 0 1 1 0 +
0 0 0 0 1 1 0 1
------------------
1 1 1 0 0 0 1 1 = -(0 0 0 1 1 1 0 1) = -29

4. Perform subtraction with the following unsigned binary numbers by taking the 2nd complement:
00011010 - 00010000

26 -
16
--
10

s 64 32 16 8 4 2 1
0 0 0 1 1 0 1 0 -
0 0 0 1 0 0 0 0

s 64 32 16 8 4 2 1
0 0 0 1 1 0 1 0 +
- (0 0 0 1 0 0 0 0)

s 64 32 16 8 4 2 1
0 0 0 1 1 0 1 0 +
1 1 1 1 0 0 0 0
------------------
0 0 0 0 1 0 1 0 = 1010

5. Perform the arithmetic operations indicated and verify the answers.


(a) 101011+ 111000
(b) 001110 – 110010

a.
s 16 8 4 2 1
1 0 1 0 1 1 +
1 1 1 0 0 0
------------------
1 0 0 0 1 1 (drop carry)

= -(011101) = -29

b.
s 16 8 4 2 1
0 0 1 1 1 0 +
-(1 1 0 0 1 0)

©Gerald Sammut Page 4


Numeric Systems – tutorial 2 (answers)

s 16 8 4 2 1
0 0 1 1 1 0 +
0 0 1 1 1 0
------------------
0 1 1 1 0 0 = (28)

6. What is the largest unsigned binary number that can be represented on 16 bits? What is its
decimal and hex equivalent.

Largest unsigned 16-bit binary number is:

1111 1111 1111 11112

= (2n – 1) = (216 – 1) = 6553510


= FFFF16

7. Represent the decimal numbers 295 and 8620 in:


(a) Binary.
(b) BCD.

a.
29510 = 1001001112
862010 = 100001101011002

b.
29510 = 0010 1001 0101 BCD
862010 = 1000 0110 0010 0000 BCD

8. The content of a 16-bit register is 0100100101110011. What is its content if it represent:


(a) Four decimal digits in BCD.
(b) An unsigned binary number.
(c) A signed binary number.

Content of 16-bit register is: 0100 1001 0111 0011

(a) = 4973 BCD


(b) = 18803 10
(c) = 18803 10 (same as b since sign bit is positive)

9. The character A is transmitted on a network using even parity. Write down the binary bits
transmitted.

The character A has ASCII value 65.


The character value is stored in the lower 7 bits with the 8th bit (MSB) being the PARITY bit.
Now we are using EVEN parity thus the number of 1s transmitted must be even.

Therefore A is transmitted as:

(Parity Bit) 64 32 16 8 4 2 1
0 1 0 0 0 0 0 1

10. What is the decimal value of the binary number 1000 if it is taken as a 2nd complement.

10002 in 4-bit 2nd complement represent the extra combination i.e.


the extra negative number, thus 10002 = -810.

©Gerald Sammut Page 5

You might also like