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.