__ __ __ __
| ** CS101 Assignment 2 Solution 2020** __Introduction to Computing(CS101)__ **Assignment # 02** **Spring 2020**
| |

### CS101 Assignment 2 Solution : __Please carefully read the following instructions before attempting the assignment.__ __ __ __RULES FOR MARKING__ **It should be clear that your assignment would not get any credit if:** **The assignment is submitted after the due date.** **The submitted assignment does not open or file is corrupt.** **Strict action will be taken if the submitted solution is copied from any other student or from the internet. ** ** ** **You should consult the recommended books to clarify your concepts as handouts are not sufficient.** ** ** **You are supposed to submit your assignment in **__.doc or doc format__**.** __Any other formats like scan images, PDF, zip, rar, ppt, and BMP, etc will not be accepted. __ **Objective:** ** ****The objective of this assignment is to increase the learning capabilities of the students about** ** ** **To understand the conversion of numbers into binary by using arithmetic operations. ** **To understand the basic concept of logical operations and how to use it to solve a problem.** ### CS101 Assignment 2 Solution : |

__NOTE__ ** ** **No assignment will be accepted **__after the due date via email in any case__ (whether it is the case of load shedding or internet malfunctioning etc.). Hence refrain from uploading assignments in the last hour of the deadline. It is recommended to upload the solution file at least two days before its closing date. ** ** **If you find any mistake or confusion in the assignment (Question statement), please consult with your instructor before the deadline. After the deadline, no queries will be entertained in this regard.** ** ** **For any query, feel free to email at:** **cs101@vu.edu.pk** ### CS101 Assignment 2 Solution : |

**Question # 01** **10 marks**

In CPU all the arithmetic operations are perform in binary numbers (0 and 1). Suppose you have a small CPU that is designed to perform all arithmetic operations using addition only. You will explain how the following operations will be solved out by the CPU.

- Multiplication of 6 and 2
- Addition of 7 and 3

_{ }

**Question # 02** **10 marks**

**You have an image that can be represent in 8 bits. The image is below:**

(00110011)_{2}

You are required to send this image to someone but not in the original form. So, nobody can extract the features from the image.

So, we will perform the following two operations on the image.

You will apply an 8-bit (10101011)_{2 }mask using AND logic operation.

You will invert the masked image using XOR logic operation.

### CS101 Assignment 2 Solution :