150 likes | 340 Views
CPU. PC. Arith Logic Unit. Registers. Main Memory. I/O Bridge. Bus Interface. Memory bus. System bus. I/O Bus. Expansion Slots. USB Controller. Disk Controller. Graphics Adapter. Disk. Monitor. Mouse. Keyboard. CPU.
E N D
CPU PC Arith Logic Unit Registers Main Memory I/OBridge Bus Interface Memory bus System bus I/O Bus Expansion Slots USB Controller Disk Controller Graphics Adapter Disk Monitor Mouse Keyboard
CPU CPU – Central Processing Unit interprets and executes instructions. Buses – electrical conduits which carry bytes (based on word size) between components. Main Memory – temporary storage for the program instructions and its static, automatic, and dynamic memory PC Arith Logic Unit Registers Main Memory I/OBridge Bus Interface Memory bus System bus I/O Bus Expansion Slots USB Controller Disk Controller Graphics Adapter Disk Monitor Mouse Keyboard
CPU I/O devices such as mouse, keyboard, monitor, and disk are connected to the I/O bus via controllers or adapters. Controllers are typically on the computer’s motherboard; whereas, adapters are separate boards. PC Arith Logic Unit Registers Main Memory I/OBridge Bus Interface Memory bus System bus I/O Bus Expansion Slots USB Controller Disk Controller Graphics Adapter Disk Monitor Mouse Keyboard
CPU Program Counter (PC) is a special register containing the address of the next instruction to execute. Arithmetic Logic Unit (ALU) performs computations, comparisons, logic, and shifts. Registers are used as high-speed intermediate memory accessible by the ALU. PC Arith Logic Unit Registers Main Memory I/OBridge Bus Interface Memory bus System bus I/O Bus Expansion Slots USB Controller Disk Controller Graphics Adapter Disk Monitor Mouse Keyboard
CPU The CPU interprets machine instructions (from programs which are in main memory). Some categories of instructions: PC Load load registers from a copy of data in main memory or other registers Store store from a copy of data in registers to main memory Arith Logic Unit Registers Main Memory I/OBridge Bus Interface Memory bus System bus I/O Bus Expansion Slots USB Controller Disk Controller Graphics Adapter Disk Monitor Mouse Keyboard
CPU The CPU interprets machine instructions (from programs which are in main memory). Some categories of instructions (continued): PC Operate execute arithmetic, comparisons, logic or shifts using data in registers, storing the result in a register Jump branch to an address within a program by changing the PC Arith Logic Unit Registers Main Memory I/OBridge Bus Interface Memory bus System bus I/O Bus Expansion Slots USB Controller Disk Controller Graphics Adapter Disk Monitor Mouse Keyboard
CPU User types ./add2 10 20. Shell causes each keystroke to be brought into a register as it is captured. PC Arith Logic Unit Registers Main Memory I/OBridge Bus Interface I/O Bus Expansion Slots USB Controller Disk Controller Graphics Adapter Disk Monitor Mouse Keyboard
CPU PC Arith Logic Unit Registers Shell stores what the user types in Main Memory as he/she types it Main Memory I/OBridge Bus Interface I/O Bus Expansion Slots USB Controller Disk Controller Graphics Adapter Disk Monitor Mouse Keyboard
CPU Determining to load ./add2 takes steps which we are not showing When user presses enter, the shell makes a request to load the ./add2 program into memory. PC Arith Logic Unit Registers Main Memory I/OBridge Bus Interface I/O Bus Expansion Slots USB Controller Disk Controller Graphics Adapter Disk Monitor Mouse Keyboard
CPU Execution begins with the Program Counter (PC) set to the beginning address of the program. PC Arith Logic Unit Registers Main Memory I/OBridge Bus Interface I/O Bus Expansion Slots USB Controller Disk Controller Graphics Adapter Disk Monitor Mouse Keyboard
CPU • The CPU fetches an operation at the address in the PC. It then • Decodes the instruction to understand the operation and its operands. • If necessary, fetches the operands • Increments the PC past the instruction • Executes the operation PC Arith Logic Unit Registers Main Memory I/OBridge Bus Interface I/O Bus Expansion Slots USB Controller Disk Controller Graphics Adapter Disk Monitor Mouse Keyboard
CPU It loads 10 and 20 into registers based on separate instructions. PC Arith Logic Unit Registers 10 20 Main Memory I/OBridge Bus Interface I/O Bus Expansion Slots USB Controller Disk Controller Graphics Adapter Disk Monitor Mouse Keyboard
CPU Based on another instruction, the ALU adds 10 to 20, storing the result in a that register. PC Arith Logic Unit Registers 10 30 Main Memory I/OBridge Bus Interface I/O Bus Expansion Slots USB Controller Disk Controller Graphics Adapter Disk Monitor Mouse Keyboard
CPU Another instruction causes 30 to be written in main memory. PC Arith Logic Unit Registers 10 20 30 Main Memory I/OBridge Bus Interface I/O Bus Expansion Slots USB Controller Disk Controller Graphics Adapter Disk Monitor Mouse Keyboard
CPU Another instruction causes 30 to be displayed on the monitor by taking the value from memory and sending it to the graphics adapter. PC Arith Logic Unit Registers 10 30 Main Memory I/OBridge Bus Interface I/O Bus Expansion Slots USB Controller Disk Controller Graphics Adapter Disk Monitor Mouse Keyboard