Showing posts with label computing basics. Show all posts
Showing posts with label computing basics. Show all posts

Monday, January 7, 2013

Quantum Computing Primer - Understanding Bits and Bytes

I've been some reading on the next true evolution of computers, that being quantum computing.  In the current digital world all of the data, all of the application, everything we do with computers can be broken down in it's simplest at the "bit" level - that a bit being a two state "switch" that is either on or off.

Before I can continue to write about quantum computing and what it's implications and impact may be on our technology and lives, it is important to understand how computers work and store data now.  This will be the first in a series of articles which attempts to explain the fundamentals.  For many of you, these articles may not be as relevant as you already understand these fundamentals..


The bit - and the inherent on/off - is a fundamental tenet of our technology.  Each character that we type or read is comprised of 8 bits and it's referred to a more familiar term - the byte (and it's distant relations, megabytes and gigabytes - millions and billions of bytes respectively.  A byte is made of 8 bits, each of which is either on or off which gives us a possibility of up to 256 different combinations of the 8 bits within a given byte which can be demonstrated as below (with 0 representing a bit being off and 1 with the bit being on).




Bit #        0  1  2  3  4  5  6  7
Bit Value  128 64 32 16  8  4  2  1  Byte Value
             0  0  0  0  0  0  0  0  0
             0  0  0  0  0  0  0  1  1
             0  0  0  0  0  0  1  0  2
             0  0  0  0  0  0  1  1  3 (2 + 1)
             0  0  0  0  0  1  0  0  4 
             0  0  0  0  0  1  0  1  5 (4 + 1)
repeating the pattern up to the state where all bits are turned on as follows:
             1  1  1  1  1  1  1  1  255 (128+64+32+16+8+4+2+1) 

Each character that we see on the screen is one byte and each letter of the alphabet is assigned one particular byte value.  When we see the word "cat" on screen, it is represented by bytes with the following three values 99 (c), 97 (a) and 116 (t).  If you were able to look so see physically how it is stored at the bit level, it would look something like this.

Bit Value  128 64 32 16  8  4  2  1  Byte Value
c  (#99)                   0       1     1      0      0     0     1      1     64 + 32 + 2 + 1 = 99

a  (#97)                   0       1     1      0      0     0     0      1     64 + 32 + 1  = 97
t  (#116)                  0       1     1      1      1     1     0      0     64 + 32 + 16 + 8 + 4 = 116