0% found this document useful (0 votes)
44 views4 pages

Assignment #1 (cs101)

The document provides instructions for two questions regarding binary operations. For question 1, the student is asked to convert decimal numbers 320 and -122 to binary, perform the addition, and convert the answer back to decimal. The student shows the step-by-step work, resulting in the decimal answer of 198. For question 2, the student is given a Boolean expression and asked to fill in a truth table, which is done correctly.

Uploaded by

Abdul Rehman
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)
44 views4 pages

Assignment #1 (cs101)

The document provides instructions for two questions regarding binary operations. For question 1, the student is asked to convert decimal numbers 320 and -122 to binary, perform the addition, and convert the answer back to decimal. The student shows the step-by-step work, resulting in the decimal answer of 198. For question 2, the student is given a Boolean expression and asked to fill in a truth table, which is done correctly.

Uploaded by

Abdul Rehman
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/ 4

Assignment : 1

Introduction to computing

Semester spring 2020

Student Name: Bashart Ali

Student ID:Mc200200284

Question:1

You are required to perform the following stated operations in Binary Number System

(320)10 + (-122)10

Please first convert the stated Decimal Numbers into Binary Numbers.

Perform the Arithmetic operation on Binary Numbers.

Convert the calculated answer back into Decimal Number System.

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

Solution:

First step:

Please first convert the stated decimal number into binarg number

stated decimal number into binarg number


320

2 160 0 The binary for 320 is (101000000)2

2 80 0

2 40 0

2 20 0 122
22 10 0 61 1
22 5 0 30 0
22 4 0 15 1
22 2 0 7 1
22 1 0 3 1

2 1 1

The binary for 122 is (1111010)2

Perform the Arithmetic operation on binary numbers

101000000 + (-01111010)

101000000 + (10000110)

101000000

10000110

11000110

198

Second step:

Performing Arithmetic operation on binary numbers


=(320)10 + (-122)10

=(101000000)2+(-1111010)2

=(11000110)2

Third step:
Convert the calculated answer back into decimal Number System

(11000110)2

Multiply cach digit of the binary number by the corresponding power of two.
1×2⁷+1×2⁶+0×2⁵+0×2³+1×2²+1×2¹+0×2⁰

Now, solve the power:

=1×128+1×64+0×32+0×16+0×8+1×4+1×2+0×1

=128+64+0+0+0+4+2+0

=128+64+0+0+0+4+2+0

=198

(11000110)2+ (198)10

So,198 is the decimal equivalent of the binary number 11000110

Question:2

For the following Boolean expression you are required to fill the stated table below.

(~A⊕B) ꓥ D) V C)

Symbol to operator mapping

(⊕ = XOR)

(~ NOT)
(V = OR)

(ꓥ = AND)

A B C D (A⊕B) ~(A⊕B) (~(A⊕B) ꓥ D) (~(A⊕B) ꓥ D) V 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