Assignment # 01: Introduction To Computing (CS101)
Assignment # 01: Introduction To Computing (CS101)
Assignment # 01
Question No.1: -
27 26 25 24 23 22 21 20
128 64 32 16 8 4 2 1
i. 01001000
27 26 25 24 23 22 21 20
128 64 32 16 8 4 2 1
0 1 0 0 1 0 0 0
64 8
Total = 72
ii. 01101001
(01101001)2= (0x27) +(1x26) +(1x25) +(0x24) +(1x23) +(0x22) +(0x21) +(1x20)
=0+64+32+0+8+0+0+1
(01101001)2=10510
OTHER METHOD:
27 26 25 24 23 22 21 20
128 64 32 16 8 4 2 1
0 1 1 0 1 0 0 1
64 32 8 1
Total = 105
iii. 00101100
27 26 25 24 23 22 21 20
128 64 32 16 8 4 2 1
0 0 1 0 1 1 0 0
32 8 4 1
Total = 45
i. 01001000
0100 = 4 1000 =8 so hexadecimal is 48
(01001000)2 = (48)16
ii. 01101001
0110 = 6 1001=9 so hexadecimal is 69
(01101001)2 = (69)16
iii. 00101100
0010=2 1100=C so hexadecimal is 2C
(00101100)2 = (2C)16
(c) Decode the 8-digit binary in textual form. (Hint: using the ASCII table).
Question No.2: -
Solution: -
Given final output is 0. We will start from the right side. If 0 passes through the NOT
gate from right side to left side the value 0 will change into 1. Next is AND gate as
we know that if both the inputs are 1only then the output is 1(otherwise 0) So it’s
obvious that inputs of next are 1 and 1. Next is again AND gates on both sides
(extreme left) so only if all inputs are 1 then it will give the result (that we have in
the middle) So technically now we know that input values of A, B, C and D will be
1,1,1,1.
B 1
C 1
D 1
Question No.3: -