Computer Architecture - Program Execution

VarunBhargava25 487 views 17 slides Aug 07, 2021
Slide 1
Slide 1 of 17
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17

About This Presentation

How Program Execution takes place in CPU


Slide Content

Program execution In Central processing unit NAME – VARUN BHARGAVA ROLL NO- I222

Central Processing Unit A  central processing unit  ( CPU ), also called a  central processor ,  main processor  or just  processor , is the  electronic circuitry  that executes  instructions  comprising a  computer program . The CPU performs basic  arithmetic , logic, controlling, and  input/output  (I/O) operations specified by the instructions in the program .

Arithmetic Logic Unit - The arithmetic and logic unit contains electronic circuitry that executes all arithmetic and logic operations that control unit asks, so as to execute set of instructions or Program. Control UNIT - The control unit of the CPU uses electrical signals to direct the entire computer system to carry Out, or execute , stored program instructions. The control unit must communicate with both the arithmetic/logic unit and memory. Helps in fetching input, directs system to execute particular instruction at a particular time and generate output for a program

Registers Registers are  a type of computer memory used to quickly accept, store, and transfer data and instructions  that are being used immediately by the CPU. ... A processor register may hold an instruction, a storage address, or any data ( such as bit sequence or individual characters ). There are in total 14 registers , Out of which 6 are general purpose registers.

General purpose registers : A general purpose register is a memory cell. Each general purpose register has a unique name It is used to store intermediate result of complex computation The 8085 has six general-purpose registers to store 8-bit data; these are identified as - B, C, D, E, H, and L . These can be combined as register pairs – BC, DE, and HL, to perform some 16-bit operation. Accumulator This Register is used for storing the Results those are produced by the system for short time. accumulator is an 8-bit register (can store 8-bit data) that is the part of the arithmetic and logical unit (ALU). Accumulator is also defined as register A .

Instruction register Instruction register Contains the current instruction being executed by the CPU. The CPU will perform the operation indicated by the instruction code contained in the Instruction register . it contains the instruction most recently fetched or executed . Memory address register This register holds the memory addresses of data and instructions . This register is used to access data and instructions from memory during the execution of an instruction . Contents of MAR is directly connected to the address bus .

Memory buffer register It is the register that contains the data to be stored in the computer storage or data after a fetch from the computer storage . It acts like a buffer and holds anything that is copied from the memory ready for the processor to use it . Contents of MBR are directly connected to the data bus . Also known as memory data register. Program counter This register contains the address of the next instruction The value in the program counter will be increased after the Central processing unit finishes executing one instruction . A branch or skip instruction will also modify the content of the PC .

Memory Buffer Register Memory Address Register

Program Execution in central processing unit Program - In computing, a program is  a specific set of ordered operations for a computer to perform . In the modern computer that John von Neumann outlined in 1945 , the program contains a one-at-a-time sequence of instructions that the computer follows. Typically, the program is put into a storage area accessible to the computer .

Instruction execution within a program • Fetch the instruction • Decode the instruction • Execute the instruction • Store the instruction Control Unit, ALU & Registers play an important role in Program Execution

fetch 1. Load the address of next instruction in the PC and of current instruction the MAR. – So that the control unit can Directly fetch the instruction from the right part of the memory . 2. Copy the instruction/data that is in the memory address given by the MAR into the MBR – MBR is used whenever anything is to go from the CPU to main memory , or vice versa. 3. Increment the PC by 1. – So that it contains the address of the next instruction, assuming that the instructions are in consecutive locations. 4. Load the instruction/data that is now in the MBR into the IR. – Thus the next instruction is copied from memory -> MBR -> IR .

DECODE Contents of IR split into operation code and address if present e.g. store, add or jump instructions . 2 . Decode the instruction that is in the INSTRUCTION REGISTERS.

Execute If the instruction is an input / load (directly) instruction then take data input and place in accumulator . • If the instruction is a load (from memory) instruction. – Copy address part of the instruction (to load from) in the IR into MAR. – Copy data from memory address held in MAR to Memory buffer – Copy data in Memory buffer register into accumulator • If the instruction is an add instruction then: – Copy address part of the instruction (of number to add) in the IR into MAR . – Copy number from memory address held in MAR into MDR. – Add number in MDR to number in accumulator (accumulator will now hold the result ).

Store the output • Result of calculations in central processing unit stored in main memory or sent to output devices . • program Counter could be updated to a new Address by incrementing .
Tags