DEV Community

Discussion on: BaseCS: Intro to Binary

Collapse
 
codemouse92 profile image
Jason C. McDonald • Edited

Fan screaming at the return of a favorite series.

Ahem.

Excellent explanation as always, Vaidehi. Just one technical note to add:

Some standards board dweebs redefined KB/MB/GB/TB to be strictly decimal; that is 1 TB = 1,000 GB = 1,000,000 MB = 1,000,000,000 KB = 1,000,000,000,000 The claim is that it's "easier" for users to understand this. The suspected reality is that it lets hard drive manufacturers effectively shortchange consumers. "2 TB hard drive! (except it's actually only 1.8, wink wink)".

Because of this, they've also defined the units KiB ("kibibytes"), MiB ("mibibytes"), GiB, TiB, and so on. Those still follow the normal rule of 1024.

Collapse
 
spqrbob profile image
Bob McCann • Edited

What a crock! The B in those abbreviations KB/MB/GB/TB stands for byte! As everyone who has worked with computing at this level knows, a byte is 8 bits long, and is capable of holding 256 different values. These values increase/decrease in powers of two, which represents the addition or subtraction of a bit to the existing bit count (check my math and call me on my errors):

<# of Bits> = <# of Values That Can Be Expressed>

4 bits = 16 (1 nibble [nybble], 0x, 1 unit of hexadecimal)
8 bits = 256 (1 byte, B, 1 character in ASCII)
10 bits = 1,024 (1 kilobit, KiB, 1 character in UTF-8 [1-4 bytes])
13 bits = 8,192 (1 kilobyte, KB)
20 bits = 1,048,576 (1 megabit, MiB)
23 bits = 8,388,608 (1 megabyte, MB)
30 bits = 1,073,741,824 (1 gigabit, GiB)
33 bits = 8,589,934,592 (1 gigabyte, GB)

And so on for terabyte (TB) and up the ladder we go....

To deny the powers of two in favor of the powers of ten should be an affront to everyone who deems themselves a computer scientist! The hard drive, thumb drive, SD/Micro SD card, etc. manufacturers have been printing the weasel words of the "powers of ten" valuation for their so-called top of the line products for years now. There is no need for some chucklehead sitting on some committee (that they should be immediately and unceremoniously ejected from) to actually enshine such tomfoolery as being some kind of actual standard. Please tell me exactly which standards board has gone public with such a "pickled hard-boiled egg fart" of a ruling so that I might write them a strongly-worded letter for which task I am singularly equipped!

I don't know when I became a grouchy old curmudgeon shaking my fist at those who would show such disdain for the fundamental truths that lie at the very foundations of our entire field of knowledge, yet here we are.

Bunch of young whippersnappers! Get offa my lawn!

Collapse
 
codemouse92 profile image
Jason C. McDonald • Edited

Indeed.

Waves his cane in disgust.

Kids these days.

Collapse
 
aaronmeza profile image
Aaron Meza • Edited

And kilo has a long-standing definition in science - it's the SI prefix that means to multiple by 1000. Yes, when you're working on the bit level it makes sense to think in powers of 2 (and I've done this, working on tar streams and file system drivers and whatnot where things sometimes don't align on byte boundaries).

As you said, the B means byte which is 8 bits. That still doesn't change the fact that kilo means 1000. Kibi means 1024. Kilobyte = 1000 bytes. Kibibyte = 1024 bytes. This isn't a new-fangled definition.

Thread Thread
 
codemouse92 profile image
Jason C. McDonald • Edited

While "Kilo-" does indeed mean 1000 in and of itself, "Kilobyte" has always meant 1024 until recently. Retroactive continuity amendments aside, since KB started out as meaning 1024, it should have persisted on meaning that.