Pages

Monday 3 October 2011

Solution of Assignment # 2 Introduction to Computing (CS 101) fall 2011


Solution of Assignment # 2

Introduction to Computing (CS 101)

fall 2011               (Total Marks: 15)


Question No. 1: Convert the following Binary Number into Decimal Numbers. (Marks 2+2)

a.      1000 0101
= 1*2^0 + 0*2^1 + 1*2^2 + 0*2^3 + 0*2^4 + 0*2^5 + 0*2^6 + 1*2^7
= 1 + 4 + 128
= 133

b.      1110 01
= 1*2^0 + 0*2^1 + 0*2^2 + 1*2^3 + 1*2^4 + 1*2^5
= 1 + 8 + 16 + 32
= 57

Question No. 2: Convert the following Decimal Numbers into Binary Numbers. (Marks 2+2)

a.      149


2
149
Remainder
2
74
1
2
37
0
2
18
1
2
9
0
2
4
1
2
2
0
2
1
0

0
1

10010101