A 32-bit system supports up to 4 GB memory

Source: Internet
Author: User

 

A 32-bit system supports up to 4 GB memory

Maybe everyone is familiar with this problem. Anyone who has installed a system or used a computer may have this experience: the computer is equipped with a 4G memory stick, after installing the system, I found that only about GB of available memory is displayed on the computer. Where does the other memory go? Many people have provided some explanations on the Internet. Most of them are not clearly explained. Let's take a look at the specific reasons.

Before that, let's take a look at some knowledge about the computer system structure and PC hardware.

1. bus structure and main board composition

When talking about bus, you must be familiar with it, and you must have dealt with it at ordinary times. When we use a USB flash drive to copy data, we must first connect the USB flash drive to the computer to copy data. A usb interface is actually a type of bus, which is generally referred to as a USB Bus (also known as a Universal Serial Bus ). There was no USB Bus long ago. At that time, each peripheral used its own interface standard. For example, the mouse manufacturer used the unique interface of the mouse, the keyboard Manufacturer uses the unique interface of the keyboard. In this way, many interfaces must be provided on the PC, which increases the hardware design difficulty and cost until the emergence of the USB interface, it unifies the standards of many peripheral interfaces, not only allows users to easily connect to some peripherals, but also enhances the scalability of the PC. So now we can see the mouse, keyboard, USB flash drive, printer and other peripherals can be directly inserted into the computer through the USB interface.

In computer systems, bus is a very important concept. It is precisely because of the bus that all components can work together in a normal collaborative division of labor. In PC a long time ago, three bus structures were used: Data Bus, address bus, and control bus. They are used to transmit different types of data, the data bus is used to transmit data, the address bus is used to transmit addresses, and the control bus is used to transmit some control signals. The following figure clearly shows the three-bus structure:

With the development of the times, this simple bus structure is gradually eliminated. The following figure shows the structure used by modern computing:

In fact, this is also the structure used by the modern motherboard, of course, some places may be slightly different (the general structure is similar ), A friend who has carefully observed the composition of the motherboard may be familiar with the above figure. There are two main components on the motherboard: North Bridge (also known as host bridge) and South Bridge (South Bridge ). The North Bridge is mainly responsible for data transmission of CPU, memory, and video card components, while the South Bridge is mainly responsible for communication between I/O devices, external storage devices, and bios. Now some of the main boards are no longer in beiqiao, because chip manufacturers have already integrated the functions of beiqiao directly into the CPU (but we will discuss them with the model of the secondary diagram above ).

In the preceding figure, I did not plot the data bus and address bus, because they were integrated into some bus standards, for example, in the PCI bus, the address bus and the data bus are always time-sharing (that is, if the PCI bus has a 32-bit data bus, the 32-bit bus can act as the data bus at a certain time point, can act as the address bus at the next time ). Some bus provide both data bus and address bus.

The following describes the functions of several major bus and North-South bridges:

FSB Bus: the front side bus, the bridge between the CPU and the North Bridge, and all data transmitted by the CPU and the North Bridge must pass through the FSB bus, in this case, the frequency of the fsb bus directly affects the speed at which the CPU accesses the memory.

North Bridge: the North Bridge is the only bridge between CPU and memory, graphics card and other components for data exchange, that is, the CPU and any other part of the communication must go through the North Bridge. The North Bridge Chip is usually integrated with memory controllers to control the communication with memory. Now the main board can no longer see beiqiao, and its functions have been integrated into the CPU.

PCI Bus: PCI bus is a high-performance local bus, which is not limited by CPU and forms a high-speed channel between CPU and peripherals. For example, the current video card generally uses a PCI slot, and the PCI bus transmission speed is fast, so that the video card and the CPU can exchange data well.

Nanqiao: it is mainly responsible for communication between I/O devices. To access peripherals, the CPU must go through the nanqiao chip.

After learning about these basic things, Let's explain why a 32-bit system supports up to 4 GB memory.

Ii. Reason

When using a computer, the maximum supported memory is determined by the operating system and hardware.

First, let's talk about the hardware. The address bus has been mentioned above. In the computer, the number of CPU address bus determines the IP address range of the CPU, the address name corresponding to the address bus is used as the physical address. Assume that the CPU has 32-bit address bus (generally, the 32-bit CPU address bus is 32-bit, and some 32-bit CPU address bus is 36-bit, for example, if it is used as the CPU of the server, the addressable physical address range is 232 = 4 GB, the 32-bit CPU and 64-bit CPU usually refer to the data width that the CPU can process at a time, that is, the bit width, not the number of Address Bus ). Since the emergence of a 64-bit CPU, 64-bit data can be processed at a time, generally, the address bus uses 36 or 40 BITs (that is, the physical address space that the CPU can address is 64 GB or 1 T ). When the CPU accesses any other part, it requires an address, just like a courier who sends a parcel. Without an address, he does not know where to deliver it. For example, to read data from a memory unit, the CPU must know the actual physical address of the memory unit to read. Similarly, reading data from memory units on the memory stick also requires the physical address of the memory unit. In other words, the CPU must know its physical address when accessing any storage unit.

The maximum memory that a user can access when using a computer is determined not only by the number of digits in the CPU address bus, but also by the operating system. In fact, when a user uses a computer, the address accessed by the process is a logical address, not a real physical address. The logical address is provided by the operating system, when executing commands, the CPU must first convert the logic address of the command to the physical address to read or write data to the corresponding storage unit (note that the logical address and physical address are one-to-one).

For a 32-bit Windows operating system, the logical address encoding uses 32-bit addresses. Therefore, the logical address addressing range provided by the operating system is 4 GB, in intel X86 architecture, the memory ing technology (memory-mapped I/O, mmio) is used ), that is to say, a part of the 4 GB logical address should be divided into physical addresses mapped to BIOS Rom, CPU registers, and I/O devices, the space in the logical address that can be mapped to the physical address of the memory stick is certainly no more than 4 GB. You can see the figure below:

Therefore, when we install a 32-bit Windows operating system, even if we buy a 4 GB memory, the actual access to the operating system must be less than 4 GB, usually about GB. If the number of bits in the address bus is not 32, for example, 20, the CPU can address 1 GB of physical address space, in this case, even if the operating system supports 4 GB logical address space and the memory stick is 4 GB, the space that can be accessed by users will not exceed 1 GB (of course, the virtual memory technology is not considered here ), therefore, the maximum memory space that a user can access is determined by the hardware and the operating system.

For 64-bit operating systems, the logical address encoding uses 40 BITs and supports a maximum of 1 TB of logical address space. Consider a situation where the CPU is 64-bit, the address bus bit is 40 bits, the operating system is also 64 bits, and the logical address encoding uses the address bit is also 40 bits, if the memory size is 64 GB, can all 64 GB memory be used? The answer is not necessarily because the memory controller is located in the North Bridge (usually in the CPU ), the actual connection address line of the Memory Controller determines the memory capacity that can be supported. That is to say, if the actual connection address line between the memory controller and the memory slot is not 40 bits, it is impossible to fully utilize the storage space of 64 GB memory. Of course, you can hardly consider the memory controller issue, because most memory controllers currently use at least 40-bit address bus.

There are so many questions about this. If you are interested in in-depth research, you can view more information on your own.

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.