Working with Boolean Algebra and Number Systems – 2

Decimal, Binary, and Hexadecimal Number Systems

Humans have been using the base 10 (decimal) number system since we began using our fingers for counting. However, any number greater than 2 can effectively be used as the basis for a number and counting system. In fact, electronic computers use the base 2 (binary) number system at their most basic level. The binary system naturally corresponds to the ON/OFF or TRUE/FALSE nature of their electronic circuits and magnetic components. In the binary system, numbers are constructed using the two digits, 0 and 1, and each of these digits represents one bit of data. Other number systems are the base 8 (octal) and base 16 (hexadecimal) number systems. We will discuss the base 2 and base 16 systems and their correspondence to the base 10 system.

Let’s begin with the base 10 or decimal system. For such a system, we need ten unique numbers: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. All numbers higher than this, and fractions less than 1, can be represented as powers of 10, as shown in Table 5.

Table 5. Decimal Number System
Power 103 102 101 100 . 10-1 10-2 10-3
Value 1000 100 10 1 Decimal Point 0.1 0.01 0.001

The binary system follows the same rule for the places, except each place is one power of 2 greater than the place on its right, as shown in Table 6.

Table 6. Binary Number System
Power 25 24 23 22 21 20 . 2-1 2-2 2-3
Value 32 16 8 4 2 1 Binary Point 1/2 = 0.5 1/4 = 0.25 1/8 = 0.125
Base 2 100000 10000 1000 100 10 1 0.1 0.01 0.001

For the hexadecimal or base 16 system, we need symbols to represent the numbers from 10 to 15. For this system, A is used for 10, B for 11, C for 12, C for 13, D for 14, and E for 15.

Table 7. Hexadecimal Number System
Power 163 162 161 160 . 16-1 16-2
Value 4096 256 16 1 Hex Point 0.0625 0.00390625
Base 16 1000 100 10 1 0.1 0.01

Table 8 shows a comparison of the decimal, binary, and hexadecimal equivalents for the first 16 numbers plus 32 and 64. Use the rules above to understand the correspondences in the table.

Table 8. Correspondence Between Decimal, Binary, and Hexadecimal Numbers
Decimal Value Binary Value Hexadecimal Value
1 1 1
2 10 2
3 11 3
4 100 4
5 101 5
6 110 6
7 111 7
8 1000 8
9 1001 9
10 1010 A
11 1011 B
12 1100 C
13 1101 D
14 1110 E
15 1111 F
16 10000 10
32 100000 20
64 1000000 30
EXAMPLE

10 in base 2 is 10102. The subscript indicates base 2. Another way to signify the base 2 number system is to put a small b (for binary) to the right of a number, i.e., 1010b.

To prove that 10102 is equal to 10 in the decimal system, refer to Table 6. The binary number 10102corresponds to one 23, no 22, one 21, and no 20 (ones). This is 8 + 2, or 10, thus proving 10 is equivalent to 10102.

Additional examples:

EXAMPLE

10 in base 16 is Ah. The subscript on the A indicates this is a base 16 or hexadecimal number.

EXAMPLE

16 in base 16 is 10h. This is one 16 and no ones.

EXAMPLE

16 in base 2 is 100002. This is one 24, no 23, no 22, no 21, and no 20 (ones).

EXAMPLE

4096 in base 16 is 10000h. This is one 163, no 162, no 161, and 160 (ones).

There are rules for adding and subtracting numbers in base systems other than decimal, but for our purposes, as long as you can convert numbers back and forth between decimal, binary, and hexadecimal, you can use the more familiar decimal system for any computations.

SEE ALL Add a note
YOU
Add your Comment
 

Course Enquiry Form

Sign Up

Course Reviews

Why Choose DIY Course?

   Course work & interactions are 100% online.

   Study at the time and place that suits you.

   24/7 access to course material.

   Learn from world-class experts in their field.

Guidebook-for-Mechanical Engineers | DIYguru

Check your Certificate Code

Copyright © DIYguru Education & Research Pvt. Ltd.