Sunday, March 3, 2013

Number system

This is the most important topic in computer terminology. Because computers only understand the number that is binary numbers. Each and everything is represented in binary numbers (0,1). We can perform operation on binary numbers like addition, subtraction, AND, OR, NOT etc but we will not be studying here basic operation on number system like addition, subtraction, AND, OR, NOT etc. We will be studying how to use the binary number system for effective utilization of processors.

We will be studying operation on binary numbers like multiplication and division. Do you known how the computer performs multiplication? Let's discuss on it. In computer system there is a shift operation (<< and >>) for shifting binary bits to left or right. So we called it as left shift (<<) and right shift (>>) operation. If we apply left shift operation then number is multiplied and if we apply right shift then number is divided. Look below how numbers are multiplied and divided.

Let the multiplier =2 and multiplicand =8
1 0 0 0            binary of 8
0 0 1 0            binary of 2

Now shift multiplier left by 1 and check out result what we get.
Figure 1. Shift left by 1

We get binary 0 0 0 1 0 0 0 0 which is binary of 16. Thus 8 got multiplied by 2.
Now look below for division:
Let the dividend=8 and divisor=2
Now shift dividend right by 1 and check out result what we get.

Figure2. Shift right by 1
We get binary 0 0 0 0 0 1 0 0 which is binary of 4. Thus 8 got divided by 2.

Here we understood how the computer performs multiplication and division. But this logic of multiplication is applied for multiplying multiplicand by even multiplier. If multiplier is odd number then we have to follow Booth's algorithm.


                                                                                                                                                                            - Sunil Badame