1 Laying the Groundwork . . . . . . . . . . . . .2 Chapter 1The Big Picture 3 1.1 Computing Systems 4
Layers of a Computing System 4
Abstraction 6
1.2 The History of Computing 9
A Brief History of Computing Hardware 9
A Brief History of Computing Software 19
Predictions 25
1.3 Computing as a Tool and a.Discipline 26
The Big Ideas of Computing 27
Summary 28
Ethical Issues: Digital Divide 30
Key Terms 31
Exercises 31
Thought Questions 33
2 The Information Layer . . . . . . . . . . . . .34 Chapter 2Binary Values and Number Systems 35 2.1 Numbers and Computing 36 2.2 Positional Notation 36
Binary, Octal, and Hexadecimal 38
Arithmetic in Other Bases 41
Power-of-2 Number Systems 42
Converting from Base 10 to Other Bases 44
Binary Values and Computers 45
Summary 48
Ethical Issues: The FISA Court 49
Key Terms 49
Exercises 50 Thought Questions 53
Chapter 3 Data Representation 55 3.1 Data and Computers 56
Analog and Digital Data 57
Binary Representations 59 3.2 Representing Numeric Data 61
Representing Negative Values 61
Representing Real Numbers 65
3.3 Representing Text 68
The ASCII Character Set 69
The Unicode Character Set 70
Text Compression 71
3.4 Representing Audio Data 77
Audio Formats 79
The MP3 Audio Format 79
3.5 Representing Images and Graphics 80
Representing Color 80
Digitized Images and Graphics 82
Vector Representation of Graphics 83
3.6 Representing Video 84
Video Codecs 84
Summary 85 Ethical Issues: The Fallout from Snowden’s Revelations 86 Key Terms 86 Exercises 87 Thought Questions 91 3 The Hardware Layer . . . . . . . . . . . . . . .92 Chapter 4 Gates and Circuits 93 4.1 Computers and Electricity 94 4.2 Gates 96
NOT Gate 96
AND Gate 97
OR Gate 98
XOR Gate 98
NAND and NOR Gates 99
Review of Gate Processing 100
Gates with More Inputs 101
4.3 Constructing Gates 101
Transistors 102
4.4 Circuits 104
Combinational Circuits 104
Adders 108
Multiplexers 110
4.5 Circuits as Memory 111 4.6 Integrated Circuits 112 4.7 CPU Chips 113 Summary 113 Ethical Issues: Codes of Ethics 114 Key Terms 116 Exercises 116 Thought Questions 119 Chapter 5 Computing Components 121 5.1 Individual Computer Components 122 5.2 The Stored-Program Concept 126
von Neumann Architecture 128
The Fetch–Execute Cycle 132
RAM and ROM 134
Secondary Storage Devices 135
Touch Screens 139
5.3 Embedded Systems 141 5.4 Parallel Architectures 142
Parallel Computing 142
Classes of Parallel Hardware 144
Summary 145 Ethical Issues: Is Privacy a Thing of the Past? 146 Key Terms 146 Exercises 147 Thought Questions 149 4 The Programming Layer . . . . . . . . . . .150 Chapter 6 Low-Level Programming Languages and Pseudocode 151 6.1 Computer Operations 152 6.2 Machine Language 152
Pep/9: A Virtual Computer 153
Input and Output in Pep/9 159
6.3 A Program Example 159
Pep/9 Simulator 160
Another Machine-Language Example 162
6.4 Assembly Language 163
Pep/9 Assembly Language 164
Numeric Data, Branches, and Labels 166
Loops in Assembly Language 170
6.5 Expressing Algorithms 171
Pseudocode Functionality 171
Following a Pseudocode Algorithm 175
Writing a Pseudocode Algorithm 177
Translating a Pseudocode Algorithm 180
6.6 Testing 182 Summary 183
Ethical Issues: Software Piracy 185
Key Terms 186 Exercises 186
Thought Questions 189
Chapter 7 Problem Solving and Algorithms 191 7.1 How to Solve Problems 192
Ask Questions 193
Look for Familiar Things 193
Divide and Conquer 194
Algorithms 194
Computer Problem-Solving Process 196
Summary of Methodology 197
Testing the Algorithm 198
7.2 Algorithms with Simple Variables 199
An Algorithm with Selection 199
Algorithms with Repetition 200
7.3 Composite Variables 206
Arrays 206
Records 207
7.4 Searching Algorithms 208
Sequential Search 208
Sequential Search in a Sorted Array 209
Binary Search 212
7.5 Sorting 214
Selection Sort 215
Bubble Sort 218
Insertion Sort 220
7.6 Recursive Algorithms 221
Subprogram Statements 221
Recursive Factorial 223
Recursive Binary Search 224
Quicksort 224
7.7 Important Threads 228
Information Hiding 228
Abstraction 229
Naming Things 230
Testing 231
Summary 231 Ethical Issues: Open-Source Software 232 Key Terms 234 Exercises 234 Thought Questions 239 Chapter 8 Abstract Data Types and Subprograms 241 8.1 What Is an Abstract Data Type? 242 8.2 Stacks 242 8.3 Queues 243 8.4 Lists 244 8.5 Trees 247
Binary Trees 247
Binary Search Trees 249
Other Operations 255
8.6 Graphs 256
Creating a Graph 258
Graph Algorithms 259
8.7 Subprograms 265
Parameter Passing 266
Value and Reference Parameters 268
Summary 271
Ethical Issues: Workplace Monitoring 273
Key Terms 274
Exercises 274
Thought Questions 279
Chapter 9 Object-Oriented Design and High-Level Programming Languages 281 9.1 Object-Oriented Methodology 282
Object Orientation 282
Design Methodology 283
Example 286
9.2 Translation Process 291
Compilers 292
Interpreters 292
9.3 Programming Language Paradigms 295
Imperative Paradigm 295
Declarative Paradigm 296
9.4 Functionality in High-Level Languages 298
Boolean Expressions 299
Data Typing 301
Input/Output Structures 305
Control Structures 307
9.5 Functionality of Object-Oriented Languages 313
Encapsulation 313
Classes 314
Inheritance 316
Polymorphism 317
9.6 Comparison of Procedural and Object-Oriented Designs 318 Summary 319
Ethical Issues: Hoaxes and Scams 321
Key Terms 322
Exercises 323
Thought Questions 327
The Operating Systems Layer . . . . . . .328 Chapter 10 Operating Systems 329 10.1 Roles of an Operating System 330
Memory, Process, and CPU Management 332
Batch Processing 333
Timesharing 334
Other OS Factors 335
10.2 Memory Management 336
Single Contiguous Memory Management 338
Partition Memory Management 339
Paged Memory Management 341
10.3 Process Management 344
The Process States 344
The Process Control Block 345
10.4 CPU Scheduling 346
First Come, First Served 347
Shortest Job Next 348
Round Robin 348
Summary 350
Ethical Issues: Medical Privacy: HIPAA 352
Key Terms 353
Exercises 354
Thought Questions 359
Chapter 11 File Systems and Directories 361 11.1 File Systems 362
Text and Binary Files 362
File Types 363
File Operations 365
File Access 366
File Protection 367
11.2 Directories 368
Directory Trees 369
Path Names 371
11.3 Disk Scheduling 373
First-Come, First-Served Disk Scheduling 375
Shortest-Seek-Time-First Disk Scheduling 375
SCAN Disk Scheduling 376
Summary 378 Ethical Issues: Privacy: Opt-In or Opt-Out? 380 Key Terms 381 Exercises 381 Thought Questions 385 6 The Applications Layer . . . . . . . . . . . .386 Chapter 12 Information Systems 387 12.1 Managing Information 388 12.2 Spreadsheets 389
Spreadsheet Formulas 391
Circular References 396
Spreadsheet Analysis 397
12.3 Database Management Systems 399
The Relational Model 399
Relationships 403
Structured Query Language 404
Database Design 405
12.4 E-Commerce 407 12.5 Big Data 408 Summary 409 Ethical Issues: Politics and the Internet 411 Key Terms 413 Exercises 413 Thought Questions 417 13.1 Thinking Machines 420
The Turing Test 421
Aspects of AI 423
13.2 Knowledge Representation 423
Semantic Networks 425
Search Trees 427
13.3 Expert Systems 430 13.4 Neural Networks 432
Biological Neural Networks 432
Artificial Neural Networks 433
13.5 Natural-Language Processing 435
Voice Synthesis 437
Voice Recognition 438
Natural-Language Comprehension 439
13.6 Robotics 440
The Sense–Plan–Act Paradigm 441
Subsumption Architecture 441
Physical Components 443
Summary 445
Ethical Issues: Initial Public Offerings 447
Key Terms 448
Exercises 448
Thought Questions 451
Chapter 14 Simulation, Graphics, Gaming, and Other Applications 453 14.1 What Is Simulation? 454
Complex Systems 454
Models 455 Constructing Models 455 14.2 Specific Models 457 Queuing Systems 457 Meteorological Models 461 Computational Biology 466 Other Models 467 Computing Power Necessary 467 14.3 Computer Graphics 468 How Light Works 470 Object Shape Matters 472 Simulating Light 472 Modeling Complex Objects 474 Getting Things to Move 480 14.4 Gaming 482 History of Gaming 483 Creating the Virtual World 484 Game Design and Development 485 Game Programming 486 Summary 487 Ethical Issues: Gaming as an Addiction 489 Key Terms 490 Exercises 490 Thought Questions 493 The Communications Layer . . . . . . . . .494 Chapter 15 Networks 495 15.1 Networking 496 Types of Networks 497 Internet Connections 500 Packet Switching 502 15.2 Open Systems and Protocols 504 Open Systems 504 Network Protocols 505 TCP/IP 506 High-Level Protocols 507 MIME Types 508 Firewalls 509 15.3 Network Addresses 510 Domain Name System 511 Who Controls the Internet? 514 15.4 Cloud Computing 515 15.5 Blockchain 516 Summary 517 Ethical Issues: The Effects of Social Networking 519 Key Terms 520 Exercises 521 Thought Questions 523 Chapter 16 The World Wide Web 525 16.1 Spinning the Web 526 Search Engines 527 Instant Messaging 528 Weblogs 529 Cookies 530 Web Analytics 530 16.2 HTML and CSS 531 Basic HTML Elements 535 Tag Attributes 536 More About CSS 537 More HTML5 Elements 540 16.3 Interactive Web Pages 541 Java Applets 541 Java Server Pages 542 16.4 XML 543 16.5 Social Network Evolution 547 Summary 548 Ethical Issues: Gambling and the Internet 551 Key Terms 552 Exercises 552 Thought Questions 555 Chapter 17 Computer Security 557 17.1 Security at All Levels 558 Information Security 558 17.2 Preventing Unauthorized Access 560 Passwords 561 CAPTCHA 563 Fingerprint Analysis 564 17.3 Malicious Code 565 Antivirus Software 566 Security Attacks 567 17.4 Cryptography 569 17.5 Protecting Your Information Online 572 Corporate Responsibility 574 Security and Portable Devices 574 WikiLeaks 575 Summary 578 Ethical Issues: Blogging and Journalism 580 Key Terms 581 Exercises 582 Thought Questions 585 In Conclusion . . . . . . . . . . . . . . . . . . .586 Chapter 18Limitations of Computing 587 18.1 Hardware 588 Limits on Arithmetic 588 Limits on Components 594 Limits on Communications 595 18.2 Software 596 Complexity of Software 596 Current Approaches to Software Quality 597 Notorious Software Errors 602 18.3 Problems 604 Comparing Algorithms 605 Turing Machines 612 Halting Problem 615 Classification of Algorithms 617 Glossary 625 Endnotes 651 Index 661