Presentation is loading. Please wait.

Presentation is loading. Please wait.

Module 5 Central Processing Unit 1. Binary representation of data 2. The components of the CPU 3. CPU and Instruction set 4. Important features of CPUs.

Similar presentations


Presentation on theme: "Module 5 Central Processing Unit 1. Binary representation of data 2. The components of the CPU 3. CPU and Instruction set 4. Important features of CPUs."— Presentation transcript:

1 Module 5 Central Processing Unit 1. Binary representation of data 2. The components of the CPU 3. CPU and Instruction set 4. Important features of CPUs

2 2 Data representation All modern digital equipment work on binary digits, 0, 1, based on the two measurable/recogniable states: such as circuitry voltage, high voltage (ON): 1 Low voltage (Off) : 0 Why? Simple, reliable, and available technology The fundamental component made of silicon: Transister Logic gates AND, OR, NOT can be constructed from transistor

3 3 Data representation All modern digital equipment work on binary digits, i.e., 0, 1, based on the two states of a circuitry, e.g. High voltage (ON): 1 Low voltage (Off) : 0 Why? Simple, reliable, and available technology CPU can only understand 0 and 1 Data must be represented in binary form before it is processed by a CPU –How to representation number? Binary (base 2) number, containing only two digits, 0 and 1 –How to represent characters? English text for example

4 4 Binary number In decimal (base 10) we indicate place values by the order of digits –135 = (1*10 2 ) + (3*10 1 ) + (5*10 0 ) In binary only 0’s and 1’s exist we do the same thing but since we use only two digits the place values change. –10011 = (1*2 4 )+(0*2 3 )+(0*2 2 )+(1*2 1 )+(1*2 0 ) = 16 + 0 + 0 + 2 + 1 = 19

5 5 Conversion between binary and decimal 1011 2 = (1x2 0 )+(1x2 1 )+(0x2 2 )+(1x2 3 ) = 1+2+0+8 = 11 Decimal to binary: repeatedly divide the quote by 2, read the remainder backward 11 51 21 10 01 11 10 =1011 2 Read up 19 91 41 20 10 19 10 = 10011 2 Read up 01

6 6 One binary digit can represents two numbers, 0, 1 Two binary digits can represent four numbers 00, 01, 10, 11 0 1 2 3 Three binary digits can represent ___numbers Fixed length binary representation

7 7 Example of 4 binary digits numbers

8 8 Binary number facts BitsRange 80 to 2 8 -1=255 160 to 2 16 -1= 65 535 320 to 2 32 -1= 4 294 967 295 640 to 2 64 -1=18 446 744 073 709 551 615 It takes more digits to represent a number in binary than it does in decimal

9 9 Binary number operations Add, subtract, multiply, division Example of add 1101 + 1001 1101 1001 +_____ 10110

10 10 Binary representation for characters Coding schemes provide a common way of representing a character of data Common Schemes –ASCII, 7 bits –Stands for American Standard Code for Information Interchange –Most widely used standard –Used on virtually all personal computers

11 11 ASCII coding scheme 7 bits, 127 different symbols Examples Dec BinarySymbols 048 0110000 0 049 0110001 1 050 0110010 2 051 0110011 3 052 0110100 4 053 0110101 5 054 0110110 6 055 0110111 7 056 0111000 8 057 0111001 9 058 0111010 : (colon) 059 0111011 ; (semi-colon) 060 0111100 < (less than) 061 0111101 = (equal sign) 062 0111110 > (greater than) 063 0111111 ? (question mark) 064 1000000 @ (AT symbol) 065 1000001 A 065 1000001 A 066 1000010 B 066 1000010 B 067 1000011 C 067 1000011 C 068 1000100 D 068 1000100 D 069 1000101 E 069 1000101 E 070 1000110 F 070 1000110 F 071 1000111 G 071 1000111 G 072 1001000 H 072 1001000 H 073 1001001 I 073 1001001 I 074 1001010 J 074 1001010 J 075 1001011 K 075 1001011 K 076 1001100 L 076 1001100 L 077 1001101 M 077 1001101 M 078 1001110 N 078 1001110 N 079 1001111 O 079 1001111 O 080 1010000 P 080 1010000 P 081 1010001 Q 081 1010001 Q 082 1010010 R 082 1010010 R 083 1010011 S 083 1010011 S 084 1010100 T 084 1010100 T 085 1010101 U 085 1010101 U 086 1010110 V 086 1010110 V 087 1010111 W 087 1010111 W 088 1011000 X 088 1011000 X 089 1011001 Y 089 1011001 Y 090 1011010 Z 090 1011010 Z

12 12 Unicode Designed to accommodate alphabets of more than 256 characters Uses 16 bits to represent one character –65,536 possible values Requires twice as much space to store data

13 13 The unit of information Bit: short for binary digit –Two possible values: 0 and 1 –Can never be empty –Basic unit for storing data, information Byte: a group of 8 bits –Each byte has 256 (2 8 ) possible values –For text, stores one character Can be letter, digit, or special character –Memory and storage devices measured in number of bytes

14 14 Word Word is the number of bits the CPU processes as a unit. A word usually consists of several bytes. It is CPU dependent. The larger the word, the more powerful the computer. We say a 32 bits processor. Here 32 is the size of the word. It is equal to the size of a register. in length

15 15 The units for information storage sizes One kilobyte (1 KB) = 1024 (2 10 ) bytes = 2 13 bits –Memory capacity of older personal computers One Megabyte (1 MB) = 2 20 bytes ≈ 10 6 bytes (one million bytes) –Personal computer memory –Portable storage devices (diskette, CD-ROM) One gigabyte (1 GB) = 2 30 bytes ≈ 10 9 bytes (one billion bytes) –Storage devices (hard drives) –Mainframe and network server memory One terabyte (1 TB) = 2 40 bytes ≈ 10 12 bytes (one trillion bytes) –Storage devices on very large systems

16 16 Central Processing Unit (CPU) Consists of complex set of electronic circuitry Executes stored program instructions Three components –Registers –Control unit –Arithmetic/Logic Unit (ALU) Control Unit ALU Registers Memory CPU

17 17 Registers Registers: temporary place for instructions and data. All instructions and data must be placed in registers before being executed and processed High-speed temporary storage areas –Storage locations located within the CPU Work under direction of control unit –Accept, hold, and transfer instructions or data –Keep track of where the next instruction to be executed or needed data is stored

18 18 Control unit Control unit: directs the computer system to execute stored program instructions Must communicate with memory and ALU Storage operations –Moving data/instructions from/to register to/from registers –Sends data and instructions from secondary storage to memory as needed

19 19 ALU 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 –Equal-to condition, Less-than condition, Greater-than condition –Branch to different instructions

20 20 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

21 21 The CPU and memory CPU cannot process data from disk or input device –It must first reside in 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 Data and instructions held in memory until sent to an output or storage device or program is shut down

22 22 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 Long-term storage Stored on external medium, such as a disk

23 23 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 –those instructions that CPU can understand and execute

24 24 The machine cycle The time required to retrieve, execute, and store an operation Components –Instruction time –Execution time System clock synchronizes operations

25 25 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

26 26 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

27 27 Microprocessor Central processing unit etched on silicon chip Contain hundreds of millions of tiny transistors Key components: –ALU –Registers –Control unit –System clock

28 28 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 –Otherwise, switch is off, representing a 0 bit The size of a transistor –New technology makes the size of a transistor smaller and smaller! –Current: 0.13 micro meter or 130 nano meter Moving to 0.09 micro meter 90 nano meter Next a few years: 60 nano meters

29 29 Types of chips Intel makes a family of processors –Pentium III and Pentium4 processors in most PCs –Celeron processor sold for low-cost PCs –Xeon and Itanium for high-end workstations and network servers Other processors –Cyrix and AMD make Intel-compatible microprocessors –PowerPC chips used primarily in Macintosh computers –Compaq’s Alpha microprocessor used in high-end servers

30 30 Computer processing speeds Instruction speeds measured in fractions of seconds –Millisecond: one thousandth of a second –Microsecond: one millionth of a second –Nanosecond: one billionth of a second Modern computers have reached this speed –Picoseconds: one trillionth of a second

31 31 Microprocessor speeds Measure of system clock speed –How many electronic pulses the clock produces per second (clock frequency) –Usually expressed in frequency Gigahertz (GHz), Megahertz (MHz), Kilohertz (KHz) –Or how much time for each cycle: clock cycle time clock cycle time = 1 / clock frequency Second, millisecond, microsecond, nanosecond, picoseconds Comparison of clock speed only meaningful between identical microprocessors

32 32 Other performance measures Millions of Instructions per Second (MIPS) –High-speed personal computers can perform over 500 MIPS –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

33 33 Cache A temporary storage area –Speeds up data transfer within computer Processor cache Control Unit ALU Registers Memory CPU Cache L1 Cache L2

34 34 Processor cache A small block of high-speed memory –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 –If not in cache, control unit retrieves from memory The more cache “hits” the faster the system performance Internal (Level 1) cache built into microprocessor –Fastest access, but highest cost External (Level 2) cache on separate chip –Incorporated into processor on some current microprocessors


Download ppt "Module 5 Central Processing Unit 1. Binary representation of data 2. The components of the CPU 3. CPU and Instruction set 4. Important features of CPUs."

Similar presentations


Ads by Google