Java Reference
In-Depth Information
Computer programs are collectively called software. The primary piece of software
running on a computer is its operating system. An operating system provides an envi-
ronment in which many programs may be run at the same time; it also provides a
bridge between those programs, the hardware, and the user (the person using the com-
puter). The programs that run inside the operating system are often called applications.
When the user selects a program for the operating system to run (e.g., by double-
clicking the program's icon on the desktop), several things happen: The instructions
for that program are loaded into the computer's memory from the hard disk, the oper-
ating system allocates memory for that program to use, and the instructions to run the
program are fed from memory to the CPU and executed sequentially.
The Digital Realm
In the last section, we saw that a computer is a general-purpose device that can
be programmed. You will often hear people refer to modern computers as digital
computers because of the way they operate.
Digital
Based on numbers that increase in discrete increments, such as the integers
0, 1, 2, 3, etc.
Because computers are digital, everything that is stored on a computer is stored as a
sequence of integers. This includes every program and every piece of data. An MP3
file, for example, is simply a long sequence of integers that stores audio information.
Today we're used to digital music, digital pictures, and digital movies, but in the
1940s, when the first computers were built, the idea of storing complex data in inte-
ger form was fairly unusual.
Not only are computers digital, storing all information as integers, but they are
also binary, which means they store integers as binary numbers.
Binary Number
A number composed of just 0s and 1s, also known as a base-2 number.
Humans generally work with decimal or base-10 numbers, which match our physi-
ology (10 fingers and 10 toes). However, when we were designing the first comput-
ers, we wanted systems that would be easy to create and very reliable. It turned out to
be simpler to build these systems on top of binary phenomena (e.g., a circuit being
open or closed) rather than having 10 different states that would have to be distin-
guished from one another (e.g., 10 different voltage levels).
From a mathematical point of view, you can store things just as easily using binary
numbers as you can using base-10 numbers. But since it is easier to construct a phys-
ical device that uses binary numbers, that's what computers use.
This does mean, however, that people who aren't used to computers find their con-
ventions unfamiliar. As a result, it is worth spending a little time reviewing how binary
 
Search WWH ::




Custom Search