The conversion of conversions is very often used in our lives.
We are more common in the system has
1. Binary
2, eight binary
3. Decimal
4. Hex
5, 12 binary
6, 24 binary
7 ...
One or two binary
We all know that binary is more used in computers because there are only two states in the computer (switch or high level low)
We generally use the base 0 and the representation, the binary operation is 2 in 1
In general, there are two ways we operate
1.1-In addition to the second method of taking the remainder
This approach is a solution
For example: (We are here to convert decimal into binary)
13 Conversion to Binary
13/2=6..........1
6/2=3.............0
3/2=1.............1
1/2=0.............1
The remainder is reversed to 1101, then 13 is converted to binary 1101 (B)
2, eight binary
Octal base is 0----7, every 8 in 1
The principle is the same as in binary
Here we have two ways to convert octal into binary.
2.1 Method 1:8 conversion to decimal, then decimal to binary
21 (8) =2*8^1+1*8^0=17
------Conversion to Binary 10001 (B)
2.2 Method 2:8 binary conversion to binary (octal binary of a corresponding binary three-bit)
-------------
Can be written in 10001
3. Decimal
Decimal the most used in our lives
123 = 1*10^2+2*10^1+3*10^1=100+20+3=123
4. Hex
Hexadecimal is the most used in a computer
Why use hex more
1, with the binary conversion convenient
2. Simpler than binary writing
The hexadecimal cardinality is 0-9 a-f
hexadecimal conversion to binary is a corresponding four-bit
0x33=00110011
The principle of other conversion and the similar above, we need to combine some of these methods or rules can be solved smoothly
Conversion between conversions (binary, octal, 16 decimal, binary)