[PDF] [PDF] NUMBER SYSTEMS

number system, e g , it may be required to convert a decimal number to binary or octal or hexadecimal The reverse is also true, i e , a binary number may be 



Previous PDF Next PDF





[PDF] Conversion of Binary, Octal and Hexadecimal Numbers - UCR CS

Replace each hexadecimal digit with the corresponding 4-bit binary string Problems Convert the following Binary Octal Decimal Hex 10011010 2705



[PDF] Binary Decimal Octal and Hexadecimal number systems

Hexadecimal number systems Conversion of binary to decimal ( base 2 to Binary, Octal, and Hex Numbers 0 0000 0 0 Decimal Binary Octal Hexadecimal



[PDF] Binary Decimal Octal and Hexadecimal number systems - csucfedu

Decimal, Binary, Octal, and Hex Numbers 0 0000 0 0 Decimal Binary Octal Hexadecimal 1 0001 1 1 2 0010 2 2 3 0011 3 3 4 0100 4 4 5 0101 5 5



[PDF] NUMBER SYSTEM CONVERSIONS - ipsgwaliororg

A) Divide the Number (Decimal Number) by the base of target base system (in which you want to convert the number: Binary (2), octal (8) and Hexadecimal (16 )) 



[PDF] Decimal-Binary-Hexadecimal Conversion Chart

This chart shows all of the combinations of decimal, binary and hexadecimal from 0 to 255 decimal When making a change in a CV this chart will show the 



[PDF] NUMBER SYSTEMS

number system, e g , it may be required to convert a decimal number to binary or octal or hexadecimal The reverse is also true, i e , a binary number may be 



[PDF] DECIMAL, BINARY, AND HEXADECIMAL - Washington

Example: 7061 in decimal (base 10) • 7061 10 Octal Numbering System Challenge Question Convert 13 10 to binary Hints: • 2 3 = 8 • 2 2 = 4 • 2 1 = 2



[PDF] Chapter 1 Binary, octal and hexadecimal numbers - TCD Maths home

Binary, octal and hexadecimal numbers this to convert from decimal to octal, to hex, or to binary An ascii manual page appeared in Version 7 AT&T UNIX



[PDF] Number System Conversion - Tutorialspoint

Shortcut method − Octal to Binary Shortcut method − Binary to Hexadecimal Shortcut method − Hexadecimal to Binary Decimal to Other Base System Steps



[PDF] Number Systems - Sonoma State University

▫ Decimal ▫ Binary ▫ Octal ▫ Hexadecimal We need to know how to use and convert from one to another Page 3 Using Binary Representation □ Digital  

[PDF] binary operator overloading in c plus plus

[PDF] binary solution chemistry examples

[PDF] binary to decimal converter

[PDF] binary to decimal questions and answers pdf

[PDF] binary to decimal worksheet pdf with answers

[PDF] binary to hexadecimal conversion chart

[PDF] binary to hexadecimal converter with steps

[PDF] binary to hexadecimal formula excel

[PDF] binary to hexadecimal in converter

[PDF] binary to hexadecimal javascript

[PDF] binary to hexadecimal practice problems

[PDF] binary to hexadecimal python code

[PDF] binary to hexadecimal questions and answers pdf

[PDF] binary to hexadecimal table pdf

[PDF] binary to octal conversion calculator

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). (ii) Then form groups of 4 bits, starting from the LSB. (iii) Then write the equivalent hexadecimal number for each group of 4 bits. SimilarlyH for converWing a UexaTecimal number inWo an ocWal number WUe following

VWepV are Wo be followeTJ

(i) First convert the hexadecimal number to its binary equivalent. (ii) Then form groups of 3 bits, starting from the LSB. (iii) Then write the equivalent octal number for eacU group of 3 biWV. Example 1.21. Convert the following hexadecimal numbers into equivalent octal numberV.

Solution:

(a) Given UexaTecimal number iV A 7 2 N = 1010011100101110 OcWal equivalenW 1 2 3 4 5 6 Hence WUe ocWal equivalenW of (A72N)16 iV (123456)8. = 0100.1011111110000101 Ńorming groupV of 3 biWV 100. 101 111 111 000 010 100 OcWal equivalenW 4 5 7 7 0 2 4 9 Hence the octal equivalent of (4.BF85)16 iV (4.577024)8. Example 1.22. Convert (247)8 inWo an equivalenW UexaTecimal number.

Solution. Given octal number is 2 4 7

= 010100111

HexaTecimal equivalenW A 7

Hence WUe UexaTecimal equivalenW of (247)8 iV (A7)16. Example 1.23. Convert (36.532)8 inWo an equivalenW UexaTecimal number. Solution. Given ocWal number iV 3 6 5 3 2 =011110.101011010

Ńorming groupV of 4 biWV 0001 1110. 1010 1101

HexaTecimal equivalenW 1 N. A M

Hence WUe UexaTecimal equivalenW of (36.532)8 iV (1N.AM)16.

1.3 Binary Arithmetic

The four basic rules for adding binary digits (biWV) are aV followVJ

0+0=0 Sum of 0 wiWU a carry 0

0+1=1 Sum of 1 wiWU a carry 0

1+0=1 Sum of 1 wiWU a carry 0

1+1=1 0 Sum of 0 wiWU a carry 1

Examples:

110 6 111 7 1111 15

100 4 011 3 1100 12

1010 10 1010 10 11011 27

The four basic rules for subtracting are as followVJ 0-0=0 1-1=0 1-0=1

0-1=1 0-1 wiWU a borrow of 1

10

Examples:

11 3 11 3 101

01 1 10 2 011

10 2 01 1 010

5 110 6 101101 45

3 101 5 001110 14

2 001 1 011111 31

The 1's complement and the 2's complement of binary number are imporWanW becauVe WUey permiW WUe repreVenWaWion of negaWive numberV.

1GVComplemenW 0 1 0 0 1 1 0 1

ComplemenW.

2GV ComplemenW= (1GV ComplemenW) +1

1GVcomplemenW 01001101

ATT 1 + 1

2GV complemenW 01001110

quotesdbs_dbs21.pdfusesText_27