Friends!
As I mentioned in one of my previous posts, there will be 6 questions on ICT (Information & Communication technology). Most of times, there are 1-2 questions on the topic of number systems and conversions between different numbers systems. Here, I am going to guide you about how to solve these questions without difficulty.
Read on....
What is number system?
Number system is a way to represent numbers. There are 2 kinds of systems-1. Non-positional 2. Positional. The best example of non-positional system is Roman number system. In a positional system, a value of each digit in a number can be determined using
1. The digit
2. The position of the digit in the number
3. The base of the number system ("base" is the total number of digits available in the number system).
The examples of positional system are:
- Binary (Base 2. Digits used : 0, 1)
- Octal (Base 8. Digits used : 0 to 7)
- Decimal (Base 10. Digits used : 0 to 9)
- Hexadecimal (Base 16. Digits used : 0 to 9, Letters used : A- F)
Each position in a positional number system represents a "x" power of the base (e.g. 2). Example 2x where x represents the last position - 1. Similar rule can be applied to Octal and Hexadecimal also.
NOTE: The understanding of the above rules will help you in learning how to convert a number from one base to the another.
There are many methods or techniques which can be used to convert numbers from one base to another. For example:
- Decimal to Other Base System
- Other Base System to Decimal
- Other Base System to Non-Decimal
- Shortcut method - Binary to Octal
- Shortcut method - Octal to Binary
- Shortcut method - Binary to Hexadecimal
- Shortcut method - Hexadecimal to Binary
The easiest way to understand how the conversion techniques work is to learn a few basic tricks:-
1. When converting a decimal number to others, apply division method
2. When converting a non-decimal number to decimal, apply addition method.
3. Under addition method, we first obtain the value of RHS by first multiplying it with base raised to power X, then adding it with the value at next position.
4. Under division method, we always divide the number in question with the base of the target number system. Its steps are:
Step 1 - Divide the decimal number to be converted by the value of the target base.
Step 2 - Get the remainder from Step 1 as the rightmost digit (least significant digit) of new base number.
Step 3 - Divide the quotient of the previous divide by the new base.
Step 4 - Record the remainder from Step 3 as the next digit (to the left) of the new base number.
Repeat the above steps till the number becomes less than the base of the target. In this case, we will stop when number becomes 1, which is less than the divisor.
1. Here, we give an example of conversion from decimal to binary:
Step
|
Operation
|
Result
|
Remainder
|
Step 1
|
35 / 2
|
17
|
1
|
Step 2
|
17 / 2
|
8
|
1
|
Step 3
|
8 / 2
|
4
|
0
|
Step 4
|
4 / 2
|
2
|
0
|
Step 5
|
2 / 2
|
1
|
0
|
Step 6
|
1/2
|
0
|
1
|
Now, arrange the remainder in the reverse order so that the first remainder becomes the least significant digit (LSD) and the last remainder becomes the most significant digit (MSD).
Thus the binary of 35 is 1000112.
The similar steps will be applied when you convert a decimal no. to octal or hexadecimal. The only thing that will change will be the divisor, i.e. it will be the base of target number system.
2. Now, steps for converting From other base system to Decimal System
Step 1 - Determine the column (positional) value of each digit, starting from the rightmost digit first.
Step 2 - Multiply the digit with the base raised to power X (starting from 0, then increment it by 1 at each digit position of source number system.)
Step 3 - Sum the products calculated in Step 2. The total is the equivalent value in decimal.
Here is an example to make it simple to understand.
We take the same number we obtained in previous example, i.e. 100011 to convert it back into decimal:
Step
|
Binary Number
|
Decimal Number
|
Step 1
|
1000112
|
( (1 x 25) + (0 x 24) + (0 x 23)
+ (0 x 22) + (1 x 21) + (1 x 20))10
|
Step 2
|
1000112
|
(32 + 0 + 0 + 0 + 2 + 1)10
|
Step 3
|
1000112
|
3510
|
3. When converting from other Base Systems to Non-Decimal System, steps will be a little different.
Step 1 - Convert the original number to a decimal number (base 10).
Step 2 - Convert the decimal number so obtained to the new base number. Example:
Octal Number : 258
Calculating Binary Equivalent:
Step 1 : Convert to Decimal
Step
|
Octal Number
|
Decimal Number
|
Step 1
|
258
|
((2 x 81) + (5 x 80))10
|
Step 2
|
258
|
(16 + 5 )10
|
Step 3
|
258
|
2110
|
Octal Number : 258 = Decimal Number : 2110
Step 2 : Convert Decimal to Binary
Step
|
Operation
|
Result
|
Remainder
|
Step 1
|
21 / 2
|
10
|
1
|
Step 2
|
10 / 2
|
5
|
0
|
Step 3
|
5 / 2
|
2
|
1
|
Step 4
|
2 / 2
|
1
|
0
|
Step 5
|
1 / 2
|
0
|
1
|
Decimal Number : 2110 = Binary Number : 101012
Octal Number : 258 = Binary Number : 101012
4. Shortcut method - Binary to Octal
Step 1 - Divide the binary digits into groups of three (starting from the right).
Step 2 - Convert each group of three binary digits to one octal digit.
Example: Binary Number: 101012
Calculating Octal Equivalent:
Step
|
Binary
Number
|
Octal
Number
|
Step 1
|
101012
|
010 101
|
Step 2
|
101012
|
28 58
|
Step 3
|
101012
|
258
|
Binary Number: 101012 = Octal Number : 258
5. Shortcut method - Octal to Binary
Step 1 - Convert each octal digit to a 3 digit binary number (the octal digits
may be treated as decimal for this conversion).
Step 2 - Combine all the resulting binary groups (of 3 digits each) into a single
binary number.
Example: Octal Number : 258
Calculating Binary Equivalent:
Step
|
Octal
Number
|
Binary
Number
|
Step 1
|
258
|
210 510
|
Step 2
|
258
|
0102 1012
|
Step 3
|
258
|
0101012
|
Octal Number: 258 = Binary Number : 101012
6. Shortcut method - Binary to Hexadecimal
Step 1 - Divide the binary digits into groups of four (starting from the right).
Step 2 - Convert each group of four binary digits to one hexadecimal symbol.
Example: Binary Number: 101012
Calculating hexadecimal Equivalent:
Step
|
Binary
Number
|
Hexadecimal
Number
|
Step 1
|
101012
|
0001
0101
|
Step 2
|
101012
|
110 510
|
Step 3
|
101012
|
1516
|
Binary Number: 101012 = Hexadecimal Number : 1516
7. Shortcut method - Hexadecimal to Binary
Step 1 - Convert each hexadecimal digit to a 4 digit binary number (the
hexadecimal digits may be treated as decimal for this conversion).
Step 2 - Combine all the resulting binary groups (of 4 digits each) into a single
binary number.
Example: Hexadecimal Number: 1516
Calculating Binary Equivalent:
Step
|
Hexadecimal
Number
|
Binary
Number
|
Step 1
|
1516
|
110 510
|
Step 2
|
1516
|
00012 01012
|
Step 3
|
1516
|
000101012
|
Hexadecimal Number: 1516 = Binary Number : 101012
I hope this post will help you understand the concept and you will be able to answer any question on Number System without mistake.
Best of Luck for December' 15 Exam!!
No comments:
Post a Comment