You are on page 1of 3

Course Code: CS101

Assignment # 01
ID:
Name:

Q No.1 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
Decimal to Binary Conversion

2 4789
2 2394 1
2 1197 0
2 598 1
2 299 0
2 149 1
2 74 1
2 37 0
2 18 1
2 9 0
2 4 1
2 2 0
1 0

(4789)10 = (1001010110101)2
Binary to Decimal Conversion

(10010101101)2=1×212 + 0×211 + 0×210 + 1×29 + 0×28 + 1×27 + 0×26 + 1×25 + 1×24 + 1×22
+ 0×2 +1×20

=1×4096+0×2048+0×1024+1×512+0×256+1×128+064+132+1×16+0×8+1×4+
1×1
=4096+0+0+512+0+128+0+32+16+0+4+1
=4789

 -8735
Decimal to Binary Conversion

2 8735
2 4367 1
2 2183 1
2 1091 1
2 545 1
2 272 1
2 136 0
2 68 0
2 34 0
2 17 0
2 8 1
2 4 0
2 2 0
1 0

 8735  10   10001000011111 2
Extend Binary sequence for 16 bits
= 0010001000011111
Now taking 2nd Complement:
=1101110111100000
Add 1 +1
= 1101110111100001

 8735  10    1101110111100001 2

Binary to Decimal Conversion

- (1001110111100001)2= -1×215+1×214+0×213+1×212+1×211+1×210+0×29+1×28+
1×27+1×26+1× 25+0×24+0×23+0×22+0×21+12×1

=-1×32768 + 1×16384 + 0×8192 + 1×4096 + 1×2048 +


1×1024 + 0×512 + 1×256 + 1×128 + 1×64 + 1×32 +0×16 +
0×8 + 0×4 + 0×2 + 1×1
Q No.2
Solve the given Boolean Expression by using truth table.
( A ⊕ D ) . ( A+ B ) .(( B́+ Ć ) ⊕ ( B+C+ D ))

( A ⊕ D)
.
( B́+ Ć ) ( A ⊕ D) ( A+ B )
A B C D A⊕D A+ B ( B́+ Ć ) ( B+C+ D ) ⊕ . .
( B+C+ D ) ( A+ B ) ¿

( B+C+ D ) ¿
0 0 0 0 0 0 1 0 1 0 0
0 0 0 1 1 0 1 1 0 0 0
0 0 1 0 0 0 1 1 0 0 0
0 0 1 1 1 0 1 1 0 0 0
0 1 0 0 0 1 1 1 0 0 0
0 1 0 1 1 1 1 1 0 1 0
0 1 1 0 0 1 0 1 1 0 0
0 1 1 1 1 1 0 1 1 1 1
1 0 0 0 1 1 1 0 1 1 1
1 0 0 1 0 1 1 1 0 0 0
1 0 1 0 1 1 1 1 0 1 0
1 0 1 1 0 1 1 1 0 0 0
1 1 0 0 1 1 1 1 0 1 0
1 1 0 1 0 1 1 1 0 0 0
1 1 1 0 1 1 0 1 1 1 1
1 1 1 1 0 1 0 1 1 0 0

You might also like