Presentation is loading. Please wait.

Presentation is loading. Please wait.

Instructions Instructions (referred to as micro-instructions in the book) specify a relatively simple task to be executed It is assumed that data are stored.

Similar presentations


Presentation on theme: "Instructions Instructions (referred to as micro-instructions in the book) specify a relatively simple task to be executed It is assumed that data are stored."— Presentation transcript:

1 Instructions Instructions (referred to as micro-instructions in the book) specify a relatively simple task to be executed It is assumed that data are stored in memory called data_mem Instructions are also stored in another memory called inst_mem For example move (x, y) means move contents of memory location x into y add (x, y, z) means add contents of locations x and y and store result into location z cmove (cx, y) means move a constant cx into location y cadd (cx, y, z) means add constant cx and contents of memory location y and store result into memory location z And similar instruction like for add for sub, and, or, xor.. See Table 12.9 in the book for more example

2 Another Type of Instructions
A collection of instructions is called an instruction set We operated on contents of memory locations or constants In more recent instruction sets (RISC for example), operands for most instructions are supposed to be in registers only Only instructions like LOAD/STORE work with memory operands Instruction set include instructions like LD R5, A /* Load contents of memory location into register R5 */ ST R5, A /* Store contents of R5 into memory location R5 */ ADD R3, R4, R5 /* Add contents of registers R4 and R5 and store the result into register R3 */ Similar instruction like Add such as SUB< AND< OR XOR In these instructions only LD and STORE take more time

3 Using Instructions Using the instructions we can write program
For example for expression like D = A * B + C will translated into the following program using first instruction set MUL (A, B, D) ADD (D, C, D) If we use the second instruction set, the program will be LD R1, A /* Get A into R1*/ LD R2, B /* Get B into R2*/ MUL R1, R1, R2 /* Multiply R1, R2, result into R1 */ LD R2, C /* Get C into R2 */ ADD R1, R1, R2 /* Add R1 and R2, result into R1 */ ST R1, D /* Store R1 into D */ These instructions are stored in program memory and executed using a data path one at a time


Download ppt "Instructions Instructions (referred to as micro-instructions in the book) specify a relatively simple task to be executed It is assumed that data are stored."

Similar presentations


Ads by Google