c o m p u t e r s c i e n c e illuminated -...

28
NELL DALE JOHN LEWIS JONES AND BARTLETT COMPUTER SCIENCE computer science illuminated

Upload: others

Post on 01-Mar-2021

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: c o m p u t e r s c i e n c e illuminated - udn.vntailieuso.udn.vn/.../3/ComputerScienceIlluminated.TT.pdf · 2020. 3. 17. · Well respected in the field of Computer Science Education,

N E L L D A L E J O H N L E W I S

J O N E S A N D B A R T L E T T C O M P U T E R S C I E N C E

c o m p u t e r s c i e n c e

i l luminated

Page 2: c o m p u t e r s c i e n c e illuminated - udn.vntailieuso.udn.vn/.../3/ComputerScienceIlluminated.TT.pdf · 2020. 3. 17. · Well respected in the field of Computer Science Education,

N E L L D A L E J O H N L E W I S

c o m p u t e r s c i e n c e

i l luminated

Page 3: c o m p u t e r s c i e n c e illuminated - udn.vntailieuso.udn.vn/.../3/ComputerScienceIlluminated.TT.pdf · 2020. 3. 17. · Well respected in the field of Computer Science Education,
Page 4: c o m p u t e r s c i e n c e illuminated - udn.vntailieuso.udn.vn/.../3/ComputerScienceIlluminated.TT.pdf · 2020. 3. 17. · Well respected in the field of Computer Science Education,

N E L L D A L E J O H N L E W I S

c o m p u t e r s c i e n c e

i l luminatedUniversity of Texas, Austin Villanova University

Page 5: c o m p u t e r s c i e n c e illuminated - udn.vntailieuso.udn.vn/.../3/ComputerScienceIlluminated.TT.pdf · 2020. 3. 17. · Well respected in the field of Computer Science Education,

Goin’ LiveThis step-by-step HTMLTutorial will guide you fromstart to finish as you createyour own website. With eachlesson, you’ll gain experienceand confidence working in theHTML language.

Online GlossaryWe’ve made all the key terms used in the text easilyaccessible to you in thissearchable online glossary.

The Language LibraryHere you will find two complete chapters thatsupplement the book’s language-neutral approach toprogramming concepts. A JAVA language chapterand C++ language chapter are included and followthe same pedagogical approach as the textbook.

The Learning StoreJones and Bartlett Publishershas a wealth of materialavailable to supplement thelearning and teachingexperience. Students andinstructors will find additional resources here or athttp://computerscience.

jbpub.com

Jones and Bartlett Publishers is pleased to provide Computer

Science Illuminated’s book-specific website. This site offers a

variety of resources designed to address multiple learning styles

and enhance the learning experience.

http://csilluminated.jbpub.com

Page 6: c o m p u t e r s c i e n c e illuminated - udn.vntailieuso.udn.vn/.../3/ComputerScienceIlluminated.TT.pdf · 2020. 3. 17. · Well respected in the field of Computer Science Education,

eLearningOur eLearning center provides chapter-specific

activities that will actively engage you in the learning

process. Each activity directly correlates to material

presented in the text to help you gain command over

chapter content.Interactive ReviewYou can check yourgeneral understanding ofkey concepts with thisdynamic chapter review.

Animated FlashcardsComputer science is rich with vocabulary, and thesevirtual flashcards will help you quickly master newterms and definitions.

Did You Know?Find out more about the funfacts and stories included ascallouts in the text. Here you’llfind an extensive collection ofmaterial ranging from historicalinformation to the latesttechnological developments.

Live Wire Explore the Web throughthese links that will sendyou to a plethora ofrelevant sites that expandupon the concepts you’vediscovered in the text.

Cryptic CrosswordPuzzlesFor a fun review of chapter material, challengeyourself with theseinteractive crosswordpuzzles.

Ethical IssuesLearn more about the newsocial challenges that comewith the development ofcomputer and Internettechnology through thesediscussions and links. Biographical

SketchesBe introduced to some ofthe many people who havemade substantialcontributions to thecomputer science field.

Page 7: c o m p u t e r s c i e n c e illuminated - udn.vntailieuso.udn.vn/.../3/ComputerScienceIlluminated.TT.pdf · 2020. 3. 17. · Well respected in the field of Computer Science Education,

World Headquarters

Jones and Bartlett Publishers

40 Tall Pine Drive

Sudbury, MA 01776

978-443-5000

[email protected]

www.jbpub.com

Jones and Bartlett Publishers Canada

2406 Nikanna Road

Mississauga, ON L5C 2W6

CANADA

Jones and Bartlett Publishers

International

Barb House, Barb Mews

London W6 7PA

UK

Copyright © 2002 by Jones and Bartlett Publishers, Inc.

Library of Congress Cataloging-in-Publication Data

Dale, Nell B.

Computer science illuminated / Nell Dale, John Lewis.

p. cm.

ISBN 0-7637-1760-6

1. Computer science. I. Lewis, John (John Allan), 1963- II. Title.

QA76 . D285 2002

004—dc21 2001050774

All rights reserved. No part of the material protected by this copyright notice may be reproduced

or utilized in any form, electronic or mechanical, including photocopying, recording, or any

information storage or retrieval system, without written permission from the copyright owner.

Chief Executive Officer: Clayton Jones

Chief Operating Officer: Don W. Jones, Jr.

Executive V.P. and Publisher: Robert W. Holland, Jr.

V.P., Design and Production: Anne Spencer

V.P., Manufacturing and Inventory Control: Therese Bräuer

Editor-in-Chief: J. Michael Stranz

Production Manager: Amy Rose

Senior Marketing Manager: Nathan Schultz

Web Product Manager: Adam Alboyadjian

Senior Development Editor: Dean DeChambeau

Associate Production Editor: Tara McCormick

Editorial Assistant: Theresa DiDonato

Production Assistant: Karen Ferreira

Cover Design: Night & Day Design

Composition: Northeast Compositors

Copyediting: Roberta Lewis

Proofreading: Diane Freed Publishing Services

Illustrations and Technical Art: Smolinski Studios

Printing and Binding: Quebecor World Taunton

Cover Printing: John Pow Company, Inc.

This book was typeset in Quark 4.1 on a Macintosh G4. The font families used were Sabon, Franklin

Gothic, Futura, and Prestige Elite. The first printing was printed on 45# New Era Matte.

Printed in the United States of America

06 05 04 03 02 10 9 8 7 6 5 4 3 2 1

Page 8: c o m p u t e r s c i e n c e illuminated - udn.vntailieuso.udn.vn/.../3/ComputerScienceIlluminated.TT.pdf · 2020. 3. 17. · Well respected in the field of Computer Science Education,

To my wife Sharon and my son Justin—why I do

what I do.

John Lewis

To Al, my husband and best friend, and to Bamsi

Bear, one of man’s best friends, who took care of us

faithfully for 12 years.

Nell Dale

Page 9: c o m p u t e r s c i e n c e illuminated - udn.vntailieuso.udn.vn/.../3/ComputerScienceIlluminated.TT.pdf · 2020. 3. 17. · Well respected in the field of Computer Science Education,

John Lewis, Villanova University

John Lewis is a leading educator and author in the field of computer science.

He has written a market-leading textbook on Java software and program design.

After earning his undergraduate degree, M.S., and Ph.D. in computer science at

Virginia Tech, John joined the faculty of the Department of Computing Sciences at

Villanova University. He has received numerous teaching awards, including the

University Award for Teaching Excellence and the Goff Award for Outstanding

Teaching. His professional interests include object-oriented technologies,

multimedia, and software engineering. In addition to his teaching and writing,

John actively participates in the Special Interest Group on Computer Science

Education (SIGCSE), and finds time to spend with his family or in his workshop.

Nell Dale, University of Texas, Austin

Well respected in the field of Computer Science Education, Nell Dale has served on

the faculty of the University of Texas at Austin for more than 25 years and has

authored over 20 undergraduate Computer Science textbooks. After receiving her

B.S. in Mathematics and Psychology from the University of Houston, Nell entered

the University of Texas at Austin where she earned her M.A. in Mathematics and

her Ph.D. in Computer Science. Nell has made significant contributions to her

discipline through her writing, research, and service. Nell’s contributions were

recognized in 1996 with the ACM SIGCSE Award for Outstanding Contributions

in Computer Science Education. In the summer of 1994, Nell retired from full-time

teaching, giving her more time to write, travel, and play tennis. She currently

resides in Austin, Texas with her husband Al and their dog Maggie.

viii

Page 10: c o m p u t e r s c i e n c e illuminated - udn.vntailieuso.udn.vn/.../3/ComputerScienceIlluminated.TT.pdf · 2020. 3. 17. · Well respected in the field of Computer Science Education,

Laying the Groundwork 3

Chapter 1 The Big Picture . . . . . . . . . . . . . . . . . . . . . . .3

The Information Layer 33

Chapter 2 Binary Values and Number Systems . . . . . .33

Chapter 3 Data Representation . . . . . . . . . . . . . . . . .51

The Hardware Layer 87

Chapter 4 Gates and Circuits . . . . . . . . . . . . . . . . . . .87

Chapter 5 Computing Components . . . . . . . . . . . . . .115

The Programming Layer 141

Chapter 6 Problem Solving and Program Design . . .141

Chapter 7 Low-Level Programming Languages . . . . .187

Chapter 8 High-Level Programming Languages . . . . .225

Chapter 9 Abstract Data Types and Algorithms . . . . .275

The Operating Systems Layer 319

Chapter 10 Operating Systems . . . . . . . . . . . . . . . . .319

Chapter 11 File Systems and Directories . . . . . . . . . .349

The Applications Layer 373

Chapter 12 Information Systems . . . . . . . . . . . . . . .373

Chapter 13 Artificial Intelligence . . . . . . . . . . . . . . . .399

Chapter 14 Simulation and Other Applications . . . . .431

The Communications Layer 455

Chapter 15 Networks . . . . . . . . . . . . . . . . . . . . . . .455

Chapter 16 The World Wide Web . . . . . . . . . . . . . . .479

In Conclusion 501

Chapter 17 Limitations of Computing . . . . . . . . . . . .501

ix

bri

ef

conte

nts

Page 11: c o m p u t e r s c i e n c e illuminated - udn.vntailieuso.udn.vn/.../3/ComputerScienceIlluminated.TT.pdf · 2020. 3. 17. · Well respected in the field of Computer Science Education,

Laying the Groundwork

Chapter 1 The Big Picture . . . . . . . . . . . . . . . . . . .31.1 Computing Systems 4

Layers of a Computing System 4Abstraction 7

1.2 The History of Computing 9A Brief History of Computing Hardware 9A Brief History of Computing Software 17Predictions 23

1.3 Computing as a Tool and a Discipline 24Summary 26Ethical Issues: Microsoft Anti-Trust Case 27Key Terms 28Exercises 28Thought Questions 31

The Information Layer

Chapter 2 Binary Values and Number Systems . .332.1 Number Categories 342.2 Natural Numbers 35

Positional Notation 35Binary, Octal, and Hexadecimal 38Arithmetic in Other Bases 39Power of Two Number Systems 40Converting From Base 10 to Other Bases 42

x Contents

Page 12: c o m p u t e r s c i e n c e illuminated - udn.vntailieuso.udn.vn/.../3/ComputerScienceIlluminated.TT.pdf · 2020. 3. 17. · Well respected in the field of Computer Science Education,

Binary Values and Computers 43Summary 45Ethical Issues: The Digital Divide 45Key Terms 46Exercises 46Thought Questions 49

Chapter 3 Data Representation . . . . . . . . . . . . . .513.1 Data and Computers 52

Analog and Digital Information 53Binary Representations 55

3.2 Representing Numeric Data 57Representing Negative Values 57Representing Real Numbers 61

3.3 Representing Text 63The ASCII Character Set 64The Unicode Character Set 65Text Compression 66

3.4 Representing Audio Information 70Audio Formats 72The MP3 Audio Format 73

3.5 Representing Images and Graphics 73Representing Color 73Digitized Images and Graphics 76Vector Representation of Graphics 77

3.6 Representing Video 78Video Codecs 78Summary 79Ethical Issues: Napster 79Key Terms 80Exercises 81Thought Questions 85

Contents xi

Page 13: c o m p u t e r s c i e n c e illuminated - udn.vntailieuso.udn.vn/.../3/ComputerScienceIlluminated.TT.pdf · 2020. 3. 17. · Well respected in the field of Computer Science Education,

The Hardware Layer

Chapter 4 Gates and Circuits . . . . . . . . . . . . . . .874.1 Computers and Electricity 884.2 Gates 90

NOT Gate 90AND Gate 92OR Gate 92XOR Gate 93NAND and NOR Gates 94Review of Gate Processing 95Gates with More Inputs 95

4.3 Constructing Gates 96Transistors 96

4.4 Circuits 99Combinational Circuits 99Adders 102Multiplexers 104

4.5 Circuits as Memory 106

4.6 Integrated Circuits 107

4.7 CPU Chips 108Summary 108Ethical Issues: E-mail Privacy 109Key Terms 110Exercises 110Thought Questions 113

Chapter 5 Computing Components . . . . . . . . . .1155.1 Individual Computer Components 1165.2 Stored-Program Concept 119

von Neumann Architecture 119The Fetch-Execute Cycle 124RAM and ROM 126Secondary Storage Devices 127

xii Contents

Page 14: c o m p u t e r s c i e n c e illuminated - udn.vntailieuso.udn.vn/.../3/ComputerScienceIlluminated.TT.pdf · 2020. 3. 17. · Well respected in the field of Computer Science Education,

5.3 Non-von Neumann Architectures 1315.4 Interpreting Ads 133

Summary 134Ethical Issues: Facial Recognition/Privacy 135Key Terms 136Exercises 136Thought Questions 139

The Programming Layer

Chapter 6 Problem Solving and Algorithm Design . . . . . . . . . . . . . . . . . . . . . . .141

6.1 Problem Solving 142How to Solve Problems 143Computer Problem-Solving 148Following an Algorithm 149Developing an Algorithm 151

6.2 Top-Down Design 151A General Example 153A Computer Example 155Summary of Methodology 160Testing the Algorithm 160

6.3 Object-Oriented Design 162Object Orientation 163Relationships between Classes 163Object-Oriented Design Methodology 164General Example 169Computer Example 171

6.4 Important Threads 176Information Hiding 176Abstraction 177Naming Things 178Programming Languages 179Testing 179

Contents xiii

Page 15: c o m p u t e r s c i e n c e illuminated - udn.vntailieuso.udn.vn/.../3/ComputerScienceIlluminated.TT.pdf · 2020. 3. 17. · Well respected in the field of Computer Science Education,

Summary 179Ethical Issues: Plagiarism 180Key Terms 181Exercises 182Thought Questions 185

Chapter 7 Low-Level Programming Languages . . . . . . . . . . . . . . . . . . . . . . . . . . . .187

7.1 Computer Operations 1887.2 Levels of Abstraction 1897.3 Machine Language 189

Pep/7: A Virtual Computer 190

7.4 A Program Example 198Problem and Algorithm 198A Program 199An Alternate Program for the Same Algorithm 203An Enhanced Version of “Hello” 204

7.5 Assembly Language 207Pep/7 Assembly Language 207

7.6 Other Important Threads 215Testing 216Summary 218Ethical Issues: Software Piracy, Copyrighting 219Key Terms 220Exercises 220Thought Questions 223

Chapter 8 High-Level Programming Languages . . . . . . . . . . . . . . . . . . . . . . . . . . . .225

8.1 Translation Process 226Compilers 226Interpreters 227

8.2 Programming Language Paradigms 2288.3 Functionality of Imperative Languages 231

Boolean Expressions 232Strong Typing 234Input/Output Structures 239Control Structures 240Composite Data Types 257

8.4 Functionality of Object-Oriented Languages 261Encapsulation 261

xiv Contents

Page 16: c o m p u t e r s c i e n c e illuminated - udn.vntailieuso.udn.vn/.../3/ComputerScienceIlluminated.TT.pdf · 2020. 3. 17. · Well respected in the field of Computer Science Education,

Inheritance 262Polymorphism 262Summary 264Ethical Issues: Hacking 265Key Terms 266Exercises 266Thought Questions 272

Chapter 9 Abstract Data Types and Algorithms . . . . . . . . . . . . . . . . . . . . . . . . .275

9.1 Abstract Data Types 2769.2 Implementation 277

Array-Based Implementations 277Linked Implementation 279

9.3 Lists 282Basic List Operations 282Additional List Operations 287

9.4 Sorting 287Selection Sort 288Bubble Sort 290Quicksort 291

9.5 Binary Search 2959.6 Stacks and Queues 298

Stacks 298Queues 300Implementation 300

9.7 Trees 300Binary Trees 302Binary Search Trees 303Other Operations 309Graphs 310

9.8 Programming Libraries 310Summary 311Ethical Issues: Web Content 312Key Terms 313Exercises 313Thought Questions 317

Contents xv

Page 17: c o m p u t e r s c i e n c e illuminated - udn.vntailieuso.udn.vn/.../3/ComputerScienceIlluminated.TT.pdf · 2020. 3. 17. · Well respected in the field of Computer Science Education,

The Operating Systems Layer

Chapter 10 Operating Systems . . . . . . . . . . . . .31910.1 Roles of an Operating System 320

Memory, Process, and CPU Management 322Batch Processing 323Timesharing 324Other OS Factors 325

10.2 Memory Management 326Single Contiguous Memory Management 327Partition Memory Management 329Paged Memory Management 331

10.3 Process Management 333The Process States 333The Process Control Block 334

10.4 CPU Scheduling 335First-Come, First-Served 336Shortest Job Next 337Round Robin 337Summary 339Ethical Issues: Privacy Invasion 340Key Terms 341Exercises 342Thought Questions 347

Chapter 11 File Systems and Directories . . . . . .34911.1 File Systems 350

Text and Binary Files 351File Types 352File Operations 353File Access 354File Protection 356

11.2 Directories 357Directory Trees 357Path Names 359

xvi Contents

Page 18: c o m p u t e r s c i e n c e illuminated - udn.vntailieuso.udn.vn/.../3/ComputerScienceIlluminated.TT.pdf · 2020. 3. 17. · Well respected in the field of Computer Science Education,

11.3 Disk Scheduling 363First-Come, First-Served Disk Scheduling 364Shortest-Seek-Time-First Disk Scheduling 365SCAN Disk Scheduling 365Summary 366Ethical Issues: Computer Viruses and Denial of Service 367Key Terms 368Exercises 368Thought Questions 371

The Applications Layer

Chapter 12 Information Systems . . . . . . . . . . .37312.1 Managing Information 37412.2 Spreadsheets 375

Spreadsheet Formulas 377Circular References 382Spreadsheet Analysis 382

12.3 Database Management Systems 383The Relational Model 384Relationships 387Structured Query Language 388Database Design 390Summary 392Ethical Issues: Encryption 393Key Terms 394Exercises 394Thought Questions 397

Chapter 13 Artificial Intelligence . . . . . . . . . . . .39913.1 Thinking Machines 400

The Turing Test 401

Contents xvii

Page 19: c o m p u t e r s c i e n c e illuminated - udn.vntailieuso.udn.vn/.../3/ComputerScienceIlluminated.TT.pdf · 2020. 3. 17. · Well respected in the field of Computer Science Education,

Aspects of AI 403

13.2 Knowledge Representation 403Semantic Networks 404Search Trees 406

13.3 Expert Systems 40913.4 Neural Networks 412

Biological Neural Networks 412Artificial Neural Networks 413

13.5 Natural Language Processing 415Voice Synthesis 416Voice Recognition 417Natural Language Comprehension 418

13.6 Robotics 419The Sense-Plan-Act Paradigm 420Subsumption Architecture 421Physical Components 422Summary 424Ethical Issues: Deep Linking 425Key Terms 426Exercises 426Thought Questions 429

Chapter 14 Simulation and Other Applications . . . . . . . . . . . . . . . . . . . . . . . . . . .431

14.1 What Is Simulation? 432Complex Systems 432Models 433Constructing Models 433Queuing Systems 435Meteorological Models 438Other Models 444Computing Power Necessary 444

14.2 Graphics and Computer-Aided Design (CAD) 44514.3 Embedded Systems 447

Summary 449Ethical Issues: Online Gambling 449Key Terms 450Exercises 451Thought Questions 452

xviii Contents

Page 20: c o m p u t e r s c i e n c e illuminated - udn.vntailieuso.udn.vn/.../3/ComputerScienceIlluminated.TT.pdf · 2020. 3. 17. · Well respected in the field of Computer Science Education,

The Communications Layer

Chapter 15 Networks . . . . . . . . . . . . . . . . . . . .45515.1 Networking 456

Types of Networks 457Internet Connections 459Packet Switching 462

15.2 Open Systems and Protocols 463Open Systems 463Network Protocols 464TCP/IP 465High-Level Protocols 465MIME Types 466Firewalls 467

15.3 Network Addresses 468Domain Name System 469Summary 471Ethical Issues: Cybersquatting 473Key Terms 474Exercises 475Thought Questions 477

Chapter 16 The World Wide Web . . . . . . . . . . .47916.1 Spinning the Web 480

16.2 HTML 482Basic HTML Formatting 485Images and Links 486

16.3 Interactive Web Pages 487Java Applets 487Java Server Pages 488

16.4 XML 489Summary 493Ethical Issues: Cookies 495Key Terms 496Exercises 496Thought Questions 498

Contents xix

Page 21: c o m p u t e r s c i e n c e illuminated - udn.vntailieuso.udn.vn/.../3/ComputerScienceIlluminated.TT.pdf · 2020. 3. 17. · Well respected in the field of Computer Science Education,

In Conclusion

Chapter 17 Limitations of Computing . . . . . . . .50117.1 Hardware 502

Limits on Arithmetic 502Limits on Communications 509

17.2 Software 510Complexity of Software 511Current Approaches to Software Quality 512Notorious Software Errors 516

17.3 Problems 518Comparing Algorithms 519Turing Machines 525Halting Problem 528Classification of Algorithms 531Summary 532Ethical Issues: Licensing Computer Professionals 533Key Terms 535Exercises 535Thought Questions 538

Answers to Selected Exercises 539

Glossary 603

Endnotes 631

Index 639

xx Contents

Page 22: c o m p u t e r s c i e n c e illuminated - udn.vntailieuso.udn.vn/.../3/ComputerScienceIlluminated.TT.pdf · 2020. 3. 17. · Well respected in the field of Computer Science Education,

Preface

Welcome to Computer Science Illuminated! This book provides a broadand thorough exploration of computer systems within a computerscience context. Although this is classified as a CS-0 book, we realize

that the term CS-0 means different things to different people.Independently, both of us have written successful textbooks on various

topics, but this book represents our first opportunity for such acomprehensive exploration of computing. We're thrilled to join forces to offerthis book.

We take pedagogy seriously—and we know you do, too.

This book is designed as a breadth-first introduction to the field ofcomputer science, providing a comprehensive and rigorous exploration of avariety of topics. It provides a general understanding of computers in all theiraspects, and it lays a solid foundation to support further study. Therefore,this book is appropriate both for computer science majors beginning theirstudies and for non-majors seeking a broad but complete overview.

Choice of TopicsWe used many sources in putting together the outline of topics for this text.We looked at course catalogue descriptions and book outlines, andadministered a questionnaire designed to find out what you, our colleagues,thought should be included in such a course. We answered the following threequestions and asked you to do the same.

• What topics should students master in a CS-0 course if it is the onlycomputer science course they will take during their college experience?

• What topics should students have mastered before entering your CS-1course?

Preface xxi

Page 23: c o m p u t e r s c i e n c e illuminated - udn.vntailieuso.udn.vn/.../3/ComputerScienceIlluminated.TT.pdf · 2020. 3. 17. · Well respected in the field of Computer Science Education,

• What additional topics should your CS-1 students be familiar with?

The strong consensus that emerged from the intersections of these sourcesformed the working outline for this book. Students who master this materialbefore taking CS-1 have a strong foundation upon which to continue in computerscience. Although our intention was to write a CS-0 text, our reviewers havepointed out that the material also forms a strong breadth-first background thatcan serve as a companion to a programming-language introduction to computerscience.

OrganizationIn Chapter 1, we set the stage with the analogy that a computing system islike an onion that has evolved layer by layer over time. The history ofhardware and software is presented beginning with the computer andmachine language, the heart of the onion. Higher level languages such asFORTRAN, Lisp, Pascal, C, C++, and Java followed, along with the ever-increasing understanding of the programming process using such tools astop-down design and object-oriented design. The operating system with itsresource-management techniques developed to surround and manage theselanguages and the programs written in them.

Sophisticated general-purpose and special-purpose software systems thatallowed non-computer people to solve problems were developed to form anotherlayer. These powerful programs were stimulated by parallel theoretical work incomputer science, which made such programs possible. The final layer is madeup of networks and software—all the tools needed for computers to communicatewith one another. The Internet and the World Wide Web put the finishing toucheson this layer.

Through our teaching experience we have discovered that complexconcepts are easier to understand if handled one layer at a time rather thanin one big bite. Thus, the book is organized into the following sections:

• Information Layer

• Hardware Layer

• Programming Layer

• Operating Systems Layer

• Applications Layer

• Communications Layer

These layers, taken in this order, examine a computer system from theinside out. Research has shown that students understand concrete examplesmore easily than abstract ones even when the students themselves are abstractthinkers. Thus, we begin with the concrete machine, and add one layer at atime, each abstracting the details of the previous level, so that other aspectsof computing can be explored. We believe that a thorough understandingof one layer makes the transition to the next abstraction easier for students.

xxii Preface

Information Layer

Hardware Layer

Programming Layer

Operating Systems Layer

Applications Layer

Communications Layer

Page 24: c o m p u t e r s c i e n c e illuminated - udn.vntailieuso.udn.vn/.../3/ComputerScienceIlluminated.TT.pdf · 2020. 3. 17. · Well respected in the field of Computer Science Education,

Individual chapters within each layer focus on particular aspects of thatlayer. The next section provides a synopsis of each chapter.

The design of this book is extremely modular. The layered view of acomputing system provides flexibility to instructors who may choose toemphasize topics differently or place them in a different order. We revisit theonion analogy at the opening of each chapter, showing how the currentdiscussion fits into the big picture.

SynopsisThe first and last chapters of the book form bookends: Chapter 1 describes

what a computing system is and Chapter 17 explores what computing systemscannot do. The chapters in between look in depth at the layers that makeup a computing system and explain, one step at a time, how a computer doeswhat it does.

Chapter 1 lays the groundwork for the rest of the book, establishingterminology and explaining the history of computing. The evolution of thehardware and software levels that make up the history of computing systemsform much of the underlying structure of the layers explored throughout thebook.

Chapters 2 and 3 examine a layer that is largely conceptual, yetpermeates all other aspects of computer processing. We call this layer theinformation layer, and it reflects how information is represented in thecomputer. Chapter 2 covers the binary number system and its relationshipto other number systems (such as decimal, the one we humans use on a dailybasis). Chapter 3 investigates how we take the myriad types of informationwe manage—numbers, text, images, audio, and video—and represent themin a binary format.

Chapters 4 and 5 explore the hardware layer. Chapter 4 describes gatesand circuits, which control the flow of electricity in fundamental ways. Thiscore electronic circuitry gives rise to the discussion in Chapter 5 of specializedhardware components such as the Central Processing Unit (CPU) andmemory, including how they interact within a von Neumann architecture.

Chapters 6 through 9 cover aspects of the programming layer. Chapter6 examines the problem-solving process, both human and computer related.George Polya's human problem-solving strategies guide the discussion.Examples of both top-down design and object-oriented design are presented.Chapter 7 covers the concepts of both machine language and assemblylanguage using Pep/7, a simulated computer. Chapter 8 covers the conceptsof high-level programming languages. The concepts are illustrated in briefexamples from four programming languages: Ada, Visual Basic .NET, C++,and Java. Chapter 9 emphasizes the role of abstract data types and datastructures in the programming process.

Preface xxiii

Page 25: c o m p u t e r s c i e n c e illuminated - udn.vntailieuso.udn.vn/.../3/ComputerScienceIlluminated.TT.pdf · 2020. 3. 17. · Well respected in the field of Computer Science Education,

Chapters 10 and 11 cover the operating systems layer. Chapter 10discusses the resource-management responsibilities of the operating systemand presents some of the basic algorithms used to implement those tasks.Chapter 11 deals with file systems, including what they are and how they aremanaged by the operating system.

Chapters 12 through 14 cover the applications layer. This layer ismade up of the general-purpose and specialized application programs thatare available for public use to solve problems. We divide this layer into thesub-disciplines of computer science upon which these programs are based.Chapter 12 examines information systems, Chapter 13 examines artificialintelligence, and Chapter 14 examines simulation, computer-aided design,and embedded systems.

Chapters 15 and 16 cover the communications layer. Chapter 15discusses various aspects of computer networks, including how they evolvedand how they manage the transmission of data. Chapter 16 explores theWorld Wide Web and some of the technologies that give it the impact it hastoday.

Chapter 17 concludes with a discussion of the inherent limitations ofcomputer hardware, software, and the problems that can and cannot besolved using a computer. Big-O notation is presented as a way to talk aboutthe efficiency of algorithms so that the categories of algorithms can bediscussed. The Halting problem is presented to show that some problems areunsolvable.

Language IssuesNote that the programming layer of this book deals with various aspects ofprogramming without going into detail on any one language. In fact, wedeliberately present high-level programming constructs in several languagesfor students to see a variety of syntax, and to reinforce that the underlyingconceptual ideas are far more important than the particular language usedto implement them.

A more detailed introduction to two high-level programming languages,Java and C++, are provided on this book’s web site. Any instructor wantingto expose their students to the details of a language may use these chaptersto supplement the book.

Special FeaturesWe have included three special features in this text in order to emphasize thehistory and breadth of computing as well as the moral obligations that comewith new technology. Each chapter includes a Short Biography of someonewho has made a significant contribution to computing. The people honoredin these sections range from those who have contributed to the information

xxiv Preface

Page 26: c o m p u t e r s c i e n c e illuminated - udn.vntailieuso.udn.vn/.../3/ComputerScienceIlluminated.TT.pdf · 2020. 3. 17. · Well respected in the field of Computer Science Education,

layer, such as George Boole and AdaLovelace, to those who have contributed tothe communications layer, such as DougEngelbart and Tim Berners-Lee. Thesebiographies are designed to give the readersome historical perspective and awarenessof the men and women who contributedand are contributing today to the world ofcomputing.

Our second feature, Callouts, are side-bar sections that include interesting tidbitsof information about the past, present, andfuture. They are garnered from history,from today’s newspapers, and from theauthors’ experiences. These little vignettesare designed to amuse, to inspire, and tointrigue.

Our third feature is the Ethical Issuessection included in each chapter. Thesesections are designed to illustrate that alongwith the advantages of computing comesresponsibility. Privacy, hacking, viruses, andfree speech are among the topics discussed.At the end of each chapter’s exercises weinclude a selection of Thought Questions.Among the questions presented here arequestions relating to the ethical issuepresented in the chapter.

Color and Typography are Sign-

postsThe layers into which the book is dividedare color coded within the text. The colorof the outside layer of the onion pictured oneach chapter opener corresponds to thelayer of that chapter. The same color isrepeated in bars across the top of the pagesof the layer. For each chapter, the slide onthe side of the chapter opener shows where

Preface xxv

Burroughs. The best-known success story of thepersonal computer revolution is that of the Apple. SteveWozniak, an engineer, and Steve Jobs, a high-schoolstudent, created a personal computer kit and marketed itout of a garage. This was the beginning of Apple

wasmanywere

micro-

From a garage to the Fortune 500

Boyhood friends Steve Jobs and Steve Wozniaksold their respective Volkswagen van andprogrammable calculator to raise the money tofinance their new computer company. Their firstsale was 50 Apple Is, the computer that they haddesigned and built in a garage. In six shortyears Apple was listed in the Fortune 500, theyoungest firm on this prestigious list. W

WW

From 1943 until her death on New Year’sDay in 1992, Admiral Grace MurrayHopper was intimately involved withcomputing. In 1991, she was awarded theNational Medal of Technology “for herpioneering accomplishments in the develop-ment of computer programming languagesthat simplified computer technology andopened the door to a significantly largeruniverse of users.”

Admiral Hopper was born Grace Brew-ster Murray in New York City on December 9, 1906.She attended Vassar and received a Ph.D. in mathe-matics from Yale. For the next 10 years, she taughtmathematics at Vassar.

In 1943, Admiral Hopper joined the U.S. Navy andwas assigned to the Bureau of Ordnance ComputationProject at Harvard University as a programmer on theMark I. After the war, she remained at Harvard as afaculty member and continued work on the Navy‘sMark II and Mark III computers. In 1949, she joinedEckert-Mauchly Computer Corporation and worked onthe UNIVAC I. It was there that she made a legendarycontribution to computing: She discovered the firstcomputer “bug”—a moth caught in the hardware.

only to be recalled within a year to full-time active duty. Her mission was tooversee the Navy’s efforts to maintainuniformity in programming languages. Ithas been said that just as Admiral HymanRickover was the father of the nuclearnavy, Rear Admiral Hopper was themother of computerized data automationin the Navy. She served with the NavalData Automation Command until sheretired again in 1986 with the rank of Rear

Admiral. At the time of her death, she was a seniorconsultant at Digital Equipment Corporation.

During her lifetime, Admiral Hopper receivedhonorary degrees from more than 40 colleges anduniversities. She was honored by her peers onseveral occasions, including the first ComputerSciences Man of the Year award given by the DataProcessing Management Association, and theContributors to Computer Science Education Awardgiven by the Special Interest Group for ComputerScience Education, which is part of the ACM (Associ-ation for Computing Machinery).

Admiral Hopper loved young people and enjoyedgiving talks on college and university campuses. She

Grace Murray Hopper

WWW

NapsterIn 1999, Shawn Fanning launched a file-sharing program that took the

music industry by storm, rapidly gaining the praise of millions and the

criticism of many. Nineteen-year-old Shawn had only recently dropped

out of his first year at Northeastern University to pursue a solution to

the difficulty of downloading and exchanging music over the Net. With

the support of his uncle, Shawn tackled this problem with dedication

and ingenuity and, in a few months, developed an answer. Shawn wrote

source code that wove together a search engine, file sharing, and

Internet Relay Chat, making it possible for anyone to easily access and

trade music files. Napster was born, and with it a fresh controversy

over intellectual property rights and privileges.

Page 27: c o m p u t e r s c i e n c e illuminated - udn.vntailieuso.udn.vn/.../3/ComputerScienceIlluminated.TT.pdf · 2020. 3. 17. · Well respected in the field of Computer Science Education,

the chapter is within the layer. We have saidthat the first and last chapters form bookends.Although they are not part of the layers of thecomputing onion, we have given each a colorthat shows up in the onion, the slide, and thecolor bar. Open the book anywhere and youcan immediately tell where you are within thelayers of computing.

We use different fonts for algorithms, in-cluding identifiers in running text, and programcode, to visually separate the abstract from theconcrete in the programming layer. You knowat a glance whether the discussion is at thelogical (algorithmic) level or at the pro-gramming language level. We color addresses inred in order to clarify visually the distinctionbetween an address and the contents of anaddress.

Color is especially useful in Chapter 7, Low-Level Programming Languages. Instructions arecolor coded to differentiate the parts of aninstruction. The operation code is green, theregister designation is clear, and the addressing

mode specifier is blue. Operands are shaded gray. As in other chapters,addresses are in red.

Web siteA web site, http://csilluminated.jbpub.com, includes a wealth of

additional information. Additional biographies, more information aboutsome of the callouts, and updates that relate to ethical issues are all availableon the text’s web site.

Available for download are introductory chapters on Java and C++ andthe Pep/7 virtual machine.

A number of interactive exercises have been developed to enhance thereader’s learning experience. Please refer to the two-page web site walkthrough for a complete description of these activities.

xxvi Preface

Laying the Groundwork

1Anatomy of a Computing System

The Information Layer

2 Binary Values and Number Systems

3 Data Representation

The Hardware Layer

4 Gates and Circuits

5 Computing Components

The Programming Layer

6 Problem Solving and Algorithms

7 Low-Level Programmming Languages

8 Procedural Programming Languages

9 Object-Oriented Design and Programming Languages

10 The Java Programming Language

11 Abstract Data Types and Algoritms

The Operating System Layer

12 Roles of an Operating System

13 File Systems and Directories

The Applications Layer

14 Information Systems

15 Artificial Intelligence

16 The Spectrum of Computing

The Communications Layer

17 Networks

18 The World Wide Web

In Conclusion

19 Limitations of Computing

3 Data Representation3 Data Representation

The Information Layer

Laying the Groundwork

1 The Big Picture

The Information Layer

2 Binary Values and Number Systems

3 Data Representation

The Hardware layer

4 Gates and Circuits

5 Computing Components

The Programming Layer

6 Problem Solving and Algorithm Design

7 Low-Level Programming Languages

8 High-Level Programming Languages

9 Abstract Data Types and Algorithms

The Operating Systems Layer

10 Operating Systems

11 File Systems and Directories

The Applications Layer

12 Information Systems

13 Artificial Intelligence

14 Simulation and Other Applications

The Communications Layer

15 Networks

16 The World Wide Web

In Conclusion

17 Limitations of Computing

Page 28: c o m p u t e r s c i e n c e illuminated - udn.vntailieuso.udn.vn/.../3/ComputerScienceIlluminated.TT.pdf · 2020. 3. 17. · Well respected in the field of Computer Science Education,

AcknowledgmentsWe would like to acknowledge the hard work of our colleagues who reviewedthe manuscript and helped shape the development of this book:

C. Michael Allen, University of North Carolina, Charlotte

Lofton Bullard, Florida Atlantic University

Cerian Jones, University of Alberta

Calvin Ribbens, Virginia Tech

Susan Sells, Wichita State University

Tom Wiggen, University of North Dakota

In addition, several individuals reviewed special sections of the manuscriptfor us: Mary Dee Harris, Chris Edmondson-Yurkanan, and Ben Kuipers ofthe University of Texas, Austin Department of Computer Science; DaveStauffer at Penn State; John McCormick at the University of Northern Iowa;Mike McMillan at Pulaski Technical College; Steve Maleno at Reuters, Inc.,and Dan Joyce of Villanova University. Thanks, friends and colleagues. Yourcomments and suggestions were invaluable. Thanks also to Sandy Baumanwho took an old snapshot and turned it into a portrait.

Mere words can’t possibly express what we owe to all the publishingprofessionals who worked so hard to make this book a reality. To MichaelStranz, Amy Rose, Anne Spencer, Dean DeChambeau, Theresa DiDonato,Tara McCormick, Adam Alboyadjian, Karen Ferreira, and Nathan Schultzat Jones and Bartlett and Mike and Sigrid Wile at Northeast Compositors—we thank you.

I must also thank my tennis buddies for keeping me fit, my bridge buddiesfor keeping my mind alert, and my family for keeping me grounded. ND

I thank my family for understanding the long hours it takes to put togethera project like this, and I thank my friends and colleagues in the Departmentof Computing Sciences at Villanova University for their support. JL

Preface xxvii