Solution to Suppose we implement a program to simulate a computer whose ability is to carry out … - Sikademy

Nov. 28, 2020

Archangel Macsika Sikademy Image

Archangel Macsika

Suppose we implement a program to simulate a computer whose ability is to carry out binary arithmetic, using bitwise operators.
Your should perform the following bitwise operations using the logical operators:
~ (not operator) & (AND operator)
| (OR operator)
^ (EX OR, which is Exclusive OR)
>> (shift right)
<< (shift left)
Your program will ask the user to enter two integers (in decimal numbers), but of course your program
(or the computer) will recognize them as binary numbers in terms of 0s and 1s.
You should test your program with the following numbers:
A = 3 = 0000 0011
B = 4 = 0000 0100
Your program will perform the logical operations on these numbers as follows:
(1) A ^ B =
(2) ~B =
(3) A | ~B =
(4) ~A^B
(5) A << 1
(6) B >> 2

Solution in C# Programming Language