Download presentation
Presentation is loading. Please wait.
Published byCollin O’Connor’ Modified over 9 years ago
1
Copyright © 2003 by Prentice Hall 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
2Module 5: CPU 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? How to representation number? Binary (base 2) number, containing only two digits, 0 and 1 Binary (base 2) number, containing only two digits, 0 and 1 How to represent characters? How to represent characters? English text for example
3
3Module 5: CPU 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 number (base 2) representation, only two digits 0 and 1 are used, in a similar way as decimal numbers. 10011 = (1*2 4 )+(0*2 3 )+(0*2 2 )+(1*2 1 )+(1*2 0 ) = 16 + 0 + 0 + 2 + 1 = 16 + 0 + 0 + 2 + 1 = 19 = 19 Octal number: base 8 representation, using eight digits: 0, 1, 2, …, 7 Hexadecimal number: base 16 representation, using sixth digits: 0,1,2, 3, …, 9, A, B, C, D, E, F
4
4Module 5: CPU 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 quotient by 2, read the remainders backward 11 10 =1011 2 19 10 = 10011 2 Q R 11/2 5 1 5/2 2 1 2/2 1 0 1/2 0 1 Q R 19/2 9 1 9/2 4 1 4/2 2 0 2/2 1 0 1/2 0 1
5
5Module 5: CPU One binary digit can represents two numbers, 0, 1 Two binary digits can represent four numbers 00, 01, 10, 11 0 1 2 3 0 1 2 3 Three binary digits can represent ___numbers Fixed length binary representation
6
6Module 5: CPU Example of 4 binary digits numbers
7
7Module 5: CPU Binary number facts BitsRange 8 0 to 2 8 -1=255 16 0 to 2 16 -1= 65 535 32 0 to 2 32 -1= 4 294 967 295 64 0 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
8
8Module 5: CPU Coding schemes Provide a common way of representing a character of data Common Schemes ASCII, 7 bits: ASCII, 7 bits: Unicode, 16 bits: Unicode, 16 bits: EBCDIC, 8 bits: EBCDIC, 8 bits:
9
9Module 5: CPU ASCII Stands for American Standard Code for Information Interchange Most widely used standard Used on virtually all personal computers
10
10Module 5: CPU ASCII coding scheme 7 bits, 127 different symbols Examples Dec BinarySymbols 048 0110000 0 049 0110001 1 049 0110001 1 050 0110010 2 050 0110010 2 051 0110011 3 051 0110011 3 052 0110100 4 052 0110100 4 053 0110101 5 053 0110101 5 054 0110110 6 054 0110110 6 055 0110111 7 055 0110111 7 056 0111000 8 056 0111000 8 057 0111001 9 057 0111001 9 058 0111010 : (colon) 058 0111010 : (colon) 059 0111011 ; (semi-colon) 059 0111011 ; (semi-colon) 060 0111100 < (less than) 060 0111100 < (less than) 061 0111101 = (equal sign) 061 0111101 = (equal sign) 062 0111110 > (greater than) 062 0111110 > (greater than) 063 0111111 ? (question mark) 063 0111111 ? (question mark) 064 1000000 @ (AT symbol) 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
11
11Module 5: CPU Unicode Designed to accommodate alphabets of more than 256 characters Uses 16 bits to represent one character 65,536 possible values 65,536 possible values Requires twice as much space to store data
12
12Module 5: CPU The unit of information Bit: short for binary digit Two possible values: 0 and 1 Two possible values: 0 and 1 Can never be empty Can never be empty Basic unit for storing data, information Basic unit for storing data, information Byte: a group of 8 bits Each byte has 256 (2 8 ) possible values Each byte has 256 (2 8 ) possible values For text, stores one character For text, stores one character Can be letter, digit, or special character Memory and storage devices measured in number of bytes Memory and storage devices measured in number of bytes
13
13Module 5: CPU Word The number of bits the CPU processes as a unit Typically a whole number of bytes Typically a whole number of bytes The larger the word, the more powerful the computer The larger the word, the more powerful the computer Personal computers typically 32 or 64 bits in length Personal computers typically 32 or 64 bits in length
14
14Module 5: CPU The units for information storage sizes One kilobyte (1 KB) = 1024 (2 10 ) bytes = 2 13 bits Memory capacity of older personal computers Memory capacity of older personal computers One Megabyte (1 MB) = 2 20 bytes ≈ 10 6 bytes (one million bytes) Personal computer memory Personal computer memory Portable storage devices (diskette, CD-ROM) Portable storage devices (diskette, CD-ROM) One gigabyte (1 GB) = 2 30 bytes ≈ 10 9 bytes (one billion bytes) Storage devices (hard drives) Storage devices (hard drives) Mainframe and network server memory Mainframe and network server memory One terabyte (1 TB) = 2 40 bytes ≈ 10 12 bytes (one trillion bytes) Storage devices on very large systems Storage devices on very large systems
15
15Module 5: CPU Central Processing Unit (CPU) Consists of complex set of electronic circuitry Executes stored program instructions Three components Registers Registers Control unit Control unit Arithmetic/Logic Unit (ALU) Arithmetic/Logic Unit (ALU) Control Unit ALU Registers Memory CPU
16
16Module 5: CPU 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 Storage locations located within the CPU Work under direction of control unit Accept, hold, and transfer instructions or data Accept, hold, and transfer instructions or data Keep track of where the next instruction to be executed or needed data is stored Keep track of where the next instruction to be executed or needed data is stored
17
17Module 5: CPU Control unit 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 Moving data/instructions from/to register to/from registers Sends data and instructions from secondary storage to memory as needed Sends data and instructions from secondary storage to memory as needed
18
18Module 5: CPU ALU Executes all arithmetic and logical operations Arithmetic operations Arithmetic operations Addition, subtraction, multiplication, division Logical operations Logical operations Compare numbers, letters, or special characters Tests for one of three conditions Equal-to condition, Less-than condition, Greater-than condition Equal-to condition, Less-than condition, Greater-than condition Branch to different instructions Branch to different instructions
19
19Module 5: CPU Memory Also known as primary storage and main memory Often expressed as random-access memory (RAM) Often expressed as random-access memory (RAM) Not part of the CPU Not part of the CPU Holds data and instructions for processing Stores information only as long as the program is in operation
20
20Module 5: CPU The CPU and memory CPU cannot process data from disk or input device It must first reside in memory It must first reside in memory Control unit retrieves data from disk and moves it into 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 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
21
21Module 5: CPU Data storage and the CPU Two types of storage: Primary storage (memory) Primary storage (memory) Stores data temporarily CPU refers to it for both program instructions and data Secondary storage Secondary storage Long-term storage Stored on external medium, such as a disk
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.