Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

The Central Processing Unit: What Goes on Inside the Computer


Published on

  • Just what I wanted
    Are you sure you want to  Yes  No
    Your message goes here
  • thanks for help
    Are you sure you want to  Yes  No
    Your message goes here
  • A very informative presentation. Thanks.
    Are you sure you want to  Yes  No
    Your message goes here
  • Thanks for this wonderful presentation....
    Are you sure you want to  Yes  No
    Your message goes here

The Central Processing Unit: What Goes on Inside the Computer

  1. 1. The Central Processing Unit: What Goes on Inside the Computer Chapter 4
  2. 2. Objectives <ul><li>Identify the components of the central processing unit and how they work together and interact with memory </li></ul><ul><li>Describe how program instructions are executed by the computer </li></ul><ul><li>Explain how data is represented in the computer </li></ul><ul><li>Describe how the computer finds instructions and data </li></ul><ul><li>Describe the components of a microcomputer system unit’s motherboard </li></ul><ul><li>List the measures of computer processing speed and explain the approaches that increase speed </li></ul>
  3. 3. Contents <ul><li>The CPU </li></ul><ul><li>Types of Storage </li></ul><ul><li>Executing Programs </li></ul><ul><li>Finding Data in Memory </li></ul><ul><li>The System Unit </li></ul><ul><li>Microprocessor </li></ul><ul><li>Semiconductor Memory </li></ul><ul><li>Bus Line </li></ul><ul><li>Speed and Power </li></ul>
  4. 4. The CPU
  5. 5. The CPU <ul><li>Converts data into information </li></ul><ul><li>Control center </li></ul><ul><li>Set of electronic circuitry that executes stored program instructions </li></ul><ul><li>Two parts </li></ul><ul><ul><li>Control Unit (CU) </li></ul></ul><ul><ul><li>Arithmetic Logic Unit (ALU) </li></ul></ul>
  6. 6. Control Unit CU <ul><li>Part of the hardware that is in-charge </li></ul><ul><li>Directs the computer system to execute stored program instructions </li></ul><ul><li>Communicates with other parts of the hardware </li></ul>
  7. 7. Arithmetic / Logic Unit ALU <ul><li>Performs arithmetic operations </li></ul><ul><li>Performs logical operations </li></ul>
  8. 8. Arithmetic Operations <ul><li>Addition </li></ul><ul><li>Subtraction </li></ul><ul><li>Multiplication </li></ul><ul><li>Division </li></ul>+ - * /
  9. 9. Logical Operations <ul><li>Evaluates conditions </li></ul><ul><li>Makes comparisons </li></ul><ul><li>Can compare </li></ul><ul><ul><li>Numbers </li></ul></ul><ul><ul><li>Letters </li></ul></ul><ul><ul><li>Special characters </li></ul></ul>NOT AND OR > < >= <= = < >
  10. 10. Registers <ul><li>Special-purpose </li></ul><ul><li>High-speed </li></ul><ul><li>Temporary storage </li></ul><ul><li>Located inside CPU </li></ul>Instruction register Holds instruction currently being executed Data register Holds data waiting to be processed Holds results from processing
  11. 11. Types of Storage <ul><li>Secondary </li></ul><ul><ul><li>Data that will eventually be used </li></ul></ul><ul><ul><li>Long-term </li></ul></ul><ul><li>Memory </li></ul><ul><ul><li>Data that will be used in the near future </li></ul></ul><ul><ul><li>Temporary </li></ul></ul><ul><ul><li>Faster access than storage </li></ul></ul><ul><li>Registers </li></ul><ul><ul><li>Data immediately related to the operation being executed </li></ul></ul><ul><ul><li>Faster access than memory </li></ul></ul>
  12. 12. Measuring Storage Capacity <ul><li>KB – kilobyte </li></ul><ul><ul><li>1024 bytes </li></ul></ul><ul><ul><li>Some diskettes </li></ul></ul><ul><ul><li>Cache memory </li></ul></ul><ul><li>MB – megabyte </li></ul><ul><ul><li>Million bytes </li></ul></ul><ul><ul><li>RAM </li></ul></ul><ul><li>GB – gigabyte </li></ul><ul><ul><li>Billion bytes </li></ul></ul><ul><ul><li>Hard disks </li></ul></ul><ul><ul><li>CDs and DVDs </li></ul></ul><ul><li>TB – terabytes </li></ul><ul><ul><li>Trillion bytes </li></ul></ul><ul><ul><li>Large hard disks </li></ul></ul>
  13. 13. Memory Many Names <ul><li>Primary storage </li></ul><ul><li>Primary memory </li></ul><ul><li>Main storage </li></ul><ul><li>Internal storage </li></ul><ul><li>Main memory </li></ul>
  14. 14. Main Types of Memory <ul><li>RAM </li></ul><ul><li>Random Access Memory </li></ul><ul><li>ROM </li></ul><ul><li>Read Only Memory </li></ul>
  15. 15. RAM <ul><li>Requires current to retain values </li></ul><ul><li>Volatile </li></ul><ul><li>Data and instructions can be read and modified </li></ul><ul><li>Users typically refer to this type of memory </li></ul>
  16. 16. What’s in RAM? <ul><li>Operating System </li></ul><ul><li>Program currently running </li></ul><ul><li>Data needed by the program </li></ul><ul><li>Intermediate results waiting to be output </li></ul>
  17. 17. ROM <ul><li>Non-volatile </li></ul><ul><li>Instructions for booting the computer </li></ul><ul><li>Data and instructions can be read, but not modified </li></ul><ul><li>Instructions are typically recorded at factory </li></ul>
  18. 18. Executing Programs <ul><li>CU gets an instruction and places it in memory </li></ul><ul><li>CU decodes the instruction </li></ul><ul><li>CU notifies the appropriate part of hardware to take action </li></ul><ul><li>Control is transferred to the appropriate part of hardware </li></ul><ul><li>Task is performed </li></ul><ul><li>Control is returned to the CU </li></ul>
  19. 19. Machine Cycle <ul><li>I-time </li></ul><ul><li>CU fetches an instruction from memory and puts it into a register </li></ul><ul><li>CU decodes the instruction and determines the memory location of the data required </li></ul>
  20. 20. Machine Cycle <ul><li>E-time </li></ul><ul><li>Execution </li></ul><ul><ul><li>CU moves the data from memory to registers in the ALU </li></ul></ul><ul><ul><li>ALU is given control and executes the instruction </li></ul></ul><ul><ul><li>Control returns to the CU </li></ul></ul><ul><li>CU stores the result of the operation in memory or in a register </li></ul>
  21. 21. System Clock <ul><li>System clock produces pulses at a fixed rate </li></ul><ul><li>Each pulse is one Machine Cycle </li></ul><ul><li>One program instruction may actually be several instructions to the CPU </li></ul><ul><li>Each CPU instruction will take one pulse </li></ul><ul><li>CPU has an instruction set – instructions that it can understand and process </li></ul>
  22. 22. Finding Data in Memory <ul><li>Each location in memory has a unique address </li></ul><ul><ul><li>Address never changes </li></ul></ul><ul><ul><li>Contents may change </li></ul></ul><ul><li>Memory location can hold one instruction or piece of data </li></ul><ul><li>Programmers use symbolic names </li></ul>
  23. 23. Data Representation On/Off <ul><li>Binary number system is used to represent the state of the circuit </li></ul>1 0 ON OFF
  24. 24. Bits, Bytes, Words <ul><li>BIT </li></ul><ul><ul><li>B inary Dig IT </li></ul></ul><ul><ul><li>On/off circuit </li></ul></ul><ul><ul><li>1 or 0 </li></ul></ul><ul><li>BYTE </li></ul><ul><ul><li>8 bits </li></ul></ul><ul><ul><li>Store one alphanumeric character </li></ul></ul><ul><li>WORD </li></ul><ul><ul><li>Size of the register </li></ul></ul><ul><ul><li>Number of BITS that the CPU processes as a unit </li></ul></ul>
  25. 25. Coding Schemes <ul><li>ASCII </li></ul><ul><ul><li>Uses one 8 bit byte </li></ul></ul><ul><ul><li>2 8 = 256 possible combinations or characters </li></ul></ul><ul><ul><li>Virtually all PCs and many larger computers </li></ul></ul><ul><li>EBCDIC </li></ul><ul><ul><li>Uses one 8 bit byte </li></ul></ul><ul><ul><li>28 =256 possible combinations or characters </li></ul></ul><ul><ul><li>Used primarily on IBM-compatible mainframes </li></ul></ul><ul><li>Unicode </li></ul><ul><ul><li>Uses two 8 bit bytes (16 bits) </li></ul></ul><ul><ul><li>216 = 65,536 possible combinations or characters </li></ul></ul><ul><ul><li>Supports characters for all the world’s languages </li></ul></ul><ul><ul><li>Downward-compatible with ASCII </li></ul></ul>
  26. 26. The System Unit The Black Box <ul><li>Houses electronic components </li></ul><ul><ul><li>Motherboard </li></ul></ul><ul><ul><li>Storage devices </li></ul></ul><ul><ul><li>Connections </li></ul></ul><ul><li>Some Apple Macintosh models have system unit inside monitor </li></ul>
  27. 27. The System Unit The Black Box <ul><li>Motherboard </li></ul><ul><li>Microprocessor chip </li></ul><ul><li>Memory chips </li></ul><ul><li>Connections to other parts of the hardware </li></ul><ul><li>Additional chips may be added – math coprocessor </li></ul>
  28. 28. The System Unit The Black Box <ul><li>Storage Devices </li></ul><ul><li>Hard drive </li></ul><ul><li>Floppy drive </li></ul><ul><li>CD-ROM drive </li></ul><ul><li>DVD-ROM drive </li></ul>
  29. 29. Microprocessor <ul><li>CPU etched on a chip </li></ul><ul><li>Chip size is ¼ x ¼ inch </li></ul><ul><li>Composed of silicon </li></ul><ul><li>Contains millions of transistors </li></ul><ul><ul><li>Electronic switches that can allow current to pass through </li></ul></ul>
  30. 30. Microprocessor Components <ul><li>Control Unit – CU </li></ul><ul><li>Arithmetic / Logic Unit – ALU </li></ul><ul><li>Registers </li></ul><ul><li>System clock </li></ul>
  31. 31. Building a Better Microprocessor <ul><li>Computers imprint circuitry onto microchips </li></ul><ul><ul><li>Cheaper </li></ul></ul><ul><ul><li>Faster </li></ul></ul><ul><li>Perform functions of other hardware </li></ul><ul><ul><li>Math coprocessor is now part of microprocessor </li></ul></ul><ul><ul><li>Multimedia instructions are now part of microprocessor </li></ul></ul>
  32. 32. Building a Better Microprocessor <ul><li>The faster the computer runs </li></ul><ul><li>The cheaper it is to make </li></ul><ul><li>The more reliable it is </li></ul>The more functions that are combined on a microprocessor:
  33. 33. Types of Microprocessors <ul><li>Intel </li></ul><ul><li>Pentium </li></ul><ul><li>Celeron </li></ul><ul><li>Xeon and Itanium </li></ul><ul><li>Intel-compatible </li></ul><ul><li>Cyrix </li></ul><ul><li>AMD </li></ul>
  34. 34. Types of Microprocessors <ul><li>PowerPC </li></ul><ul><ul><li>Cooperative efforts of Apple, IBM, and Motorola </li></ul></ul><ul><ul><li>Used in Apple Macintosh family of PCs </li></ul></ul><ul><ul><li>Found in servers and embedded systems </li></ul></ul><ul><li>Alpha </li></ul><ul><ul><li>Manufactured by Compaq </li></ul></ul><ul><ul><li>High-end servers and workstations </li></ul></ul>
  35. 35. Semiconductor Memory <ul><li>Reliable </li></ul><ul><li>Compact </li></ul><ul><li>Low cost </li></ul><ul><li>Low power usage </li></ul><ul><li>Mass-produced economically </li></ul><ul><li>Volatile </li></ul><ul><li>Monolithic </li></ul><ul><ul><li>All circuits together constitute an inseparable unit of storage </li></ul></ul>
  36. 36. Semiconductor Memory CMOS <ul><li>Complementary metal oxide semiconductor </li></ul><ul><li>Uses little electricity </li></ul><ul><li>Used in PC to store hardware settings that are needed to boot the computer </li></ul><ul><li>Retains information with current from battery </li></ul>
  37. 37. RAM <ul><li>Keeps the instructions and data for current program </li></ul><ul><li>Data in memory can be accessed randomly </li></ul><ul><li>Easy and speedy access </li></ul><ul><li>Volatile </li></ul><ul><li>Erased </li></ul><ul><li>Written over </li></ul>
  38. 38. Types of RAM <ul><li>SRAM </li></ul><ul><li>Retains contents as long as power is maintained </li></ul><ul><li>Faster than DRAM </li></ul>
  39. 39. Types of RAM <ul><li>DRAM </li></ul><ul><li>Must be constantly refreshed </li></ul><ul><li>Used for most PC memory because of size and cost </li></ul><ul><li>SDRAM </li></ul><ul><ul><li>faster type of DRAM </li></ul></ul><ul><li>Rambus DRAM </li></ul><ul><ul><li>Faster than SDRAM </li></ul></ul><ul><ul><li>Expensive </li></ul></ul>
  40. 40. Adding RAM <ul><li>Purchase memory modules that are packaged on circuit boards </li></ul><ul><li>SIMMS – Chips on one side </li></ul><ul><li>DIMMS – Chips on both sides </li></ul><ul><li>Maximum amount of RAM that can be installed is based upon the motherboard design </li></ul>
  41. 41. ROM <ul><li>Programs and data that are permanently recorded at the factory </li></ul><ul><li>Read </li></ul><ul><li>Use </li></ul><ul><li>Cannot be changed by the user </li></ul><ul><li>Stores boot routine that is activated when computer is turned on </li></ul><ul><li>Nonvolatile </li></ul>
  42. 42. PROM <ul><li>Programmable ROM </li></ul><ul><li>ROM burner can change instructions on some ROM chips </li></ul>
  43. 43. Bus Line <ul><li>Paths that transport electrical signals </li></ul><ul><li>System bus </li></ul><ul><ul><li>Transports data between the CPU and memory </li></ul></ul><ul><li>Bus width </li></ul><ul><ul><li>Number of bits of data that can be carried at a time </li></ul></ul><ul><ul><li>Normally the same as the CPUs word size </li></ul></ul><ul><li>Speed measured in MHz </li></ul>
  44. 44. Bus Line <ul><li>CPU can support a greater number and variety of instructions </li></ul>More memory available = CPU can reference larger memory addresses Faster computer = CPU can transfer more data at a time More powerful computer = Larger bus width
  45. 45. Expansion Buses <ul><li>Connect the motherboard to expansion slots </li></ul><ul><li>Plug expansion boards into slots </li></ul><ul><ul><li>interface cards </li></ul></ul><ul><ul><li>adapter cards </li></ul></ul><ul><li>Provides for external connectors / ports </li></ul><ul><ul><li>Serial </li></ul></ul><ul><ul><li>Parallel </li></ul></ul>
  46. 46. Expansion Buses
  47. 47. PC Buses and Ports Credit card sized PC card devices normally found on laptops PC Card High-speed bus connecting video equipment to the computer IEEE 1394 (FireWire) Supports “daisy-chaining” eliminating the need for multiple expansion cards; hot-swappable USB Connects memory and graphics card for faster video performance AGP High-speed devices like hard disks and network cards PCI Slow-speed devices like mouse, modem ISA
  48. 48. Speed and Power <ul><li>What makes a computer fast? </li></ul><ul><li>Microprocessor speed </li></ul><ul><li>Bus line size </li></ul><ul><li>Availability of cache </li></ul><ul><li>Flash memory </li></ul><ul><li>RISC computers </li></ul><ul><li>Parallel processing </li></ul>
  49. 49. Computer Processing Speed <ul><li>Time to execute an instruction </li></ul><ul><li>Millisecond </li></ul><ul><li>Microsecond </li></ul><ul><li>Nanosecond </li></ul><ul><ul><li>Modern computers </li></ul></ul><ul><li>Picosecond </li></ul><ul><ul><li>In the future </li></ul></ul>
  50. 50. Microprocessor Speed <ul><li>Clock speed </li></ul><ul><ul><li>Megahertz (MHz) </li></ul></ul><ul><ul><li>Gigahertz (GHz) </li></ul></ul><ul><li>Number of instructions per second </li></ul><ul><ul><li>Millions of Instructions Per Second (MIPS) </li></ul></ul><ul><li>Performance of complex mathematical operations </li></ul><ul><ul><li>One million floating-point operations per second (Megaflop ) </li></ul></ul>
  51. 51. Cache <ul><li>Small block of very fast temporary memory </li></ul><ul><li>Speed up data transfer </li></ul><ul><li>Instructions and data used most frequently or most recently </li></ul>
  52. 52. Cache Step 1 Processor requests data or instructions <ul><ul><li>Step 2 </li></ul></ul><ul><ul><li>Go to address in main memory and read </li></ul></ul>Step 3 Transfer to main CPU and cache <ul><li>Next processor request </li></ul><ul><li>Look first at cache </li></ul><ul><li>Go to memory </li></ul>P R O C E S S O R R A M Cache
  53. 53. Types of Cache <ul><li>Internal cache </li></ul><ul><ul><li>Level 1 (L1) </li></ul></ul><ul><ul><li>Built into microprocessor </li></ul></ul><ul><ul><li>Up to 128KB </li></ul></ul><ul><li>External cache </li></ul><ul><ul><li>Level 2 (L2) </li></ul></ul><ul><ul><li>Separate chips </li></ul></ul><ul><ul><li>256KB or 512 KB </li></ul></ul><ul><ul><li>SRAM technology </li></ul></ul><ul><ul><li>Cheaper and slower than L1 </li></ul></ul><ul><ul><li>Faster and more expensive than memory </li></ul></ul>
  54. 54. Flash Memory <ul><li>Nonvolatile RAM </li></ul><ul><li>Used in </li></ul><ul><ul><li>Cellular phones </li></ul></ul><ul><ul><li>Digital cameras </li></ul></ul><ul><ul><li>Digital music recorders </li></ul></ul><ul><ul><li>PDAs </li></ul></ul>
  55. 55. Instruction Sets <ul><li>CISC Technology </li></ul><ul><ul><li>Complex Instruction Set Computing </li></ul></ul><ul><ul><li>Conventional computers </li></ul></ul><ul><ul><li>Many of the instructions are not used </li></ul></ul><ul><li>RISC Technology </li></ul><ul><ul><li>Reduced Instruction Set Computing </li></ul></ul><ul><ul><li>Small subset of instructions </li></ul></ul><ul><ul><li>Increases speed </li></ul></ul><ul><ul><li>Programs with few complex instructions </li></ul></ul><ul><ul><ul><li>Graphics </li></ul></ul></ul><ul><ul><ul><li>Engineering </li></ul></ul></ul>
  56. 56. Types of Processing <ul><li>Serial processing </li></ul><ul><ul><li>Execute one instruction at a time </li></ul></ul><ul><ul><li>Fetch, decode, execute, store </li></ul></ul><ul><li>Parallel Processing </li></ul><ul><ul><li>Multiple processors used at the same time </li></ul></ul><ul><ul><li>Can perform trillions of floating-point instructions per second (teraflops) </li></ul></ul><ul><ul><li>Ex: network servers, supercomputers </li></ul></ul>
  57. 57. Types of Processing <ul><li>Pipelining </li></ul><ul><ul><li>Instruction’s action need not be complete before the next begins </li></ul></ul><ul><ul><li>Fetch instruction 1, begin to decode and fetch instruction 2 </li></ul></ul>