351 likes | 1.16k Views
Memory. Control Unit. Registers. ALU. CPU. Central Processing Unit (CPU). Consists of complex set of electronic circuitry Executes stored program instructions Three components Registers Control unit Arithmetic/Logic Unit (ALU). ALU Executes all arithmetic and logical operations
E N D
Memory Control Unit Registers ALU CPU Central Processing Unit (CPU) • Consists of complex set of electronic circuitry • Executes stored program instructions • Three components • Registers • Control unit • Arithmetic/Logic Unit (ALU)
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
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 • Work under direction of control unit • A special register, called program counter, keeps the track of where the next instruction to be executed or needed data is stored
Control unit • Direct the computer system to execute stored program instructions • Tell ALU what to do • Storage operations • Moving data/instructions between registers and memory • Moving data/instructions secondary storage and memory as needed
Memory • Primary storage • Often expressed as random-access memory (RAM) • Holds data and instructions for processing • Stores instructions and data of a running program
CPU and memory • CPU cannot process data from disk or input device • Items sent to ALU for processing • Data and instructions held in memory until sent to an output or storage device or program is shut down
CPU and Instructions • An instruction is the basic operation a CPU can execute. • Each CPU is designed to implement a set of instructions • Types of instructions
How the CPU executes instructions • Four steps performed for each instruction • Fetch • Decode • Compute • Save
Machine cycles • 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
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
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
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 • Measure of system clock speed
The machine cycle and system clock • System clock synchronizes operations • One instruction takes one or more clock cycle • Hz • Clock cycle time: