Computer Composition 8 Storage hierarchy 8.7 calculation of storage capacity
For memory, we care about both its performance and its capacity. Now, there is some controversy over the calculation of memory capacity. What's going on here? Let's have a look together.
We look at a strange thing about the U disk, one day I want to take some files on my computer with me. I first looked at the file size of a total of 3.8GB, so I found a 4G USB flash drive. This should be easy to save. So I inserted a USB flash drive to start copying files, the result, pop up a dialog box, said the space is insufficient. I am obviously a 4G u disk, the results of the system said the available size of a total of only 3.72GB, can not save my 3.8G file. What the hell is going on here?
So I just click on the right button to see the properties of the U disk, it does show that it is 3.72GB. Here (inside the red rectangle) The system also counts the total number of bytes for this USB drive, and then calculates the number of bytes that the 4GB should be. So the computer learned that the so-called 32-bit CPU can access 4Gbyte (bit) memory space. This means that a 32-bit signal can produce a total of 2 32-time addresses, and you can access 2 of the 32 bytes at a time. Therefore, 4G byte is equal to 2 of the 32 square byte, also equivalent to 4 times 1024 of the 3, the total should be Chise bytes, and this U disk for me a full Chice byte, this is not too obvious jerry-building it? So I complained to the manufacturer, saying that you gave me so much less stuff?
We originally bought a 4GB u disk, you are also labeled 4GB. Why is it actually only 3.72GB? Did not expect, people slowly told me a big reason, said we this is 4GB. That's the way it is. Of course you see this 4,001,333,248 byte is not wrong, but our calculation method is this, the 4,001,333,248 bytes is approximately equal to 4 times 1000 3 times, this is 4GB. In fact, we have sent you more distances bytes, you take the cheap instead of complaining about our jerry-building, and what is the reason? I can't give up this easily, the computer should use 1024 as the base. How can you be 1000 as a base? So, you should give me 4 times 1024 of the 3, this is a 4GB u disk. Otherwise the so-called 32-bit address can access 4GB of storage space wouldn't it be a joke? So we both uncompromising, who can not persuade who.
Although the story is fictional. But the controversy is real, so take a look at it from the beginning.
Just mentioned in 4GB, where B, that is, byte is a unit of data, and G is the prefix of this unit.
For example, we often use the length of 1km is one kilometer, or called 1-kilometer. It is equivalent to 1000m,m is the meter, which is the unit of length, and K is a unit prefix used to refer to 1000. So similarly, 1kg is 1 kilograms. We also often have such unit prefixes in the knowledge of computers we learn. For example, we introduce the cache capacity, we would say it is 32KB, which equals 32 times 1024. Here K refers to 2 of the 10 parties, while M, which is what we normally call trillion, refers to 2 of 20, while G refers to 2 of the 30-th square. Therefore, we say that a memory is 4GB, that is, it has 4 times 1024 of the three of the square so many bytes. But according to the manufacturer of the U-disk just now, the 4GB U-disk means 4 times 1000 of the three bytes. So, at least in terms of market capitalisation, 4GB of U disk and 4GB of memory, although they use the same capacity tag, but actually their real capacity is not the same. In addition, if you check the capacity of the hard disk in the same way, you will also find that the capacity of the hard disk does not seem to be as much as it is nominally. This is the same reason.
We check the properties of the hard disk in the computer system, we will certainly find it less than 1T, then what is the contradiction in the end? Who is right and who is wrong? In addition to the storage capacity, there are some other places, but also the use of these prefixes, they actually express what meaning? To determine the meaning of these unit prefixes, we have to start with the international authorities.
The first one is the unit of temperature, Kelvin, denoted by K. The second is the unit of time, the second, expressed in S. The third one is the length of the unit, M, expressed in M. The fourth one is the unit of mass, kilogram, expressed in kg. Here we have to note that in fact, Grams is also a unit, and thousand is a unit prefix. There are also a few other units that we will not explain.
Then we look at the international unit of units prefix.
Just now we have mentioned the K prefix, which represents 1000, that is, 10 of the three-time side. Because 1000 of this quantity is not big, people often encounter in daily life. So, this prefix has been determined very early. What we should note is that this k is lowercase.
Of course, with the development and progress of society, the number of people need to record and calculate more and more, this also need to have a new unit prefix. Larger than K is M, which is equivalent to 1000 squared. The larger level is G, which is equivalent to 1000 of the three-time square. The higher one is T, which is 1000 of the four-time square. This was determined in 1960. That is to say, in that era, the level of the prefix of the unit is basically enough.
Of course, when these prefixes are not enough, we have to add new.
In 75, p and E were added, representing 1000 of the 5-and 6-time parties. By the Year 91, Z and y have been added, representing 1000 of the 7-and 8-time parties. This is the current largest unit prefix.
Then there are big and small. When we want to express a smaller number, we need to have a prefix in another direction.
For example, M is 1000 minus 1 times, or 1 per thousand. MM is our usual millimeter, and MS is milliseconds. These are also the areas that people can perceive directly, so they are determined very early.
Later in 60, the micro-prefix was determined, which is called "micro" in Chinese. Corresponding to the micron, microseconds, micrograms and so on, it is a Greek letter μ to express, of course, in the case of handwriting, there is no problem. And if the computer to input, then there will be some difficulties. If the conditions allow, we should use the insertion of special characters, such as the correct input μ this letter, and only if it is not possible to enter the case, you can also use the English letter "U" instead.
In the same year, it specifies the prefix of n, which is "NA". Now the IC design is on the scale of Nano, and the clock frequency of 1G hertz corresponds to the clock period, that is nanosecond.
The prefix of a smaller level than N is P, which is translated as "skin" in Chinese. The delay of a logic gate consisting of transistors is now in the picosecond order.
Then again, in 64, the two unit prefixes F and a were set. is 1000 negative 5 times and 1000 negative 6 times respectively.
In another 91 years, Z and y were added. is 1000 negative 7 times and 1000 negative 8 times respectively.
These are now internationally recognized units and unit prefixes.
While the use of the computer field is different, the internal memory does not comply with the requirements of the International unit of measure, while the capacity of the external memory tag is followed by the standard of the International unit of units. From this point of view, it seems that this markup method of external memory is more reasonable. Why does the internal memory take 1024 for the bottom? The reason is also very clear. Just now we have explained that, because the calculator internal to take the binary count, in fact, the main thing is that the CPU of the operator using binary computing way, for example, 15-bit address just can represent 2 of the 15-square so many bytes, Each of these 15-bit address lines can represent exactly one byte in the SRAM, so you should naturally use 1024 as the base for the calculation.
For external memory, it is far from the CPU, unlike cache and memory, which is directly operated by the CPU. Therefore, they do not need to use the 1024-bottom calculation method.
Some other parameters, such as data transmission rate, clock frequency, although also used inside the computer, but it and the address width just mentioned there is no direct connection, and all just say in a unit of time to complete how many things. For example, the transmission rate of Ethernet 100Mbps refers to the transmission of 100 megabytes per second. So, the trillion point here is 1000 of the two-time side. The CPU's main frequency corresponds to how many times the clock's signal is flipped every second, and 3G Hertz means 3 billion clock cycles per second.
Therefore, we can see that most of the unit prefixes in the computer are in decimal form and conform to the requirements of the international SI units. It is reasonable to use the binary form only when calculating the internal memory capacity. The only problem, however, is that only the 1024-base prefix is used, with the same letters as the International unit of units. There are some official arguments about the use of these unit prefixes.
The National Institute of Standards and the Association of Electrical and Electronic Engineers, in 1968, had standards. With regard to K, it gives two definitions, one is the same as the international unit of units, refers to 1000, and the second, which in particular shows that if it is used to describe the capacity of computer storage, then this prefix can represent 2 of the 10-time side is 1024. Similarly, M, there are also two definitions.
In reality, however, they are still fragmentation and are not implemented in accordance with their provisions. Also according to the memory set, external memory set, each said the words.
As a result, the IEEE Standards Committee also issued a statement through the American National Standards and technology researcher. Presumably, the IEEE standard will use the universally accepted definition of the international unit of measure prefix for the status quo. So mega, which is what we call a trillion, that means 1 million, no longer has 2 of the 20-time square such another definition. Of course, it is also said that if it can be clearly stated that it is based on 2, it can also be treated as a separate case until there is a new standard specifically for binary unit prefixes.
Now the standard of this unit prefix has been developed, by the ISO and IEC of the International Electrotechnical Commission. For example, Ki refers to 1024, while MI means 1024 squared, GI means 1024 three, and so on. Therefore, the hard disk that is now marked as 500GB, if it is to correspond to the storage capacity marked by the internal memory of the computer, should be 466GiB; we now often say that the memory labeled 512MB, if you want to not cause confusion, you should mark the 512MiB.
Under the influence of this set of standards, there is no longer a problem of confusion.
The standard is now available, but how it's done is another matter. The current CPU and memory vendors do not seem to have much power to change the way the original storage capacity is labeled. But for us, we already know what's going on inside the truth. At least, it's not going to confuse us.
8.7 Calculation of storage capacity