Pointer essence (1) starting from the number of CPU digits

Source: Internet
Author: User

When we say that a CPU is "32-bit" or "64-bit", it refers to the width of the arithmetic logical unit (ALU) in the CPU, this corresponds to the number of registers in the CPU. The larger the number of digits, the larger the data processed at a time. More information can be processed.

In computer systems, the data bus width is usually the same as that of ALU, but there are exceptions.

In the computer architecture, the most natural address bus width should be consistent with the data bus width [Linux KernelSource codeScenario Analysis]. This is becauseProgramFrom the design point of view, an address is also a pointer, preferably the same length as an integer.

Pointer appears in the programming of advanced languages. In assembly, there is no pointer, and some are addresses. Every memory unit in the computer is addressing.
All accesses are carried out through the address. The advanced language masks these low-level hardware details. The data processed by the program is stored in the data object, and the data object can be used in a specific storage location, occupying a certain amount of space.
Save the ticket.

 
Because the address needed to access the memory, the pointer variable is introduced in the advanced language to store the address of the Data Object and access the memory.

A variable with an address value is a pointer variable.

 
Since the pointer stores the address, it is necessary to be able to address all memory units, that is, the pointer size is the system addressing range.

 
All pointers occupy the same storage size, because their values are addresses, which are usually represented by a machine word. Then the machine word is usually the same as the address range, it is best to keep the data bus and address bus widths consistent in programming.

 
We know that the 32-bit address bus can address 4 GB of address space (0 ~ 232
-1) the pointer is a variable.
And it also occupies the memory unit. In a 32-bit system, the integer int value is also 32-bit.

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.