Following are various number systems in use with their bases:
Name of number system : Base
Binary : 2
Decimal : 10
Octal : 8
Hexadecimal : 16
Decimal System:
1> It has a base of 10.
2> The largest value of a digit is 9.
3> Each place represents a different multiple of 10.
MSD : Most Significant Digit : It’s the leftmost digit having highest weight.
LSD : Least Significant Digit : Its the right most digit having lowest weight.
Examples of Decimal no- 25, 88, 165, 97 etc.
Following is the representation of the decimal number in terms of power of 10.
846.45
N= [8] [4] [6] . [4] [5]
N= 8 x 102 + 4 x 101 + 6 x 100 + 4 x 10-1 + 5 x 10-2
Binary System:
1> It has a base of 2.
2> Uses only two digits “0” and “1”.
3> A computer operates on binary number system.
4> The largest value of a digit is 1.
5> Binary digits ‘0’ and ‘1’ are also called as Bits.
MSD : Most Significant Digit : It’s the leftmost digit having highest weight.
LSD : Least Significant Digit : Its the right most digit having lowest weight.
Example of Binary no- 1011010, 111, 1001 etc.
Following is the representation of the binary number in terms of power of 2.
1101.011
N = [1] [1] [0] [1] . [0] [1] [1]
N = 1 x 23 + 1 x 22 + 0 x 21 + 1 x 20 + 0 x 2-1 + 1 x 2-2 + 1 x 2-3
Binary Number Formats:
1> Bit: The smallest unit of data is defined as a single bit.
E.g.: 1, 0
2> Nibble: A nibble is a combination of 4 bits.
E.g.: 1101
3> Byte: A byte is a combination of 8 bits or 2 nibbles
E.g.: 11010110
4> Word: A word is a combination of 16 bits or 4 nibbles, or 2 bytes.
E.g.: 0010101110101101
5> Double Word: Its collection of 2 words, that is it contains 32 bits.
E.g.: 10101101101011011110101110101101
Conversion of Decimal Number to Binary Number
Following is a Stepwise Procedure to convert Decimal number to Binary Number.
1> Divide the decimal number by 2, the reminder is either 0 or 1.
2> Place the reminder to the right of the quotient obtained in step 1.
3> Divide the partial quotient of step1, by 2, placing the reminder to right of new partial quotient.
4> Repeat the step 1,2,3 until a quotient of zero is obtained.
5> The binary number is equal to the reminders arranged so that first reminder is the LSB and the last reminder is MSB of binary number.
Conversion of fractional part of a Decimal Number to Binary Number.
1> Multiply the given fractional decimal number by the 2.
2> Record the carry generated in this multiplication as MSD.
3> Multiply only the fractional number of the product in step 2 by the base(i.e.2), and record the carry as the next bit to MSD.
4> Repeat steps 2 and 3 upto the end. The last carry will represent the LSD of equivalent binary number.
(Conversion is generally carried out only upto 5 digits.)
Lets us solve an example to understand it better.
Example – convert 85.63 to binary.
Following are steps to convert the above decimal number to Binary number.
1> Separate the integer and fractional parts of the given decimal number.
2> Convert the integer part to binary.
3> Convert the fractional part to binary.
4> Combine the results of step 2 and 3 to get the final answer.
Hence (85)10 = (1010101)2 And (0.63)10 = (10100)2
And (85.63)10 = (1010101.10100)2
Conversion of Binary Number to Decimal Number
Conversion of binary number to decimal number is simple. Following are steps to do it.
1> Note down the given binary number.
2> Wrote down the weights for different positions.
3> Multiply each digit in the given number with the corresponding weight to obtain product numbers.
4> Add all the product numbers to get the decimal equivalent.
Example. Convert binary number1011.01 into its decimal equivalent.
Octal Number System :
1> It has a base of 8.
2> The value of each digit in octal number system are in range of o 1 to 7 that is
0,1,2,3,4,5,6,7.
3> The octal number higher than 7 will not be 8 but it will be 10.
For example
0, 1, 2, 3, 4, 5, 6, 7,
10, 11, 12, 13, 14, 15, 16, 17,
20, 21, 22, 23, 24, 25, 26, 27,
30….
Hexadecimal Number System :
1> It has a base 16.
2> The values include 0 to 9 digits and letters A, B, C, D, E, F
3> Hence the possible values are:
0, 1, 2, ,3 , 4, 5, 6, 7, 8, 9, A, B, C, D, E, F