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

Assignment No. 01: CS101-Introduction To Computing

The document contains a 2 question assignment for an intro to computing course. Question 1 asks the student to convert a decimal number to binary and back. The student shows the step-by-step work to get 3242 decimal = 1100101010 binary = 3242 decimal. Question 2 asks the student to use a truth table to solve a Boolean expression. The student lays out the full truth table to evaluate the expression and get the output values of 0, 0, 0, 0, 1, 0, 0, 0.

Uploaded by

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

Assignment No. 01: CS101-Introduction To Computing

The document contains a 2 question assignment for an intro to computing course. Question 1 asks the student to convert a decimal number to binary and back. The student shows the step-by-step work to get 3242 decimal = 1100101010 binary = 3242 decimal. Question 2 asks the student to use a truth table to solve a Boolean expression. The student lays out the full truth table to evaluate the expression and get the output values of 0, 0, 0, 0, 1, 0, 0, 0.

Uploaded by

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

Assignment No.

01

CS101- Introduction to
Computing

Name: Muhammad Zeeshan


Roll No: bc180407201

BS-Software Engineering
(BSSE)

Semester 1st
Dated: 15-11-2018

1
Assignment No. 01
Semester Fall 2018
Total Marks: 20
CS101- Introduction to
Computing

Question#1: [Marks 10]

I. Convert the following decimal numbers into equivalent binary numbers


II. Then convert the binary answer back into equivalent decimal.

 3242 (Show all the steps of conversions.)

Question#1:
(I) Convert the decimal numbers into equivalent binary numbers.
(3242)10 => (?) 2
(Solution)

Step 1:
Write down the decimal number and continually divide by 2, to give a result and a remainder. The
remainder is either 1 or a 0.
In this question we have:
Result Remainder

3242 / 2 1621 0
1621 / 2 810 1
810 / 2 405 0
405 / 2 202 1
202 / 2 101 0
101 / 2 50 1
50 / 2 25 0
25 / 2 12 1
12 / 2 6 0
6 / 2 3 0
3 / 2 1 1
1 / 2 0 1

Step 2:
Read the remainders from bottom to top.

So, the Answer is:

(3242)10 = (110010101010)2

2
Question#1:
(II) Convert the binary answer back into equivalent decimal numbers.
(110010101010)2 => (?) 10
_______________________________________________________________________________________
(Solution)

Step 1:
Start at the rightmost digit. Take that digit and multiply with 20 (20 = 1). I multiply second digit with
21, third with 22, and so on......
In this question I have:
Products

0 x 20 = 0 x 1 = 0
1 x 21 = 1 x 2 = 2
0 x 22 = 0 x 4 = 0
1 x 23 = 1 x 8 = 8
0 x 24 = 0 x 16 = 0
1 x 25 = 1 x 32 = 32
0 x 26 = 0 x 64 = 0
1 x 27 = 1 x 128 = 128
0 x 28 = 0 x 256 = 0
0 x 29 = 0 x 512 = 0
1 x 210 = 1 x 1024 = 1024
1 x 211 = 1 x 2048 = 2048

Step 2:
Add all products together.
All Products = 0 + 2 + 0 + 8 + 0 + 32 + 0 + 128 + 0 + 0 + 1024 + 2048 = 3242

So, the Answer is:

(110010101010)2 = (3242)10

3
Question#2: [Marks 10]

Solve the given Boolean Expression by using truth table.


(AB).((A/ + C/)  (A/+B)) (Here . is for And Sign)
______________________________________________________________________________________________
(Solution)

 We can solve Boolean Expression by using truth tables stepwise.


Step 1:
NOT operations:
A A/ C C/
0 1 0 1
0 1 1 0
0 1 0 1
0 1 1 0
1 0 0 1
1 0 1 0
1 0 0 1
1 0 1 0

Step 2:
OR operations:

A/ C/ (A/ + C/) A/ B (A/+B)

1 1 1 1 0 1
1 0 1 1 0 1
1 1 1 1 1 1
1 0 1 1 1 1
0 1 1 0 0 0
0 0 0 0 0 0
0 1 1 0 1 1
0 0 0 0 1 1

4
Step 3:
XOR operations:

A B AB (A/ + C/) (A/+B) (A/ + C/)  (A/+B)

0 0 0 1 1 0
0 0 0 1 1 0
0 1 1 1 1 0
0 1 1 1 1 0
1 0 1 1 0 1
1 0 1 0 0 0
1 1 0 1 1 0
1 1 0 0 1 1

Step 4:
AND operations:

AB (A/ + C/)  (A/+B) (AB).((A/ + C/)  (A/+B))

0 0 0
0 0 0
1 0 0
1 0 0
1 1 1
1 0 0
0 0 0
0 1 0
So, the Answer is:
(AB).((A/ + C/)  (A/+B))
0
0
0
0
1
0
0
0

5
 We can represent all the above tables in one table, as given below:

/ /
(AB).((A/
(A + C )
A B C AB A/ C/ (A/ + C/) (A/+B) + C/) 
 (A/+B)
(A/+B))

0 0 0 0 1 1 1 1 0 0
0 0 1 0 1 0 1 1 0 0
0 1 0 1 1 1 1 1 0 0
0 1 1 1 1 0 1 1 0 0
1 0 0 1 0 1 1 0 1 1
1 0 1 1 0 0 0 0 0 0
1 1 0 0 0 1 1 1 0 0
1 1 1 0 0 0 0 1 1 0

_______________________________________________________________________________________

You might also like