Web info-x
   
THIS SITE IS FOR SALE
 
 
Tutorials
 Info-x : Info-x Tutorials and Documents : Tutorials
Message Icon Topic: Undertsanding the binary system Post Reply Post New Topic
Author Message
deej
Admin Group
Admin Group


Joined: 22 Nov 1997
Online Status: Offline
Posts: 3
Quote deej Replybullet Topic: Undertsanding the binary system
    Posted: 14 Dec 2004 at 15:34
What is the binary system?

The word \"binary\" describes a system that has only two possible digits. To
understand this, let's first compare this to a system you're probably more familiar
with, the Decimal system.

The word \"decimal\" describes a system that has ten possible digits. These
are the digits 0 through 9. Every number expressed in the decimal system is
a combination of these ten digits. You use the decimal system every day, it
comes naturally, we all have 10 fingers and 10 toes (unless your family tree
doesn't fork, but let's not go there), and some of us use those 10 fingers and
toes extensively to help with every day addition and subtraction.

The binary system works essentially the same way, with the only difference
that it only has two digits. These are visually expressed by the digits 0 and
1. Every number expressed in the binary system is a combination of these two
digits.

Why do we need the binary system?

The binary system is essential in technology. The reason is that any electronic
circuit can have only two possible states, on or off. A simple example is the
light in your room. The switch has only two options, on or off. Another example
of a binary system would be Morse code. It also works with only two digits,
a dot or a dash. Anything expressed in Morse code is done with these two digits.
Electronic circuits work the same way, they are either on or off. And every
sequence of these two signals has a certain meaning. Every communication that
takes place inside your computer uses this binary system.

How does it work?

If you're not used to them, binary numbers look pretty strange. Here's an
example:


1 0 1 0 1 1 1 0

So what is this number in the decimal system? Converting binary numbers to decimal
numbers is not that difficult if you know the secret.

The secret of the binary system?

The first thing to know is that you read binary numbers from right to left.
The second thing you need to understand is that each digit is based on a power
of the number 2. Check this out:

2 to the power of 0 equals 1 2 to the power of 1 equals 2 2 to the power of
2 equals 4 2 to the power of 3 equals 8 2 to the power of 4 equals 16 2 to the
power of 5 equals 32 2 to the power of 6 equals 64 2 to the power of 7 equals
128 ...

See the pattern? Now let's take these numbers to use them as a template while
remembering that binary numbers are read from right to left:

128 64 32 16 8 4 2 1 

Now let's use this template on that ugly binary number from our earlier example.
At the top is our template, at the bottom is our binary number:


128 64 32 16 8 4 2 1

1 0 1 0 1 1 1 0

Now we use simple multiplication and addition. If the binary number is a 1,
it means this digit is \"on\" or \"true\" and we add the corresponding number from
the template, if it is a 0, it means the digit is \"off\" or \"false\", and we do
not add the corresponding number from the template.

In our example, the digits for 128, 32, 8, 4 and 2 are true, so we add



128 + 32 + 8 + 4 + 2 = 174



You could also express it as

128*1 + 64*0 + 32*1 + 16*0 + 8*1 + 4*1 + 2*1 + 1*0 = 174 

This means our binary number 10101110 is the number 174 in the decimal system.

Bits vs. Bytes

Ok, now that we understand the binary system and how binary numbers work,
let's take a closer look at how your computer uses this system. Earlier we talked
about 1 and 0 being binary digits. That's an ugly phrase to use, so let's abbreviate
it by combining the two words into a nice short term: Bit. Sound familiar? Thought
so.

In our earlier example, we used the binary number 10101110. This number has
8 binary digits, or 8 bits. This is not a coincidence, because if you take a
group of 8 bits, you have a byte. The reason we have to group bits is that if
you are being fed a continuous stream of bits you have no idea where one piece
of information ends and the next one starts. But if you receive groups of defined
length, e.g. a byte containing 8 bits, it's easy to interpret them. A good example
is how ASCII code (American Standard Code for Information Interchange) works.
Any character you type on your keyboard is interpreted by your computer as a
byte, an 8 digit binary number. For example, the letter \"A\" is expressed as
the ASCII code 65. But 65 is a decimal number, so if you convert it to a binary
number, you get 01000001. These 8 digits, or one byte, are known to your computer
as the letter \"A\".

It is very important to know the difference between a bit and a byte because
these two can get easily confused. One good example is monitoring data transfer
speed. When you download a file from the Internet, you probably have noticed
that your browser indicates the transfer rate in KBps. Please note that the
letter \"B\" is capitalized. This means the transfer rate is shown in Kilo Bytes
per second. For example, your download might arrive at a rate of 3.5 KBps. Now,
if you are using a 56K modem, why is that rate so low, shouldn't you see something
closer to 56? No, because 56K is short for 56 Kbps. Note the lower case \"b\",
it means Kilo Bits per second. And since we know that 8 bits equal one byte,
we divide 56 by 8 and get a theoretical maximum of 7 Kilo Bytes per second.

A GigaByte does not necessarily equal a GigaByte

Here's another situation where you can look really smart if you paid attention
and know the difference between the binary and the decimal system. This question
is asked over and over again:

\"I bought a 8.4GB hard drive, but when I formatted it, Windows tells me that
I have only 7.82 GB available. Did they sell me the wrong drive?\"

No, they sold you the correct drive, but it was not labeled quite correctly.
The marketing department of the drive manufacturer doesn't know too much about
bits and bytes and the binary system. To make it easier to calculate, they assume
that 1 KB is 1000 Bytes, 1 MB is 1000 KB, etc. which is wrong. So when they
have a drive that can hold 8,400,000,000 Bytes, they just call it 8.4 GB and
say that's close enough for government work. Not so.The multiplication factor
is not 1000 since we're not using the decimal system, it is 1024 instead (2
to the power of 10).

To figure out the correct size of that drive, divide 8,400,000,000 Bytes by
1024 and you'll get 8,203,125 KB. Divide that by 1024, and you get 8,010 MB.
Divide that by 1024 and you get 7.82 GB which is the actual size of your hard
drive in GB as reported by your operating system.

Of Pits and Grooves

A CD stores data using the binary system in the following matter: When writing
data to a CD, the laser does nothing else than following a spiral- shaped \"guide
groove\" while burning the data as a long string of pits into a reflective dye
layer on the CD. When the CD is read later, a laser follows the same spiral
and reads either a pit where the light does not get reflected very well, or
a smooth area called land where the light reflects very well. This system is
nothing else but our good old binary system, using only two possible states,
pit or land, to read and record data in binary format, 0 or 1.

Magnetic storage

Storing data on a magnetic media, such as a hard drive, also uses the binary
system. In a very simplified manner of speaking, each data bit gets stored on
a drive as a tiny magnetic field. Each magnetic field has two poles, North and
South. When the disk spins around and data is read by the read head, the magnetic
field either has the North or the South pole aligned first. Again, only two
possible stages, North or South, 0 or 1.

Bus Width

You might have heard the term \"bus\" in connection with computers. A bus is
a connection or channel between the chip set on your motherboard and the different
parts of your PC, such as the processor, memory, expansion cards, etc.

There is the processor bus which connects the chip set to the CPU, the memory
bus which connects the chip set to the memory, local buses such as the PCI bus
(Peripheral Component Interconnect), expansion buses such as the ISA bus (Industry
Standard Architecture), and more.

Each bus consists of two parts, the data bus, which transfers the actual data,
and the address bus, which transfers information about where the data is supposed
to go to.

Every bus runs at a certain clock speed, which is expressed in MegaHertz (MHz).
For example, the old ISA bus runs at a whopping 8 MHz, the PCI bus runs at 33
or 66 MHz, and the AGP bus runs at 66 MHz.

Each bus also has a certain width which brings us finally back to our topic,
because the bus width is expressed in bits, indicating how many bits can be
transferred simultaneously over the bus. Physically, this means how many wires
are in the bus. The ISA bus width ran from 8 to 32 bit, the PCI bus is either
32 or 64 bits wide, and the AGP bus is 32 bits wide. Naturally, this means the
wider the bus, the more data can be transferred at the same time, the faster
the bus is.

FAT 16 vs. FAT 32 When you partition a new, clean hard drive, one of the things
you do is decide what file system to use. Until a few years ago, FAT16 was the
main file system for home PCs. It's main limitation was that it could handle
only partitions up to a size of ca. 2 GB. The reason for this was that it used
a 16-bit number to index each cluster.

Let's do some math to understand the difference between FAT (or more exact
FAT 16) and FAT 32. When you partition and format the drive, it is being organized
into a lot of cubby holes, so to speak. Those are called clusters, which are
numbered by the FAT to keep track of them and what's in them. FAT 16 uses a
16 bit number to number them, and the highest number you can display using 16
bits, is 2^16 = 65,535.

The biggest possible size each cluster can be is 32,768 Bytes. Therefore,
if you take the maximum number of clusters - 65,535 - times the maximum cluster
size - 32,768 Bytes -, you get the maximum hard drive size FAT can handle -
2,147,450,880 Bytes, or 2 GB.

In contrast to that, FAT 32 uses a 32-bit number, and therefore can handle
up to 2 TeraBytes

Summary

Pretty amazing, isn't it? The binary system is very simple once you understand
it, very powerful, and omni-present in our everyday lives in anything that has
a circuit board inside. Even though this was just a basic overview, you now
know how the binary system works and what all it does inside of your PC.

IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum

Bulletin Board Software by Web Wiz Forums version 8.04
Copyright ©2001-2006 Web Wiz Guide

This page was generated in 0.094 seconds.
  Log in  
User:
Pass:
Remember Me:
Register
Forgot Password
  Christmas Gifts  

Bar Gifts
Xmas Gifts for Him
Xmas Gifts for Dads
Gadgets and Gizmos
Sporting Gifts
Games
Unique Lifestyle Gifts
Geek Gifts
iPod Mains Charger More Gadgets

THIS SITE IS FOR SALE
Sedo - Buy and Sell Domain Names and Websites project info: info-x.co.uk Statistics for project info-x.co.uk etracker® web controlling instead of log file analysis