Comp - CSE - 141 - Sheet 1 - A
Comp - CSE - 141 - Sheet 1 - A
1.3 Convert the following numbers with the indicated bases to decimal:
(a) (4310) 5 (b) (198) 12
(c) (435) 8 (d) (345) 6
Answer:
(a) 4 * 53 + 3 * 52 + 1 * 51 + 0 * 50 = (580)10
(b) 1* 122 + 9 * 121 + 8 * 120 = (260)10
(c) 4 * 82 + 3 * 81 + 5 * 80 = (285)10
(d) 3 * 62 + 4 * 61 + 5 * 60 = (137)10
1.7 Convert the hexadecimal number 64CD to binary, and then convert it
from binary to octal.
Answer:
1.8 Convert the decimal number 431 to binary in two ways: (a) convert
directly to binary; (b) convert first to hexadecimal and then from
hexadecimal to binary. Which method is faster?
Answer:
Integer Remainder
(a)
431/2
215 1
431 = (110101111)2
107 1
53 1
26 1
13 0
6 1
3 0
1 1
0 1
1
(b) Integer Remainder
Answer:
Answer:
Reason: 110.0102 is the same as 1.100102 shifted to the left by two places.
1.12 Add and multiply the following numbers without converting them to
decimal.
(a) Binary numbers 1011 and 101.
(b) Hexadecimal numbers 2E and 34.
Answer:
a) Addition Multiplication
1
1001 1001
+ ×
0101 0101
1110 1001
00000
100100
101101
2
b) Addition Multiplication
1
2E 2E
+ ×
34 34
62 38 +
80
B8
+
2A0
600
958
27/2 0.315*2 2
7.31510 = 11011.01012
13 1 0.36 0
6 1 0.26 1
3 0 0.52 0
1 1 0.04 1
0 1 0.08 0
0.16 0
0.32 0
1.14 Obtain the 1’s and 2’s complements of the following binary numbers:
(a) 00010000 (b) 00000000
(c) 11011010 (d) 10101010
Answer:
3
1.15 Find the 9’s and the 10’s complement of the following decimal numbers:
(a) 25,478,036 (b) 63, 325, 600
(c) 25,000,000 (d) 00,000,000.
Answer:
Answer:
1.17 Perform subtraction on the given unsigned numbers using the 10’s
complement of the subtrahend. Where the result should be negative,
find its 10’s complement and affix a minus sign. Verify your answers.
(a) 4,637 - 2,579 (b) 125 - 1,800
Answer:
4
125 + 8200 = 8325 here, the result should be negative; we find its
10’s complement and affix a minus sign.
result= - 1675
1.18 Perform subtraction on the given unsigned binary numbers using the
2’s complement of the subtrahend. Where the result should be negative,
find its 2’s complement and affix a minus sign.
(a) 10011 – 10010 (b) 100010 – 100110
Answer:
1.19 Convert decimal 6,514 to both BCD and ASCII codes. For ASCII, an even
parity bit is to be appended at the left.
Answer:
1.20 Represent the unsigned decimal numbers 791 and 658 in BCD, and then
show the steps necessary to form their sum.
Answer: 1 1 1
0111 1001 0001
+
0110 0101 1000
1 1 1 11 1 1
1101 1110 1001 = (1449)BCD
0110 0110 +