Home » Community » Forums » General Programming » Size of KB and MB
  Intel sponsors gamedev.net search:   
[Control Panel] [Register] [Bookmarks] [Who's Online] [Active Topics] [Stats] [FAQ] [Search]

Add Forum to Favorites |  Send Topic To a Friend | View Forum FAQ | Track this topic

Page:   1 2 »»

 Last Thread Next Thread 
 Size of KB and MB
Post New Topic  Post Reply 
Where did this number come from? What calculation can you use to show the size of a KB and a MB

 User Rating: 930   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

byte = 8 bits
KB = 1024 bytes
MB = 1024 KB
GB = 1024 MB

 User Rating: 1750   |  Rate This User  Send Private MessageView ProfileView Journal Report this Post to a Moderator | Link

why did they pick those numbers? I was looking for some type of binary calculations that explained why 1024

 User Rating: 930   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

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).



As a general rule, if you post in For Beginners and your code contains the word 'char', you have a bug. std::string roxors teh big one one one one.
"OMG! I'm so happy! I have "1 Friends"!!!" -- coldacid
"Basically whenever you invoke the dread ellipses construct you leave the happy world of type safety." -- SiCrane
"I mean, if you had sex for every time O'Reilly used the word Patriotism you'd be almost as awesome as Chuck Norris." -- tthibault

<triforce101> uh im not a noob i finished the game

 User Rating: 1992   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

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

 User Rating: 1015    Report this Post to a Moderator | Link

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.

 User Rating: 1365   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

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!

 User Rating: 1714   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

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
...our upcoming dual play Xbox 360 2D shooter: Duality ZF
Duality ZF (April 2009 Trailer): youtube.com/watch?v=7TkG6J2CWvU

 User Rating: 1179   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

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.

-=www.redadept.com=-

 User Rating: 1033   |  Rate This User  Send Private MessageView ProfileView GD Showcase Entries Report this Post to a Moderator | Link

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

 User Rating: 1517   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

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






 User Rating: 1750   |  Rate This User  Send Private MessageView ProfileView Journal Report this Post to a Moderator | Link

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.


Yeah, but I've never seen the term "mebibyte" used outside of discussions like this. (Then again, I'm not "in the industry" where "the industry" is any industry that cares...)

 User Rating: 1015    Report this Post to a Moderator | Link

MS Windows uses this format:
k = 1,000
K = 1,024

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

A bit off topic but:
b = bit
B = byte (so 1B = 8b)

Degra

 User Rating: 1073   |  Rate This User  Send Private MessageView ProfileView GD Showcase Entries Report this Post to a Moderator | Link

I thought lower case (k, m, or b) meant somethingbit, instead of somethingbyte.

 User Rating: 1079   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

edit: double post

 User Rating: 1079   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

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.


Dirge of the Derelict
[Work - Egosoft] [Epoch Language] [Journal - Peek into my shattered mind]


 User Rating: 1955   |  Rate This User  Send Private MessageView ProfileView Journal Report this Post to a Moderator | Link

Except that m=0.001 (milli) is standard notation...

 User Rating: 1015   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

Quote:
Original post by Ghwerig
Except that m=0.001 (milli) is standard notation...


Yeah, in metric units, m is milli- (1e-3) and M is mega- (1e6). For example, mV (millivolt) is 0.001 V and MV (megavolt) is 1,000,000 V. You just have to watch context.

 User Rating: 1015    Report this Post to a Moderator | Link

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.



 User Rating: 1157   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

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é

 User Rating: 1176   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

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?

 User Rating: 1839   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

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
...our upcoming dual play Xbox 360 2D shooter: Duality ZF
Duality ZF (April 2009 Trailer): youtube.com/watch?v=7TkG6J2CWvU

 User Rating: 1179   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

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.


 User Rating: 1826   |  Rate This User  Send Private MessageView ProfileView Journal Report this Post to a Moderator | Link

Quote:
that anything I post here, code inclusive, was theirs to do with as they please.
Not so. It's just that you provide licence for them to display it publicly on their message board (or journals, or GDShowcase, or other areas of the site, etc). It prevents the (rediculious) situation where a user might post something on the message board and then get upset and sues GameDev.net for displaying (publishing) that post.


Quote:
that I agree to pay them promptly any charges, which they may declare at their convinience.
Not so either. You only have to make payments as provided under the terms of use (not just anything the owners just make up on the spot). This is only relevent to GDNet+ users (or anything else the owners make as a payment-based service).

In other words - they can't randomly bill you for things. Not that they would anyway.


Quote:
I imagine I'll post far far less should I ever begin to write code for anyone more than myself
Yes, there is a clause in there which basically says you are responsible for your posts. So if your employer sues GameDev.net for publishing trade secrets (that you posted) or whatever, then GameDev.net will point out that you agreed to the ToS and you will become the sue'd person.

This is standard legal practice, and goes hand-in-hand with licence-type agreements (see the first point for where you're giving GameDev.net a licence to your posts). You are responsible if you go licencing something that isn't yours to licence.


Don't worry. There's a few things in there that protect GameDev.net's ass, but there is nothing evil, folks .

 User Rating: 1841   |  Rate This User  Send Private MessageView ProfileView Journal Report this Post to a Moderator | Link

Oh, I understand why it's there but to me, admittedly a layman, in section 3d "otherwise use" is legalese for "do whatever with". Or at least vague enough to cause serious headaches should the absolute worst case scenario arise.

And I certainly don't expect any headaches. And I've never head of anyone ever having any problems with the site or staff, let alone have them escalate til the need for lawyers. Like I said; a little paranoid. Too many years in computer security :]

 User Rating: 1826   |  Rate This User  Send Private MessageView ProfileView Journal Report this Post to a Moderator | Link
Page:   1 2 »»
All times are ET (US)

Post Reply
 Last Thread Next Thread 
Forum Rules:
You may not post new threads
You may post replies
You may not edit your posts
You may not use HTML in your posts
Jump To:
Administrative Options: