Radix conversion (binary, octal, hexadecimal)
Radix conversion
Understanding binary numbers is very important in learning computers. That's because the computer memorizes data with ON and OFF. Different storage devices have different ways of expressing ON and OFF. For example, ON and OFF are represented by voltages such as 5V and 0V, or by creating two different states such as the direction of magnetism.
ON ・・・ 1
OFF ・・・ 0
Expressing "ON as 1" and "OFF as 0" means expressing a number with two characters. In other words, computers use binary numbers internally because binary numbers are easier to handle than decimal numbers.
However, for humans, binary numbers are a difficult representation to handle. For example, the decimal number 9 is 1001 in binary. A decimal number that can be expressed in one digit requires four digits in binary.
In this way, in binary numbers, the number of digits becomes very large when expressing large numbers. Also, remembering the sequence of 1s and 0s is difficult. Therefore, sometimes numbers are represented using octal or hexadecimal numbers.
● Radix conversion table
Decimal number | Binary number | octal | Hexadecimal |
0 | 0 | 0 | 0 |
1 | 1 | 1 | 1 |
2 | 10 | 2 | 2 |
3 | 11 | 3 | 3 |
4 | 100 | 4 | 4 |
5 | 101 | 5 | 5 |
6 | 110 | 6 |