Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "Copyright © 2003 by Prentice Hall Computers: Tools for an Information Age Chapter 4 The Central Processing Unit: What Goes On Inside the Computer."— Presentation transcript:

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

2 2Copyright © 2003 by Prentice Hall Objectives Identify the components of the central processing unit and explain how they work together and interact with memory Describe how program instructions are executed by the computer Explain how data is represented in the computer Describe how the computer finds instructions and data Describe the components of a microcomputer system unit’s motherboard List the measures of computer processing speed and explain the approaches that increase speed

3 3Copyright © 2003 by Prentice Hall Central Processing Unit A control center that converts data input to information output Complex set of electronic circuitry Executes stored program instructions Two parts Control unit Control unit Control unit Control unit Arithmetic/logic unit (ALU) Arithmetic/logic unit (ALU) Arithmetic/logic unit (ALU) Arithmetic/logic unit (ALU)

4 4Copyright © 2003 by Prentice Hall Control Unit Contains circuitry that uses electrical signals Directs the computer system to execute stored program instructions CU does not execute program instructions but it directs other parts of the system to do so Must communicate with memory and ALU Sends data and instructions from secondary storage to memory as needed Return

5 5Copyright © 2003 by Prentice Hall Arithmetic Logic Unit Contains the electronic circuitry that executes all arithmetic and logical operations Arithmetic operations Addition, subtraction, multiplication, division Addition, subtraction, multiplication, division Also performs logical operations, or comparisons Compare numbers, letters, or special characters Compare numbers, letters, or special characters Tests for one of three conditions Tests for one of three conditions Equal-to condition Less-than condition Greater-than condition In addition computer can also test for less than or equal to, greater than or equal to and not equal to In addition computer can also test for less than or equal to, greater than or equal to and not equal to They are called relational operators

6 6Copyright © 2003 by Prentice Hall Data Storage and the CPU Two types of storage: Primary storage (memory) Primary storage (memory) Stores data temporarily CPU refers to it for both program instructions and data Secondary storage Secondary storage Long-term storage Stored on external medium, such as a disk

7 7Copyright © 2003 by Prentice Hall The CPU and Memory CPU cannot process data from disk or input device It must first reside in memory It must first reside in memory Control unit retrieves data from disk and moves it into memory Control unit retrieves data from disk and moves it into memory Items sent to ALU for processing Control unit sends items to ALU, then sends back to memory after processing Control unit sends items to ALU, then sends back to memory after processing Data and instructions held in memory until sent to an output or storage device or program is shut down

8 8Copyright © 2003 by Prentice Hall Temporary Storage Areas Registers Memory

9 9Copyright © 2003 by Prentice Hall Registers Special purpose, high-speed temporary storage areas for instructions or data Special additional storage locations located within the CPU that offer the advantage of speed Special additional storage locations located within the CPU that offer the advantage of speed Work under direction of control unit Accept, hold, and transfer instructions or data and perform arithmetic and logical comparisons at high speed Accept, hold, and transfer instructions or data and perform arithmetic and logical comparisons at high speed Holding the instructions that is currently being executed Holding the instructions that is currently being executed Keep track of where the next instruction to be executed or needed data is stored Keep track of where the next instruction to be executed or needed data is stored Registers hold data that is immediately related to the operation being executed

10 10Copyright © 2003 by Prentice Hall Memory Also known as primary storage and main memory Often expressed as random-access memory (RAM) Often expressed as random-access memory (RAM) Not part of the CPU Not part of the CPU Holds data and instructions for processing Stores information only as long as the program is in operation Keeping items in memory when the program is not running is not feasible because: Memory store items only when the Computer is on Memory store items only when the Computer is on Secondary storage is more cost effective than memory for storing large amount of data Secondary storage is more cost effective than memory for storing large amount of data If more than one program is running at the same time, a single program cannot lay exclusive claim to memory and there may not be room to hold all the processed data If more than one program is running at the same time, a single program cannot lay exclusive claim to memory and there may not be room to hold all the processed data

11 Memory The data must be first available in memory for CPU to process CU sends data and instructions from an input and storage device into memory When required, CU sends these items from memory to ALU After processing, the result is sent to memory Memory enables very fast access to instructions and data

12 12Copyright © 2003 by Prentice Hall How the CPU Executes Instructions Program instructions and data must be placed into memory from an input device or a secondary memory storage Four steps performed for each instruction Machine cycle: the amount of time needed to execute an instruction Machine cycle: the amount of time needed to execute an instruction Personal computers execute in less than one millionth of a second Personal computers execute in less than one millionth of a second Supercomputers execute in less than one trillionth of a second Supercomputers execute in less than one trillionth of a second

13 13Copyright © 2003 by Prentice Hall The Machine Cycle The time required to retrieve, execute, and store an operation Combination of: Instruction time Instruction time Instruction time Instruction time Execution time Execution time Execution time Execution time Each CPU has an internal System clock that produces pulses at a fixed rate and synchronizes operations

14 14Copyright © 2003 by Prentice Hall Instruction Time Also called I-time Control unit gets instruction from memory and puts it into a register Control unit decodes instruction and determines the memory location of needed data Return

15 15Copyright © 2003 by Prentice Hall Execution Time Control unit moves data from memory to registers in ALU ALU executes instruction on the data ALU executes instruction on the data Control unit stores result of operation in memory or in a register Eventually CU directs memory to send the result Eventually CU directs memory to send the result Return

16 16Copyright © 2003 by Prentice Hall Memory Addresses Each memory location has an address A unique number, much like a mailbox A unique number, much like a mailbox May contain only one instruction or piece of data When data is written back to memory, previous contents of that address are destroyed When data is written back to memory, previous contents of that address are destroyed Referred to by number Programming languages use a symbolic (named) address, such as Hours or Salary Programming languages use a symbolic (named) address, such as Hours or Salary

17 17Copyright © 2003 by Prentice Hall Data Representation Computers understand two things: on and off Data represented in binary form Binary (base 2) number system Binary (base 2) number system Contains only two digits, 0 and 1 Contains only two digits, 0 and 1 Corresponds to two states, on and off

18 18Copyright © 2003 by Prentice Hall Representing Data Bit Byte Word

19 19Copyright © 2003 by Prentice Hall Bit Each 0 or 1 is called as bit Short for binary digit Two possible values: 0 and 1 Two possible values: 0 and 1 Can never be empty Can never be empty Basic unit for storing data 0 means off, 1 means on 0 means off, 1 means on Return

20 20Copyright © 2003 by Prentice Hall Byte Single bit cannot store all numbers, letters and special characters A group of 8 bits Each byte has 256 (2 8 ) possible values Each byte has 256 (2 8 ) possible values For text data, each byte stores one character Can be letter, digit, or special character Can be letter, digit, or special character Memory and storage devices measured in number of bytes Return

21 21Copyright © 2003 by Prentice Hall Word The number of bits the CPU processes as a unit The length of word varies by CPU but is whole number of bytes The length of word varies by CPU but is whole number of bytes The larger the word, the more powerful the computer The larger the word, the more powerful the computer Personal computers typically 32 or 64 bits in length Personal computers typically 32 or 64 bits in length

22 22Copyright © 2003 by Prentice Hall Storage Sizes Kilobyte: 1024 (2 10 ) bytes Memory capacity of older personal computers Memory capacity of older personal computers Megabyte: roughly one million (2 20 ) bytes Personal computer memory Personal computer memory Portable storage devices (diskette, CD-ROM) Portable storage devices (diskette, CD-ROM) Gigabyte: roughly one billion (2 30 ) bytes Storage devices (hard drives) Storage devices (hard drives) Mainframe and network server memory Mainframe and network server memory Terabyte: roughly one trillion (2 40 ) bytes Storage devices on very large systems Storage devices on very large systems Return

23 23Copyright © 2003 by Prentice Hall Coding Schemes Particular set of bits is equivalent to which character Provide a common way of representing a character of data Needed so computers can exchange data Needed so computers can exchange data Each byte contains 8 bits, there are 2 8 =256 possible combinations of 1s and 0s in a byte A coding scheme assigns each one of these combinations to a specific character Common Schemes ASCII ASCII ASCII EBCDIC EBCDIC EBCDIC Unicode Unicode Unicode

24 24 ASCII Stands for American Standard Code for Information Interchange Most widely used standard Used on virtually all personal computers

25 25Copyright © 2003 by Prentice Hall EBCDIC Extended Binary Coded Decimal Interchange Code Used primarily on IBM and IBM-compatible mainframes Used primarily on IBM and IBM-compatible mainframes Return

26 26 Unicode ASCII and EBCDIC is too small for handling the many alphabets used throughout the rest of the world Designed to accommodate alphabets of more than 256 characters Uses 16 bits to represent one character 65,536 possible values 65,536 possible values Requires twice as much space to store data Most new OS and software packages include support for Unicode

27 27Copyright © 2003 by Prentice Hall The System Unit Houses the electronic components of the computer system Motherboard Motherboard Motherboard Storage devices Storage devices Storage devices Storage devices

28 28Copyright © 2003 by Prentice Hall Motherboard Flat circuit board that holds the computer circuitry Also called main circuit board Mass of chips and connections that organize the computer speed Central processing unit (microprocessor) is most important component Central processing unit (microprocessor) is most important componentmicroprocessor Return

29 29Copyright © 2003 by Prentice Hall Storage Devices Most microcomputer system units also contain one or more storage device Long-term storage of memory Data not lost when computer shut down Data not lost when computer shut down Examples include hard drive, diskette, DVD-ROM Return

30 30Copyright © 2003 by Prentice Hall Microprocessor Central processing unit etched on silicon chip, a tiny square of silicon called microprocessor Key components: Central processing unit (CU and ALU) Central processing unit (CU and ALU) Registers Registers System clock System clock

31 31Copyright © 2003 by Prentice Hall Transistors Basic building block of microprocessor Microprocessor’s contain tens of millions of transistors Electronic switches that may or may not allow electric current to pass through If current passes through, switch is on, representing a 1 bit If current passes through, switch is on, representing a 1 bit Otherwise, switch is off, representing a 0 bit Otherwise, switch is off, representing a 0 bit Return

32 32Copyright © 2003 by Prentice Hall Types of Chips In 1980s, Intel incorporated a math coprocessor, a separate chip Intel makes a family of processors Pentium III and Pentium4 processors in most PCs Pentium III and Pentium4 processors in most PCs Pentium 4 chip include multimedia instructions Celeron processor sold for low-cost PCs Celeron processor sold for low-cost PCs Xeon and Itanium for high-end workstations and network servers Xeon and Itanium for high-end workstations and network servers Other processors Cyrix and AMD make Intel-compatible microprocessors Cyrix and AMD make Intel-compatible microprocessors PowerPC chips used primarily in Macintosh family of personal computers PowerPC chips used primarily in Macintosh family of personal computers Designed through the efforts of Apple, IBM and Motorola Compaq’s Alpha microprocessor used in high-end servers Compaq’s Alpha microprocessor used in high-end servers

33 33Copyright © 2003 by Prentice Hall Memory Components Semiconductor Memory Semiconductor Memory RAM and ROM RAM and ROM Flash Memory Flash Memory

34 34 Semiconductor Memory Used by most modern computers Reliable, inexpensive, and compact Reliable, inexpensive, and compact Volatile: requires continuous electric current Volatile: requires continuous electric current If the current is interrupted, data is lost If the current is interrupted, data is lost Made up of 1000s of small circuits on a silicon chip Made up of 1000s of small circuits on a silicon chip One important type of design is Complementary Metal Oxide Semiconductor (CMOS) One important type of design is Complementary Metal Oxide Semiconductor (CMOS) one use for CMOS is CMOS RAM which retains information when power is shut down one use for CMOS is CMOS RAM which retains information when power is shut down Use relatively little electricity Used to store information needed when the computer boots Used to store information needed when the computer boots

35 35Copyright © 2003 by Prentice Hall RAM and ROM Random Access Memory Random Access Memory (RAM) Random Access Memory Read-Only Memory Read-Only Memory (ROM) Read-Only Memory Return

36 36 Random Access Memory Data can be accessed randomly Memory address 10 can be accessed as quickly as memory address 10,000,000 Memory address 10 can be accessed as quickly as memory address 10,000,000Types: Static RAM (SRAM) Static RAM Dynamic RAM (DRAM) Dynamic RAM Packaged on circuit boards called Single in-line memory modules (SIMMS) Dual in-line memory modules (DIMMS) Allows faster data transfer Wider data path

37 37Copyright © 2003 by Prentice Hall Static RAM Retains its contents without intervention from CPU as long as power is maintained Faster and more expensive than DRAM Return

38 38Copyright © 2003 by Prentice Hall Dynamic RAM Must be continuously refreshed by CPU or it loses its contents Used for personal computer memory because of cost advantages Synchronous DRAM (SDRAM): faster type of DRAM used today Synchronous DRAM (SDRAM): faster type of DRAM used today Rambus DRAM (RDRAM): faster than SDRAM, will become more commonly used as price declines Rambus DRAM (RDRAM): faster than SDRAM, will become more commonly used as price declines Return

39 39Copyright © 2003 by Prentice Hall Read-Only Memory Contains programs and data permanently recorded into memory at the factory Cannot be changed by user Cannot be changed by user Boot routine that is activated is stored in ROM Boot routine that is activated is stored in ROM Not volatile: contents do not disappear when power is lost Not volatile: contents do not disappear when power is lost Programmable ROM (PROM) chips Some instructions on chip can be changed Some instructions on chip can be changed Return

40 40Copyright © 2003 by Prentice Hall Flash Memory Nonvolatile RAM Used in cellular phones, digital cameras, and some handheld computers Used in cellular phones, digital cameras, and some handheld computers Flash memory chips resemble credit cards Flash memory chips resemble credit cards Smaller than disk drive and require less power Smaller than disk drive and require less power Return

41 41Copyright © 2003 by Prentice Hall The System Bus Parallel electrical paths that transport data between the CPU and memory Copper tracing on the surface of mother board Bus width Bus width The number of bits of data that can be carried at one time The number of bits of data that can be carried at one time The number of electrical paths to carry data The number of electrical paths to carry data Measured in bits Measured in bits Bus speed Bus speed Measured in megahertz (MHz) Measured in megahertz (MHz)

42 42Copyright © 2003 by Prentice Hall Bus Width Typically the same as CPU’s word size With a larger bus size, CPU can: Transfer more data at a time Transfer more data at a time Makes computer faster Makes computer faster Reference larger memory address numbers Reference larger memory address numbers Allows for more memory Allows for more memory Support a greater number and variety of instructions Support a greater number and variety of instructions Return

43 43Copyright © 2003 by Prentice Hall Bus Speed The faster the bus speed, the faster data travels through the system Personal computers have bus speeds of 400 or 533 MHz Return

44 44Copyright © 2003 by Prentice Hall Expansion Buses Add peripheral devices to system Expansion board Expansion board Port Common expansion buses Common expansion buses

45 45Copyright © 2003 by Prentice Hall Expansion Boards Also called interface cards Connect to expansion slots on motherboard Used to connect peripheral devices Used to connect peripheral devices A connector at the end of the board is accessible through an opening on the back of System unit Return

46 46Copyright © 2003 by Prentice Hall Ports External connectors to plug in peripherals such as printers Two types of ports Serial: transmit data one bit at a time Serial: transmit data one bit at a time Used for slow devices such as the mouse and keyboard Used for slow devices such as the mouse and keyboard Parallel: transmit groups of bits together side- by-side Parallel: transmit groups of bits together side- by-side Used for faster devices such as printers and scanners Used for faster devices such as printers and scanners Return

47 47 Common Expansion Buses and Ports Industry Standard Architecture (ISA) bus Used for slow devices such as the mouse and modem Used for slow devices such as the mouse and modem Peripheral Component Interconnect (PSI) bus Used for faster devices such as hard disks Used for faster devices such as hard disks Accelerated Graphics Port (AGP) Provides faster video performance Provides faster video performance Provide a dedicated connection between memory and AGP graphics card Provide a dedicated connection between memory and AGP graphics card Universal Serial Bus (USB) port Devices with USB connectors can be connected in a series and plugged into USB port Devices with USB connectors can be connected in a series and plugged into USB port Connect and disconnect without turning off the computer Connect and disconnect without turning off the computer IEEE 1394 bus A high-speed bus normally used to connect video equipment A high-speed bus normally used to connect video equipment PC Card bus Used on laptops to plug in a credit-card sized device Used on laptops to plug in a credit-card sized device Can contain modems and even miniature hard drives Can contain modems and even miniature hard drives

48 48Copyright © 2003 by Prentice Hall Computer Processing Speeds Instruction speeds measured in fractions of seconds Millisecond: one thousandth of a second Millisecond: one thousandth of a second Microsecond: one millionth of a second Microsecond: one millionth of a second Nanosecond: one billionth of a second Nanosecond: one billionth of a second Modern computers have reached this speed Modern computers have reached this speed Picosecond: one trillionth of a second Picosecond: one trillionth of a second

49 49Copyright © 2003 by Prentice Hall Microprocessor Speeds Measure of system clock speed How many electronic pulses the clock produces per second How many electronic pulses the clock produces per second Usually expressed in gigahertz (GHz) Usually expressed in gigahertz (GHz) Billions of machine cycles per second Billions of machine cycles per second Some old PCs measured in megahertz (MHz) Some old PCs measured in megahertz (MHz) Comparison of clock speed only meaningful between identical microprocessors

50 50Copyright © 2003 by Prentice Hall Other Performance Measures Millions of Instructions per Second (MIPS) High-speed personal computers can perform over 500 MIPS High-speed personal computers can perform over 500 MIPS Typically a more accurate measure of performance than clock speed Typically a more accurate measure of performance than clock speed Megaflop: one million floating-point operations Measures ability of computer to perform complex mathematical operations Measures ability of computer to perform complex mathematical operations

51 51Copyright © 2003 by Prentice Hall Cache A temporary storage area Speeds up data transfer within computer Speeds up data transfer within computer Memory cache Memory cache Processor cache Processor cache

52 52 Memory Cache A small block of high-speed memory Speeds up internal transfer of data and software instructions Speeds up internal transfer of data and software instructions Stores most frequently and most recently used data and instructions Stores most frequently and most recently used data and instructions Microprocessor looks for what it needs in cache first Transferred from cache much faster than from memory Transferred from cache much faster than from memory If not in cache, control unit retrieves from memory If not in cache, control unit retrieves from memory The more cache “hits” the faster the system performance

53 53 Processor Cache Internal (Level 1) cache built into microprocessor Fastest access, but highest cost Fastest access, but highest cost Increases the cost of microprocessor Increases the cost of microprocessor Usually 128 KB Usually 128 KB External (Level 2) cache on separate chip Usually 256 or 512 KB Usually 256 or 512 KB Cheaper and slower than L1 Cheaper and slower than L1 Incorporated into processor chip on some current microprocessors for faster access Incorporated into processor chip on some current microprocessors for faster access

54 54Copyright © 2003 by Prentice Hall RISC Technology Reduced Instruction Set Computing Uses a small subset of instructions Uses a small subset of instructions Fewer instructions increases speed Fewer instructions increases speed Drawback: complex operations have to be broken down into a series of smaller instructions, slowing execution speed Drawback: complex operations have to be broken down into a series of smaller instructions, slowing execution speed Traditional processors use Complex Instruction Set Computing (CISC) Many of the most complex instructions are rarely used Many of the most complex instructions are rarely used

55 55Copyright © 2003 by Prentice Hall Parallel Processing and Pipelining Pipelining A variation of traditional serial processing A variation of traditional serial processing Parallel Processing Parallel Processing Using multiple processors at once Using multiple processors at once

56 56Copyright © 2003 by Prentice Hall Pipelining Feeds a new instruction into CPU at each step of the machine cycle Instruction 2 fetched when instruction 1 is being decoded, rather than waiting until cycle is complete Instruction 2 fetched when instruction 1 is being decoded, rather than waiting until cycle is complete Return

57 57Copyright © 2003 by Prentice Hall Parallel Processing Control processor divides problem into parts Each part sent to separate processor Each part sent to separate processor Each processor has its own memory Each processor has its own memory Control processor assembles results Control processor assembles results Some computers using parallel processing operate in terms of teraflops: trillions of floating-point instructions per second Return


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

Similar presentations


Ads by Google