We all know that all the information in the computer is represented by something like binary code 0010101010111. But this string of 01 itself is actually meaningless. Only by encode the various coding algorithms can it be given life.
It is often necessary to take out a binary code for analysis when learning a group. But this pile of 000111 or something is too long to write .... In fact, hexadecimal can be very simple to represent the binary, and the conversion between them is very simple.
For example: 0X5F3759DF corresponds to binary number 101 1111 0011 0111 0101 1001 1101 1111
Take a closer look at what the rules are.
First, we fill the high 0:0101 1111 0011 0111 0101 1001 1101 1111
It is not difficult to find that in binary, each of the four bits corresponds to one in hexadecimal.
This may be the source of many hexadecimal editors in your computer. such as editing the hard disk partition table when the AA and other things, in fact, the corresponding is a string of binary.
In computer memory, the smallest addressing unit is a byte.
The length of the binary instruction that the CPU can process at a time. The size of the memory's maximum addressing space can also be computed by the word length. For example, for 32bit CPUs, the maximum addressable space is 2^32=4294967296BYTE=4GB. This is why 32-bit machine memory is 4GB maximum. (but because some other hardware also consumes some memory resources, less than 4G is actually available)
And look back at the above equation: 0x5f3759df corresponds to binary number 0101 1111 0011 0111 0101 1001 1101 1111
The number of strings we write on paper is natural from left to right, so how do we store it in computer memory?
Here's an interesting little story:
"Csapp Reading note 1"