The document Converting Between Number Systems Electrical Engineering (EE) Notes | EduRev is a part of the Electrical Engineering (EE) Course Digital Electronics.

All you need of Electrical Engineering (EE) at this link: Electrical Engineering (EE)

It is often necessary to convert values written in one number system to another. The simplest way is to reach for your calculator or use a conversion app. from the web. That is fine, but converting a number in this way does not help you to understand the way each number system works and how different systems are related. The purpose of this module is to explain just that, and to get you to carry out some simple conversions so that you can not only convert between number systems, but also understand how the conversion process works. There are various ways to tackle conversions without a calculator; once the conversion methods are learned, the only skills needed are the ability to multiply and divide, and to add together a few numbers.

The number of values that can be expressed by a single digit in any number system is called the system radix, and any value can be expressed in terms of its system radix.

For example the system radix of octal is 8, since any of the 8 values from 0 to 7 can be written as a single digit.

**Convert 126 _{8} to decimal.**

Using the value of each column, (which in an octal integer are powers of 8) the octal value 126_{8} can also be written as:

(1x8^{2}) + (2x8^{1}) + (6 x 8^{0})

As (8^{2} = 64), (8^{1} = 8) and (8^{0} =1), this gives a multiplier value for each column.

Multiply the digit in each column by the column multiplier value for that column to give:

1x64 = 64 2x8 =16 6x1 = 6

Then simply add these results to give the decimal value.

64 + 16 + 6 = 86_{10}

Therefore 126_{8} = 86_{10}.

**Convert 1101 _{2} to decimal.**

The same method can be used to convert binary number to decimal:

= (1x2^{3})+(1x2^{2})+(0x2^{1})+(1x2^{0})

= 8 + 4 +0 +1

= 13_{10}

Therefore 1101_{2} = 13_{10}.

**Convert B2D _{16} to decimal.**

Using the same method to convert hexadecimal to decimal.

= (Bx16^{2})+(2x16^{1})+(Dx16^{0})

= (11x16^{2})+(2x16^{1})+(13x16^{0})

= 2816 + 32 +13

= 2861_{10}

Therefore B2D_{16} = 2861_{10}.

The same method (multiplying each digit by it's column value) can be to convert any system to decimal.

To convert a decimal integer number (a decimal number in which any fractional part is ignored) to any other radix, all that is needed is to continually divide the number by its radix, and with each division, write down the remainder. When read from bottom to top, the remainder will be the converted result.

For example, to convert the decimal number 86_{10} to octal:

Divide 86_{10} by the system radix, which when converting to octal is 8. This gives the answer 10, with a remainder of 6.

Continue dividing the answer by 8 and writing down the remainder until the answer = 0

Now simply write out the remainders, starting from the bottom, to give 126_{8}

Therefore 86_{10} = 126_{8}

This process also works to convert decimal to binary, but this time the system radix is 2:

For example, to convert the decimal number 13_{10} to binary:

Therefore 13_{10} = 1101_{2}

It also works to convert decimal to hexadecimal, but now the radix is 16:

As some of the remainders may be greater than 9 (and so require their alphabetic replacement), you may find it easier to use Decimal for the remainders, and then convert them to Hex.

**Therefore 2861 _{10} = B2D_{16}**

It is very common in the decimal system to use fractions; that is any decimal number that contains a decimal point, but how can decimal numbers, such as 34.625_{10} be converted to binary fractions?

In electronics this is not normally done, as binary does not work well with fractions. However as fractions do exist, there has to be a way for binary to deal with them. The method used is to get rid of the radix (decimal) point by **NORMALISING** the decimal fraction using **FLOATING POINT** arithmetic. As long as the binary system keeps track of the number of places the radix point was moved during the normalisation process, it can be restored to its correct position when the result of the binary calculation is converted back to decimal for display to the user.

However, for the sake of completeness, here is a method for converting decimal fractions to binary fractions. By carefully selecting the fraction to be converted, the system works, but with many numbers the conversion introduces inaccuracies; a good reason for not using binary fractions in electronic calculations.

The radix point splits the number into two parts; the part to the left of the radix point is called the INTEGER. The part to the right of the radix point is the FRACTION. A number such as 34.625_{10} is therefore split into 34_{10} (the integer), and .625_{10} (the fraction).

To convert such a fractional decimal number to any other radix, the method described above is used to covert the integer.

So 34_{10} = 100010_{2}

To convert the fraction, this must be MULTIPLIED by the radix (in this case 2 to convert to binary). Notice that with each multiplication a CARRY is generated from the third column. The Carry will be either 1 or 0 and these are written down at the left hand side of the result. However when each result is multiplied the carry is ignored (don’t multiply the carry). Each result is multiplied in this way until the result (ignoring the carry) is 000. Conversion is now complete.

For the converted value just read the carry column from top to bottom.

So 0.625_{10} = .101_{2}

Therefore the complete conversion shows that 34.62510 = 100010.101_{2}

However, with binary, there is a problem in using this method, .625 converted easily but many fractions will not. For example if you try to convert .626 using this method you would find that the binary fraction produced goes on to many, many places without a result of exactly 000 being reached.

With some decimal fractions, using the above method will produce carries with a repeating pattern of ones and zeros, indicating that the binary fraction will carry on infinitely. Many decimal fractions can therefore only be converted to binary with limited accuracy. The number of places after the radix point must be limited, to produce as accurate an approximation as required.

The most commonly encountered number systems are binary and hexadecimal, and a quick method for converting to decimal is to use a simple table showing the column weights, as shown in Tables 1.2.1a and 1.2.1b.

To convert from binary to decimal, write down the binary number giving each bit its correct ‘weighting’ i.e. the value of the columns, starting with a value of one for the right hand (least significant) bit. Giving each bit twice the value of the previous bit as you move left.

To convert the binary number 01000011_{2} to decimal. Write down the binary number and assign a ‘weighting’ to each bit as in Table 1.2.1a

Now simply add up the values of each column containing a 1 bit, ignoring any columns containing 0.

Applying the appropriate weighting to 01000011 gives 64 + 2 + 1 = 67

Therefore: 01000011_{2} = 67_{10}

A similar method can be used to quickly convert hexadecimal to decimal, using Table 1.2.1b

The hexadecimal digits are entered in the bottom row and then multiplied by the weighting value for that column.

Adding the values for each column gives the decimal value.

**Therefore: 25CB _{16} = 9675_{10}**

Converting between binary and hexadecimal is a much simpler process; hexadecimal is really just a system for displaying binary in a more readable form.

Binary is normally divided into Bytes (of 8 bits) it is convenient for machines but quite difficult for humans to read accurately. Hexadecimal groups each 8-bit byte into two 4-bit nibbles, and assigns a value of between 0 and 15 to each nibble. Therefore each hexadecimal digit (also worth 0 to 15) can directly represent one binary nibble. This reduces the eight bits of binary to just two hexadecimal characters.

11101001_{2} is split into 2 nibbles 1110_{2} and 1001_{2} then each nibble is assigned a hexadecimal value between 0 and F.

The bits in the most significant nibble (1110_{2}) add up to 8+4+2+0 = 14_{10} = E_{16}

The bits in the least significant nibble (1001_{2}) add up to 8+0+0+1 = 9_{10} = 9_{16}

**Therefore 11101001 _{2} = E9_{16}**

Converting hexadecimal to binary of course simply reverses this process.

Offer running on EduRev: __Apply code STAYHOME200__ to get INR 200 off on our premium plan EduRev Infinity!

92 videos|91 docs|12 tests