Gigabyte or Gibibyte (1000 or 1024)?
Asked Answered
B

3

13

This may be a duplicate and I apologies if that is so but I really want a definitive answer as that seems to change depending upon where I look.

Is it acceptable to say that a gigabyte is 1024 megabytes or should it be said that it is 1000 megabytes? I am taking computer science at GCSE and a typical exam question could be how many bytes in a kilobyte and I believe the exam board, AQA, has the answer for such a question as 1024 not 1000. How is this? Are both correct? Which one should I go with?

Thanks in advance- this has got me rather bamboozled!

Bon answered 3/12, 2016 at 15:4 Comment(2)
So what is the source of the confusion and why do some people and even companies use 1024 bytes in a kilobyte rather than 1000?Bon
Matt: Because 2^10 = 1024.Workaday
S
17

The sad fact is that it depends on who you ask. But computer terminology is slowly being aligned with normal terminology, in which kilo is 103 (1,000), mega is 106 (1,000,000), and giga is 109 (1,000,000,000).

This is reflected in the International System of Quantities and the International Electrotechnical Commission, which define gigabyte as 109 and use gibibyte for the computer-specific 1024 x 1024 x 1024 value.

The reason it "depends who you ask," is that for many years, specifically in relation to "bytes" of storage, the prefixes kilo, mega, and giga meant 1024, 10242, and 10243. But that flies in the face of normal convention with regard to these prefixes. So again, computer terminology is being aligned with non-computer terminology.

Streamer answered 3/12, 2016 at 15:11 Comment(3)
So you believe I should use 1000 as the correct answer?Bon
@Matt: That's the right answer according to the ISQ and IEC. Greyhairs like me may not like it, but there it is. :-)Streamer
Thanks- I think to be sure I will write down in any such exam question why it is 1000 in case the mark scheme has it down as 1024.Bon
D
9

The term gigabyte is commonly used to mean either 10003 bytes or 10243 bytes depending on the context. Disk manufacturers prefer the decimal term while memory manufacturers use the binary.

Decimal definition

  • 1 GB = 1,000,000,000 bytes (= 10003 B = 109 B)

Based on powers of 10, this definition uses the prefix as defined in the International System of Units (SI). This is the recommended definition by the International Electrotechnical Commission (IEC). This definition is used in networking contexts and most storage media, particularly hard drives, flash-based storage, and DVDs, and is also consistent with the other uses of the SI prefix in computing, such as CPU clock speeds or measures of performance.

Binary definition

  • 1 GiB = 1,073,741,824 bytes (= 10243 B = 230 B).

The binary definition uses powers of the base 2, as is the architectural principle of binary computers. This usage is widely promulgated by some operating systems, such as Microsoft Windows in reference to computer memory (e.g., RAM). This definition is synonymous with the unambiguous unit gibibyte.

The difference between units based on decimal and binary prefixes increases as a semi-logarithmic (linear-log) function—for example, the decimal kilobyte value is nearly 98% of the kibibyte, a megabyte is under 96% of a mebibyte, and a gigabyte is just over 93% of a gibibyte value. This means that a 300 GB (279 GiB) hard disk might be indicated variously as 300 GB, 279 GB or 279 GiB, depending on the operating system.

The Wikipedia article https://en.wikipedia.org/wiki/Gigabyte has a good writeup of the confusion surrounding the usage of the term

Debris answered 3/12, 2016 at 15:9 Comment(1)
Okay so a hard drive with 1TB will typically have 1000GB, a stick of RAM with 1GB will typically actually have 1GiB so 1024 bytes and a hard drive when displayed by Microsoft to have 500GB will actually have 500 GiB just because Microsoft for some reason use the wrong measurement. Is that correct?Bon
S
2

MB (MegaByte) was 1,048,576 bytes

Historically, Disk/Memory were manufactured based on powers of 2. Disk sectors were often 2^9 = 512 bytes, and 1K was 2^10 = 1024 bytes, and a megabyte was:

1K * 1024 = 1024MB = 1024 x 1024 = 1,048,576 bytes

(where 1K = 1024 bytes).

Disk drives were marketed using Megabytes, so to get to 1 Gigabyte (1 GB), you would get take

1MB * 1024 = 1024MB  (same as 2^30 = 1,073,741,824)

NOTE: Later this will be called 1 GiB.

Why 1024? Because the relationship was with the power of 2s. (Quora reference):

1byte = 8bits (2^3)
1KB = 1024 bytes (2^10)
1MB = 1024KB (2^20)
1GB = 1024MB (2^30)

So

2^10 MiB === 2^10 x 1,048,576 bytes === 1,073,741,824 bytes (or 1 GiB)

In summary:

1 MB = 1,000,000 bytes
1 MiB = 1,048,576 bytes (2^20)
1 GB = 1,000,000,000 bytes
1 GiB = 2^30 = 1,073,741,824 bytes (same as 2^10 MiB)

Megabyte is now 1,000,000 bytes

So why do people call a MB (Megabyte) 1,000,000 bytes?

The term MB changed it's definition when some operating systems reported data sizes calling Mega bytes as 1,000,000 bytes which is different than what the disk manufacturers were calling Megabytes. For a variety of reasons, the industry standardized on Megabyte (MB) being 10^6 or 1,000,000 bytes, not 2^20 bytes.

Later, some group wanted a term to refer to a disk sizes using disk megabytes (my made up term) and they had to come up with a new term. The new term was MiB (mebibyte) was created to represent a megabyte being 1024 * 1024 bytes.

Mebibyte = 2^20 = 1024 x 1024 = 1,048,576 bytes

So now you ask: Gigabyte or Gibibyte (1000 or 1024)? The selected answer provides a good answer: The sad fact is that it depends on who you ask

This answer, hopefully, helps explain why the answer depends. If you ask someone who is 20, the answer is clear. If you ask someone who is a disk technology expert, the answer may be different because of the history I explained above.

References

Data Sizes          Kilobytes       Megabytes   Gigabytes       Terabytes
How many in a Byte? 0.001 KB        0.000001 MB 0.000000001 GB  0.000000000001 TB
How many in an KB?  1 KB            0.001 MB    0.000001 GB     0.000000001 TB
How many in an MB?  1000 KB         1 MB        0.001 GB        0.000001 TB
How many in a GB?   1000000 KB      1000 MB     1 GB            0.001 TB
How many in a TB?   1000000000 KB   1000000 MB  1000 GB         1 TB

This table clearly has megabytes in terms of 10 to the power of something. So 10^6 = 1,000,000.

Suter answered 27/7, 2023 at 23:35 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.