34
1.1 1 Introduction Foundations of Computer Science Cengage Learning

1 Introduction - kau

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 1 Introduction - kau

1.1

1Introduction

Foundations of Computer Science Cengage Learning

Page 2: 1 Introduction - kau

1.2

Define the Turing model of a computer.

Define the von Neumann model of a computer.

Describe the three components of a computer: hardware,data, and software.

List topics related to computer hardware.

List topics related to data.

List topics related to software.

Discuss some social and ethical issues related to the use ofcomputers.

Give a short history of computers.

ObjectivesAfter studying this chapter, the student should be able to:

Page 3: 1 Introduction - kau

1.3

1-1 TURING MODEL

• Alan Turing described the idea of a universalcomputational device in 1937.• He proposed that all computation could be performedby a special kind of a machine, now called a Turingmachine.• He based the model on the actions that people performwhen involved in computation.• He abstracted these actions into a model for acomputational machine that has really changed theworld.

Page 4: 1 Introduction - kau

1.4

The computer as a data processors• A computer acts as a black box that accepts input data,processes the data, and creates output data.• This model defines the functionality of a computer• Drawbacks:

• It is too general. A pocket calculator is also a computer• Represent a specific-purpose computer that is designedto do specific jobs such as controlling the roomtemperature

Figure 1.1 A single purpose computing machine

Page 5: 1 Introduction - kau

1.5

Programmable data processors• The Turing model is a better model for a general-purposecomputer.• This model adds an extra element to the specificcomputing machine: the program.•A program is a set of instructions that tells the computerwhat to do with data.

Figure 1.2 A computer based on the Turing model

Page 6: 1 Introduction - kau

1.6

Figure 1.3 The same program, different data

Page 7: 1 Introduction - kau

1.7Figure 1.4 The same data, different programs

Page 8: 1 Introduction - kau

1.8

The universal Turing machine• A universal Turing machine, a machine that can do anycomputation if the appropriate program is provided, was thefirst description of a modern computer.• It can be proved that a very powerful computer and auniversal Turing machine can compute the same thing.• We need only provide the data and the program—thedescription of how to do the computation—to eithermachine.• In fact, a universal Turing machine is capable ofcomputing anything that is computable.

Page 9: 1 Introduction - kau

1.9

1-2 VON NEUMANN MODEL

• Computers built on the Turing universal machinestore data in their memory.• John von Neumann proposed that, since program anddata are logically the same, programs should also bestored in the memory of a computer.

Page 10: 1 Introduction - kau

1.10

Computers built on the von Neumann model divide thecomputer hardware into four subsystems: memory,arithmetic logic unit, control unit, and input/output.

Four subsystems

Figure 1.5 The von Neumann model

Page 11: 1 Introduction - kau

1.11

• The von Neumann model states that the program must bestored in memory.• This is totally different from the architecture of earlycomputers in which only the data was stored in memory: theprograms for their task was implemented by manipulating aset of switches or by changing the wiring system.• The memory of modern computers hosts both a programand its corresponding data.• This implies that both the data and programs should havethe same format, they are stored as binary patterns inmemory—a sequence of 0s and 1s.

The stored program concept

Page 12: 1 Introduction - kau

1.12

• A program in the von Neumann model is made of a finitenumber of instructions.• The control unit fetches one instruction from memory,decodes it, then executes it.• The instructions are executed one after another.• Sequential execution of a program was the initialrequirement of a computer based on the von Neumannmodel.

Sequential execution of instructions

Page 13: 1 Introduction - kau

1.13

1-3 COMPUTER COMPONENTS

We can think of a computer as being made up of threecomponents: computer hardware, data, and computersoftware.

Page 14: 1 Introduction - kau

1.14

Computer hardware today has four components under thevon Neumann model, although we can have different typesof memory, different types of input/output subsystems, andso on. We discuss computer hardware in more detail inChapter 5.

Computer hardware

The von Neumann model clearly defines a computer as adata processing machine that accepts the input data,processes it, and outputs the result.

Data

Page 15: 1 Introduction - kau

1.15

• The main feature of the Turing or von Neumann models isthe concept of the program.• Although early computers did not store the program in thecomputer’s memory, they did use the concept of programs.• Programming those early computers meant changing thewiring systems or turning a set of switches on or off.• Programming was therefore a task done by an operator orengineer before the actual data processing began.

Computer software

Page 16: 1 Introduction - kau

1.16

Figure 1.6 Program and data in memory

Page 17: 1 Introduction - kau

1.17

Figure 1.7 A program made of instructions

Page 18: 1 Introduction - kau

1.18

1-4 HISTORY

In this section we briefly review the history of computingand computers. We divide this history into three periods.

Page 19: 1 Introduction - kau

1.19

Mechanical machines (before 1930)

During this period, several computing machines wereinvented that bear little resemblance to the modern conceptof a computer.

In the 17th century, Blaise Pascal, a French mathematician andphilosopher, invented Pascaline.

In the late 17th century, a German mathematician called GottfriedLeibnitz invented what is known as Leibnitz’ Wheel.

The first machine that used the idea of storage and programmingwas the Jacquard loom, invented by Joseph-Marie Jacquard at thebeginning of the 19th century.

Page 20: 1 Introduction - kau

1.20

In 1823, Charles Babbage invented the Difference Engine. Later,he invented a machine called the Analytical Engine that parallelsthe idea of modern computers.

In 1890, Herman Hollerith, working at the US Census Bureau,designed and built a programmer machine that could automaticallyread, tally, and sort data stored on punched cards.

Page 21: 1 Introduction - kau

1.21

The birth of electronic computers (1930–1950)Between 1930 and 1950, several computers were inventedby scientists who could be considered the pioneers of theelectronic computer industry.

The early computers of this period did not store the programin memory—all were programmed externally. Fivecomputers were prominent during these years:

ABC Z1Mark I. Colossus ENIAC

Early electronic computers

Page 22: 1 Introduction - kau

1.22

The first computer based on von Neumann’s ideas was madein 1950 at the University of Pennsylvania and was calledEDVAC. At the same time, a similar computer calledEDSAC was built by Maurice Wilkes at CambridgeUniversity in England.

Computers based on the von Neumann model

Page 23: 1 Introduction - kau

1.23

Computer generations (1950–present)Computers built after 1950 more or less follow the vonNeumann model. They have become faster, smaller, andcheaper, but the principle is almost the same. Historiansdivide this period into generations, with each generationwitnessing some major change in hardware or software (butnot in the model).

The first generation (roughly 1950–1959) is characterizedby the emergence of commercial computers.

First generation

Page 24: 1 Introduction - kau

1.24

Second-generation computers (roughly 1959–1965) usedtransistors instead of vacuum tubes. Two high-levelprogramming languages, FORTRAN and COBOL inventedand made programming easier.

Second generation

The invention of the integrated circuit reduced the cost andsize of computers even further. Minicomputers appeared onthe market. Canned programs, popularly known as softwarepackages, became available. This generation lasted roughlyfrom 1965 to 1975.

Third generation

Page 25: 1 Introduction - kau

1.25

The fourth generation (approximately 1975–1985) saw theappearance of microcomputers. The first desktop calculator,the Altair 8800, became available in 1975. This generationalso saw the emergence of computer networks.

Fourth generation

This open-ended generation started in 1985. It has witnessedthe appearance of laptop and palmtop computers,improvements in secondary storage media (CD-ROM, DVDand so on), the use of multimedia, and the phenomenon ofvirtual reality.

Fifth generation

Page 26: 1 Introduction - kau

1.26

1-5 SOCIAL AND ETHICAL ISSUES

Computer science has created some peripheral issues, themost prevalent of which can be categorized as social andethical issues.

Page 27: 1 Introduction - kau

1.27

Social issuesComputers have created some arguments. We introducesome of these arguments here.

Some people think that computers have created a kind ofdependency, which makes people’s lives more difficult.

Dependency

Social justice is another issue we often hear about. Theadvocates of this issue argue that using computers at home isa luxury benefit that not all people can afford. The cost of acomputer, peripheral devices, and a monthly charge forInternet access is an extra burden on low-income people.

Social justice

Page 28: 1 Introduction - kau

1.28

The concept of digital divide covers both the issues ofdependency and social justice discussed above. The conceptdivides society into two groups: those who are electronicallyconnected to the rest of society and those who are not.

Digital divide

Page 29: 1 Introduction - kau

1.29

Ethical issuesComputers have created some ethical issues. We introducesome of these here.

Computers allow communication between two parties to bedone electronically. However, much needs to be done tomake this type of communication private. Society is payinga big price for private electronic communication. Networksecurity may create this type of privacy, but it needs effortand costs a lot.

Privacy

Page 30: 1 Introduction - kau

1.30

Another ethical issue in a computerized society is copyright:who owns data? The Internet has created opportunities toshare ideas, but has also brought with it a further ethicalissue: electronic copyright.

Copyright

Computers and information technology have created newtypes of crime. Hackers have been able to access manycomputers in the world and have stolen a lot of money. Viruscreators design new viruses to be sent through the Internetand damage the information stored in computers. Althoughthere are many anti-virus programs in use today, society ispaying a big price for this type of crime, which did not existbefore the computer and Internet era.

Computer crime

Page 31: 1 Introduction - kau

1.31

1-6 COMPUTER SCIENCE AS A DISCIPLINE

With the invention of computers, a new discipline hasevolved: computer science. Like any other discipline,computer science has now divided into several areas. Wecan divide these areas into two broad categories: systemsareas and applications areas. This book is a breadth-firstapproach to all these areas. After reading the book, thereader should have enough information to select thedesired area of specialty.

Page 32: 1 Introduction - kau

1.32

1-7 OUTLINE OF THE COURSE

After this introductory chapter, the book is divided into five parts.

Part I: Data representation and operationThis part includes Chapters 2, 3, and 4. Chapter 2 discussesnumber systems; how a quantity can be represented usingsymbols. Chapter 3 discusses how different data is storedinside the computer. Chapter 4 discusses some primitiveoperations on bits.

Page 33: 1 Introduction - kau

1.33

Part II: Computer hardwareThis part includes Chapters 5 and 6. Chapter 5 gives ageneral idea of computer hardware, discussing differentcomputer organizations. Chapter 6 shows how individualcomputers are connected to make computer networks andinternetworks (internets).

Part III: Computer softwareThis part includes Chapters 7, 8, 9 and 10. Chapter 7discusses operating systems. Chapter 8 shows how problemsolving is reduced to writing an algorithm for the problem.Chapter 9 takes a journey through the list of contemporaryprogramming languages. Chapter 10 is a review of softwareengineering.

Page 34: 1 Introduction - kau

1.34

Part IV: Data organization and abstractionPart IV includes Chapters 11, 12, 13 and 14. Chapter 11discuss data structures, collecting data of the same ordifferent type under one category. Chapter 12 discussesabstract data types. Chapter 13 shows how different filestructures can be used for different purposes. Chapter 14discusses databases.

Part V: Advanced topicsThis part covers Chapters 15, 16, 17 and 18. Chapter 15discusses data compression. Chapter 16 explores someissues to do with security. Chapter 17 discusses the theory ofcomputation. Chapter 18 is an introduction to artificialintelligence, a topic with day-to-day challenges in computerscience.