Central processing unit (CPU)

 

CS 231: Introduction to Programming
Lecture #4: Hardware architecture

Central processing unit (CPU)
bullet Components of the CPU the main components of the CPU include:
registers (used to hold data for immediate use);
• the ALU (used to perform transformations on data);
• the control unit (used to "direct traffic")

Control bar


















































 

CS 231: Introduction to Programming
Lecture #4: Hardware architecture

Central processing unit (CPU)
bullet Components of the CPU
bullet The native language of machines each CPU has a pre-determined set of instructions which it can execute; typical instructions might include "add some numbers", "get some information from memory", etc.

Control bar


















































 

CS 231: Introduction to Programming
Lecture #4: Hardware architecture

Central processing unit (CPU)
bullet Components of the CPU
bullet The native language of machines
bullet Stored program computers • each instruction is represented by a word, i.e., a sequence of ones and zeros of some fixed width (often a power of 2, e.g., 32, 64, etc.)
• a sequence of instructions (i.e., a program) can be stored in the computer's memory and retrieved to be performed as needed

Control bar


















































 

CS 231: Introduction to Programming
Lecture #4: Hardware architecture

Central processing unit (CPU)
bullet Components of the CPU
bullet The native language of machines
bullet Stored program computers
bullet The basic operating cycle • in order to "run" a program, the computer must follow these steps: get an instruction, decode it (control), perform the associated task (e.g., addition), and then continue
• a special register called the program counter is used to store the "number" of the next instruction to be performed

Control bar