Professional Documents
Culture Documents
Introduction To Computing
Introduction To Computing
Introduction To Computing
Introduction to Computing
CONTENTS
1.1 Computing Systems 2
1.2 Computer Organization 14
Exercises 20
One machine can do the work of fifty ordinary men. No machine can do the work
of one extraordinary man.
ELBERT HUBBARD
Where a computer like the ENIAC is equipped with 18,000 vacuum tubes and
weighs 30 tons, computers in the future may have only 1000 vacuum tubes and
weigh only 1-1/2 tons.
POPULAR MECHANICS MARCH 1949
So IBM has equipped all XTs with what it considers to be the minimum gear for a
serious personal computer. Now the 10-megabyte disk and the 128K of memory are
naturals for a serious machine.
PETER NORTON 1983
1
2 ◾ Programming in C++ for Engineering and Science
T he modern electronic computer is one of the most important products of the twen-
tieth century. It is an essential tool in many areas, including business, industry, govern-
ment, science, and education; indeed, it has touched nearly every aspect of our lives. The
impact of the twentieth-century information revolution brought about by the development of
high-speed computing systems has been nearly as widespread as the impact of the nineteenth-
century industrial revolution. In this chapter we begin with some background by describing
computing systems, their main components, and how information is stored in them.
Early computers were very difficult to program. In fact, programming some of the earli-
est computers consisted of designing and building circuits to carry out the computations
required to solve each new problem. Later, computer instructions could be coded in a lan-
guage that the machine could understand. But these codes were very cryptic, and pro-
gramming was therefore very tedious and error prone. Computers would not have gained
widespread use if it had not been for the development of high-level programming lan-
guages that made it possible to enter instructions using an English-like syntax.
Fortran, C, C++, Java, and Python are some of the languages that are used extensively in
engineering and scientific applications. This text will focus on C++ but will also describe
some properties of its parent language, C, noting features that these two languages have in
common, as well as their differences.
This section briefly describes a few of the important events and devices that have imple-
mented these concepts. Additional information can be found on the website for this book
described in the preface.
(a)
(b)
(c)
FIGURE 1.1 (a) Abacus. (Image courtesy of the Computer History Museum.) (b) Stonehenge.
(c) Slide rule.
4 ◾ Programming in C++ for Engineering and Science
The English mathematician William Oughtred invented a circular slide rule in the early
1600s, and more modern ones (Figure 1.1c) were used by engineers and scientists through
the 1950s and into the 1960s to do rapid approximate computations.
In 1642, the young French mathematician Blaise Pascal invented one of the first mechan-
ical adding machines to help his father with calculating taxes. This Pascaline (Figure 1.2a)
was a digital calculator because it represented numerical information as discrete digits, as
opposed to a graduated scale like that used in analog instruments of measurement such
as slide rules and nondigital thermometers. Each digit was represented by a gear that
had 10 different positions (a ten-state device) so that it could “count” from 0 through 9
and, upon reaching 10, would reset to 0 and advance the gear in the next column so as to
represent the action of “carrying” to the next digit. In 1673, the German mathematician
Gottfried Wilhelm von Leibniz invented an improved mechanical calculator (Figure 1.2b)
that also used a system of gears and dials to do calculations. However, it was more reliable
and accurate than the Pascaline and could perform all four of the basic arithmetic opera-
tions of addition, subtraction, multiplication, and division. A number of other mechanical
calculators followed that further refined Pascal’s and Leibniz’s designs, and by the end of
the nineteenth century, these calculators had become important tools in science, business,
and commerce.
(a) (b)
FIGURE 1.2 (a) Pascaline. (b) Leibnitz’s calculator. (Images courtesy of the Computer History
Museum.)
Introduction to Computing ◾ 5
The Jacquard loom (Figure 1.3a), invented in 1801 by the Frenchman Joseph Marie
Jacquard, is an early example of a stored program automatically controlling a hardware
device. Holes punched in metal cards directed the action of this loom: a hole punched in
one of the cards would enable its corresponding thread to come through and be incorpo-
rated into the weave at a given point in the process; the absence of a hole would exclude
an undesired thread. To change to a different weaving pattern, the operator of this loom
would simply switch to another set of cards. Jacquard’s loom is thus one of the first exam-
ples of a programmable machine, and many later computers would make similar use of
punched cards.
(a) (b)
(c)
FIGURE 1.3 (a) Jacquard Loom. (Image courtesy of the Computer History Museum.) (b) Charles
Babbage. (c) Difference Engine.