There are four major number systems we are going to deal with in this chapter.The decimal number system has a base of 10.The binary a base of 2 ,the octal has base of 8 and hexadecimal hasa base of 16.
Let us discuss each number system one by one.
1.Decimal number system:
The numbers which can be represented in terms of the 10 symbols 0,1,2,3,4,5,6,7,8,9 are called decimal numbers.
The digit in the extreme right having least value is called least significant bit(LSB) and the digit appearing in the extreme left having maximum value is called the most significant bit(MSB).
2.Binary
The binary number system has a base of two as mentioned earlier.It implies that all the characters are expressed only in terms of 0 and 1.
2.(a)
Binary to decimal conversion:
Binary numbers may be converted to decimal equivalent by positional weight method.
Each digit in the binary number is multiplied by its weight and the sum of the weights is taken to get the decimal number.
ex: (10101)in binary=(21)in decimal
2.(b)
Decimal to binary conversion:
i.Sum of weights method:
Successively the sum of powers of 2 are taken such that their sum total yields the decimal number.
ii.Double dabble method:
The decimal number is successively divided by 2 and the remainder is noted down.Till the quotient turns zero the process is repeated.The remainders taken in reverse order depict the binary number.
2.(c)
Binary addition
Rules for binary addition:
0 + 0 = 0
0 + 1 =1
1 + 0 =1
1 + 1 =10 i.e 0 with a carry of 1
ex: 1010 + 111 =10001
2.(d)
Binary subtraction
Rules for binary subtraction:
0 - 0 = 0
1 - 1 = 0
1 - 0 = 1
0 - 1 = 1 with a borrow of 1
ex:1010.01 - 111.111 = 0010.011
2.(e)
Binary multiplication
The rules for binary multiplication is that ,we multiply the multiplicand with each bit of the multiplier,and add the partial products.The partial product is same as the multiplicand if the multiplier bit is a 1 and is zero if the multiplier bit is 0.
Rules for binary multiplication:
0 * 0 = 0
1 * 1 = 1
1 * 0 = 0
0 * 1 = 0
ex:1100 * 1001 = 01101100
2.(f)
Binary division
In binary division the long-division procedure similar to that in decimal is used .First the given binary numbers are converted into their decimal equivalents and after division is performed the quotient is converted into decimal form.
ex:101101 / 110 =111.1
2(g)
Representation of signed numbers using 2's complement or 1's complement method:
1.If the number is positive represent the number in its true binary form and with a sign bit zero in front of the MSB .
2.If the number is negative the number is represented in its 2's complement or 1's complement form, a sign bit 1 is placed in front of the MSB.
Two's complement arithmetic:
Two's complement of a number is obtained by adding 1 to its one's complement.
In the 2's complement subtraction,add the 2's complement of the subtrahend to the minuend.If there is a carry out it is to be ignored.then we have to check the bit in the MSB position.
If the bit in the MSB is 0 then the answer is positive and in its true binary form.
If the bit in the MSB is a 1 then the answer is negative and in its 2's complement form.In this case,we have to take out the 2's complement of the answer and put a negative sign before it.
One's complement arithmetic:
One's complement of a number is obtained by exchanging all zeroes by ones and all ones by zeroes in the number.
The procedure of one's complement subtraction is interesting.
We take the one's complement of the subtrahend and add it to the minuend.If there is a carry then it added to the LSB.
Even if there is a carry or not the bit in the MSB position of the sum is checked .
If it is a 0 then the answer is positive and in its true form,if it a 1 then the answer is negative and in the 1's complement form.In such a case we have to take the 1's complement of the sum term and put a negative sign before it to get the binary number.
3.Octal number system
the ease with which the conversions can be made from octal to binary and from binary to octal makes octal a way of expressing in shorthand.
3.1 Octal to binary conversion:
To replace an octal number by its binary equivalent each digit in the octal number is replaced by its 3 bit binary equivalent.
ex:367.52(in octal) = 011110111.101010(in binary)
3.2 Octal to decimal conversion:
to convert an octal number into its decimal equivalent multiply each digit in the octal number by its weight and add all the products together to get the decimal equivalent.
ex:4057.06(octal) = 2095.0937(in decimal)
3.3Octal addition:
the octal addition is performed by the decimal method.All the digits in one column are added and the resulting decimal value is converted to octal value.Corresponding sum and carry are noted and the the carry is taken ahead to the next column.This process is repeated for the complete number.
ex:327.54 + 665.37 = 1215.13
3.4Octal subtraction:
the octal subtraction is similar to the decimal subtraction
4.Hexadecimal number system
The base of the system is 16.Any hexadecimal number can be represented using the 16 symbols of 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E and F.
4.1 Binary to hexadecimal conversion:
For binary to hexadecimal conversion the bits starting from the decimal point are grouped into groups of 4 bits.Each group is replaced by its hexadecimal equivalent.
ex:1011011011(binary) = 2DB(hexadecimal)
4.2 hexadecimal to decimal:
Each digit in the hex number is multiplied by its weight and all the product terms are added.
ex:5C7(hexadecimal) = 1479(decimal)
4.3 Decimal to hexadecimal:
The decimal number is divided by 16 and the remainders are noted down.The process is repeated till the quotient is zero.The remainders taken in the reverse order represent the hexadecimal number.
ex:2598.675(decimal) = A26.ACCC(hexadecimal)
4.4Octal to hexadecimal
Each octal is represented in its 3 bit equivalent binary.the resulting number is divided into gropu of 4 bits starting from the decimal number.Each 4 bit group is represented by its hexadecimal equivalent.
ex:756.603(octal) = (1EE.C18)
4.5Hexadecimal Addition:
It is similar to the procedure explained in octal.
4.6Hexadecimal subtraction:
It is similar to decimal subtraction.
Let us discuss each number system one by one.
1.Decimal number system:
The numbers which can be represented in terms of the 10 symbols 0,1,2,3,4,5,6,7,8,9 are called decimal numbers.
The digit in the extreme right having least value is called least significant bit(LSB) and the digit appearing in the extreme left having maximum value is called the most significant bit(MSB).
2.Binary
The binary number system has a base of two as mentioned earlier.It implies that all the characters are expressed only in terms of 0 and 1.
2.(a)
Binary to decimal conversion:
Binary numbers may be converted to decimal equivalent by positional weight method.
Each digit in the binary number is multiplied by its weight and the sum of the weights is taken to get the decimal number.
ex: (10101)in binary=(21)in decimal
2.(b)
Decimal to binary conversion:
i.Sum of weights method:
Successively the sum of powers of 2 are taken such that their sum total yields the decimal number.
ii.Double dabble method:
The decimal number is successively divided by 2 and the remainder is noted down.Till the quotient turns zero the process is repeated.The remainders taken in reverse order depict the binary number.
2.(c)
Binary addition
Rules for binary addition:
0 + 0 = 0
0 + 1 =1
1 + 0 =1
1 + 1 =10 i.e 0 with a carry of 1
ex: 1010 + 111 =10001
2.(d)
Binary subtraction
Rules for binary subtraction:
0 - 0 = 0
1 - 1 = 0
1 - 0 = 1
0 - 1 = 1 with a borrow of 1
ex:1010.01 - 111.111 = 0010.011
2.(e)
Binary multiplication
The rules for binary multiplication is that ,we multiply the multiplicand with each bit of the multiplier,and add the partial products.The partial product is same as the multiplicand if the multiplier bit is a 1 and is zero if the multiplier bit is 0.
Rules for binary multiplication:
0 * 0 = 0
1 * 1 = 1
1 * 0 = 0
0 * 1 = 0
ex:1100 * 1001 = 01101100
2.(f)
Binary division
In binary division the long-division procedure similar to that in decimal is used .First the given binary numbers are converted into their decimal equivalents and after division is performed the quotient is converted into decimal form.
ex:101101 / 110 =111.1
2(g)
Representation of signed numbers using 2's complement or 1's complement method:
1.If the number is positive represent the number in its true binary form and with a sign bit zero in front of the MSB .
2.If the number is negative the number is represented in its 2's complement or 1's complement form, a sign bit 1 is placed in front of the MSB.
Two's complement arithmetic:
Two's complement of a number is obtained by adding 1 to its one's complement.
In the 2's complement subtraction,add the 2's complement of the subtrahend to the minuend.If there is a carry out it is to be ignored.then we have to check the bit in the MSB position.
If the bit in the MSB is 0 then the answer is positive and in its true binary form.
If the bit in the MSB is a 1 then the answer is negative and in its 2's complement form.In this case,we have to take out the 2's complement of the answer and put a negative sign before it.
One's complement arithmetic:
One's complement of a number is obtained by exchanging all zeroes by ones and all ones by zeroes in the number.
The procedure of one's complement subtraction is interesting.
We take the one's complement of the subtrahend and add it to the minuend.If there is a carry then it added to the LSB.
Even if there is a carry or not the bit in the MSB position of the sum is checked .
If it is a 0 then the answer is positive and in its true form,if it a 1 then the answer is negative and in the 1's complement form.In such a case we have to take the 1's complement of the sum term and put a negative sign before it to get the binary number.
3.Octal number system
the ease with which the conversions can be made from octal to binary and from binary to octal makes octal a way of expressing in shorthand.
3.1 Octal to binary conversion:
To replace an octal number by its binary equivalent each digit in the octal number is replaced by its 3 bit binary equivalent.
ex:367.52(in octal) = 011110111.101010(in binary)
3.2 Octal to decimal conversion:
to convert an octal number into its decimal equivalent multiply each digit in the octal number by its weight and add all the products together to get the decimal equivalent.
ex:4057.06(octal) = 2095.0937(in decimal)
3.3Octal addition:
the octal addition is performed by the decimal method.All the digits in one column are added and the resulting decimal value is converted to octal value.Corresponding sum and carry are noted and the the carry is taken ahead to the next column.This process is repeated for the complete number.
ex:327.54 + 665.37 = 1215.13
3.4Octal subtraction:
the octal subtraction is similar to the decimal subtraction
4.Hexadecimal number system
The base of the system is 16.Any hexadecimal number can be represented using the 16 symbols of 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E and F.
4.1 Binary to hexadecimal conversion:
For binary to hexadecimal conversion the bits starting from the decimal point are grouped into groups of 4 bits.Each group is replaced by its hexadecimal equivalent.
ex:1011011011(binary) = 2DB(hexadecimal)
4.2 hexadecimal to decimal:
Each digit in the hex number is multiplied by its weight and all the product terms are added.
ex:5C7(hexadecimal) = 1479(decimal)
4.3 Decimal to hexadecimal:
The decimal number is divided by 16 and the remainders are noted down.The process is repeated till the quotient is zero.The remainders taken in the reverse order represent the hexadecimal number.
ex:2598.675(decimal) = A26.ACCC(hexadecimal)
4.4Octal to hexadecimal
Each octal is represented in its 3 bit equivalent binary.the resulting number is divided into gropu of 4 bits starting from the decimal number.Each 4 bit group is represented by its hexadecimal equivalent.
ex:756.603(octal) = (1EE.C18)
4.5Hexadecimal Addition:
It is similar to the procedure explained in octal.
4.6Hexadecimal subtraction:
It is similar to decimal subtraction.
No comments:
Post a Comment