Program Execution-Programming and Computer Architecture-Lecture Slides, Slides of Computer Architecture and Organization

Chanchal Mahanthapa delivered this lecture at Chandra Shekhar Azad University of Agriculture and Technology for Programming and Computer Architecture. It includes: Data, Manipulation, Program, Execution, CPU, JUMP, Instruction, Fetch, Execute, Decode

Typology: Slides

2011/2012

Uploaded on 07/13/2012

ekraj
ekraj 🇮🇳

4.1

(11)

123 documents

1 / 31

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Data Manipulation
Program Execution
docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f

Partial preview of the text

Download Program Execution-Programming and Computer Architecture-Lecture Slides and more Slides Computer Architecture and Organization in PDF only on Docsity!

Data ManipulationProgram Execution

docsity.com

Program Execution

A computer follows a program stored inits memory by copying the instructionsfrom memory into the CPU as needed.

Once in the CPU, each instruction isdecoded and obeyed.

The order in which the instructions arefetched from the memory corresponds tothe order in which the instructions arestored in the memory unless there is aJUMP instruction.

docsity.com

Program Execution(Contd.)

Fetch:

Each instruction is two bytes long, fetchprocess involves retrieving the contents of thetwo memory cells from the main memory.

CPU places the instruction received from thememory in its instruction register and thenincrements the program counter by two.

The counter contains the address of the nextinstruction stored in the memory.

Thus the program counter will be ready forthe next fetch.

docsity.com

Program Execution(Contd.)

Decode:

The instruction now in the instructionregister, the CPU decodes the instruction,which involves breaking the operand field intoits proper components based on theinstruction’s op-code.

Execute:

CPU then executes the instruction byactivating the appropriate circuitry toperform the requested task.

docsity.com

Example B

B258:

JUMP to the instruction at address 58 if the contentsof register 2 is the same as that of register 0.

We will start by comparing the values in register 2and 0.

If the contents are different bits, the execution stepterminates and the next machine cycle begins.

If the contents are equal than the machine places thevalue 58 in its program counter during the executestep.

Next fetch step finds 58 in the program counter, soinstruction at that address will the next instruction tobe fetched and executed.

docsity.com

Decoding the instruction B

docsity.com

An example of ProgramExecution(Contd.)

We first need to put the programsomewhere in the memory.

For our example, suppose the program isstored in consecutive addresses, startingat address A0(hexadecimal).

With the program stored in this manner, we can cause the machine to execute itby placing the address(A0) of the firstinstruction in the program counter andstarting the machine.

docsity.com

The program stored in main memory ready forexecution

docsity.com

Performing the fetch step of the machinecycle

docsity.com

An example of ProgramExecution(Contd.)

Notice that, in our machine, instructionsare 16bits(two bytes) long.

Thus entire instruction to be fetchedoccupies the memory cells at bothaddress A0 and A1.

CPU is designed to take this into accountso it retrieves the content of both cellsand places the bit pattern received in theinstruction register which is 16 bit long.

docsity.com

An example of ProgramExecution(Contd.)

At the end of the fetch step of the firstmachine cycle, the program counter andinstruction register contain the followingdata:

Program Counter:A

Instruction Register: 156C

docsity.com

Operating SystemsOperating System Architecture

docsity.com

Operating System Architecture

To understand the composition of atypical operating system we need to firstconsider the complete spectrum ofsoftware found within a typical computersystem.

Then we will concentrate on theoperating system itself.

docsity.com

A Software Survey

Microsoft Window’s operating systems

Group of programs called “Accessories” and“Administrative Tools”.

These are called

application and utility classes.

Machine software categories:

Application Software

System Software

docsity.com