You are on page 1of 3

Total marks = 20

Introduction to Computing
1st June, 2020
(CS101)
Assignment # 01
Ahemd Waqar Qayum Khan
BC200202796
Questions No 01 Marks (10)

You are required to perform the following stated operations in Binary Number System
 (320)10 + (-122)10
o Please first convert the stated Decimal Numbers into Binary Numbers.

320 Into Binary:


256 128 64 32 16 8 4 2 1
1 0 1 0 0 0 0 0 0

For -122 we have to find 2’s complement for the 122:

122 Into Binary:


256 128 64 32 16 8 4 2 1
0 0 1 1 1 1 0 1 0

To find 2’s complement first we have to find 1’s


complement of 122:
Step 1: Invert all the bits of 122:

1 1 0 0 0 0 1 0 1

Step 2: Add 1 to the it:

1 1 0 0 0 0 1 0 1
+ 1
1 1 0 0 0 0 1 1 0

Now we get -122 using 2’s complement:

-122 in binary:
1 1 0 0 0 0 0 1 1 0

o Perform the Arithmetic operation on Binary Numbers.

Adding 320 and -122 in binary:


256 128 64 32 16 8 4 2 1
1 0 1 0 0 0 0 0 0
1 1 0 0 0 0 1 1 0
+
0 1 1 0 0 0 1 1 0

o Convert the calculated answer back into Decimal Number System.


256 128 64 32 16 8 4 2 1
0 1 1 0 0 0 1 1 0

Adding the 1 bit 128+64+4+2 = 198


Note: You are bound to show each, and every step involved in conversions or arithmetic
operations involved.

Questions No 02 Marks (10)


For the following Boolean Expression, you are required to fill the stated table below:
( ( A ⨁ B)∧ D) ∨C ¿

Symbol to operator mapping:


(⨁ = XOR)
(~ = NOT)
(∨ = OR)
(∧ = AND)

A B C D ( A ⨁ B) ( A ⨁ B) ( ( A ⨁ B)∧ D)( ( A ⨁ B)∧ D) ∨C ¿


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

You might also like