176858c515dca2250f8922ef7d671af9.ppt
- Количество слайдов: 35
Welcome to CMPE 003 Personal Computer Concepts: Hardware and Software Winter 2003 UC Santa Cruz Instructor: Guy Cox January 23, 2003
Midterm #1 n Wednesday – January 29 Chapters 1 – 4 and 8 q ~50 questions q Multiple choice q n Bring Scantron form q #F-1712 -ERI-L n Bring q (big & pink) #2 pencil Bring your student ID n Required January 23, 2003 to take exam 2
The Central Processing Unit: What Goes on Inside the Computer Chapter 4 Part a January 23, 2003
Objectives n n n 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 4
The CPU January 23, 2003 5
The CPU n n Converts data into information Control center Set of electronic circuitry that executes stored program instructions Two parts q q Control Unit (CU) Arithmetic Logic Unit (ALU) January 23, 2003 6
Control Unit: CU n n n Part of the hardware that is in-charge Directs the computer system to execute stored program instructions Communicates with other parts of the hardware q Interrupt signals January 23, 2003 7
Arithmetic/Logic Unit: ALU Performs arithmetic operations Performs logical operations January 23, 2003 8
Arithmetic Operations Addition Subtraction Multiplication Division January 23, 2003 9
Logical Operations n n n Evaluates conditions Makes comparisons Can compare q q q Numbers Letters Special characters January 23, 2003 10
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 11
Types of Storage n n Secondary q Data that will eventually be used q Long-term Memory q Data that will be used in the near future q Temporary q Faster access than storage Memory Cache q Data that was recently used or fetched q Temporary q Faster than memory Registers q Data immediately related to the operation being executed q Faster access than memory January 23, 2003 12
Measuring Storage Capacity KB – kilobyte • • • 1024 bytes Some diskettes Cache memory MB – megabyte • Million bytes GB – gigabyte • (1, 073, 741, 824) • • January 23, 2003 RAM Hard disks CDs and DVDs TB – terabytes • (1, 048, 576) • Billion bytes Trillion bytes (1, 099, 511, 627, 776) • Large hard disks 13
Memory: Many Names Primary storage Primary memory Main storage Internal storage Main memory January 23, 2003 14
Main Types of Memory RAM Random Access Memory ROM Read Only Memory January 23, 2003 15
RAM n Volatile q n n Requires current (power) to retain values Data and instructions can be read and modified Users typically refer to this type of memory January 23, 2003 16
What’s in RAM? n Operating System q n n n Kernel Programs currently running Data needed by the programs Intermediate results waiting to be output q q Screen display Printer output January 23, 2003 17
ROM n n Non-volatile Data and instructions can be read, but not modified Instructions are typically recorded at factory Uses – q q Instructions for booting the computer Device controllers January 23, 2003 18
Executing Programs n n n Fetch q CU gets an instruction Decode q CU decodes the instruction Execute q CU notifies the appropriate part of hardware to take action q Control is transferred to the appropriate part of hardware q Task is performed Store Control is returned to the CU January 23, 2003 19
The Machine Cycle January 23, 2003 20
Machine Cycle I-time (Instruction time) n n CU fetches an instruction from memory and puts it into a register CU decodes the instruction and determines the memory location of the data required and the operation required. January 23, 2003 21
Machine Cycle E-time (Exectution time) n Execution q q q n CU moves the data from memory to registers in the ALU is given control and executes the instruction Control returns to the CU CU stores the result of the operation in memory or in a register January 23, 2003 22
Machine Cycle - Example January 23, 2003 23
System Clock n n n 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 process q Different CPUs have unique instruction sets n January 23, 2003 Different types non-compatible (ie, Apple vs Intel) 24
Finding Data in Memory n n n Each location in memory has a unique address q Address never changes q Contents may change Memory location can hold one instruction or piece of data Programmers use symbolic names for memory locations q Rate (3) q Hours (6) q Salary (8) January 23, 2003 25
Example n n n 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 q n Result stays in accumulator store result in memory location symbolically addressed by Z January 23, 2003 26
Data Representation: On/Off Binary number system is used to represent the state of the circuit January 23, 2003 27
Bits, Bytes, Words n n n BIT q Binary Dig. IT q On/off circuit q 1 or 0 BYTE q 8 bits q Store one alphanumeric character q Nibble = 4 bits (Half a byte) WORD q Size of the register q Number of BITS that the CPU processes as a unit January 23, 2003 28
Number systems Digital numbers: base 10 n 10 fingers n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 n ones=100, tens=101, hundreds=102, etc January 23, 2003 29
Number systems Binary Number: base 2 n on and off n 0, 1 n ones=20, twos=21, fours=22, etc n 0000 = 0 base 10 n 0000 0001 = 1 base 10 n 0000 0010 = 2 base 10 n 0000 0011 = 3 base 10 n 0000 1010 = 10 base 10 January 23, 2003 30
Binary Number System n We have 10 fingers. . . 100 10 1 . . . n 1000 10^3 10^2 10^1 10^0 Computers have devices with 2 states 1 0 0 1 1 the binary number 2^4 2^3 2^2 2^1 2^0 place values (1 * 2^4) + (0 * 2^3) + (0 * 2^2) + (1 * 2^1) + (1 * 2^0) = 16 + 0 + 2 + 1 = 19 January 23, 2003 31
Hexadecimal Numbers Hexadecimal Number: base 16 n alternative representation to binary n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F n ones=160, sixteens=161, 256's=162, etc n translation of hex into binary n 0000 = 0 base 16 = 0 base 10 n 0000 0001 = 1 base 16 = 1 base 10 n 0000 1010 = A base 16 = 10 base 10 n 0001 0000 = 10 base 16 = 16 base 10 January 23, 2003 32
Coding Schemes n n n ASCII (American Standard Code for Information Interchange) q Uses one 8 bit byte q 28 = 256 possible combinations or characters q Virtually all PCs and many larger computers EBCDIC (Extended Binary Coded Digital Interchange Code) q Uses one 8 bit byte q 28 =256 possible combinations or characters q Used primarily on mainframes Unicode q Uses two 8 bit bytes (16 bits) q 216 = 65, 536 possible combinations or characters q Supports characters for all the world’s languages q Downward-compatible with ASCII January 23, 2003 33
Encoding Text n n Text can be represented in binary ASCII – American Standard Code for Information Interchange ASCII Binary Code A 01000001 B 01000010 C 01000011 D 0100 1 00110001 2 00110010 3 0011 January 23, 2003 a b c d # $ % 01100001 01100010 01100011 01100100011 00100100101 34
January 23, 2003 35