You are on page 1of 7

Number Bases

Base 2 Base 16 Base 10

Ref: http://www.me.gatech.edu/me3056/lab4/

Number Bases Used In Data Acquistion


Base 2 (Binary) is the Computers operating number system. Base 16 (Hex) is often used to represent large binary numbers because it is easier for humans to read and is easy to convert directly to and from Base 2. Base 10 (Decimal) is used for human math problem.

Base 10 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Base 2 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111

Base 16 (Hex) 0 1 2 3 4 5 6 7 8 9 A B C D E F

Bahan Ajar Elektronika Industri - Revisi 0 - Update 02 Februari 2010

Binary Definitions

Byte

10011001
Bit Nibble

Base Conversions
Base 2 to Base 10 Base 16 to Base 10 Base 10 to Base 2 Base 10 to Base 16 Base 2 to Base 16 Base 16 to Base 2 Base 10 to Hi/Lo Bytes Hi/Lo Bytes to Base 10

Bahan Ajar Elektronika Industri - Revisi 0 - Update 02 Februari 2010

Base 2 to Base 10
Each digit is multiplied by 2 raised to the appropriate power.

Base 16 to Base 10
Each digit is multiplied by 16 raised to the appropriate power. Note that B=11 and F=15 from the previous table.

Bahan Ajar Elektronika Industri - Revisi 0 - Update 02 Februari 2010

Base 10 to Base 2
An example of converting 13 to 11012 ... Start by finding the largest power of 2 that's still less than 13, in this case it's 23 or 8. Divide it into 13 and record the remainder, 5. Proceed as shown in the example.

Base 10 to Base 16
An example of converting 1807 to 70F16 ... Start by finding the largest power of 16 that's still less than 1807, in this case it's 162 or 256. Divide it into 1807 and record the remainder, 15. Proceed as shown in the example.

Bahan Ajar Elektronika Industri - Revisi 0 - Update 02 Februari 2010

Base 2 to Base 16
Converting from Base 2 to Base 16 is straight forward. Partition the binary number into groups of 4 digits. Convert each group directly to a hexadecimal number using the previous table.

Base 16 to Base 2
Converting from Base 16 to Base 2 is also straight forward. Convert each individual hex digit to binary using the previous table.

Bahan Ajar Elektronika Industri - Revisi 0 - Update 02 Februari 2010

Hi/Lo Byte Partitions


Integers greater than 256 cannot be stored in a single byte. The two following examples demonstrate how to convert integers up to 65,535 to and from "high & low bytes".

Base 10 to Hi/Lo Bytes


Partitioning 15,465 into high and low bytes is demonstrated below.

Bahan Ajar Elektronika Industri - Revisi 0 - Update 02 Februari 2010

Hi/Lo Bytes to Base 10


Combining the high and low bytes to reform the decimal number is shown here.

Bahan Ajar Elektronika Industri - Revisi 0 - Update 02 Februari 2010

You might also like