A computer is really nothing more than a series of switches. Of course,
it's a highly complex series of switches. Thousands and thousands of them.
Like any switches, those you find in a computer can have two positions,
on or off. Storing information in a computer is simply a matter of setting
a sequence of switches on or off. If the switch is on, its value
is 1. If the switch is off, it holds a value of 0.
The digital circuits used in computers are
switches which perform a specified series of actions, all based on the information
in the on and off states of the circuit. Everything in a digital circuit
is either on or off, unlike analog circuits, found in things like radios
and televisions, which deal with voltage levels and signals. Analog circuits
may amplify or otherwise modify electronic signals of various levels.
These on and off states within a computer are represented
as electronic signals of two different voltage levels. In the computers this
book deals with, an on state corresponds to a signal of about +5
volts, while the off state corresponds with a signal of about 0 volts.
(Actually, a positive voltage more than 2.5 volts is considered on, and
a voltage less than 0.5 volts is considered off. This is called a TTL,
or transistor-transistor logic signal level.)
Since a switch can exist in only two states, on or
off, what information can be represented? Simple-one of two numbers. The
on state can be assigned to mean the number 1, and the off state can be the
number 0-the two digits which make up the base two binary number system.
The binary number system naturally lends itself for use with the digital
logic circuitry in a computer. Unfortunately, we're used to counting by ten.
The number 65, for instance, has far more meaning to us than its binary equivalent,
1000001.
Dealing with numbers at the binary level is best left
to the computer, but when you're trying to interface your computer to the
outside world, it's often necessary to know and understand how setting a
bit in a memory address within the computer affects the machine and its operation.

Number Systems
The binary number system is just another way of representing numbers.
The number system we normally use, the decimal number system, is a base
ten number system. In other words, there are ten different symbols (0, 1,
2, ..., 9) which can be used independently or in combination to represent
a given number. The value of the number represented depends on both the
combination of symbols and their relative positions. Let's take a look at
how a decimal number is made up, for example 37,506.

Position

43210

Decimal number

37506

Symbol

Base

Position

Decimal
Value

3

*

10

^4

=

30,000

7

*

10

^3

=

7,000

5

*

10

^2

=

500

0

*

10

^1

=

0

6

*

10

^0

=

6

=

37,506

As you can see, the first symbol, 3, represents three
times ten to the fourth power (in other words, a 3 followed by four zeros).
In the same manner, each symbol represents a number multiplied by a power
of ten (the power is determined by the symbol's relative position). Adding
all these values together gives us the number 37,506.
The binary number system has just two symbols, 0 and
1. A Binary digiT, or bit, can thus be either 0 or 1. One bit by itself can
only be used to count up to one. Larger numbers in binary, as in the decimal
number where you can represent larger value numbers with more digits (a
number like 245 requires three digits, whereas the number 4 requires just
one), are represented by more bits. As you can see in the following example,
a binary number is made in a similar manner as a decimal number.

Position

76543210

Binary number

11111001

Symbol

Base

Position

Decimal
Value

1

*

2

^7

=

128

1

*

2

^6

=

64

1

*

2

^5

=

32

1

*

2

^4

=

16

1

*

2

^3

=

8

0

*

2

^2

=

0

0

*

2

^1

=

0

1

*

2

^0

=

1

249

Just as with the more comfortable decimal numbers, binary
numbers are built by combining symbols, then multiplying those values by
two (since binary is base two) raised to the power of the symbol's position.
A 1 in the seventh position, then, represents the decimal value 128, while
a 1 in the first position only represents 1.
Here are a few more examples of how decimal numbers (what
we use) are represented as binary numbers (what computers use). Try working
them out to see if you come up with the same values.

Decimal

Binary

10

=

1010

5

=

101

134

=

10000110

Chock Full of Bits
In computers, bits are usually put together in groups of eight when stored
or otherwise manipulated. A group of eight bits is called a byte. Since it
has eight positions, a byte can hold any number from 00000000 binary (0
decimal) to 11111111 binary (255 decimal). The largest number which can be
represented by a byte, then, is 255.
These binary values are used by the computer for all
its operations, from executing an applications program to representing alphanumeric,
even graphics characters.
Understanding the elements of the binary number system,
bits, and bytes will prove useful as you move into the heart of Electronic
Computer Projects. The next chapter, "Exploring the Control Port," is your
start toward your own custom-built computer projects.Return to Table of Contents
| Previous Chapter
| Next Chapter