5.2 Mathematical Power, Convenience, and Cost The set of operations represents a tradeoff among the...

30
5.2 Mathematical Power, Convenience, and Cost • The set of operations represents a tradeoff among the cost of the hardware, the convenience for a programmer, and engineering considerations such as power consumption.
  • date post

    21-Dec-2015
  • Category

    Documents

  • view

    213
  • download

    0

Transcript of 5.2 Mathematical Power, Convenience, and Cost The set of operations represents a tradeoff among the...

Page 1: 5.2 Mathematical Power, Convenience, and Cost The set of operations represents a tradeoff among the cost of the hardware, the convenience for a programmer,

5.2 Mathematical Power, Convenience, and Cost

• The set of operations represents a tradeoff among the cost of the hardware, the convenience for a programmer, and engineering considerations such as power consumption.

Page 2: 5.2 Mathematical Power, Convenience, and Cost The set of operations represents a tradeoff among the cost of the hardware, the convenience for a programmer,

5.3 Instruction Set and Representation

• Two key consideration– The set of operations– The instruction format

Page 3: 5.2 Mathematical Power, Convenience, and Cost The set of operations represents a tradeoff among the cost of the hardware, the convenience for a programmer,

5.4 Op-codes, Operands, and Results

• Each instruction contains three parts:– Op-codes– Operands– Results

Page 4: 5.2 Mathematical Power, Convenience, and Cost The set of operations represents a tradeoff among the cost of the hardware, the convenience for a programmer,

From Essentials of Computer Architecture by Douglas E. Comer. ISBN 0131491792. © 2005 Pearson Education, Inc. All rights reserved.

Page 5: 5.2 Mathematical Power, Convenience, and Cost The set of operations represents a tradeoff among the cost of the hardware, the convenience for a programmer,

Variable-Length Vs. Fixed-Length instructions

• Fixed length instructions can make processor hardware less complex and faster

Page 6: 5.2 Mathematical Power, Convenience, and Cost The set of operations represents a tradeoff among the cost of the hardware, the convenience for a programmer,

5.7 General-Purpose Registers

• General purpose registers act as a temporary storage facility.

Page 7: 5.2 Mathematical Power, Convenience, and Cost The set of operations represents a tradeoff among the cost of the hardware, the convenience for a programmer,

5.9 Programming with Registers

• The process of choosing which values the registers contain is known as register allocation.

Page 8: 5.2 Mathematical Power, Convenience, and Cost The set of operations represents a tradeoff among the cost of the hardware, the convenience for a programmer,

From Essentials of Computer Architecture by Douglas E. Comer. ISBN 0131491792. © 2005 Pearson Education, Inc. All rights reserved.

Page 9: 5.2 Mathematical Power, Convenience, and Cost The set of operations represents a tradeoff among the cost of the hardware, the convenience for a programmer,

5. 10 Register Banks

• Conflict occurs sometimes– R X + Y – S Z – X– T Y + Z

– The programmer must either reassign registers or insert an instruction to copy values

Page 10: 5.2 Mathematical Power, Convenience, and Cost The set of operations represents a tradeoff among the cost of the hardware, the convenience for a programmer,

From Essentials of Computer Architecture by Douglas E. Comer. ISBN 0131491792. © 2005 Pearson Education, Inc. All rights reserved.

Page 11: 5.2 Mathematical Power, Convenience, and Cost The set of operations represents a tradeoff among the cost of the hardware, the convenience for a programmer,

5.11 Complex and Reduced Instruction Sets

• CISC– Complex Instruction Set Computer– Intel 80X86 processors

• RISC– Reduced Instruction Set Computer– MIPS processor

Page 12: 5.2 Mathematical Power, Convenience, and Cost The set of operations represents a tradeoff among the cost of the hardware, the convenience for a programmer,

5.12 RISC Design and the Execution Pipeline

• Several stages– Fetch the next instruction– Examine the OP-code– Fetch operands– Perform operation– Store the result

Page 13: 5.2 Mathematical Power, Convenience, and Cost The set of operations represents a tradeoff among the cost of the hardware, the convenience for a programmer,

From Essentials of Computer Architecture by Douglas E. Comer. ISBN 0131491792. © 2005 Pearson Education, Inc. All rights reserved.

Page 14: 5.2 Mathematical Power, Convenience, and Cost The set of operations represents a tradeoff among the cost of the hardware, the convenience for a programmer,

From Essentials of Computer Architecture by Douglas E. Comer. ISBN 0131491792. © 2005 Pearson Education, Inc. All rights reserved.

Page 15: 5.2 Mathematical Power, Convenience, and Cost The set of operations represents a tradeoff among the cost of the hardware, the convenience for a programmer,

5.13 Pipelines and Instruction Stalls

• The instruction pipeline is transparent to programmers

• A stage of the pipeline stalls to wait for the operand to become available

Page 16: 5.2 Mathematical Power, Convenience, and Cost The set of operations represents a tradeoff among the cost of the hardware, the convenience for a programmer,

From Essentials of Computer Architecture by Douglas E. Comer. ISBN 0131491792. © 2005 Pearson Education, Inc. All rights reserved.

Page 17: 5.2 Mathematical Power, Convenience, and Cost The set of operations represents a tradeoff among the cost of the hardware, the convenience for a programmer,

From Essentials of Computer Architecture by Douglas E. Comer. ISBN 0131491792. © 2005 Pearson Education, Inc. All rights reserved.

Page 18: 5.2 Mathematical Power, Convenience, and Cost The set of operations represents a tradeoff among the cost of the hardware, the convenience for a programmer,

5.14 Other Cause of Pipeline Stalls

• Access external storage

• Invoke a coprocessor

• Branches to a new location

• Calls to a subroutine

Page 19: 5.2 Mathematical Power, Convenience, and Cost The set of operations represents a tradeoff among the cost of the hardware, the convenience for a programmer,

From Essentials of Computer Architecture by Douglas E. Comer. ISBN 0131491792. © 2005 Pearson Education, Inc. All rights reserved.

Page 20: 5.2 Mathematical Power, Convenience, and Cost The set of operations represents a tradeoff among the cost of the hardware, the convenience for a programmer,

5.16 Programming, Stalls, and No-OP Instruction

• Insert a comment that explain the reason for a stall

• Insert no-op instructions to document an instruction stall

Page 21: 5.2 Mathematical Power, Convenience, and Cost The set of operations represents a tradeoff among the cost of the hardware, the convenience for a programmer,

From Essentials of Computer Architecture by Douglas E. Comer. ISBN 0131491792. © 2005 Pearson Education, Inc. All rights reserved.

Page 22: 5.2 Mathematical Power, Convenience, and Cost The set of operations represents a tradeoff among the cost of the hardware, the convenience for a programmer,

5.18 Types of Operations

• Arithmetic instructions

• Logical instructions

• Data access and transfer instructions

• Branch instructions

• Floating point instructions

• Processor control instructions

Page 23: 5.2 Mathematical Power, Convenience, and Cost The set of operations represents a tradeoff among the cost of the hardware, the convenience for a programmer,

5.19 Program Counter, Fetch-Execute, and Branching

• Assign the program counter an initial address, Repeat forever {– Fetch: access the next step of the program

• Set an internal register to the next instruction

– Execute : perform the step of the program• Copy the content of the internal register to the

program counter

• }

Page 24: 5.2 Mathematical Power, Convenience, and Cost The set of operations represents a tradeoff among the cost of the hardware, the convenience for a programmer,

From Essentials of Computer Architecture by Douglas E. Comer. ISBN 0131491792. © 2005 Pearson Education, Inc. All rights reserved.

Page 25: 5.2 Mathematical Power, Convenience, and Cost The set of operations represents a tradeoff among the cost of the hardware, the convenience for a programmer,

From Essentials of Computer Architecture by Douglas E. Comer. ISBN 0131491792. © 2005 Pearson Education, Inc. All rights reserved.

Page 26: 5.2 Mathematical Power, Convenience, and Cost The set of operations represents a tradeoff among the cost of the hardware, the convenience for a programmer,

From Essentials of Computer Architecture by Douglas E. Comer. ISBN 0131491792. © 2005 Pearson Education, Inc. All rights reserved.

Page 27: 5.2 Mathematical Power, Convenience, and Cost The set of operations represents a tradeoff among the cost of the hardware, the convenience for a programmer,

From Essentials of Computer Architecture by Douglas E. Comer. ISBN 0131491792. © 2005 Pearson Education, Inc. All rights reserved.

Page 28: 5.2 Mathematical Power, Convenience, and Cost The set of operations represents a tradeoff among the cost of the hardware, the convenience for a programmer,

5.23 The Principle of Orthogonality

• An instruction set is orthogonal if each instruction performs a unique task.

Page 29: 5.2 Mathematical Power, Convenience, and Cost The set of operations represents a tradeoff among the cost of the hardware, the convenience for a programmer,

5.24 Condition Codes and Conditional Branch

• The ALU sets a condition code.

• A conditional branch instruction can test one or more of the flag bits, and use the result to determine whether to branch.

Page 30: 5.2 Mathematical Power, Convenience, and Cost The set of operations represents a tradeoff among the cost of the hardware, the convenience for a programmer,

From Essentials of Computer Architecture by Douglas E. Comer. ISBN 0131491792. © 2005 Pearson Education, Inc. All rights reserved.