4-1 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Principles.

Slides:



Advertisements
Similar presentations
Lecture 10 Instruction Set Architecture
Advertisements

6-1 Chapter 6 - Datapath and Control Department of Information Technology, Radford University ITEC 352 Computer Organization Principles of Computer Architecture.
INSTRUCTION SET ARCHITECTURES
ITCS 3181 Logic and Computer Systems 2015 B. Wilkinson slides3.ppt Modification date: March 16, Addressing Modes The methods used in machine instructions.
 Suppose for a moment that you were asked to perform a task and were given the following list of instructions to perform:
Computer Organization and Architecture
Computer Organization and Architecture
1 Registers and MAL - Part I. Motivation So far there are some details that we have ignored instructions can have different formats most computers have.
5-1 Chapter 5 - Languages and the Machine Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Assembly.
Execution of an instruction
CSCE 121, Sec 200, 507, 508 Fall 2010 Prof. Jennifer L. Welch.
Choice for the rest of the semester New Plan –assembler and machine language –Operating systems Process scheduling Memory management File system Optimization.
Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved The Instruction Set Architecture.
What is an instruction set?
Implementation of a Stored Program Computer
Overview von Neumann Model Components of a Computer Some Computer Organization Models The Computer Bus An Example Organization: The LC-3.
Processor Types And Instruction Sets Barak Perelman CS147 Prof. Lee.
Some material taken from Assembly Language for x86 Processors by Kip Irvine © Pearson Education, 2010 Slides revised 2/2/2014 by Patrick Kelley.
Lecture 17 Today’s Lecture –Instruction formats Little versus big endian Internal storage in the CPU: stacks vs. registers Number of operands and instruction.
4-1 Chapter 4 - The Instruction Set Architecture Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring.
Instruction Set Architecture
Instruction Set Architecture
4-1 Chapter 4 - The Instruction Set Architecture Department of Information Technology, Radford University ITEC 352 Computer Organization Principles of.
Dr Mohamed Menacer College of Computer Science and Engineering Taibah University CS-334: Computer.
Implementation of a Stored Program Computer ITCS 3181 Logic and Computer Systems 2014 B. Wilkinson Slides2.ppt Modification date: Oct 16,
ITEC 352 Lecture 12 ISA(3). Review Buses Memory ALU Registers Process of compiling.
6-1 Chapter 6 - Datapath and Control Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Principles of.
5-1 Chapter 5 - Languages and the Machine Department of Information Technology, Radford University ITEC 352 Computer Organization Principles of Computer.
4-1 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Principles.
6-1 Chapter 6 - Languages and the Machine Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer.
Chapter 4 MARIE: An Introduction to a Simple Computer.
Chapter 5 A Closer Look at Instruction Set Architectures.
5-1 Chapter 5 - Languages and the Machine Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Principles.
Execution of an instruction
Computer Architecture and Organization
5-1 Chapter 5 - Datapath and Control Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture.
Computer Architecture EKT 422
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI N305 Information Representation: Machine Instructions.
Represents different voltage levels High: 5 Volts Low: 0 Volts At this raw level a digital computer is instructed to carry out instructions.
1.4 Representation of data in computer systems Instructions.
Computer Organization 1 Instruction Fetch and Execute.
Chapter 10 Instruction Sets: Characteristics and Functions Felipe Navarro Luis Gomez Collin Brown.
Instruction Sets: Addressing modes and Formats Group #4  Eloy Reyes  Rafael Arevalo  Julio Hernandez  Humood Aljassar Computer Design EEL 4709c Prof:
1 The Instruction Set Architecture September 27 th, 2007 By: Corbin Johnson CS 146.
Question What technology differentiates the different stages a computer had gone through from generation 1 to present?
What is a program? A sequence of steps
Operand Addressing And Instruction Representation Tutorial 3.
Simple ALU How to perform this C language integer operation in the computer C=A+B; ? The arithmetic/logic unit (ALU) of a processor performs integer arithmetic.
Ass. Prof. Dr Masri Ayob TK 2123 Lecture 14: Instruction Set Architecture Level (Level 2)
Computer Organization Instructions Language of The Computer (MIPS) 2.
Instruction Sets. Instruction set It is a list of all instructions that a processor can execute. It is a list of all instructions that a processor can.
Computer Organization 1
Instruction Sets: Characteristics and Functions  Software and Hardware interface Machine Instruction Characteristics Types of Operands Types of Operations.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
A Closer Look at Instruction Set Architectures
A Closer Look at Instruction Set Architectures
Computer Architecture and Organization Miles Murdocca and Vincent Heuring Chapter 4 – The Instruction Set Architecture.
William Stallings Computer Organization and Architecture 8th Edition
CSCE Fall 2013 Prof. Jennifer L. Welch.
MARIE: An Introduction to a Simple Computer
ECEG-3202 Computer Architecture and Organization
ECEG-3202 Computer Architecture and Organization
CSCE Fall 2012 Prof. Jennifer L. Welch.
Information Representation: Machine Instructions
Chapter 10 Instruction Sets: Characteristics and Functions
Presentation transcript:

4-1 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Principles of Computer Architecture Miles Murdocca and Vincent Heuring Chapter 4: The Instruction Set Architecture

4-2 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring The Instruction Set Architecture The Instruction Set Architecture (ISA) view of a machine corresponds to the machine and assembly language levels. A compiler translates a high level language, which is architecture independent, into assembly language, which is architecture dependent. An assembler translates assembly language programs into executable binary codes.

4-3 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring The System Bus Model of a Computer System, Revisited A compiled program is copied from a hard disk to the memory. The CPU reads instructions and data from the memory, executes the instructions, and stores the results back into the memory.

4-4 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Common Sizes for Data Types A byte is composed of 8 bits. Two nibbles make up a byte (useful for hexdecimal). Halfwords, words, doublewords, and quadwords are composed of bytes as shown below:

4-5 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Big-Endian and Little-Endian Formats In a byte-addressable machine, the smallest datum that can be referenced in memory is the byte. Multi-byte words are stored as a sequence of bytes, in which the address of the multi-byte word is the same as the byte of the word that has the lowest address. When multi-byte words are used, two choices for the order in which the bytes are stored in memory are: most significant byte at lowest address, referred to as big-endian, or least significant byte stored at lowest address, referred to as little-endian.

4-6 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Memory Map for the ARC Memory locations are arranged linearly in consecutive order. Each numbered locations corresponds to an ARC word. The unique number that identifies each word is referred to as its address.

4-7 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Abstract View of a CPU The CPU consists of a data section containing registers and an ALU, and a control section, which interprets instructions and effects register transfers. The data section is also known as the datapath.

4-8 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring The Fetch-Execute Cycle The steps that the control unit carries out in executing a program are: (1) Fetch the next instruction to be executed from memory. (2) Decode the opcode. (3) Read operand(s) from main memory, if any. (4) Execute the instruction and store results. (5) Go to step 1. This is known as the fetch-execute cycle.

4-9 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring An Example Datapath The ARC datapath is made up of a collection of registers known as the register file and the arithmetic and logic unit (ALU).

4-10 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring The ARC ISA The ARC ISA is a subset of the SPARC ISA.

4-11 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring ARC Assembly Language Format The ARC assembly language format is the same as the SPARC assembly language format.

4-12 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring ARC User-Visible Registers

4-13 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring ARC Instruction and PSR Formats

4-14 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring ARC Data Formats

4-15 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring ARC Pseudo-Ops Pseudo-ops are instructions to the assembler. They are not part of the ISA.

4-16 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring ARC Example Program An ARC assembly language program adds two integers:

4-17 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring In C Same program written in C: int main() { int x=15,y=9,z=0; z = x + y; return 0; }

4-18 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring A More Complex Example Program An ARC program sums five integers.

4-19 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring In C Same program written in C int main() { int length = 5, a[5] = {25,-10,33,-5,7}; int sum=0, I; for (i=length-1; i> 0; i--) sum += a[i]; return 0; }

4-20 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Memory address for each instruction Memory address for array a:

4-21 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring One, Two, Three-Address Machines Consider how the C expression A = B*C + D might be evaluated by each of the one, two, and three-address instruction types. Assumptions: Addresses and data words are two bytes in size. Opcodes are 1 byte in size. Operands are moved to and from memory one word (two bytes) at a time. Three-Address Instructions: In a three-address instruction, the expression A = B*C + D might be coded as: multB, C, A addD, A, A which means multiply B by C and store the result at A. (The mult and add operations are generic; they are not ARC instructions.) Then, add D to A and store the result at address A. The program size is 7  2 = 14 bytes. Memory traffic is  (2  3) = 26 bytes. ! A <- B*C ! A <- A+D

4-22 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Memory traffic 7 bytes of fetch 6 bytes of data traffic Total memory traffic = = 26 vytes

4-23 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring One, Two, Three-Address Machines Two Address Instructions: In a two-address instruction, one of the operands is overwritten by the result. Here, the code for the expression A = B*C + D is: loadB, A multC, A addD, A The program size is now 3  (1+2  2) or 15 bytes. Memory traffic is   2  3 or 31 bytes. ! A <- B ! A <- A*C ! A<- A+D

4-24 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring One, Two, Three-Address Machines One Address (Accumulator) Instructions: A one-address instruction employs a single arithmetic register in the CPU, known as the accumulator. The code for the expression A = B*C + D is now: load B multC addD storeA The load instruction loads B into the accumulator, mult multiplies C by the accumulator and stores the result in the accumulator, and add does the corresponding addition. The store instruction stores the accumulator in A. The program size is now 4  3 or 12 bytes, and memory traffic is  2 or 20 bytes. !acc <- B !Acc <- Acc*C !Acc <- Acc+ D !A <- Acc

4-25 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring One-address machine Smallest program size Smallest instruction traffic Very popular in early machines Accumulator holds one arithmetic operand Serves as the target for the result of mathematical operation

4-26 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Special purpose registers Memory index register Intel: 80x86 family SI, DI: point to the beginning or end of an array in memory Floating point register Special register to handle floating pointer number operations Time related register Power-PC 601 series OS related register Dedicated for privileged instruction Instructions that are not available to user, only used by OS

4-27 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Addressing Modes Four ways of computing the address of a value in memory: (1) a constant value known at assembly time, (2) the contents of a register, (3) the sum of two registers, (4) the sum of a register and a constant. The table gives names to these and other addressing modes.

4-28 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Addressing modes Refer to the way in which operand of an instruction is specified Immediate Reference to a constant Direct Access data using their address Indirect Access a pointer var using its address Register indirect Content of a register is an address Register indexed, register based, register indexed

4-29 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Subroutine Linkage – Registers Subroutine linkage with registers passes parameters in registers.

4-30 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Subroutine Linkage – Data Link Area Subroutine linkage with a data link area passes parameters in a separate area in memory. The address of the memory area is passed in a register (%r5 here).

4-31 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Subroutine Linkage – Stack Subroutine linkage with a stack passes parameters on a stack.

4-32 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Stack Linkage Example A C program illustrates nested function calls.

4-33 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Stack Linkage Example (cont’) (a-f) Stack behavior during execution of the program shown in previous slide.

4-34 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Stack Linkage Example (cont’) (g-k) Stack behavior during execution of the C program shown previously.

4-35 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Input and Output for the ISA Memory map for the ARC, showing memory mapped I/O.