Question B1 A) Solution,: Name: - Suraj Chaudhary - TP Number: - NP000619

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

Name: ____Suraj Chaudhary_____________________

TP Number: ________NP000619_________________

Intake : _______NP1F2103IT____________________

QUESTION B1

a) Solution,

-29.12510

Step1: Converting the decimal equivalent into binary equivalent,

For integral part, Fractional part,

29 / 2 = 14 with 1 remainder 0.125*2 = 0.25


14 / 2 = 7 with 0 remainder 0.25*2 = 0.5
7 / 2 = 3 with 1 remainder 0.5*2 = 1
3 / 2 = 1 with 1 remainder
1 / 2 = 0 with 1 remainder

⸫ 29.12510= 11101.0012

Step 2: Normalization

11101.001 = 1.1101001 * 24

Step 3: Bias rule for IEEE 16 bit, n = 6

Bias rule = 2n-1 – 1

= 26-1 – 1

= 31

⸫Exponent 4 is stored as (31 + 4) = 35

Now,

Converting 3510 into binary

35/2 = 17 with 1 remainder

17/2 = 8 with 1 remainder


8/2 = 4 with 0 remainder

4/2 = 2 with 0 remainder

2/2 = 1 with 0 remainder

1/2 = 0 with 1 remainder

3510 = 1000112

⸫Exponent bit is for 1000112 for IEEE 16-bit

Step 4: Determining mantissa,

Here Mantissa is obtained from step 2 as 11010012

For IEEE 16-bit mantissa is 1101001002

Step 5: Since, it is negative so sign bit is 1.

Here, Computer stores -29.125 in floating point representation for 16- bit as,

11000111101001002

(b) Solution,

Step 1:-Here, the exponent is 1000011

Converting binary into decimal equivalent.


Digit 1 0 0 0 0 1
5 4
Weight 2 2 23 22 21 20
Digit*Weigh 32 0 0 0 0 1
t

Sum = 32+1
= 3310
Exponent (E) = 3310

Step 2:-
Here mantissa is 1110010002 after decimal. Converting it into decimal equivalent.
Digit 1 1 1 0 0 1
Weight 2-1 2-2 2-3 2-4 2-5 2-6
Digit*Weigh 1/2 1/4 1/8 0 0 1/64
t

Sum = 1/2+1/4+1/8+1/64
Sum = 0.89062510

Mantissa (M) = 0.89062510


Step 3:-
Bias rule (B) = 2n-1 – 1
For IEE 16 bit, n = 6
So,
Bias = 26-1 – 1
Bias (B) = 31
Step4:-
Sign bit (S) = 0

Using formula,
= (-1) s * (1+M)*2E-B
= (-1)0* (1+ 0.890625)*233-31
= 1* 1.890625*4
=7.562510
⸫The decimal equivalent of 0100 0011 1100 10002 is 7.562510
QUESTION B2

(a)
(i) False
(ii) True
(iii) False

b) Solution,

i)U = {1,2,3,4,5,6,7,8,9,10,11}
A = {2, 3, 5, 7, 11}
B = {6}
C = {5, 7, 9, 11}

ii) A'∪C\B = [(U – A) ∪ C] \ B

= {1, 4, 5, 6, 7, 8, 9, 10, 11} – {6}


= {1, 4, 5, 7, 8, 9, 10, 11}

iii)

B' = U- B
= {1,2,3,4,5,6,7,8,9,10,11} – {6}
= {1,2,3,4,5,7,8,9,10,11}

Here,
C ∩ B’ = { 5,7,9,11} ∩ { 1,2,3,4,5,7,8,9,10,11}
= {5,7,9,11}
Now,
n{ C ∩ B’} = 2n
n=4

So,

n [P(C ∩ B’)] = 24
So, n [(C ∩ B’)] = 16
QUESTION B3

(a) Solution, to show tree diagram represent the bit strings of 4 length that does not have
three consecutive 0’s.

1 0010
1
0 0 0011
0 0
1 1
0100
1 0
0101
1
1 0110
0
0 0111
1
1 1 1001
0 1010
0
1 1011
1
0 1100
1 1101
0 1110
1
1111
b)
Solution,
The selection of committee can be formed as:
Men(5) Women(5) Selection
3 3 5C3*5C3
2 4 5C2*5C4
1 5 5C1*5C5

The required selection of the committee= (5C3*5C3) + (5C2*5C4) + (5C1*5C5)


=10*10 +10*5 +5*1
=155

Now, the probability that the committee has at least 3 women = m / n


= 155 / 210
= 0.738

So, the probability that the committee has at least 3 women is 0.738
c) Solution,

Let n be the total exhaustive case.

where n= 5 + 8 + 20 + 22 + 25 = 80.

Let, A be the total favorable cases where student score at most 39 marks = 5+8 = 13

By definition of probability,

⸫Probability of scoring at most 39 marks = P (A) = A/n = 13/80.

Again,

Let, B be the total favorable cases of where student score at least 60 marks = 22+25 = 47

By definition of probability,

⸫ Probability of scoring at least 60 marks = P (B) = B/n = 47/80.

Now, the probability that the student has scored at most 39 marks or at least 60 marks =

P (A ∪ B) = P (A) + P (B) = 13/80 + 47/80 = 60/80 = ¾

So, the probability that the student has scored at most 39 marks or at least 60 marks is

3/4.

You might also like