Home Random Page


CATEGORIES:

BiologyChemistryConstructionCultureEcologyEconomyElectronicsFinanceGeographyHistoryInformaticsLawMathematicsMechanicsMedicineOtherPedagogyPhilosophyPhysicsPolicyPsychologySociologySportTourism






Converting an Octal Number to a Decimal Number

Here's another example to determine the value of the octal number 16018:

Octal Addition

Octal addition is performed just like decimal addition, except that if a column of two addends produces a sum greater than 7, you must subtract 8 from the result, put down that result, and carry the 1. Remember that there are no such digits as "8" and "9" in the octal system, and that 810 = 108, 910 = 118, etc.

Example 1: Add 5438 + 1218 (no carry required):

Example 2: Add 76528 + 45748 (carries required):

 

 

Hexadecimal System

It is usually difficult for a person to look at a binary number and instantly recognize its magnitude. Unless you are quite experienced at using binary numbers, recognizing the relative magnitudes of 101011012 and 101001012 is not immediate (17310 is greater than 16510). Nor is it immediately apparent to us that 10011011012 equals 62110 without going through the process of calculating 512 + 64 + 32 + 8 + 4 + 1. There is another problem: we are prone to creating errors when writing or typing binary numbers. As a quick exercise, write the binary number 10010111111011010010001112 onto a sheet of paper. Did you make a mistake? Most people would have made at least one error. To make the binary representation of numbers easier on us humans, there is a shorthand representation for binary values. It begins by partitioning a binary number into its nibbles starting at the least significant bit (LSB). An example is shown below:

The number: 1001011110110100100111 can be divided into: 10 0101 1110 1101 0010 0111

Next, a symbol is used to represent each of the possible combinations of bits in a nibble. We start by numbering them with the decimal values equivalent to their binary value, i.e.:

00002 = 010

00012 = 110

00102 = 210

: : :

10002 = 810

10012 = 910

At 9, however, we run out of decimal characters. There are six more nibbles to label, so we begin using letters: A, B, C, D, E, and F. These represent the decimal values 1010, 1110, 1210, 1310, 1410, and 1510 respectively.

Another way to look at it is that hexadecimal counting is also similar to decimal except that instead of having 10 numerals, it has sixteen. This is also referred to as a base-16 numbering system. How do we convert binary to hexadecimal? Begin by dividing the binary number into its nibbles (if the number of bits is not divisible by 4, add leading zeroes), then nibble-by-nibble use the table above to find the hexadecimal equivalent to each 4-bit pattern. For example:

The number: 1001011110110100100111 is divided into: 0010 0101 1110 1101 0010 0111 .which translates to: 2 5 E D 2 7. Therefore, 10010111101101001001112 = 25ED2716. Notice the use of the subscript "16" to denote hexadecimal representation. Going the other way is just as easy. Translating 5D3F2116 to binary goes something like this: The hexadecimal value: 5 D 3 F 2 1 translates to: 0101 1101 0011 1111 0010 0001.



Therefore, 5D3F2116 = 01110100111111001000012.

It is vital to note that computers do not use hexadecimal, humans do. Hexadecimal provides humans with a reliable, short-hand method of writing large binary numbers.

For reference, the following table shows the decimal numbers 0 through 31 with their hexadecimal equivalents:

 


Date: 2015-12-17; view: 707


<== previous page | next page ==>
Decimal to Unsigned Binary Conversion | Converting a Hexadecimal Number to a Decimal Number
doclecture.net - lectures - 2014-2022 year. Copyright infringement or personal data (0.002 sec.)