The Central Processing Unit Chapter 4 B.M.H
Learning Objectives <ul><li>CPU </li></ul><ul><li>Register </li></ul><ul><li>Memory </li></ul><ul><li>Computer ’ s executi...
The CPU (Central Processing Unit) <ul><li>A control center </li></ul><ul><ul><li>Converts  data input  to  information out...
MIU
The Control Unit <ul><li>Contains circuitry  </li></ul><ul><ul><li>uses electrical signals to direct the entire computer s...
The Arithmetic/Logic Unit (ALU) <ul><li>Contains the electronic circuitry  </li></ul><ul><ul><li>that executes all arithme...
Logical operations <ul><li>In addition to three basic condition </li></ul><ul><ul><li>The computer can test for </li></ul>...
Data storage and the CPU <ul><li>Two major types of storage </li></ul><ul><ul><li>Primary storage (memory) </li></ul></ul>...
Registers <ul><li>Special storage areas for instructions and data   </li></ul><ul><ul><li>located within the CPU itself </...
Registers <ul><li>The kinds of Register  </li></ul><ul><li>MBR (Memory Buffer Register):  all data come and go through thi...
Storage Comparison <ul><li>Registers </li></ul><ul><ul><li>Hold data that is  immediately  related to operation being exec...
Memory <ul><li>The part of computer  </li></ul><ul><ul><li>that holds data and instructions for processing. </li></ul></ul...
Memory <ul><li>Characteristics  </li></ul><ul><ul><li>Fast speed : Allow very fast access to instructions and data </li></...
How the CPU executes    program instructions
Before an instructions executions <ul><li>In Memory  </li></ul><ul><ul><li>The  necessary program instruction and data  mu...
MIU
MIU
Machine cycle <ul><li>The four steps for each instruction </li></ul><ul><li>[ Instruction time (or I-time) ] </li></ul><ul...
Machine cycle <ul><li>The combination of I-time and E-time </li></ul><ul><li>System clock </li></ul><ul><ul><li>produces p...
<ul><li>Each location(of instruction and data) has address number </li></ul><ul><li>ex) mailbox in front of apartment hous...
Data Representation Bits, Bytes and Words Coding Schemes
Binary system <ul><li>Computers know only two things : on and off. </li></ul><ul><li>Two state on/off system : Binary syst...
Binary Equivalent of Decimal Numbers 0-17  MIU Units : bit  Byte(8 bit)  word(2 or 4 B)  KB(1,024 B)  MB(1,024 KB)  GB(1,0...
Bits, Bytes, and Words <ul><li>(  )  </li></ul><ul><ul><li>Each 0 or 1 in the binary system </li></ul></ul><ul><ul><li>Bi ...
<ul><li>The number of bytes </li></ul><ul><ul><li>The capacity of memory and storage  </li></ul></ul><ul><ul><ul><li>is ex...
<ul><li>(  ) </li></ul><ul><ul><li>The size of register </li></ul></ul><ul><ul><li>the number of bits the CPU processes as...
Coding Schemes <ul><ul><li>A byte can represent a character of data </li></ul></ul><ul><ul><li>Each byte contains ( ) bits...
ASCII, EBCDIC and Unicode <ul><li>ASCII code </li></ul><ul><ul><li>American Standard Code for Information Interchange </li...
ASCII, EBCDIC and Unicode <ul><li>   256-character capability of ASCII and EBCDIC   </li></ul><ul><li>: sufficient for En...
Short Quiz <ul><li>________ contains circuitry that uses electrical signals to direct the entire computer system to carry ...
Review <ul><li>The CPU ’ s two parts are (  and  ). </li></ul><ul><li>Four kinds of arithmetic operations are  </li></ul><...
Upcoming SlideShare
Loading in …5
×

Computers6 Ch4 1

685 views

Published on

Chapter 4 (Part I)

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
685
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
37
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Computers6 Ch4 1

  1. 1. The Central Processing Unit Chapter 4 B.M.H
  2. 2. Learning Objectives <ul><li>CPU </li></ul><ul><li>Register </li></ul><ul><li>Memory </li></ul><ul><li>Computer ’ s execution of instructions </li></ul><ul><li>Data Representation </li></ul>MIU
  3. 3. The CPU (Central Processing Unit) <ul><li>A control center </li></ul><ul><ul><li>Converts data input to information output </li></ul></ul><ul><li>A highly complex, extensive set of electronic circuitry </li></ul><ul><ul><li>Executes stored program instructions </li></ul></ul><ul><li>Two parts </li></ul><ul><ul><li>The control unit </li></ul></ul><ul><ul><li>The arithmetic/logic unit </li></ul></ul>MIU Intel pentium processor
  4. 4. MIU
  5. 5. The Control Unit <ul><li>Contains circuitry </li></ul><ul><ul><li>uses electrical signals to direct the entire computer system to carry out stored program instructions </li></ul></ul><ul><li>Does not execute program instructions; </li></ul><ul><ul><li>directs other parts of the system execute program instructions </li></ul></ul><ul><li>Communicates with both the ALU and memory </li></ul>MIU CPU
  6. 6. The Arithmetic/Logic Unit (ALU) <ul><li>Contains the electronic circuitry </li></ul><ul><ul><li>that executes all arithmetic and logical operations </li></ul></ul><ul><ul><li>Arithmetic operations (mathematical calculation) </li></ul></ul><ul><ul><ul><li>Addition, Subtraction, Multiplication, Division </li></ul></ul></ul><ul><ul><li>Logical operations (comparisons) </li></ul></ul><ul><ul><ul><li>: Compare numbers, letters, or special characters to test the three conditions </li></ul></ul></ul><ul><ul><ul><li>Equal-to, Less-than, Greater-than condition </li></ul></ul></ul>MIU CPU
  7. 7. Logical operations <ul><li>In addition to three basic condition </li></ul><ul><ul><li>The computer can test for </li></ul></ul><ul><ul><li>Less-than-or-equal-to condition </li></ul></ul><ul><ul><li>Greater-than-or-equal-to condition </li></ul></ul><ul><ul><li>Less-than-or-greater-than condition </li></ul></ul><ul><ul><ul><li>: Not-equal-to </li></ul></ul></ul><ul><li> Relational operator </li></ul><ul><ul><li>The symbol that programmers use to tell the computer </li></ul></ul><ul><ul><li>which type of comparison to perform </li></ul></ul><ul><ul><li>The most common : =, <, > </li></ul></ul>MIU CPU
  8. 8. Data storage and the CPU <ul><li>Two major types of storage </li></ul><ul><ul><li>Primary storage (memory) </li></ul></ul><ul><ul><ul><li>Holds data only temporarily </li></ul></ul></ul><ul><ul><ul><li>A program is working directly with it </li></ul></ul></ul><ul><ul><li>Secondary storage </li></ul></ul><ul><ul><ul><li>Holds permanent or semipermanent data </li></ul></ul></ul><ul><ul><ul><li>on some external medium, such as a disk, </li></ul></ul></ul><ul><ul><ul><li>until it is needed for processing by the computer </li></ul></ul></ul><ul><li>The CPU interacts closely with memory </li></ul><ul><ul><li>referring to it for both instructions and data </li></ul></ul>MIU
  9. 9. Registers <ul><li>Special storage areas for instructions and data </li></ul><ul><ul><li>located within the CPU itself </li></ul></ul><ul><ul><li>offer the advantage of speed </li></ul></ul><ul><ul><li>; special-purpose, high-speed, temporary </li></ul></ul><ul><li>Work under the direction of the control unit </li></ul><ul><ul><li>To accept, hold, and transfer instructions or data </li></ul></ul><ul><ul><li>To perform arithmetic or logical comparisons at high speed. </li></ul></ul>MIU
  10. 10. Registers <ul><li>The kinds of Register </li></ul><ul><li>MBR (Memory Buffer Register): all data come and go through this. </li></ul><ul><li>MAR (Memory Address Register): for registering address </li></ul><ul><li>IR (Instruction Register): for registring current implementing data </li></ul><ul><li>IR (Index Register): Decide corresponding address during excuting instruction. </li></ul><ul><li>GPR (General Purpose Register): for general purpose </li></ul><ul><li>BR (Base Register):register having base address of program </li></ul>MIU
  11. 11. Storage Comparison <ul><li>Registers </li></ul><ul><ul><li>Hold data that is immediately related to operation being executed </li></ul></ul><ul><li>Memory </li></ul><ul><ul><li>Stores data that will be used in the near future </li></ul></ul><ul><li>Secondary storage </li></ul><ul><ul><li>Holds data that may be needed </li></ul></ul><ul><ul><ul><li>later in the same program execution or </li></ul></ul></ul><ul><ul><ul><li>perhaps at some more remote time in the future </li></ul></ul></ul>MIU
  12. 12. Memory <ul><li>The part of computer </li></ul><ul><ul><li>that holds data and instructions for processing. </li></ul></ul><ul><ul><li>Only stores them as long as the program is in operation </li></ul></ul><ul><ul><li>Closely associated with the CPU, but separate from it. </li></ul></ul><ul><li>Known as </li></ul><ul><ul><li>primary storage (or memory), main storage (or memory), internal storage </li></ul></ul><ul><ul><li>Manufactures often use the term RAM </li></ul></ul>MIU
  13. 13. Memory <ul><li>Characteristics </li></ul><ul><ul><li>Fast speed : Allow very fast access to instructions and data </li></ul></ul><ul><ul><li>Temporary : Most of types of memory store items only while the computer is turned on. </li></ul></ul>MIU
  14. 14. How the CPU executes program instructions
  15. 15. Before an instructions executions <ul><li>In Memory </li></ul><ul><ul><li>The necessary program instruction and data must be placed from input device or a secondary storage device </li></ul></ul><ul><li>Then the CPU </li></ul><ul><ul><li>performs the four steps for each instruction </li></ul></ul>MIU
  16. 16. MIU
  17. 17. MIU
  18. 18. Machine cycle <ul><li>The four steps for each instruction </li></ul><ul><li>[ Instruction time (or I-time) ] </li></ul><ul><li>The CU - fetches the instruction from memory and </li></ul><ul><li>- put it into a resister </li></ul><ul><li>The CU - decodes the instruction and </li></ul><ul><li>- determines the memory location of the data </li></ul><ul><li>[ Execution time (or E-time) ] </li></ul><ul><li>The CU - moves the data from memory to registers in the ALU. </li></ul><ul><li>The ALU - executes the arithmetic or logical instruction. </li></ul><ul><li>The CU - stores the result of this operation in memory or in a register </li></ul>MIU Always
  19. 19. Machine cycle <ul><li>The combination of I-time and E-time </li></ul><ul><li>System clock </li></ul><ul><ul><li>produces pulses </li></ul></ul><ul><ul><ul><li>at a fixed rate to synchronize all computer operations </li></ul></ul></ul>MIU
  20. 20. <ul><li>Each location(of instruction and data) has address number </li></ul><ul><li>ex) mailbox in front of apartment house </li></ul><ul><li>Address remains the same but the contents of locations may change when new instruction or data may be placed. </li></ul><ul><li>Fig4-4 shows how a program manipulates data in memory. </li></ul>Storage Locations and Addresses MIU How the control unit finds instructions and data 1 2 3 Rate 8 4 5 6 Hours 40 7 8 Salary 320 Employee’s salary Instruction ↓ Data in 3ⅩData in 6 ↓ Move to 8
  21. 21. Data Representation Bits, Bytes and Words Coding Schemes
  22. 22. Binary system <ul><li>Computers know only two things : on and off. </li></ul><ul><li>Two state on/off system : Binary system </li></ul><ul><ul><li>Has a base of ( ). </li></ul></ul><ul><ul><li>Contains only two digits, ( ) and ( ), which correspond to the two states ( ) and ( ). </li></ul></ul><ul><ul><li> Decimal number system </li></ul></ul><ul><li>Combination of 0s and 1s (ex. 0011, 0101) </li></ul><ul><ul><li>represent larger numbers. </li></ul></ul>MIU
  23. 23. Binary Equivalent of Decimal Numbers 0-17 MIU Units : bit Byte(8 bit) word(2 or 4 B) KB(1,024 B) MB(1,024 KB) GB(1,024 MB) Physical Representation Conversion(Bin -> Dec) binary digit 2 8 = 256 0 1 N S N S + 100110 2 32 4 2 38 10 = 32 16 8 4 2 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 0 1 10 11 100 101 110 111 1000 1001 1010 1011 1100 1101 1110 1111 10000 10001 0 1 2 3 4 5 6 7 8 9 A B C D E F 10 11 Dec Binary Hex
  24. 24. Bits, Bytes, and Words <ul><li>( ) </li></ul><ul><ul><li>Each 0 or 1 in the binary system </li></ul></ul><ul><ul><li>Bi nary digi t </li></ul></ul><ul><ul><li>Basic unit of storing data in computer memory: ( ) means off, ( ) means on. </li></ul></ul><ul><li>( ) </li></ul><ul><ul><li>The bits put together in a group </li></ul></ul><ul><ul><li>A collection of bits </li></ul></ul><ul><ul><li>Most computers use ( )-bit bytes. </li></ul></ul><ul><ul><li>Each byte usually stores one character of data-letter, digit, or special character </li></ul></ul><ul><ul><li>(ex. 00110000 : 0, 00101011 : + ) </li></ul></ul>MIU Data Representation
  25. 25. <ul><li>The number of bytes </li></ul><ul><ul><li>The capacity of memory and storage </li></ul></ul><ul><ul><ul><li>is expressed in the number of ( ) that they contain. </li></ul></ul></ul><ul><ul><li>Today </li></ul></ul><ul><ul><ul><li>- PC Memory capacity : MB (128MB and more) </li></ul></ul></ul><ul><ul><ul><li>- Secondary storage devices, mainframe memory : GB </li></ul></ul></ul><ul><ul><ul><li>- Secondary storage on mainframes and network : TB </li></ul></ul></ul>MIU Bits, Bytes, and Words Data Representation Term Abbreviation Approximate Number Exact Number Kilobyte KB 10 3 2 10 = 1024 Megabyte MB 10 6 2 20 Gigabyte GB 10 9 2 40 Terabyte TB 10 12 2 80
  26. 26. <ul><li>( ) </li></ul><ul><ul><li>The size of register </li></ul></ul><ul><ul><li>the number of bits the CPU processes as a unit </li></ul></ul><ul><ul><li>The length varies by CPU. </li></ul></ul><ul><ul><ul><li>The larger the word, the more powerful the computer </li></ul></ul></ul><ul><ul><ul><li>Today : 32 or 64 bits for most PC </li></ul></ul></ul>Bits, Bytes, and Words MIU Data Representation
  27. 27. Coding Schemes <ul><ul><li>A byte can represent a character of data </li></ul></ul><ul><ul><li>Each byte contains ( ) bits, each of which can hold a ( ) or 0. </li></ul></ul><ul><ul><li>There are ( ) possible combination of 1s and 0s in a byte. </li></ul></ul><ul><li>( ) or just code </li></ul><ul><ul><li>: Assigns each one of those combinations to a specific character. </li></ul></ul><ul><ul><li>ASCII </li></ul></ul><ul><ul><li>EBCDIC </li></ul></ul><ul><ul><li>Unicode </li></ul></ul>MIU
  28. 28. ASCII, EBCDIC and Unicode <ul><li>ASCII code </li></ul><ul><ul><li>American Standard Code for Information Interchange </li></ul></ul><ul><ul><ul><li>The most widely used code </li></ul></ul></ul><ul><ul><ul><li>Used on virtually all PCs and on many larger system </li></ul></ul></ul><ul><li>EBCDIC </li></ul><ul><ul><li>Extended Binary Coded Decimal Interchange Code </li></ul></ul><ul><ul><ul><li>Primarily on IBM and IBM-compatible mainframes </li></ul></ul></ul><ul><li> Textbook : figure 4-7 on the page 4-108 </li></ul>MIU Coding Schemes
  29. 29. ASCII, EBCDIC and Unicode <ul><li> 256-character capability of ASCII and EBCDIC </li></ul><ul><li>: sufficient for English and Western European languages </li></ul><ul><li>: too small to handle the many different alphabets used throughout the rest of the world </li></ul><ul><li>Unicode </li></ul><ul><ul><li>Designed to solve this problem </li></ul></ul><ul><ul><li>Uses two bytes ( bits) to represent one character </li></ul></ul><ul><ul><li>The capability of representing 2 16 =65,536 characters </li></ul></ul><ul><ul><li>- more than enough for all the world ’ s languages </li></ul></ul><ul><ul><li>Recognizes ASCII characters </li></ul></ul>MIU Coding Schemes
  30. 30. Short Quiz <ul><li>________ contains circuitry that uses electrical signals to direct the entire computer system to carry out stored program instructions </li></ul><ul><li>________ contains the electronic circuitry that executes all arithmetic and logical operations </li></ul><ul><li>What are the four steps to executing instructions? </li></ul><ul><li>What are the components of the CPU. </li></ul><ul><li>Your computer knows only two numbers, __ and __. They mean ____ and _____ </li></ul><ul><li>These two numbers are used in _______ code. </li></ul><ul><li>One byte has how many bits? </li></ul><ul><li>ALU stands for? </li></ul><ul><li>What are 6 operations the ALU can do? </li></ul><ul><li>Bit stands for _______ digit? </li></ul>MIU
  31. 31. Review <ul><li>The CPU ’ s two parts are ( and ). </li></ul><ul><li>Four kinds of arithmetic operations are </li></ul><ul><ul><li>addition, subtraction, multiplication, division </li></ul></ul><ul><li>Three kinds of Logical operations </li></ul><ul><ul><li>Equal-to condition </li></ul></ul><ul><ul><li>Less-than condition </li></ul></ul><ul><ul><li>Greater-than condition </li></ul></ul><ul><li>( ) are special additional storage locations located within the CPU itself that offer the advantage of speed </li></ul>MIU

×