CS 101: Introduction to Computing
Name: Ahmad Ali Rasheed
Student ID: BC200406760
Questions No 01 Marks (10)
Convert the following decimal numbers into equivalent binary numbers and then convert the
binary answer back into equivalent decimal. Show all the steps of conversions.
4789
-8735
Solution
4789 8735
2 2394 1 2 4367 1
2 1197 0 2 2183 1
2 598 1 2 1091 1
2 299 0 2 545 1
2 149 1 2 272 1
2 74 1 2 136 0
2 37 0 2 68 0
2 18 1 2 34 0
2 9 0 2 17 0
2 4 1 2 8 1
2 2 0 2 4 0
1 0 2 2 0
2 1 0
(4789)10 = (1001010110101)2 - (8735) 10= -(10001000011111) 2
TASK 2
1. (1001010110101)2 = (4789)10
=(1×2)12+(0×2)11+(0×2)10+(1×2)9+(0×2)8+(1×2)7+(0×2)6+(1×2)5+(1×2)4+(0×2)3+(1×2)
2
+(0×2) +(1×2)0
1
= 4096+512+128+32+16+4+1
= 4789
2. -(10001000011111))2 = -(8735)10
= - [(1×2)13+(0×2)12+(0×2)11+(0×2)10+(1×2)9+(0×2)8+(0×2)7+(0×2)6(0×2)5+(1×2)4+
(1×2)3+(1×2)2+(1×2)1+(1×2)0]
= - [8192+512+16+8+4+2+1]
= -8735
Questions No 02 Marks (10)
Solve the given Boolean Expression by using truth table.
( A ⊕ D ) . ( A+ B ) .(( B́+ Ć ) ⊕ ( B+C+ D ))
Solution
( A ⊕ D)
.
( B́+ Ć ) ( A ⊕ D) ( A+ B )
A B C D ( B́ ) ( Ć ) A⊕D A+ B ( B́+ Ć ) ( B+C+ D ) ⊕ . .
( B+C+ D ) ( A+ B ) ¿
⊕
( B+C+ D ) ¿
1 1 1 1 0 0 0 1 0 1 1 0 0
1 1 1 0 0 0 1 1 0 1 1 1 1
1 1 0 1 0 1 0 1 1 1 0 0 0
1 1 0 0 0 1 1 1 1 1 0 1 0
1 0 1 1 1 0 0 1 1 1 0 0 0
1 0 1 0 1 0 1 1 1 1 0 1 0
1 0 0 1 1 1 0 1 1 1 0 0 0
1 0 0 0 1 1 1 1 1 0 1 1 1
0 1 1 1 0 0 1 1 0 1 1 1 1
0 1 1 0 0 0 0 1 0 1 1 0 0
0 1 0 1 0 1 1 1 1 1 0 1 0
0 1 0 0 0 1 0 1 1 1 0 0 0
0 0 1 1 1 0 1 0 1 1 0 0 0
0 0 1 0 1 0 0 0 1 1 0 0 0
0 0 0 1 1 1 1 0 1 1 0 0 0
0 0 0 0 1 1 0 0 1 0 1 0 0
THE END