The Central Processing Unit What Goes on Inside the Computer Chapter 4 Objectives Identify the components of the central processing unit and 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 January 23 2003 2 The CPU January 23 2003 3 The CPU Complex set of electronic circuitry Control center Set of electronic circuitry that executes stored program instructions Two parts Control Unit CU Arithmetic Logic Unit ALU January 23 2003 4 Control Unit CU Part of the hardware that is in charge Directs the computer system to execute stored program instructions Must communicate with memory and ALU Sends data and instructions from secondary storage to memory as needed January 23 2003 5 Arithmetic Logic Unit Executes all arithmetic and logical operations Arithmetic operations Addition subtraction multiplication division Logical operations Compare numbers letters or special characters Tests for one of three conditions January 23 2003 Equal to condition Less than condition Greater than condition 6 Data Storage and the CPU Two types of storage Primary storage memory Stores data temporarily CPU refers to it for both program instructions and data Secondary storage January 23 2003 Long term storage Stored on external medium such as a disk 7 The CPU and Memory CPU cannot process data from disk or input device Items sent to ALU for processing It must first reside in memory Control unit retrieves data from disk and moves it into memory 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 January 23 2003 8 Registers Special purpose High speed Temporary storage Located inside CPU Instruction register Holds instruction currently being executed Status Register Holds status of ALU operations January 23 2003 Data register Holds data waiting to be processed Holds results from processing 9 Memory Also known as primary storage and main memory Often expressed as random access memory RAM Not part of the CPU Holds data and instructions for processing Stores information only as long as the program is in operation January 23 2003 10 Memory Addresses Each memory location has an address May contain only one instruction or piece of data A unique number much like a mailbox 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 January 23 2003 11 Data Representation Computers understand two things on and off Data represented in binary form Binary base 2 number system Contains only two digits 0 and 1 January 23 2003 Corresponds to two states on and off 12 Representing Data Bit Byte Word January 23 2003 13 Bit Short for binary digit Two possible values 0 and 1 Can never be empty Basic unit for storing data 0 means off 1 means on January 23 2003 14 Byte A group of 8 bits For text stores one character Each byte has 256 28 possible values Can be letter digit or special character Memory and storage devices measured in number of bytes January 23 2003 15 Word The number of bits the CPU processes as a unit Typically a whole number of bytes The larger the word the more powerful the computer Personal computers typically 32 or 64 bits in length January 23 2003 16 Storage Sizes Kilobyte 1024 210 bytes Megabyte roughly one million 220 bytes Personal computer memory Portable storage devices diskette CD ROM Gigabyte roughly one billion 230 bytes Memory capacity of older personal computers Storage devices hard drives Mainframe and network server memory Terabyte roughly one trillion 240 bytes Storage devices on very large systems January 23 2003 17 Executing Programs Fetch CU gets an instruction Decode CU decodes the instruction Execute CU notifies the appropriate part of hardware to take action Control is transferred to the appropriate part of hardware Task is performed Store Control is returned to the CU January 23 2003 18 How the CPU Executes Instructions Four steps performed for each instruction Machine cycle the amount of time needed to execute an instruction Personal computers execute in less than one millionth of a second Supercomputers execute in less than one trillionth of a second Each CPU has its own instruction set January 23 2003 those instructions that CPU can understand and execute 19 The Machine Cycle The time required to retrieve execute and store an operation Components Instruction time Execution time System clock synchronizes operations January 23 2003 20 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 January 23 2003 21 Execution Time Control unit moves data from memory to registers in ALU ALU executes instruction on the data Control unit stores result of operation in memory or in a register January 23 2003 22 Machine Cycle Example January 23 2003 23 System Clock System clock produces pulses at a fixed rate Each Machine Cycle is one or more clock pulses One program instruction may actually be several instructions to the CPU Each CPU instruction will take one machine cycle CPU has an instruction set instructions that it can understand and process Different CPUs have unique instruction sets January 23 2003 Different types non compatible ie Apple vs Intel 24 Example get instruction from address location 2110 decipher instruction Z X Y mov X into register A the accumulator mov Y into register B add register B to register A Result stays in accumulator store result in memory location symbolically addressed by Z January 23 2003 25 Coding Schemes Provide a common way of representing a character of data Needed so computers can exchange data Common Schemes ASCII EBCDIC Unicode January 23 2003 26 ASCII Stands for American Standard Code for Information Interchange Most widely used standard Used on virtually all personal computers January 23 2003 27 EBCDIC Extended Binary Coded Decimal Interchange Code Used primarily on IBM and IBM compatible mainframes January 23 2003 28 Unicode Designed to accommodate alphabets of more than
View Full Document
Unlocking...