Wednesday, March 11, 2009

bits for blondes

when i have nothing better to write about, i'll write a little explanation of something from computers / programming. i know a lot of sites try to simplify programming (like programming for dummies) but i don't think any do a good job for a lay person.
i entitled this bits for blondes because (a) it's alliterative which makes me seem clever (b) blonde people often get confused. i say this semi tongue in cheek, but i wonder if there there is any real statistical research on the cognitive abilities of blondes. and i don't mean only girls, i know lots of blonde guys who think a "bit" is a horse's mouthpiece (they happen to be right - why are blonde guys rich horse riders and/or surfers - is it causation?).

and of course, there are plenty of exceptions. Marissa Mayer was in a lot of my comp sci classes at Stanford (more on her in later posts).

now that all the disclaimers out of the way, here's the first lesson. what is a "bit"?

a bit is an on/off switch. either the bit is turned on (or thought to be "1") or it is turned off (in "0" position). and that's all a bit is.

"wait?" you say... "you've used a computer and it does not resemble an on/off switch?", well, in reality, a computer is just millions of on/off switches.

when the bit is turned on ("1"), it allows electricity to flow through, when off ("0"), it does not. the sequence of on/off switches allows your computer to do everything. a "byte" is just a convention meaning 8 bits together. it's an arbitrary designation, stemming from when computers could only examine whether 8 switches were turned on/off at a time. computers these days can read billions of bits at a time.

think of the digital picture you took with your camera. let's say you save your picture on your hard drive and the size sapicture you took is 4 megabytes. that means your picture is 4 x 8 bits per byte x 1,000,000 = 32 million switches to determine what your pictures looks like. change one of those bits and your picture is ever so slightly different (maybe a tiny part goes from blue to a different shade of blue that to a human looks exactly the same). you'd probably have to change thousands of bits before your picture looked any different to you.

so now think of your hard drive with 500 gigaabytes on it. that's 500 x 8 x 1,000,000,000 bits = 4 quadrillion switches to store your data. the blonde in you thinks, "there's no way there's 4 quadrillion tiny on/off switches in my computer." but, i assure you, there is. that's why if you unplug your computer and there's no power and you turn it back on, all your data is still there. because the switches don't change. they are physically either on or off. and it's why to really erase your data, you have to do some seriously crazy things. spill a giant glass of wine on your hard drive... guess what, you're in luck, the switches stay where they are. magnets? hah! silicon (what those switches are made of) are non metallic. in order to have a magnet effect your hard drive, you'd need a magnet "powerful enough to suck the iron out of your blood cells".

so dear blondes, that's a bit. rest assured, there is nothing you could do by accident to make your hard drive unreadable, but you might do something that could make reading that hard drive prohibitively expensive. so pour that chardonnay into your mouth, not onto your friend's macbook air.

No comments:

Post a Comment