The basic concept of the first section of the system
Bit-based system is a count and calculation of the convenience of counting systems, our computer is generally used in binary.
So what is binary? Decimal refers to 10 digits, 0-9, 10 in 1; binary refers to 2, 0, 1, 2 to 1, and a number in different positions represents a different value.
Decimal is often used in our real life, and we are familiar with it, how is the binary used to represent a number?
Use decimal for example to 8=1000;3=0011;2=0010;9=1001;6=0110.
8=1000, from right to left, the first three bits are 0, the fourth is 1, that is 2 3, 2^3 * 1+2^2 * 0+2^1 * 0+2^0 * 0=8.
Decimal conversion to binary method, we generally put the number of conversions needed as a divisor, divided by 2, the remainder is not 1 is 0, the remainder is taken out backwards read is the number of binary.
The binary system is widely used in computer, which can make its operation simple and simplify the structure of computer. Of course, there are other systems in the computer, such as octal (0-7, every eight into one, the beginning of the sign with 0), Hex (0-9,a,b,c,d,e,f, the beginning of the logo is represented by 0x), here you can see that 8 and 16 are 2^3 and 2^4 respectively, because are 2 of the whole number of square, So it will be used a little.
| Decimal |
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
| Binary |
0000 |
0001 |
0010 |
0011 |
0100 |
0101 |
0110 |
0111 |
1000 |
1001 |
1010 |
1011 |
1100 |
1101 |
1110 |
1111 |
| Octal |
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
| Decimal |
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
A |
B |
C |
D |
E |
F |
Decimal conversion binary, using the number that needs to be converted divided by 2, the output remainder is the binary of the number, octal equivalent, is the number divided by 8, and then get the remainder from the bottom to the top number, decimal conversion octal, hexadecimal is the same. Binary, octal, 16 binary conversion 10 binary, is also the right to expand, add the decimal number.
Bit operations in the second section binary
Preliminary understanding of Java in-process