1 / 33

CPU

CPU. The Central Processing Unit. Computer Diagram. CPU. Cache. Peripheral Storage Disk Tape CD/DVD Network. HCI Keyboard Display Pointers. Bus. Memory. How the Pieces Connect. The CPU connects to all other pieces of the computer through the Bus Memory is short term storage

Download Presentation

CPU

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CPU The Central Processing Unit

  2. Computer Diagram CPU Cache Peripheral StorageDiskTape CD/DVD Network HCIKeyboardDisplay Pointers Bus Memory

  3. How the Pieces Connect • The CPU connects to all other pieces of the computer through the Bus • Memory is short term storage • Peripherals (such as disk) are used for long term storage • The bus is a group of communication lines between the CPU and other pieces

  4. CPU and Cache • The CPU has increased in speed much faster than anything else • The cache is a short term memory that keeps recently used items • It keeps the CPU busy and off the bus

  5. Two Principal Sections of CPU • Arithmetic/Logic Unit • Performs arithmetic (addition, subtraction, multiplication and division) • Compares two items of data to determine if equal, or which is larger (works on numbers or letters) called a logic operation • Control Unit • Directs the flow of electronic traffic (coordinates computer's operation)

  6. Control Unit • Controls ALU and Memory • Fetches and decodes instructions • Directs data transfers • Has the ALU do operations • Contains two important registers: • Program Counter (PC) • Instruction Register (IR)

  7. Registers • Special temporary storage locations that act as high-speed staging (loading) areas • Part of the CPU, not main memory • Usually under direction of the control unit • Several types are available • Each has a different purpose • Some are accessible to programmer

  8. CPU Control Unit Arithmetic Logic Unit Registers Registers

  9. Register Types • Program Counter • Instruction Register • Status • Accumulator • Address • Segment • Index • General purpose • Stack Pointer • Floating point

  10. The IBM 360/370 • 16 General Purpose 32 bit • All integer arithmetic • Indexing (except R0) • Even/Odd pairs for 64 bit • Program Status Word • Program counter and status register • 8 Floating point registers • Lots of inaccessible registers

  11. Intel 8080 • An 8 bit processor with 16 bit address space (64K) • Itself an extension of 8008 and 4040 • Four 16 bit registers each partitioned into a High and Low 8 bit • AX (AL and AH) does most of arithmetic • BX is the Base register • CX is Count register • DX is Data register • Connects to AX for double length • Stack Pointer

  12. Intel 8086 • Four 16 bit general purpose (AX-DX) • AX evolved from accumulator • Pointer and index • Stack Pointer (SP) • Base Pointer (BP) • Source Index (SI) • Segment • Code Segment • Stack Segment • Data Segment • Extra Segment

  13. 8086 Segments Code Segment Code 64K Data Segment Stack Segment Data 1 M 64K Stack Pointer Stack 64K

  14. Intel 80386 through Pentiums • Serious attempt to maintain upward compatibility • Each model adds capabilities • Register sizes increase to 32 bit • AX becomes low order 16 bits of the 32 bit EAX • The maximum addressable memory increases • Virtual memory has hardware support

  15. Memory • Also called "main memory" or Primary (internal) storage • Closely associated with CPU but physically separated • Holds or stores • Data and program instructions awaiting processing • Intermediate results • Processed output (ready to be transmitted to secondary storage or output device

  16. Memory Characteristics • Volatile • Loses value when power is removed • Has no history • Only the last value is retained • Always has a value • May be unknown • Each cell has a numbered address

  17. How can a piece of data be retrieved from memory? • Control Unit finds instructions or data by the use of addresses • Analogy - departmental mail boxes • Two things to note • One item only may be stored • Addresses are always numbers • Tells where stored

  18. Memory Commands • Memory interprets two commands: • Read and Write • Read requires an address • Returns the contents • Write requires an address and a value • Changes the address to contain the value • Unit is one byte (8 bits) • Several units may be ganged together • 2, 4, 8 bytes

  19. Memory Example 05 0 135 1 20 2 42 3 0 4 180 5

  20. Memory • Short term storage of data occurs here • All data must be represented in memory • The organization of memory determines the data representation

  21. Data Representation • Binary - number system with two states • Two states (On or Off) • Bits (BInary digiTS) each 0 or 1 • Organization (small to large) • Bit (individual 1 or 0) • Byte (made up of 7 or 8 bits and represents a character) • Word (how much a computer can handle at one time - multiple bytes)

  22. Byte • Represents a single character of data • 7 or 8 bits (depending on code) • Used to indicate machines' storage capacity • Kilobyte (KB) - equal to 1024 bytes • Megabyte (MB) - equals 10242 bytes = 1,048,576 • Gigabyte (GB) - equals 10243 bytes • Terabyte (TB) - equals 10244 bytes • Petabyte (PB) - equals 10245 bytes

  23. Word • The number of bits that constitutes a common unit of data • Length varies by computer • Common word lengths • 16 bits (micros, 286 and before) • 32 bits (Pentiums, Power PC, mainframes) • 64 bits (newer AMD micros, supercomputers)

  24. Digitization • Nothing can be processed by a computer unless it can be converted to digital representation • Graphics – pixels • Compression • Sounds – sampling • Music - MIDI • Characters – character codes

  25. Character Codes • Mechanism to represent character data numerically • BCD • EBCDIC • ASCII • UNICODE

  26. Machine Cycles • Series of operations involved in the execution of a single machine-level instruction • System clock - timing mechanism that governs transmission of instructions and data • Also known as Fetch-Execute Cycle • Made up of two parts: I-cycle and E-cycle • Microcode - mechanism to tailor the instruction set

  27. Fetch-Execute cycle: I-cycle • Take program counter and fetch next instruction from memory • Decode the particular instruction • Increment program counter to point at next instruction • Fetch operands • This part called I-cycle or I-time

  28. Fetch-Execute Cycle: E-cycle • Execute the instruction • Store results (if needed) • Go back to beginning and do it again • This is called the E-cycle or E-time

  29. Machine Instructions • Arithmetic • Comparison • Input and Output • Jumps

  30. Processing Speeds of cycle times • Milliseconds • Thousandths of a second • Microseconds • Millionths of a second • Nanoseconds • Billionths of a second • Picoseconds • Trillionths of a second

  31. Speed Ratings • Older micros rated in megahertz MHz • One MHz represents a million clock ticks per second • Original Apple ran at 1 MHz • Original IBM PC ran at 4.77 MHz • Today - 2000 to 4500 • 2000 MHz is 2 GHz • In mainframes rated in mips • One mip equals million instructions per second • In supercomputers rates in mflops • One mflop equals million floating-point operations per second

  32. Instruction Format • There are various components in each machine language instruction • Operation code • Defines which instruction • Operands • May be implied • Register • Immediate data • Memory location • Other things • Masks or flags • Lengths

  33. Instructions sizes • Instructions may be multiple sizes or single sizes • Single size • Easier to interpret • Wastes bits • Multiple sizes • More complicated CPU design • Better packing in memory

More Related