0% found this document useful (0 votes)
51 views

CS101 Assignment 1 Solution..

The document contains two questions from an assignment on introduction to computing. The first question asks to convert the decimal numbers 4789 and -8735 to binary, and then convert the binary numbers back to decimal. The student shows the step-by-step conversions for both numbers. The second question asks to solve a given Boolean expression using a truth table. The student constructs a truth table with 16 rows for all combinations of the variables A, B, C and D. The values of the sub-expressions and the overall expression are calculated and filled in the table.

Uploaded by

vikas
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views

CS101 Assignment 1 Solution..

The document contains two questions from an assignment on introduction to computing. The first question asks to convert the decimal numbers 4789 and -8735 to binary, and then convert the binary numbers back to decimal. The student shows the step-by-step conversions for both numbers. The second question asks to solve a given Boolean expression using a truth table. The student constructs a truth table with 16 rows for all combinations of the variables A, B, C and D. The values of the sub-expressions and the overall expression are calculated and filled in the table.

Uploaded by

vikas
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Introduction to Computing Total marks = 20

(CS101)
Assignment # 01 30 November 2020
Fall 2020

Hafiz Muhammad Ajmal Latif


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
Solution Decimal to Binary
212 211 210 29 28 27 26 25 24 23 22 21 20
4096 2048 1024 512 256 128 64 32 16 8 4 2 1
1 0 0 1 0 1 0 1 1 0 1 0 1

4789= (1001010110101)2

Solution Binary to Decimal


212 211 210 29 28 27 26 25 24 23 22 21 20
4096 2048 1024 512 256 128 64 32 16 8 4 2 1
1 0 0 1 0 1 0 1 1 0 1 0 1
4096+512+128+32+16+4+1=4789
(1001010110101)2 =4789

Solution Decimal to Binary


 -8735

Sign 213 212 211 210 29 28 27 26 25 24 23 22 21 20


Bit
- 8192 4096 2048 1024 512 256 128 64 32 16 8 4 2 1
1 1 0 0 0 1 0 0 0 0 1 1 1 1 1

-8735= (110001000011111)2
Solution Binary to Decimal to
 -8735

Sign 213 212 211 210 29 28 27 26 25 24 23 22 21 20


Bit
- 8192 4096 2048 1024 512 256 128 64 32 16 8 4 2 1
1 1 0 0 0 1 0 0 0 0 1 1 1 1 1

8192+512+16+8+4+2+1=-8735

(110001000011111)2 =-8735

Questions No 02 Marks (10)


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