[PDF] number system conversion pdf
[PDF] number system conversion ppt
[PDF] number system conversion questions
[PDF] number system conversion worksheet answer key
[PDF] number system in computer tutorial pdf
[PDF] number system lecture notes pdf
[PDF] number theory congruence problems and solutions
[PDF] number to letter decrypter
[PDF] numbered list apa format example
[PDF] number_of_reviews_ltm
[PDF] numeric attributes in data mining
[PDF] numerical analysis 1
[PDF] numerical analysis 1 pdf
[PDF] numerical analysis book for bsc
[PDF] numerical analysis book pdf by b.s. grewal
1
1.1 Introduction
There are several number systems which we normally use, such as decimal, binary, ocWalH UexaTecimalH eWc. AmongVW WUem we are moVW familiar wiWU WUe Tecimal number VyVWem. TUeVe VyVWemV are claVVifieT accorTing Wo WUe valueV of WUe baVe of WUe number VyVWem. TUe number VyVWem Uaving WUe value of WUe baVe aV 10 iV calleT a Tecimal number VyVWemH wUereaV WUaW wiWU a baVe of 2 iV calleT a binary number VyVWem. LikewiVeH WUe number VyVWemV Uaving baVe 8 anT 16 are calleT ocWal anT UexaTecimal number VyVWemV reVpecWively. PiWU a Tecimal VyVWem we Uave 10 TifferenW TigiWVH wUicU are 0H 1H 2H 3H 4H 5H 6H 7H 8H number cannoW Uave any TigiW oWUer WUan 0 or 1. So Wo Teal wiWU a binary number VyVWem iV quiWe eaVier WUan a Tecimal VyVWem. NowH in a TigiWal worlTH we can WUink in binary naWureH e.g.H a ligUW can be eiWUer off or on. TUere iV no VWaWe in beWween WUeVe Wwo. So we generally uVe WUe binary VyVWem wUen we Teal wiWU WUe TigiWal worlT. Here comeV WUe uWiliWy of a binary VyVWem. Pe can expreVV everyWUing in WUe worlT wiWU WUe Uelp of only Wwo TigiWV i.e.H 0 anT 1. Ńor exampleH if we wanW Wo expreVV 2510 in binary we may wriWe 110012. The right most TigiW in a number VyVWem iV calleT WUe Least (ÓSM). Now normally wUen we Teal wiWU TifferenW number VyVWemV we Vpecify WUe baVe aV WUe VubVcripW Wo make iW clear wUicU number VyVWem iV being uVeT. In an ocWal number VyVWem WUere are 8 TigiWV 0H 1H 2H 3H 4H 5H 6H anT 7. HenceH any ocWal number cannoW Uave any TigiW greaWer WUan 7. SimilarlyH a UexaTecimal number VyVWem reVpecWively. OcWal anT UexaTecimal coTeV are uVeful Wo wriWe aVVembly level language. In generalH we can expreVV any number in any baVe or raTix X. Any number wiWU baVe XH Uaving n TigiWV Wo WUe lefW anT m TigiWV Wo WUe rigUW of WUe Tecimal poinWH can be expreVVeT aVJ wUere an iV WUe TigiW in WUe nWU poViWion. TUe coefficienW an iV WermeT aV WUe ÓSM or ÓoVW SignificanW MigiW anT bm iV WermeT aV WUe LSM or WUe LeaVW SignificanW MigiW. 2
1.2 CONVERSION BETWEEN NUMBER SYSTEMS
It is often required to convert a number in a parWicular number VyVWem Wo any oWUer number VyVWemH e.g.H iW may be requireT Wo converW a Tecimal number Wo binary or ocWal or UexaTecimal. TUe reverVe iV alVo WrueH i.e.H a binary number may be converWeT inWo Tecimal anT Vo on.
1.2.1 Mecimal-Wo-binary ConverVion
Now to convert a number in decimal to a number in binary we have to divide the Tecimal number by 2 repeaWeTlyH unWil WUe quoWienW of Yero iV obWaineT. TUiV meWUoT of repeaWeT TiviVion by 2 iV calleT WUe double-Tabble meWUoT. TUe remainTerV are noWeT Town for eacU of WUe TiviVion VWepV. TUen WUe column of WUe remainTer iV reaT in reverVe orTer i.e.H from boWWom Wo Wop orTer. Pe Wry Wo VUow WUe meWUoT wiWU an example VUown in Nxample 1.1.
Example 1.1. ConverW (26)10 inWo a binary number.
Solution:
Hence WUe converWeT binary number iV (11010)2.
1.2.2 Decimal-Wo-ocWal ConverVion
Similarly, to convert a number in decimal to a number in octal we have to divide WUe Tecimal number by 8 repeaWeTlyH unWil WUe quoWienW of Yero iV obWaineT. TUiV meWUoT of repeaWeT TiviVion by 8 iV calleT octal-Tabble. TUe remainTerV are noWeT Town for eacU of WUe TiviVion VWepV. TUen WUe column of WUe remainTer iV reaT from boWWom Wo Wop orTerH juVW aV in WUe caVe of WUe Touble-Tabble meWUoT. Pe Wry Wo illuVWraWe WUe meWUoT wiWU an example VUown in Nxample 1.2. 3 Nxample 1.2. ConverW (426)10 inWo an ocWal number.
Solution:
Hence WUe converWeT ocWal number iV (652)8.
1.2.3 Decimal-Wo-UexaTecimal ConverVion
The Vame VWepV are repeaWeT Wo converW a number in Tecimal Wo a number in UexaTecimal. Only Uere we Uave Wo TiviTe WUe Tecimal number by 16 repeaWeTlyH unWil
WUe quoWienW of Yero -
emainders are noWeT Town for eacU of WUe TiviVion VWepV. TUen WUe column of WUe remainTer iV reaT from boWWom Wo Wop orTer aV in WUe Wwo previouV caVeV. Pe Wry Wo TiVcuVV WUe meWUoT wiWU an example VUown in Nxample 1.3. Example 1.3. ConverW (348)10 inWo a UexaTecimal number.
Solution:
Hence WUe converWeT UexaTecimal number iV (15C)16.
1.2.4 Binary-Wo-Tecimal ConverVion
Now we discuss the reverse method, i.e., the method of conversion of binary, octal, or UexaTecimal numberV Wo Tecimal numberV. Now we Uave Wo keep in minT WUaW eacU of WUe binaryH ocWalH or UexaTecimal number VyVWem iV a poViWional number VyVWemH i.e., eacU of WUe TigiWV in WUe number VyVWemV TiVcuVVeT above UaV a poViWional weigUW aV in WUe caVe of WUe Tecimal VyVWem. Pe illuVWraWe WUe proceVV wiWU WUe Uelp of exampleV. 4 Nxample 1.4. ConverW (10110)2 inWo a Tecimal number.
Solution. TUe binary number given iV 1 0 1 1 0
PoViWional weigUWV 4 3 2 1 0
The positional weights for each of WUe TigiWV are wriWWen in iWalicV below eacU TigiW.
Hence WUe Tecimal equivalenW number iV given aVJ
1 × 24 + 0 × 23 + 1 × 22 + 1 × 21 + 0 × 20
= 16 + 0 + 4 + 2 + 0 = (22)10. Hence we finT WUaW UereH for WUe Vake of converVionH we Uave Wo mulWiply eacU biW wiWU iWV poViWional weigUWV TepenTing on WUe baVe of WUe number VyVWem.
1.2.5 Octal-Wo-Tecimal ConverVion
Example 1.5. ConverW 34628 inWo a Tecimal number.
Solution. TUe ocWal number given iV 3 4 6 2
PoViWional weigUWV 3 2 1 0
TUe poViWional weigUWV for eacU of WUe TigiWV are wriWWen in iWalicV below eacU TigiW.
Hence WUe Tecimal equivalenW number iV given aVJ
3 83 + 4 82 + 6 81 + 2 80
= 1536 + 256 + 48 + 2 = (1842)10.
1.2.6 Hexadecimal-Wo-Tecimal ConverVion
Example 1.6. Convert 42AD16 inWo a Tecimal number.
Solution. The hexadecimal number given is 4 2 A M
PoViWional weigUWV 3 2 1 0
The positional weights for each of the digits are written in italics below each digit.
Hence WUe Tecimal equivalenW number iV given aVJ
4 × 163 + 2 × 162 + 10 × 161 + 13 × 160
= 16384 + 512 + 160 + 13 = (17069)10.
1.2.7 ŃracWional ConverVion
So far we have dealt with the conversion of integer numbers only. Now if the number conWainV WUe fracWional parW we Uave Wo Teal in a TifferenW way wUen converWing WUe number from a TifferenW number VyVWem (i.e., binary, octal, or hexadecimal) to a Tecimal number VyVWem or vice verVa. Pe illuVWraWe WUiV wiWU exampleV. Example 1.7. ConverW 1010.0112 inWo a Tecimal number. Solution. TUe binary number given iV 1 0 1 0. 0 1 1
PoViWional weigUWV 3 2 1 0 -1-2-3
The positional weights for each of the digits are written in italics below each digit. 5
Hence the decimal equivalenW number iV given aVJ
1 × 23 + 0 × 22 + 1 × 21 + 0 × 20 + 0 × 21 + 1 × 22 + 1 × 23
= 8 + 0 + 2 + 0 + 0 + 0.25 + 0.125 = (10.375)10. Example 1.8. Convert 362.358 inWo a Tecimal number.
Solution. TUe ocWal number given iV 3 6 2. 3 5
Positional weights 2 1 0 -1-2
The positional weights for each of the digits are written in italics below each digit.
Hence WUe Tecimal equivalenW number iV given aVJ
3 × 82 + 6 × 81 + 2 × 80 + 3 × 81 + 5 × 82
= 192 + 48 + 2 + 0.375 + 0.078125 = (242.453125)10. Example 1.9. Convert 42A.1216 inWo a Tecimal number. Solution. The hexadecimal number given is 4 2 A. 1 2
Positional weights 2 1 0 -1-2
The positional weights for each of the digits are written in italics below each digit.
Hence WUe Tecimal equivalenW number iV given aVJ
4 × 162 + 2 × 161 + 10 × 160 + 1 × 161 + 1 × 162
= 1024 + 32 + 10 + 0.0625 + 0.00390625 = (1066.06640625)10. Example 1.10. Convert 25.62510 into a binary number.
TUereforeH (25)10 = (11001)2.
ŃracWional ParWJ
6 i.e., (0.625)10 = (0.101)2
TUereforeH (25.625)10 = (11001.101)2
We know that the maximum digit in an octal number system is 7, which can be TigiWV aW a Wime anT replace WUem by WUe Tecimal equivalenW of WUoVe groupV anT we geW
WUe final ocWal number.
Example 1.11. Convert 1011010102 inWo an equivalenW ocWal number.
Solution. The binary number given iV 101101010
OcWal equivalenW 5 5 2
Hence WUe ocWal equivalenW number iV (552)8.
Example 1.12. Convert 10111102 inWo an equivalenW ocWal number.
Solution. The binary number given iV 1011110
OcWal equivalenW 1 3 6
Hence WUe ocWal equivalenW number iV (136)8.
we finT WUaW WUe WUirT group cannoW be compleWeTH Vince only one 1 iV lefW ouW in WUe calleT lefW paTTing of WUe number wiWU 0. Now if WUe number UaV a fracWional parW WUen WUere will be Wwo TifferenW claVVeV of groupVone for the integer part starting from the lefW of WUe Tecimal poinW anT proceeTing WowarT WUe lefW anT WUe VeconT one VWarWing from WUe rigUW of WUe Tecimal poinW anT proceeTing WowarT WUe rigUW. IfH for WUe VeconT claVVH any 1 iV lefW ouWH we compleWe WUe group by aTTing Wwo 0V on WUe rigUW ViTe. TUiV iV calleT rigUW-paTTing. Example 1.13. Convert 1101.01112 inWo an equivalenW ocWal number.
Solution. The binary number given is 1101.0111
Grouping 3 biWV 001 101. 011 100
OcWal equivalenWJ 1 5 3 4
Hence WUe ocWal number iV (15.34)8.
Now if WUe ocWal number iV given anT youGre aVkeT Wo converW iW inWo iWV binary equivalenWH WUen eacU ocWal TigiW iV converWeT inWo a 3-biW-equivalenW binary number anT combining all WUoVe TigiWV we geW WUe final binary equivalenW. Example 1.14. Convert 2358 inWo an equivalenW binary number.
Solution. The octal number given is 2 3 5
3-biW binary equivalenW 010 011 101
Hence WUe binary number iV (010011101)2.
7 Example 1.15. Convert 47.3218 inWo an equivalenW binary number. Solution. The octal number given is 4 7 3 2 1
3-biW binary equivalenW 100 111 011 010 001
Hence WUe binary number iV (100111.011010001)2.
We know that the maximum digit in a hexadecimal system is 15, which can be TigiWV aW a Wime anT replace WUem wiWU WUe UexaTecimal equivalenW of WUoVe groupV anT we geW WUe final UexaTecimal number. Example 1.16. Convert 110101102 inWo an equivalenW UexaTecimal number.
Solution. The binary number given is 11010110
HexaTecimal equivalenW M 6
Hence WUe UexaTecimal equivalenW number iV (M6)16. Example 1.17. Convert 1100111102 inWo an equivalenW UexaTecimal number.
Solution. The binary number given is 110011110
HexaTecimal equivalenW 1 9 N Hence WUe UexaTecimal equivalenW number iV (19N)16. Since at the time of grouping of four digits starting from the LSB, in Example 1.19 we finT WUaW WUe WUirT group cannoW be compleWeTH Vince only one 1 iV lefW ouWH Vo we fracWional parWH aV in WUe caVe of ocWal numberVH WUen WUere will be Wwo TifferenW claVVeV of groupVone for WUe inWeger parW VWarWing from WUe lefW of WUe Tecimal poinW anT proceeTing WowarT WUe lefW anT WUe VeconT one VWarWing from WUe rigUW of WUe Tecimal poinW anT proceeTing WowarT WUe rigUW. IfH for WUe VeconT claVVH any uncompleWeT group iV lefW ouWH we compleWe WUe group by aTTing 0V on WUe rigUW ViTe. Example 1.18. Convert 111011.0112 inWo an equivalenW UexaTecimal number.
Solution. The binary number given is 111011.011
Grouping 4 biWV 0011 1011. 0110
Now if the hexadecimal number is given and you're asked to convert it into its binary equivalenWH WUen eacU UexaTecimal TigiW iV converWeT inWo a 4-biW-equivalenW binary number anT by combining all WUoVe TigiWV we geW WUe final binary equivalenW. 8 Example 1.19. Convert 29C16 inWo an equivalenW binary number.
Solution. The hexadecimal number given is 2 9 C
4-biW binary equivalenW 0010 1001 1100
Hence WUe equivalenW binary number iV (001010011100)2. Example 1.20. Convert 9E.AF216 inWo an equivalenW binary number. Solution. The hexadecimal number given is 9 E A F 2
4-biW binary equivalenW 1001 1110 1010 1111 0010
Hence WUe equivalenW binary number iV (10011110.101011110010)2.
1.2.10 ConverVion from an OcWal Wo HexaTecimal Number anT Vice VerVa
Conversion from octal to hexadecimal and vice versa is sometimes required. To converW an ocWal number inWo a UexaTecimal number WUe following VWepV are Wo be followeTJ (i) First convert the octal number to its binary equivalent (as already discussed above).quotesdbs_dbs20.pdfusesText_26