CF_MidtermQuestion Question Solving Class
CF_MidtermQuestion Question Solving Class
1
Fall-23
Conversion
1. Decimal to Others
2. Others to Decimal
3. Others to Others
Decimal to Others
(---)₂ = (---)ₓ
(19.35)₁₀ = (?)₂
(19.35)₁₀ = (10011.0101)₂
2 19 Remainder 2 x .35
.70 0
2 9 - 1
2 x .70
2 4 - 1 1.40 1
2 2 - 0 2 x .40
.80 0
2 1 - 0
2 x .80
2 0 - 1 1.60 1
2
Fall-23
Conversion
1. Decimal to Others
2. Others to Decimal
3. Others to Others
Decimal to Others
(---)₁₀ = (---)ₓ
(19.35)₁₀ = (?)₈
(19.35)₁₀ = (23.26)₈
8 19 Remainder 8 x .35
2.80 2
8 2 - 3
8 x .80
2 0 - 2 6.40 6
3
Fall-23
Conversion
Others to Decimal
(---)ₓ = (---)₁₀
(1101.01)₂ = (?)₁₀
=8 + 4 +0 +1 +0 +(1/4)
=13.25
(1101.01)₂ = (13.25)₁₀
4
Fall-23
Conversion
Others to Decimal
(---)ₓ = (---)₁₀
(17.4)₈ = (?)₁₀
=8 + 7 + 4/8
=15.5
(17.4)₈ = (15.5)₁₀
5
Fall-23
Conversion
Others to Decimal
(---)ₓ = (---)₁₀
(A7.C)₁₆ = (?)₁₀
=160 +7 +12/16
=167.75
(A7.C)₁₆ = (167.75)₁₀
6
Fall-23
Conversion
Others to Others
(---)ₓ = (---)ᵧ
1)Others(x) to Decimal
2)Decimal to Others(y)
7
Fall-23
i.(132)₄=(?)₆
ii. (A7B)₁₆=(?)₈
i.(132)₄=(?)₆
Solution:
(132)₄=(?)₁₀
(?)₁₀=(?)₆
(132)₄=(30)₁₀
8
Fall-23
(30)₁₀=(?)₆
6 30 Remainder
6 5 - 0
0 - 5
(30)₁₀=(50)₆
(132)₄=(50)₆
9
Fall-23
ii. (A7B)₁₆=(?)₈
(A7B)₁₆=(?)₁₀
(?)₁₀=(?)ₐ
=2683
(A7B)₁₆=(2683)₁₀
10
Fall-23
(A7B)₁₆=(2383)₁₀
(2383)₁₀=(?)₈
8 2683 Remainder
8 335 - 3
8 41 - 7
8 5 - 1
8 0 - 5
(A7B)₁₆=(2683)₁₀
(2683)₁₀=(5173)₈
11
Fall-23
b)
i. Unlike humans, computers do not perform subtraction directly, instead, they utilize an additive method.
Now demonstrate this by subtracting (-41) from (80) using the additive approach.
ii.(10101111)₂ / (110)₂
12
Spring-23
Rules:
0+0=0
0+1=1
1+0=1
1 + 1 = 0 ;carry=1
1 + 1 + 1 = 1 ;carry=1
1 1 1 1 1 Carry
1 0 0 1 1 1
1 1 0 1 1
1 0 0 0 0 1 0 Sum
13
Fall-23
b)
i. Unlike humans, computers do not perform subtraction directly, instead, they utilize an additive method.
Now demonstrate this by subtracting (-41) from (80) using the additive approach.
Solution:
80 – (- 41)
80 + ( 41)
80 = 0101 0000
41 = 0010 1001
80 = 0101 0000
41 = 0010 1001
0111 1001
14
Fall-23
ii.(10101111)₂ / (110)₂
15
Fall-23
16
Fall-23
c) How will you represent -29.55 x 2⁻³ in using IEEE 754 binary 32 bit format?
17
Fall-23
c) How will you represent -29.55 x 10⁻³ in using IEEE 754 binary 32 bit format?
2 x 0.02955
0.0591 0
Answer:
(-29.55 x 10⁻³ ) = - 0.02955 2 x 0.0591
0.1182 0
(-0.2955) = 0.00000111 100100001001 2 x 0.1182
0.2364 0
Sign(1) = 1 2 x 0.2364
Exponent(8) = (2^7-1)-6=121=0111 1001 0.4728 0
Mantissa(23) = 11100100001001011010111
Answer: 1 0111 1001 11100100001001011010111 2 x 0.4728
0.9456 0
2 x 0.9456
0.8912 1
2 x 0.8912
1.7824 1
2 x 0.7824
1.5648 1 118
Fall-23
c) How will you represent -29.55 x 2⁻³ in using IEEE 754 binary 32 bit format?
19
Spring-23
i. (1423)₅ = (?)₉
ii. (249D)₁₆ = (?)₈
20
Spring-23
b)
i. Computer cannot perform subtraction as human. It uses an additive approach to do so. Now perform
subtraction 78₁₀ from 52₁₀ using the additive approach.
78 = 0100 1110
52 = 0011 0100
52-78=52+(-78)
78 = 0100 1110
1011 0001
+1 –1’s Complement
—------------------
1011 0010 –2’s Complement
52 = 0011 0100
-78 = 1011 0010
—-----------------
1110 0110
21
Spring-23
22
Spring-23
c) Show-how can we represent 121.3750 into an IEEE 754 binary 32 bit format?
Sign(1) = 0
Exponent(8) = (2^7)+6=133=1000 0101
Mantissa(23) = 1110 0101 1000 0000 0000 000
Answer: 0 1000 0101 11100101100000000000000
23
Fall-22
i. (928356)₁₀ = (?)₁₆
ii. (654231)₇ = (?)₅
24
Fall-22
3.
(a) Solve the complement of the number (643)₁₀
25
Fall-22
i. (00110110)₂ - (10110101)₂
1011 0101
0100 1010
+1
—------------
0100 1011
0011 0110
--------------
1000 0001
26
Fall-22
27