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

Semester Spring 2020 mc200203361 Introduction To Computing (CS101)

The document provides the steps to solve two problems involving binary operations and Boolean expressions. For the first problem, it converts the decimal numbers 320 and -122 to binary, adds them together in binary, and converts the answer back to decimal. The decimal answer is 198. For the second problem, it provides a Boolean expression and requires filling a truth table to show the output for all combinations of the variables A, B, C, and D.

Uploaded by

Zahra Mushtaq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
77 views

Semester Spring 2020 mc200203361 Introduction To Computing (CS101)

The document provides the steps to solve two problems involving binary operations and Boolean expressions. For the first problem, it converts the decimal numbers 320 and -122 to binary, adds them together in binary, and converts the answer back to decimal. The decimal answer is 198. For the second problem, it provides a Boolean expression and requires filling a truth table to show the output for all combinations of the variables A, B, C, and D.

Uploaded by

Zahra Mushtaq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

SEMESTER SPRING 2020

mc200203361
Introduction to Computing (CS101)
Assignment # 01

Questions No 11

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.
o Perform the Arithmetic operation on Binary Numbers.
o Convert the calculated answer back into Decimal Numbers.

SOLUTION:

a) Conversion of decimal no. into binary number.


As; (320)10 + (-122)
2 320
2 160 ____ 0
2 80 ____ 0
2 40 ____ 0
Hence,
(320)10 = 2 20 ____ 0 (101000000)2
Similarly; 2 10 ____ 0
2 122
5 ____ 0
2 61
4 ____10
____
2 2
30 ____
____01
2 15 ____ 0
2 7 ____ 1
2 3 ____ 1
2 1 ____ 1
0 ____ 1
Hence,
(122)10 = (01111010)2
Since 122 is a negative value, so that take 2nd complement of 122 binary no.
For this we have to take inverse of whole value & then add 1 to the incoming value.
1  Taking inverse of (01111010)
01111010  10000101
2  Now by adding 1 to the above value

10000101
+ 1
10000110
Hence ,
(-122)10 = (10000110)2
b) Perform the Arithmetic operation on Binary Numbers.

(320)10 + (-122)10 = (101000000)2 + (10000110)2


= (11000110)2

c) Convert the calculated answer back into Decimal Number System.

(11000110)2 = 1×27+1×26+0×25+0×24+0×23+1×22+1×21+0×20
= 1×128×1 × 64× 0 ×32+0×16+0×8+1×4+1×2+0×1
=128+64+0+0+0+4+2+0
= 198
(11000110)2 = (198)10

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

SOLUTION:

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