L03-InstructionSet - Concocting an Instruction Set Nerd...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
L03 – Instruction Set 1 Comp 411 – Fall 2009 9/2/09 Concocting an Instruction Set move flour,bowl add milk,bowl add egg,bowl move bowl,mixer rotate mixer ... Nerd Chef at work. Read: Chapter 2.1-2.3, 2.5-2.7
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
L03 – Instruction Set 2 Comp 411 – Fall 2009 9/2/09 A General-Purpose Computer The von Neumann Model Many architectural approaches to the general purpose computer have been explored. The one on which nearly all modern, practical computers is based was proposed by John von Neumann in the late 1940s. Its major components are: Central Processing Unit Central Processing Unit (CPU): A device which fetches, interprets, and executes a specified set of operations called Instructions . Main Memory Memory: storage of N words of W bits each, where W is a fixed architectural parameter, and N can be expanded to meet needs. Input/ Output I/O: Devices for communicating with the outside world.
Background image of page 2
L03 – Instruction Set 3 Comp 411 – Fall 2009 9/2/09 Anatomy of an Instruction Computers execute a set of primitive operations called instructions Instructions specify an operation and its operands (the necessary variables to perform the operation) Types of operands: immediate, source, and destination add $t0, $t1, $t2 addi $t0, $t1, 1 Operation Operands (variables, arguments, etc. Source Operands Destination Operand Immediate Operand Why the “$” on some operands? $X is a convention to denote the “contents” of a temporary variable named “X”, whereas immediate operands indicate the specified value
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
L03 – Instruction Set 4 Comp 411 – Fall 2009 9/2/09 Meaning of an Instruction Operations are abbreviated into opcodes (1-4 letters) Instructions are specified with a very regular syntax First an opcode followed by arguments Usually the destination is next, then source arguments (This is not strictly the case, but it is generally true) Why this order? Analogy to high-level language like Java or C add $t0, $t1, $t2 int t0, t1, t2 t0 = t1 + t2 implies The instruction syntax provides operands in the same order as you would expect in a statement from a high level language.
Background image of page 4
L03 – Instruction Set 5 Comp 411 – Fall 2009 9/2/09 Being the Machine! Generally… Instructions are executed sequentially from a list Instructions execute after all previous instructions have completed, therefore their results are available to the next instruction But, you may see exceptions to these rules $t0: 0 $t1: 6 $t2: 8 $t3: 10 Variables add $t0, $t1, $t1 add $t0, $t0, $t0 add $t0, $t0, $t0 sub $t1, $t0, $t1 Instructions 12 24 48 42 What is this program doing?
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
L03 – Instruction Set 6 Comp 411 – Fall 2009 9/2/09 Analyzing the Machine! Repeat the process treating the variables as
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/31/2009 for the course COMPUTER computer 1 taught by Professor Abedauthman during the Spring '08 term at Aarhus Universitet.

Page1 / 32

L03-InstructionSet - Concocting an Instruction Set Nerd...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online