Binary Values and Number Systems

2.1 Binary, Octal, and Hexadecimal

The base-2 (binary) number system is particularly important in computing. It is also helpful to be familiar with number systems that are powers of 2, such as base 8 (octal) and base 16 (hexadecimal). The base value specifies the number of digits in the number system.

  • Base 10 has ten digits (0-9)
  • Base 2 has two digits (0-1)
  • Base 8 has eight digits (0-7)

What are the digits in bases higher than 10? We need symbols to represent the digits that correspond to the decimal values 10 and beyond. In bases higher than 10, we use letters as digits. We use the letter

  • A to represent the number 10,
  • B to represent 11,
  • C to represent 12,

and so forth. Therefore, the 16 digits in base 16 are:

0, 1, 2, 3, 4, 5, 6, 7, 8 ,9, A, B, C, D, E, F

465 in octal (base 8) is:

4 * 82 = 4 * 64 = 256
+ 6 * 81 = 6 * 8 = 48
+ 5 * 80 = 5 * 1 = 5
        ---------
(Decimal) 309

hexadecimal number DEF to decimal is:

D * 162 = 13 * 256 = 3328
+ E * 161 = 14 * 16 = 224
+ F * 160 = 15 * 1 = 15
        ---------
(Decimal) 3567