hit counter code

Tuesday, August 19, 2008

1's & 0's: Note and the first part

NOTE: I pondered which article to write and post first. I want to do one on hard drive storage, one on digital cameras and storage, and others. However, I realized that they all come down to a basic understanding of how computers store information. If you understand that other posts will make a lot more sense. I will put this in plain language but follow along closely—no dozing off! :-)

If you get lost or your eyes start to “glaze over” in this post PLEASE leave a comment or send an email so that I will know! If you are bored at the prospect of reading on, please wait for the future posts on storage in which I will link back to this “base understanding” post. I'm sure I will reference this post often.

This post will be broken up into sub-sections for easier clickability and reading. Enjoy!

=============================================

You may have heard that all a computer “understands” or stores is 1's and 0's. Yup, that's right, all a computer knows or stores is an “on” or an “off”, an electromagnetic charge or discharge, like a light that is on or off. This true/ false or 1/ 0 or on/ off is also called binary, “bi” meaning two or it can be one of two things-- a 1 or a 0.

So what's a 1 or a 0 got to do with storage? Well, let's look at how the characters I am typing and that you are reading on this blog are stored, in their most basic sense, on a computer system. We need to understand how the letter “A” gets stored as 1's and 0's.

1's & 0's: ASCII Tables

First you need to know that all letters and characters are converted to a number. One of these easy to understand number conventions is called the ASCII (say “Ask Key or Ask Key Two”). This standard dates back to the early 1960's as a conventional way of storing the English alphabet and stands for American Standard Code for Information Interchange, or ASCII. There are other formats out there, but for our discussion we'll stick with this one.

So, according to the ASCII standard, the letter “A” gets the decimal (number) value of 65. Why you ask? I don't know, that's just the way it has been for many years. The letter “B” is 66, and so forth. You can view a table here or look up ASCII on Wikipedia if you are really inquisitive and want to read more.

So, how does a computer store the number 65 that represents and ASCII letter “A”? To understand that we need to explore how 0's and 1's can represent any number. This gets a little interesting, but if you follow it you'll know the answer to the question of why a computer “sees” Kilobyte (K) of memory, for example, is 1024 bytes and NOT 1000 bytes.


1's & 0's: Base-2 numbers

A zero and a one gives you two options or base-2, as the mathematicians would say. I'm not a mathematician, and I never did enjoy calculus. Basically it means instead of counting from 1 to 10 as we do in our base-10 number system we all know, computers only have two numbers (0 and 1) NOT ten numbers (0,1,2,3,4,5,6,7,8,and 9) as we know it. OK, so a base-2 you go 0,1 then 0,1 then 0,1, exciting, right? My eyes are glossing over and I'm starting to drift off to sleep! How in the blazes do you store a 65 when all you can do is go 0,1 0,1, 0 or 1?

Well, let's line each of those zeros or ones up and give them a base-2 value. In our current base-10 numbering system if I have a 1 it is 10 to the 0 power or 10^0 = 1 . If I add a zero behind it I have 10 to the 1st power or 10 (10^1 = 10). Add another zero and I have 10 to the 10th power or 100 (10^10 = 100). You get the idea. I other words 001 is (10^0 = 1) and 010 is (10^1 = 10) and so forth. Each movement to the left represents another 10 to the power of or 10-based value. Have I confused you yet?

Well, in a base-2 world if I have a 1 it is now 2^0 or 1 as well. But the next placement over of 10 the “1” actually represents 2^1 = 2. (two to the first power exponentially) Therefore 100 is “100” in base-10 but in computer land of 0's and 1's in base-2 the 100 actually is broken down to 2^2 = 4. Here's a little representation of the decimal places that could represent any number from zero to 255.

1 1 1 1 1 1 1 1
(2^7=128) + (2^6=64) + (2^5=32) + (2^4=16) + (2^3=8) + (2^2=4) + (2^1=2) + (2^0=1) = 255

Whew, that's heavy! It might take a little review, but this concept of base-2 numbers is everywhere in the world of electronics today. Basically if you see a 1 you figure out what exponential position it is in (2^? power) and then add them together. If you see a zero or “off” you ignore it.

So, 0000001 is 1, 00000010 equals 2, and so forth. As shown above 11111111 is equal to 255. Given this, [Quiz time!] what would 00100100 be? If you said 36 (32 + 4) you are right!

1's & 0's: Base-2 and bytes- How characters are stored

You may have noticed a pattern now that looks strangely familiar in the world of electronics. Specifically if you have ever purchased a memory card for your camera or RAM (Random Access Memory) for your computer you have noticed that it comes in these strange base-2 numbers like 128K, 256MB, 512, or even 1024K of RAM.

Ah, but what does all of that mean? Interestingly enough when you count by base-2 or 2^7 you will notice you get these “funky” numbers like 128 or that 2^10 is actually 1024. Hold that thought for just a moment.

Given the background you know have you know that our letter “A” represented by the decimal “65” or by 01000001 in binary zero's and ones' stores this one character. Well one character is typically a byte or eight bits. A bit is simply a zero or a one and a byte (8 bits) can then represent any number from 0 to 255 as we have seen above.

So, each character of this long post is represented in the computer as a byte—a number from 0 to 255 that corresponds to a character in the ASCII (say “Ask Key two”) table. If I put the word “word” in the computer it is represented by four bytes. You'd say the document (if strictly ASCII text with no formatting) would then take up 4 bytes of space.


1's & 0's: Cool sounding Mega-prefixes

So what if you type a few paragraphs and it is over a thousand characters or bytes? Well, since the computer stores bytes as 2 to the ? Power when we reach 2^10 (1024) it is called a Kilobyte. Why Kilo? Well, in the metric system Kilo means 1,000 if I remember correctly.
Now, we come down to the age-old computer question of WHY is a Kilobyte (K) 1024 bytes and not 1000 bytes? Well, according to the metric 'purists' I'll call them 1000 is truly a Kilobyte. In a perfect world of base-10 I suppose it is a great metrics name, Kilobyte, Kilo meaning a thousand. But wait, we're not in a perfect base-10 world, we're in a computer realm of base-2, remember?

So, as we represented succeeding numbers with each 1 being a power of 2 or 2^10 we found it equals 1024, NOT 1,000. Therefore, computers see a Kilobyte or K as 1024 not 1000. Does that make sense? Say yes! :-)

Here's the “cool sounding” prefixes that will dazzle your friends at the water cooler. A thousand (1024 really) is a K or Kilobyte. What if you have 1024K or 1024 Kilobytes? Well, then you could say it is 1024K or you could go to the next level and say it is a Megabyte or MB for short. Here's a list of all of these.

1024 bytes or 1024^1 = 1K (Kilobyte)
1024K or 1024^2 bytes = 1Mb (Megabyte)
1024Mb or 1024^3 bytes = 1Gb (Gigabyte)
1024Gb or 1024^4 bytes = 1Tb (Terabyte)

Note that there are hard drives that have 1 terabyte of storage today. Also note that when you get into hard drives they use 1000 not 1024 but that is a discussion for another day. Perhaps my chart above should be in 1000 not 1024 as Kilo theoretically means 1000 (base 10) not 1024 (base 2). The important thing is to remember that the prefixes in order are:

Kilo, Mega, Giga, Tera, Peta, Exa, Zetta, Yotta.

Why the standard goes from zetta back to “Y” in yottabyte I have no idea. About ten years ago I heard that Boeing corporation had an Exabyte network for storing streaming video in the Seattle area. A more recent article predicts that by 2013 all of the hard drives combined shipping to all the customers in the world will equal a yottabyte a year. Interesting.

1's & 0's: Summary and the END

Since there is no time to "splain" let me sum-up. A computer stores information in on or off, zeros or ones. This is called binary as there are only two options. This means that numbers are stored in base-2. To store the letter “A” we go to the ASCII table and see that A is given a decimal value of “65” which is then stored in binary as 01000001.

When you get 2^10 characters together or 1024 characters it is known as a K or kilobyte of storage. In order the higher prefixes are Mega, Giga, Tera, Peta, Exa, Zetta, and Yotta. Today we have terabyte home disk drives available and a single yottabyte device is still theoretical.

Now, go amaze your friends with your new-found knowledge and amaze the salesperson at the electronics store by knowing that a terabyte is a thousand (1024) gigabytes!

Thursday, August 14, 2008

Welcome and Purpose

Welcome to my new tech blog! The purpose of this blog is to make you, as a technology consumer a little more informed. I hope I can answer some common questions that I often get from my family and friends about computers and electronics. Questions such as Aunt Matilda's burning questions about burning DVD's or Uncle George's questions of what a VOIP is.

Maybe you have had questions about gigabytes, megapixels, or other wacky terms used these days. Maybe you've wondered about the best storage options for your photos and videos or perhaps just what is new in the world of technology these days. I hope to use plain-language and describe many items and new questions as they come up.

This blog is something I've always wanted to do, and now is the time for me to do it. I'll provide my two-cents-worth and opinion based on my years of experience and knowledge. Come along for the ride, join in the discussion, leave your comments! You too can be part of my extended online family asking those questions and I'll do my best to put it in no-nonsense plain-language terms for you to understand.

I have always been known as the "computer geek" of the family. I always seem to get the questions of "how does this work Blaine?" or "Can you come fix my computer?" or "What would you buy?" from my family. These questions have led me to write many articles in my mind for some time now. I am looking forward to getting these down on electronic paper on this blog and I hope they will benefit you.

-Blaine

p.s. I'm doing this mostly for fun and for your information (well remember free advice is worth what you pay for it) but along the way if I can generate some revenue for myself that would be "icing on the cake" as well. Therefore you'll find some ads on this site and you will eventually find some cases where I might provide a link to sign up for a product I have used and love and I might get a small cut if you do sign up. I'm not out to make money (I'll keep my day job thanks) I'll only do it for a few products I am very happy with.

About Me

Here's a little bit about me:

I grew up loving computers. Years ago I went to my local public library (I must have been about 10 years old?) and got a book on computers. I quickly devoured the college text on bits, bytes, and even nibbles. A lot of it went over my head, but a lot of what I learned I still remember today.

I went in with some friends to purchase my first computer, a Commodore Vic20, and three of us shared it in a garage. I started playing games and programming that Vic20 until it ran out of the 5K of RAM it had. We saved and loaded programs on a tape drive. I moved on to a Commodore 64, and then to an IBM in high school.

While in high school I had a short 'career' writing articles for a local computer user group. I remember well the thrill of writing my first article and transmitting it across town to the computer store using a blazing fast 300 baud modem! Those were the days. I worked in college with PCs and a Mac on rare occasion and eventually graduated with a degree in Information Systems. Nowadays I earn a living in the technology field as a programmer supporting automation for software test engineers.

I have always had an interest in technology. I like hardware and newer, faster machines and hardware. I've built systems from scratch and know the basics of what's out there today in the market. Maybe not the latest or the coolest gaming system (I'm not a gamer) but I do seem to know what gets the job done for home use.

I also have an interest in digital photography and video making. I enjoy making home movies and preserving memories for my family. It takes a long time to produce a good-quality home movie DVD, I have not done as much of this lately.

That's about it about me. I think you'll agree it qualifies me to write about a variety of basic technological items and again my purpose is to inform you and answer your questions and to make you smarter about technology.