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

Introduction To Computing (CS101) : Assignment # 01

The document provides instructions for two computing assignment questions. For question 1, the student is asked to: (1) Convert decimal numbers 320 and -122 to binary, (2) Add the binary numbers, (3) Convert the resulting binary number back to decimal. The student shows the steps and calculations to arrive at the answer that 320 + -122 = 442 in decimal. For question 2, the student is asked to fill in the values for a truth table with 4 variables (A, B, C, D) according to the Boolean expression ((A XOR B) AND D) OR C. The student provides the completed truth table as the answer.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views

Introduction To Computing (CS101) : Assignment # 01

The document provides instructions for two computing assignment questions. For question 1, the student is asked to: (1) Convert decimal numbers 320 and -122 to binary, (2) Add the binary numbers, (3) Convert the resulting binary number back to decimal. The student shows the steps and calculations to arrive at the answer that 320 + -122 = 442 in decimal. For question 2, the student is asked to fill in the values for a truth table with 4 variables (A, B, C, D) according to the Boolean expression ((A XOR B) AND D) OR C. The student provides the completed truth table as the answer.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Submitted By:

Introduction to Computing MC
(CS101)
Assignment # 01

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

Answer:

First Step: Conversion into Binary Numbers

Division by 2 Quotient Reminder Bit #


320/2 160 0 0
160/2 80 0 1
80/2 40 0 2
40/2 20 0 3
20/2 10 0 4
10/2 5 0 5
5/2 2 1 6
2/2 1 0 7
1/2 0 1 8

So (320)10 = (101000000)2

Division by 2 Quotient Reminder Bit #


-122/2 61 0 0
-61/2 30 1 1
-30/2 15 0 2
-15/2 7 1 3
-7/2 3 1 4
-3/2 1 1 5
-1/2 0 1 6

So (-122)10 = (1111010)2

Second Step: Now, applying arithmetic operation on binary converted numbers, we get
(320)10 + (-122)10 = (101000000)2 + (1111010)2
Following these addition
rules
101000000
0+0=0
001111010
0+1=1
1+0=1
110111010
1 + 1 = 0, carry over the 1

Third Step:

Binary Number 1 1 0 1 1 1 0 1 0
Power of 2 28 27 26 25 24 23 22 21 20

(110111010)2 = 1. 28 + 1. 27 + 0. 26 + 1. 25 + 1. 24 + 1. 23 + 0. 22 + 1. 21 + 0. 20
(110111010)2 = 256 + 128 + 0 + 32 + 16 + 8 + 2
(110111010)2 = 442

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)

Answer:

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