"Csapp Reading note 1"

Source: Internet
Author: User

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"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.