+ All Categories
Home > Documents > Chapter 1 Background

Chapter 1 Background

Date post: 22-Feb-2016
Category:
Upload: sal
View: 29 times
Download: 0 times
Share this document with a friend
Description:
Chapter 1 Background. Fundamentals of Java: AP Computer Science Essentials, 4th Edition. Lambert / Osborne. Objectives. Give a brief history of computers. Describe how hardware and software make up computer architecture. Explain the binary representation of data and program in computers. 2. - PowerPoint PPT Presentation
Popular Tags:
39
1 Chapter 1 Background Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne
Transcript
Page 1: Chapter 1 Background

1

Chapter 1Background

Fundamentals of Java: AP Computer Science Essentials, 4th Edition

Lambert / Osborne

Page 2: Chapter 1 Background

Chapter 1

Lambert / Osborne Fundamentals of Java 4E222

Objectives

Give a brief history of computers. Describe how hardware and software make

up computer architecture. Explain the binary representation of data and

program in computers.

Page 3: Chapter 1 Background

Chapter 1

Lambert / Osborne Fundamentals of Java 4E333

Objectives (continued)

Discuss the evolution of programming languages.

Describe the software developmental process.

Discuss the fundamental concepts of object-oriented programming.

Page 4: Chapter 1 Background

Chapter 1

Lambert / Osborne Fundamentals of Java 4E444

Vocabulary

application software assembly language auxiliary input/output (I/O) auxiliary storage device bit byte

central processing unit (CPU)

hardware information hiding instance variables internal memory machine language

Page 5: Chapter 1 Background

Chapter 1

Lambert / Osborne Fundamentals of Java 4E555

Vocabulary (continued)

network connection object-oriented programming primary memory RAM secondary memory software

software development life cycle (SDLC)

system software ubiquitous

computing user interface waterfall model

Page 6: Chapter 1 Background

Chapter 1

Lambert / Osborne Fundamentals of Java 4E666

History of Computers

ENIAC (1940s) was one of the world’s first digital electronic computers.

IBM sold its first business computer in the 1950s.– It was thought the world needed no more than 10.– Power was 1/2000 of the typical laptop of today.

Today there are hundreds of millions of laptop and desktop computers in the world.

Page 7: Chapter 1 Background

Chapter 1

Lambert / Osborne Fundamentals of Java 4E777

History of Computers (continued)

The first computers could perform only a single task at a time.– Paper cards and tape used for input and output.

In 1960s, time-sharing computers were sold for businesses.– Cost up to millions of dollars.– 30 people could work at once.– Teletypes used phone wires.

Page 8: Chapter 1 Background

Chapter 1

Lambert / Osborne Fundamentals of Java 4E888

History of Computers (continued)

In 1970s, e-mail and file transfers were born. In 1980s, personal computers and local area

networks were available. In 1990s, an explosion of computer use and

availability of Internet access. Computing has become ubiquitous.

– Cell phones, cameras, PDAs, music players

Page 9: Chapter 1 Background

Chapter 1

Lambert / Osborne Fundamentals of Java 4E999

Computer Hardware and Software

Computers are machines that process information. Hardware are the physical devices on your desktop. Software are the programs that give the hardware

functionality. Bits and Bytes: Bits are the smallest unit of information processed by

a computer (0s and 1s). Bytes are eight bits.

Page 10: Chapter 1 Background

Chapter 1

Lambert / Osborne Fundamentals of Java 4E101010

Computer Hardware and Software (continued)

Computer Hardware: Computers have six major subsystems:

– User interface– Auxiliary input/output (I/O)

Keyboard, monitor, printer, digital camera, joystick– Auxiliary storage devices

Secondary memory Hard disks, DVDs, flash memory

– Network connection Modem, TV cable, satellite dish, Ethernet cards

Page 11: Chapter 1 Background

Chapter 1

Lambert / Osborne Fundamentals of Java 4E

Computer Hardware and Software (continued)

Computer Hardware (cont):– Internal memory (RAM)

RAM (random access memory) is primary memory ROM (read-only memory)

– Central processing unit (CPU) Performs basic tasks using complex hardware. Moore’s Law: speed is doubled every two years Transistor is the building block of the CPU and RAM.

11

Page 12: Chapter 1 Background

Chapter 1

Lambert / Osborne Fundamentals of Java 4E12

Secondary Memory DevicesInformation is movedbetween main memoryand secondary memoryas needed

CentralProcessing

Unit

MainMemory

Floppy Disk

Hard Disk

Secondary memorydevices providelong-term storage

Hard disksFloppy disksZIP disksWritable CDsWritable DVDsTapes

Page 13: Chapter 1 Background

Chapter 1

Lambert / Osborne Fundamentals of Java 4E131313

Computer Hardware and Software (continued)

A computer’s six major subsystems

Page 14: Chapter 1 Background

Chapter 1

Lambert / Osborne Fundamentals of Java 4E141414

Computer Hardware and Software (continued)

Computer Software:– System software

Supports the operations of the computer. Includes the operating system, communication software,

compilers, and the user interface subsystem.– Application software

Allows users to accomplish tasks. Types include Word processors, spreadsheets, databases,

and multimedia.

Page 15: Chapter 1 Background

Chapter 1

Lambert / Osborne Fundamentals of Java 4E151515

Binary Representation of Information and Computer Memory

Computer memory stores patterns of electronic signals.

The patterns are strings of binary digits or bits. Computers use binary (base 2) notation.

– Two bases: On/Off– Computer scientists also use bases octal (8) and

hexadecimal (16).

Page 16: Chapter 1 Background

Chapter 1

Lambert / Osborne Fundamentals of Java 4E16

Representing Text Digitally For example, every character is stored as a number, including spaces,

digits, and punctuation

Corresponding upper and lower case letters are separate characters

H i , H e a t h e r .

72 105 44 32 72 101 97 116 104 101 114 46

Page 17: Chapter 1 Background

Chapter 1

Lambert / Osborne Fundamentals of Java 4E17

Binary Numbers

Once information is digitized, it is represented and stored in memory using the binary number system

A single binary digit (0 or 1) is called a bit

Devices that store and move information are cheaper and more reliable if they have to represent only two states

Page 18: Chapter 1 Background

Chapter 1

Lambert / Osborne Fundamentals of Java 4E18

Binary Numbers

A single bit can represent two possible states, like a light bulb that is either on (1) or off (0)

Combinations of bits are used to store values

Page 19: Chapter 1 Background

Chapter 1

Lambert / Osborne Fundamentals of Java 4E19

Bit Combinations

1 bit01

2 bits00011011

3 bits000001010011100101110111

4 bits00000001001000110100010101100111

10001001101010111100110111101111

Each additional bit doubles the number of possible combinations

Page 20: Chapter 1 Background

Chapter 1

Lambert / Osborne Fundamentals of Java 4E20

Bit Combinations Each combination can represent a particular

item There are 2N combinations of N bits Therefore, N bits are needed to represent 2N

unique items 21 = 2 items

22 = 4 items

23 = 8 items

24 = 16 items

25 = 32 items

1 bit ?

2 bits ?

3 bits ?

4 bits ?

5 bits ?

How manyitems can be

represented by

Page 21: Chapter 1 Background

Chapter 1

Lambert / Osborne Fundamentals of Java 4E21

Bit Combinations Suppose we have three bits … see how

different numbers are represented with them

1 0 1 5

22 = 4 0 1+ + = 5

1 1 1 7

22 = 4 21 = 2 1+ + = 7

Page 22: Chapter 1 Background

Chapter 1

Lambert / Osborne Fundamentals of Java 4E22

Bit Combinations

Since you were very small, people have told you that you can count up to 10 with your two hands, right?

Well … you can do better than this … With one hand you can count up to 31 … With two hands you can count up to 1023 …

Page 23: Chapter 1 Background

Chapter 1

Lambert / Osborne Fundamentals of Java 4E232323

Binary Representation of Information and Computer Memory (continued)

Floating-Point numbers– Fractions– Use mantissa/exponent notation

Characters and Strings– ASCII, represents patterns as bytes

Java uses Unicode– Patterns of 15 bits from 0000 0000 0000 0000 to

1111 1111 1111 1111

Page 24: Chapter 1 Background

Chapter 1

Lambert / Osborne Fundamentals of Java 4E242424

Binary Representation of Information and Computer Memory (continued)

Floating-Point numbers– Fractions– Use mantissa/exponent notation

Characters and Strings– ASCII, represents patterns as bytes

Java uses Unicode– Patterns of 15 bits from 0000 0000 0000 0000 to

1111 1111 1111 1111

Page 25: Chapter 1 Background

Chapter 1

Lambert / Osborne Fundamentals of Java 4E252525

Binary Representation of Information and Computer Memory (continued)

Sound is analog data.– Analog information has a continuous range of infinite

values.– Sampling reads the waveform at intervals.– Memory requirements for sound are higher than text.

Images– Sampling measures color values as pixels in a two-

dimensional grid.– Grayscale, black-and-white, RGB, true-color

Page 26: Chapter 1 Background

Chapter 1

Lambert / Osborne Fundamentals of Java 4E262626

Binary Representation of Information and Computer Memory (continued)

Video– Video includes a soundtrack and a set of images

called frames.– Data compression is difficult.

Program instructions– A sequence of bits in RAM

Computer Memory– A gigantic sequence of bytes, each with an address.

Page 27: Chapter 1 Background

Chapter 1

Lambert / Osborne Fundamentals of Java 4E272727

Programming Languages

Generation 1 (Late 1940s to Early 1950s)-Machine Languages:

Programs were coded in machine language, whose only symbols are binary digits.

Coding was tedious, slow, and error-prone. It was difficult to modify programs. Each type had its own machine language so

programs were not portable.

Page 28: Chapter 1 Background

Chapter 1

Lambert / Osborne Fundamentals of Java 4E282828

Programming Languages (continued)

Generation 2 (Early 1950s to Present)-Assembly Languages:

Assembly languages use mnemonic symbols to represent instructions & data.

Programs are translated by assembler and loaded and run using a loader.

Assembly language is more programmer friendly, but still tedious.

Like machine language, it is not portable as each computer has its own unique language.

Page 29: Chapter 1 Background

Chapter 1

Lambert / Osborne Fundamentals of Java 4E292929

Programming Languages (continued)

Generation 3 (Mid-1950s to Present)-High-Level Languages:

Examples of high-level languages are FORTRAN, COBOL, BASIC, C, Pascal, C++, Python, Smalltalk, and Java.

High-level languages are easy to write, read, understand.

Translation to machine language is done using a compiler.

Java does not need to be recompiled for each type of computer.

Page 30: Chapter 1 Background

Chapter 1

Lambert / Osborne Fundamentals of Java 4E303030

The Software Development Process

Software development life cycle (SDLC)– Waterfall method:

Customer request (user requirements) Analysis Design Implementation (coding) Integration Maintenance

Page 31: Chapter 1 Background

Chapter 1

Lambert / Osborne Fundamentals of Java 4E313131

The Software Development Process (continued)

Percentage of total cost incurred in each phase of the development process

Page 32: Chapter 1 Background

Chapter 1

Lambert / Osborne Fundamentals of Java 4E323232

Basic Concepts of Object-Oriented Programming

High-level programming languages fall into two major groups.

The older languages, COBOL, FORTRAN, BASIC, C, and Pascal, all use a procedural approach.

New languages, Smalltalk, C++, Python, and Java use an object-oriented approach.– Object-oriented is considered superior.

Page 33: Chapter 1 Background

Chapter 1

Lambert / Osborne Fundamentals of Java 4E333333

Basic Concepts of Object-Oriented Programming (continued)

Object-oriented programming (OOP) process is the process of programming with objects.– Steps: planning, execution, outcome

Programs are composed of different types of software components called classes.

Classes define:– Instance variables (data resources)– Methods (rules of behavior)

Combining resources and behaviors into a single software entity is encapsulation.

Page 34: Chapter 1 Background

Chapter 1

Lambert / Osborne Fundamentals of Java 4E343434

Basic Concepts of Object-Oriented Programming (continued)

An executing program is composed of interacting objects.– An object is an instance of the class that

describes its resources and behavior. Objects send messages to each other to

accomplish the mission of the program. Information hiding provides access to

services but not data resources.

Page 35: Chapter 1 Background

Chapter 1

Lambert / Osborne Fundamentals of Java 4E353535

Basic Concepts of Object-Oriented Programming (continued)

Classes are organized into hierarchies. Subclasses share methods and instance

variables with the root class using inheritance.

Different types of objects can understand the same message, called polymorphism.

An object’s response to a message depends on its class.

Page 36: Chapter 1 Background

Chapter 1

Lambert / Osborne Fundamentals of Java 4E3636

Summary

In this chapter, you learned: The modern computer age began in the late 1940s with

the development of ENIAC. Business computing became practical in the 1950s, and time-sharing computers advanced computing in large organizations in the 1960s and 1970s. The 1980s saw the development and first widespread sales of personal computers, and the 1990s saw personal computers connected in networks. During the first decade of the twenty-first century, computing has become ubiquitous.

36

Page 37: Chapter 1 Background

Chapter 1

Lambert / Osborne Fundamentals of Java 4E3737

Summary (continued)

Modern computers consist of two primary components: hardware and software. Computer hardware is the physical component of the system. Computer software consists of programs that enable us to use the hardware.

All information used by a computer is represented in binary form. This information includes numbers, text, images, sound, and program instructions.

37

Page 38: Chapter 1 Background

Chapter 1

Lambert / Osborne Fundamentals of Java 4E3838

Summary (continued)

Programming languages have been developed over the course of three generations: generation 1 is machine language, generation 2 is assembly language, and generation 3 is high-level language.

The waterfall model of the software development process consists of several standard phases: customer request, analysis, design, implementation, integration, and maintenance.

38

Page 39: Chapter 1 Background

Chapter 1

Lambert / Osborne Fundamentals of Java 4E3939

Summary (continued)

Object-oriented programming is a style of programming that can lead to better-quality software. Breaking code into easily handled components simplifies the job of writing a large program.

39


Recommended