Skip to main content
GameDev.net gamedev.net
🔒 Locked

Size of KB and MB

Started by Gink Jun 14, 2005 at 1:09 AM 25 replies 4.5k views
Original Post
Gink
Gink
Where did this number come from? What calculation can you use to show the size of a KB and a MB
Gink
Gink
why did they pick those numbers? I was looking for some type of binary calculations that explained why 1024
Zahlman
Zahlman
2^10 == 1024 =~ 1000 (thus it is used as an approximate thousand, since powers of 2 are easier to work with in general in the hardware).
cignox1
cignox1
1024 is 2^10 (2 to the power of 10, that is).
The common steps in our life is x10 (think to km, kg, or hg, always x10 or x0.1) but these is simple with a base 10 nuemeric system. With the base 2 of computers, it happens that power of two nearest to a power of 10 is 1024 (2^10) and so they took this number as the common way to make higher orders size easier to understand.
I hope you undertood me, because I'm tired and I explained it very bad.
iMalc
iMalc
Quote:
Original post by Anonymous Poster
I belive that harddrive manufactors use the *real* meaning of K and M, Kilo=10^3 and Mega=10^6.

While it is more natural to approx. K to 2^10 and M to 2^20.

/skanatic
True, although ironically what I see as one of the main reasons for using 1024 is that it's related to the size of a disk sector.

Hmm, that's the second annonymous poster I've seen today that attempts to be not-so-anonymous. Why not register? You've got nothing to lose!
Matthew Doucette
Matthew Doucette
Although most computer people do not use it, kilo = 1,000 not 1,024 and mega = 1,000,000 not 1,048,576, etc. It's long been the standard. I.e., kilometer = 1,000 meters.

Check out this page for more details:
http://en.wikipedia.org/wiki/Binary_prefix

...after reading wikipedia...

So, 1,000,000 bytes is not a megabyte, it's a mebibyte! :)

[EDIT: Correction. This is wrong. I wrote it backwards by mistake. 1,000,000 bytes IS a megabyte, NOT a mebibyte.]


Some good parts concerning hard drive and floppy drive standards:

"Hard disk drive manufacturers state capacity in decimal units, so what is advertised as a "30 GB" hard drive will hold 30 × 10^9 bytes, roughly equal to 28×2^30 bytes (i.e. 28 GiB). This usage has a long engineering tradition, and was probably not influenced by marketing. It arose because nothing about the physical structure of the disk drives makes power-of-two capacities natural: the number of platters, tracks and sectors per track are all continuously variable (though the size of an individual sector is half a binary kilobyte)."

"Some disk storage measurements — such as floppy disks — use an even more confusing hybrid system. Disk media are accessed by the sector, not the individual byte. Sectors are intended for direct transfer to RAM, which comes in powers of two, so sector size itself is almost always a power of two. Sector size may range from 512 bytes (floppy disks) to 2048 bytes (DVDs). A thousand binary-"kilobyte" sectors creates a 1,024,000-byte "megabyte". Thus a "1.44 MB" floppy holds neither 1.44 × 2^20 bytes nor 1.44 × 10^6 bytes, but rather 1.44 × 1000 × 1024 bytes (approximately 1.406 MiB, or 1.475 MB)."

[Edited by - Matthew Doucette on June 14, 2005 10:14:47 PM]
Matthew Doucette, Xona Games
valles
valles
I used to create sprites on the commodore 64, the pixel locations worked like a grid starting at 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, it's all 2 to the power of X.
Boder
Boder
Quote:
Original post by Matthew Doucette

So, 1,000,000 bytes is not a megabyte, it's a mebibyte! :)


Actually, I think it's not that way under the IEC standard prefixes.

1,048,576 bytes is not a megabyte, it's a mebibyte! :)
1,000,000 is the proper megabyte.



Boder's Website: Games and Guinea Pigs
Alpha_ProgDes
Alpha_ProgDes
Quote:
Original post by Boder
Quote:
Original post by Matthew Doucette

So, 1,000,000 bytes is not a megabyte, it's a mebibyte! :)


Actually, I think it's not that way under the IEC standard prefixes.

1,048,576 bytes is not a megabyte, it's a mebibyte! :)
1,000,000 is the proper megabyte.



Boder's Website: Games and Guinea Pigs

there's nothing proper about it [flaming]


[grin]

Beginner in Game Development?  Read here. And read here.  
Daniel Miller
Daniel Miller
I thought lower case (k, m, or b) meant somethingbit, instead of somethingbyte.
ApochPiQ
ApochPiQ
Nope, Degra is correct - generally, a lower case order-of-magnitude specifier (k, m, etc.) is used to indicate a power of 1000 rather than a power of 2. A lower case b is used to indicate bits, and an uppercase B is used to indicate bytes. A common example of this is bandwidth descriptions: 1Mb/s bandwidth vs. 128KB/s actual transfer speed.
Ghwerig
Ghwerig
Except that m=0.001 (milli) is standard notation...
Erzengeldeslichtes
Erzengeldeslichtes
Quote:
Original post by Ghwerig
Except that m=0.001 (milli) is standard notation...


It's a bit hard to have a millibyte, so it shouldn't be confusing.

----Erzengel des Lichtes光の大天使Archangel of LightEverything has a use. You must know that use, and when to properly use the effects.♀≈♂?
SirLuthor
SirLuthor
Quote:
Original post by Erzengeldeslichtes
Quote:
Original post by Ghwerig
Except that m=0.001 (milli) is standard notation...


It's a bit hard to have a millibyte, so it shouldn't be confusing.

Quoted for truth! Touché [grin]
Free speech for the living, dead men tell no tales,Your laughing finger will never point again...Omerta!Sing for me now!
JohnBolton
JohnBolton
Quote:
Original post by Degra
MS Windows uses this format:
k = 1,000
K = 1,024

m = 1,000,000
M = 1,048,576


Is this just something you heard somewhere or is there actually some MS documentation somewhere that states this?
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
Matthew Doucette
Matthew Doucette
Quote:
Original post by Boder
Quote:
Original post by Matthew Doucette

So, 1,000,000 bytes is not a megabyte, it's a mebibyte! :)


Actually, I think it's not that way under the IEC standard prefixes.

1,048,576 bytes is not a megabyte, it's a mebibyte! :)
1,000,000 is the proper megabyte.


Oops. I just wrote it backwards by accident. What you said was exactly what I meant to say! Thanks for clearing up my mistake, Boder! I will go modify my original post.
Matthew Doucette, Xona Games
Telastyn
Telastyn
Quote:
Original post by iMalc

Hmm, that's the second annonymous poster I've seen today that attempts to be not-so-anonymous. Why not register? You've got nothing to lose!


I put off registering for quite a while due to GDNet's Terms of Use.

In specific:
-that anything I post here, code inclusive, was theirs to do with as they please.
-that I agree to pay them promptly any charges, which they may declare at their convinience.

In the end, I noted that I was perhaps just being paranoid. Still, legal issues like that can get messy if you're not careful. I imagine I'll post far far less should I ever begin to write code for anyone more than myself.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.