23
Copyright © 2003 by Copyright © 2003 by Prentice Hall Prentice Hall Computers: Computers: Tools for an Tools for an Information Age Information Age Chapter 4 Chapter 4 The Central Processing Unit: The Central Processing Unit: What Goes On Inside the What Goes On Inside the Computer Computer

Copyright © 2003 by Prentice Hall Computers: Tools for an Information Age Chapter 4 The Central Processing Unit: What Goes On Inside the Computer

  • View
    217

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Copyright © 2003 by Prentice Hall Computers: Tools for an Information Age Chapter 4 The Central Processing Unit: What Goes On Inside the Computer

Copyright © 2003 by Prentice HallCopyright © 2003 by Prentice Hall

Computers:Computers:Tools for an Information AgeTools for an Information Age

Chapter 4Chapter 4The Central Processing Unit: The Central Processing Unit:

What Goes On Inside the ComputerWhat Goes On Inside the Computer

Page 2: Copyright © 2003 by Prentice Hall Computers: Tools for an Information Age Chapter 4 The Central Processing Unit: What Goes On Inside the Computer

22 Copyright © 2003 by Prentice HallCopyright © 2003 by Prentice Hall

ObjectivesObjectives

Identify the components of the central processing unit Identify the components of the central processing unit and explain how they work together and interact with and explain how they work together and interact with memorymemoryDescribe how program instructions are executed by the Describe how program instructions are executed by the computercomputerExplain how data is represented in the computerExplain how data is represented in the computerDescribe how the computer finds instructions and dataDescribe how the computer finds instructions and dataDescribe the components of a microcomputer system Describe the components of a microcomputer system unit’s motherboardunit’s motherboardList the measures of computer processing speed and List the measures of computer processing speed and explain the approaches that increase speedexplain the approaches that increase speed

Page 3: Copyright © 2003 by Prentice Hall Computers: Tools for an Information Age Chapter 4 The Central Processing Unit: What Goes On Inside the Computer

33 Copyright © 2003 by Prentice HallCopyright © 2003 by Prentice Hall

Central Processing UnitCentral Processing Unit

Complex set of Complex set of electronic circuitry electronic circuitry

Executes stored Executes stored program instructionsprogram instructions

Two partsTwo parts Control unitControl unit Arithmetic/logic unit (AArithmetic/logic unit (A

LU)LU)

Page 4: Copyright © 2003 by Prentice Hall Computers: Tools for an Information Age Chapter 4 The Central Processing Unit: What Goes On Inside the Computer

66 Copyright © 2003 by Prentice HallCopyright © 2003 by Prentice Hall

Data Storage and the CPUData Storage and the CPU

Two types of storage:Two types of storage: Primary storage (memory)Primary storage (memory)

Stores data temporarilyStores data temporarily

CPU refers to it for both program instructions and CPU refers to it for both program instructions and datadata

Secondary storageSecondary storageLong-term storageLong-term storage

Stored on external medium, such as a diskStored on external medium, such as a disk

Page 5: Copyright © 2003 by Prentice Hall Computers: Tools for an Information Age Chapter 4 The Central Processing Unit: What Goes On Inside the Computer

77 Copyright © 2003 by Prentice HallCopyright © 2003 by Prentice Hall

The CPU and MemoryThe CPU and Memory

CPU cannot process data from disk or input CPU cannot process data from disk or input devicedevice It must first reside in memoryIt must first reside in memory Control unit retrieves data from disk and moves it into Control unit retrieves data from disk and moves it into

memorymemory

Items sent to ALU for processingItems sent to ALU for processing Control unit sends items to ALU, then sends back to Control unit sends items to ALU, then sends back to

memory after processingmemory after processing

Data and instructions held in memory until sent Data and instructions held in memory until sent to an output or storage device or program is shut to an output or storage device or program is shut downdown

Page 6: Copyright © 2003 by Prentice Hall Computers: Tools for an Information Age Chapter 4 The Central Processing Unit: What Goes On Inside the Computer

88 Copyright © 2003 by Prentice HallCopyright © 2003 by Prentice Hall

Temporary Storage AreasTemporary Storage Areas

RegistersRegisters

MemoryMemory

Page 7: Copyright © 2003 by Prentice Hall Computers: Tools for an Information Age Chapter 4 The Central Processing Unit: What Goes On Inside the Computer

1111 Copyright © 2003 by Prentice HallCopyright © 2003 by Prentice Hall

How the CPU Executes InstructionsHow the CPU Executes Instructions

Four steps performed for each instructionFour steps performed for each instruction Machine cycle: the amount of time needed Machine cycle: the amount of time needed

to execute an instructionto execute an instruction Personal computers execute in less than Personal computers execute in less than

one millionth of a secondone millionth of a second Supercomputers execute in less than one Supercomputers execute in less than one

trillionth of a secondtrillionth of a second

Each CPU has its own instruction setEach CPU has its own instruction set those instructions that CPU can understand those instructions that CPU can understand

and executeand execute

Page 8: Copyright © 2003 by Prentice Hall Computers: Tools for an Information Age Chapter 4 The Central Processing Unit: What Goes On Inside the Computer

1212 Copyright © 2003 by Prentice HallCopyright © 2003 by Prentice Hall

The Machine CycleThe Machine Cycle

The time required to The time required to retrieve, execute, and retrieve, execute, and store an operationstore an operationComponentsComponents Instruction timeInstruction time Execution timeExecution time

System clock System clock synchronizes synchronizes operationsoperations

Page 9: Copyright © 2003 by Prentice Hall Computers: Tools for an Information Age Chapter 4 The Central Processing Unit: What Goes On Inside the Computer

1515 Copyright © 2003 by Prentice HallCopyright © 2003 by Prentice Hall

Memory AddressesMemory Addresses

Each memory location has Each memory location has an addressan address

A unique number, much like A unique number, much like a mailboxa mailbox

May contain only one May contain only one instruction or piece of datainstruction or piece of data

When data is written back to When data is written back to memory, previous contents of memory, previous contents of that address are destroyedthat address are destroyed

Referred to by numberReferred to by number Programming languages use Programming languages use

a symbolic (named) address, a symbolic (named) address, such as Hours or Salarysuch as Hours or Salary

Page 10: Copyright © 2003 by Prentice Hall Computers: Tools for an Information Age Chapter 4 The Central Processing Unit: What Goes On Inside the Computer

1616 Copyright © 2003 by Prentice HallCopyright © 2003 by Prentice Hall

Data RepresentationData Representation

Computers understand two Computers understand two things: on and offthings: on and off

Data represented in binary formData represented in binary form Binary (base 2) number systemBinary (base 2) number system Contains only two digits, 0 and 1Contains only two digits, 0 and 1

Corresponds to two states, on and offCorresponds to two states, on and off

Page 11: Copyright © 2003 by Prentice Hall Computers: Tools for an Information Age Chapter 4 The Central Processing Unit: What Goes On Inside the Computer

1717 Copyright © 2003 by Prentice HallCopyright © 2003 by Prentice Hall

Representing DataRepresenting Data

BitBit

ByteByte

WordWord

Page 12: Copyright © 2003 by Prentice Hall Computers: Tools for an Information Age Chapter 4 The Central Processing Unit: What Goes On Inside the Computer

2222 Copyright © 2003 by Prentice HallCopyright © 2003 by Prentice Hall

Coding SchemesCoding Schemes

Provide a common way of representing a Provide a common way of representing a character of datacharacter of data Needed so computers can exchange dataNeeded so computers can exchange data

Common SchemesCommon Schemes ASCIIASCII EBCDICEBCDIC UnicodeUnicode

Page 13: Copyright © 2003 by Prentice Hall Computers: Tools for an Information Age Chapter 4 The Central Processing Unit: What Goes On Inside the Computer

2626 Copyright © 2003 by Prentice HallCopyright © 2003 by Prentice Hall

The System UnitThe System Unit

Houses the electronic components of the Houses the electronic components of the computer systemcomputer system MotherboardMotherboard Storage devicesStorage devices

Page 14: Copyright © 2003 by Prentice Hall Computers: Tools for an Information Age Chapter 4 The Central Processing Unit: What Goes On Inside the Computer

3131 Copyright © 2003 by Prentice HallCopyright © 2003 by Prentice Hall

Types of ChipsTypes of Chips

Intel makes a family of processorsIntel makes a family of processors Pentium III and Pentium4 processors in most PCsPentium III and Pentium4 processors in most PCs Celeron processor sold for low-cost PCsCeleron processor sold for low-cost PCs Xeon and Itanium for high-end workstations and Xeon and Itanium for high-end workstations and

network serversnetwork servers

Other processorsOther processors Cyrix and AMD make Intel-compatible Cyrix and AMD make Intel-compatible

microprocessorsmicroprocessors PowerPC chips used primarily in Macintosh PowerPC chips used primarily in Macintosh

computerscomputers Compaq’s Alpha microprocessor used in high-end Compaq’s Alpha microprocessor used in high-end

serversservers

Page 15: Copyright © 2003 by Prentice Hall Computers: Tools for an Information Age Chapter 4 The Central Processing Unit: What Goes On Inside the Computer

3232 Copyright © 2003 by Prentice HallCopyright © 2003 by Prentice Hall

Memory ComponentsMemory Components

Semiconductor MemorySemiconductor Memory

RAM and ROMRAM and ROM

Flash MemoryFlash Memory

Page 16: Copyright © 2003 by Prentice Hall Computers: Tools for an Information Age Chapter 4 The Central Processing Unit: What Goes On Inside the Computer

4040 Copyright © 2003 by Prentice HallCopyright © 2003 by Prentice Hall

The System BusThe System Bus

Parallel electrical paths that transport data Parallel electrical paths that transport data between the CPU and memorybetween the CPU and memory

Bus widthBus width The number of electrical paths to carry dataThe number of electrical paths to carry data Measured in bitsMeasured in bits

Bus speedBus speed Measured in megahertz (MHz)Measured in megahertz (MHz)

Page 17: Copyright © 2003 by Prentice Hall Computers: Tools for an Information Age Chapter 4 The Central Processing Unit: What Goes On Inside the Computer

4343 Copyright © 2003 by Prentice HallCopyright © 2003 by Prentice Hall

Expansion BusesExpansion Buses

Add peripheral devices to systemAdd peripheral devices to system

Expansion boardExpansion board

PortPort

Common expansion busesCommon expansion buses

Page 18: Copyright © 2003 by Prentice Hall Computers: Tools for an Information Age Chapter 4 The Central Processing Unit: What Goes On Inside the Computer

4747 Copyright © 2003 by Prentice HallCopyright © 2003 by Prentice Hall

Computer Processing SpeedsComputer Processing Speeds

Instruction speeds measured in fractions Instruction speeds measured in fractions of secondsof seconds Millisecond: one thousandth of a secondMillisecond: one thousandth of a second Microsecond: one millionth of a secondMicrosecond: one millionth of a second Nanosecond: one billionth of a secondNanosecond: one billionth of a second

Modern computers have reached this speedModern computers have reached this speed Picosecond: one trillionth of a secondPicosecond: one trillionth of a second

Page 19: Copyright © 2003 by Prentice Hall Computers: Tools for an Information Age Chapter 4 The Central Processing Unit: What Goes On Inside the Computer

4848 Copyright © 2003 by Prentice HallCopyright © 2003 by Prentice Hall

Microprocessor SpeedsMicroprocessor Speeds

Measure of system clock speed Measure of system clock speed How many electronic pulses the clock How many electronic pulses the clock

produces per secondproduces per second Usually expressed in gigahertz (GHz) Usually expressed in gigahertz (GHz)

Billions of machine cycles per secondBillions of machine cycles per second

Some old PCs measured in megahertz (MHz)Some old PCs measured in megahertz (MHz)

Comparison of clock speed only Comparison of clock speed only meaningful between identical meaningful between identical microprocessorsmicroprocessors

Page 20: Copyright © 2003 by Prentice Hall Computers: Tools for an Information Age Chapter 4 The Central Processing Unit: What Goes On Inside the Computer

4949 Copyright © 2003 by Prentice HallCopyright © 2003 by Prentice Hall

Other Performance MeasuresOther Performance Measures

Millions of Instructions per Second (MIPS)Millions of Instructions per Second (MIPS) High-speed personal computers can perform High-speed personal computers can perform

over 500 MIPSover 500 MIPS Typically a more accurate measure of Typically a more accurate measure of

performance than clock speedperformance than clock speed

Megaflop: one million floating-point Megaflop: one million floating-point operationsoperations Measures ability of computer to perform Measures ability of computer to perform

complex mathematical operationscomplex mathematical operations

Page 21: Copyright © 2003 by Prentice Hall Computers: Tools for an Information Age Chapter 4 The Central Processing Unit: What Goes On Inside the Computer

5050 Copyright © 2003 by Prentice HallCopyright © 2003 by Prentice Hall

CacheCache

A temporary storage areaA temporary storage area Speeds up data transfer within computerSpeeds up data transfer within computer

Memory cacheMemory cache

Processor cacheProcessor cache

Page 22: Copyright © 2003 by Prentice Hall Computers: Tools for an Information Age Chapter 4 The Central Processing Unit: What Goes On Inside the Computer

5353 Copyright © 2003 by Prentice HallCopyright © 2003 by Prentice Hall

RISC TechnologyRISC Technology

Reduced Instruction Set ComputingReduced Instruction Set Computing Uses a small subset of instructionsUses a small subset of instructions Fewer instructions increases speedFewer instructions increases speed Drawback: complex operations have to be Drawback: complex operations have to be

broken down into a series of smaller broken down into a series of smaller instructionsinstructions

Traditional processors use Complex Traditional processors use Complex Instruction Set Computing (CISC)Instruction Set Computing (CISC)

Page 23: Copyright © 2003 by Prentice Hall Computers: Tools for an Information Age Chapter 4 The Central Processing Unit: What Goes On Inside the Computer

5454 Copyright © 2003 by Prentice HallCopyright © 2003 by Prentice Hall

Parallel Processing and PipeliningParallel Processing and Pipelining

PipeliningPipelining A variation of traditional serial processingA variation of traditional serial processing

Parallel ProcessingParallel Processing Using multiple processors at onceUsing multiple processors at once