1.1 binary number, bit, byte and word
We are accustomed to decimal numbers: 10,12, etc.
A bit can only represent 0, or 12 states, short bit, a bit
A byte is 8 binary, called 8 bits, or byte,8 bits is a byte
A word is 2 bytes, abbreviated to Word.
Two words for double word, abbreviated DWORD
1.2 Octal
Octal system is based on the number 8, the C language 0 means octal, 0666;
1.3 Hex
The hexadecimal value 16 is the radix number system, the C language uses 0x to denote hexadecimal
Decimal |
Hexadecimal |
Binary |
0 |
0 |
0000 |
1 |
1 |
0001 |
2 |
2 |
0010 |
3 |
3 |
0011 |
4 |
4 |
0100 |
|
|
|
Decimal conversion 8, with the decimal number as dividend, 8 as the divisor, the quotient and the remainder, until the quotient is 0, the remainder is reversed is the result of conversion
Decimal conversion 16, with the decimal number as dividend, 16 as the divisor, the quotient and the remainder, until the quotient is 0, the remainder is reversed is the result of conversion
Source: Intelligence Podcast for study only
Data types in 2_c languages (ii) binary