# Bits & Bytes

All of the data in your computer is stored in Bits (binary digits).

We usually use the decimal system when doing math.  The decimal system consists of the values 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9.  The word Dec means 10.  A digit is a single place that can hold numerical values between 0 and 9. Digits are normally combined together to create larger numbers.  Moving from left to right in a decimal number we have the one’s place, followed by the ten’s place, followed by the hundred’s place, followed by the thousand’s place, etc.

100,000  10,000    1,000   100   10   1

The decimal value   3,256 consists of:    3 one thousands
2 one hundreds
5 tens
6 ones

The developers of early computing machine found it was very difficult to make devices work with the decimal system.  They decided it would greatly simplify things if they only had to deal with the numbers 0 and 1.

The very early computers were  electro mechanical. They used relayed switches to represent 0s and 1s.   If the relay switch was on it represented a 1.  If the switch was off it represented a 0. Relay Switch

The first generation computers used vacuum tubes to represent values. A vacuum tube was  either on or off so it could easily be represented a 1 or 0. Vacuum Tube

The second generation computers used transistors.   A transistor is an electronic device that has three ends; a source, a sink, and a gate. The gate acts as a switch  which is used to control the flow of electricity to another part of the circuit.  When the gate(switch) of a transistor is ON electricity can flow from the source to the sink.  The On position represents the binary value 1.  When the gate(switch) is off electricity can't flow.   The Off  position represents the binary value 0. Transistor

Third generation computer used integrated chips and fourth generation computers used microprocessors.  Integrated chips and microprocessors contain extremely small transistors. If the switch is on in the transistor it represents a 1.  If the switch is off it represents a 0. Integrated Chip                                      Integrated Chip

Because of how easily 0’s and 1’s work with these devices, computers have adopted the binary system. The word Bi means 2.

A binary digit is a single placeholder in the binary system. The word bit is an abbreviation for binary digit. It takes a combination of 8 bits to represent a byte.   A byte can represent a numeric value or a character.

In a decimal value we have the one’s place, the ten’s place, the hundred’s place, etc.  Therefore, the farthest right digit is 10^0, the next digit to the left is 10^1, the next digit to the left is 10^2 etc.  The binary system is similar except the farthest right bit is 2^0, the next bit to the left is 2^1, the next bit to the left is 2^2.

The number 90 is represented by the byte 01011010.

0      1     0     1     1     0     1     0
128   64   32   16     8     4     2     1

The byte is computed by adding the bits that contain a 1.  The 0 bits have no value.

Thus the value is computed as    2 + 8 + 16 + 64   =     90

Computers only recognize 0s and 1s.   All the numbers, characters, and colors in your computer are represented by 0s and 1s.  Computers have gotten faster and faster but how the computer works hasn't changed much.   We have just been able to manipulate those 1s and 0s extremely fast and we have been able to shrink the size of the transistors that hold those 0s and 1s into the most miniscule size.

The computer recognizes two character codes ASCII (American Standard Code of Information Interchange) and Unicode.

ASCII can represent a total of 256 characters.  The original version used characters 0 through 127.  An extended version added an additional 128 characters.  ASCII can produce 256 characters because there 8 bits to a byte (2 to the power of 8 = 256).

The table below displays the first 128 binary values in the ASCII code system, along with their decimal equivalents and the character they represent. For example, the capital letter A is created with the binary value 01000001 which has a decimal equivalent of 65.

If you are in an application such as Excel or Notepad you can create the characters in the ASCII table by turning on your computer's Num Lock then hold down the Alt key while you type the Decimal Number on the numeric keypad.  For example, hold down the Alt key and type 65 on the numeric keypad to create the capital letter A.   Hold down the Alt key and type 1 on the numeric keypad to create a smiley face. ## Unicode

The ASCII code was okay for creating American language characters but other languages require many other symbols. There was a need for a lot more than 256 characters. How do we create more symbols? By combining bytes. The Unicode (Universal Code) coding system uses 4 bytes together for a total of 32 bits.

The table below gives the names assigned to the various units of storage. The sizes associated with the storage size names aren’t exact.  For example a kilobyte is actually 1024 characters not 1000.  Looking at the powers of 2 you can see the value would be 1024 not 1000.  If you purchase a 64GB USB drive it can hold approximately 64 billion characters.  If you purchase a 2TB hard drive it can hold approximately 2 trillion characters.