Assignment #1 (cs101)
Assignment #1 (cs101)
Assignment #1 (cs101)
Introduction to computing
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.
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
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
101000000 + (-01111010)
101000000 + (10000110)
101000000
10000110
11000110
198
Second step:
=(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⁰
=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
Question:2
For the following Boolean expression you are required to fill the stated table below.
(~A⊕B) ꓥ D) V C)
(⊕ = XOR)
(~ NOT)
(V = OR)
(ꓥ = AND)
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