1 The Instruction Set Architecture September 27 th, 2007 By: Corbin Johnson CS 146.

Slides:



Advertisements
Similar presentations
Chapter 2: Data Manipulation
Advertisements

Assembly Language.
Machine Instructions Operations
Machine Instructions Operations 1 ITCS 3181 Logic and Computer Systems 2015 B. Wilkinson Slides4-1.ppt Modification date: March 18, 2015.
 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
Instruction Set Architecture & Design
1 ICS 51 Introductory Computer Organization Fall 2006 updated: Oct. 2, 2006.
By Tien Phung CS 147 Dr. Sin-Min Lee. High-level Languages Assembly Languages Machine Languages.
Stored Program Concept: The Hardware View
Chapter 7 Low-Level Programming Languages. 2 Chapter Goals List the operations that a computer can perform Discuss the relationship between levels of.
Computer Architecture
Processor Types And Instruction Sets Barak Perelman CS147 Prof. Lee.
Unit-1 PREPARED BY: PROF. HARISH I RATHOD COMPUTER ENGINEERING DEPARTMENT GUJARAT POWER ENGINEERING & RESEARCH INSTITUTE Advance Processor.
Chapter 17 Microprocessor Fundamentals William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper.
Group 5 Alain J. Percial Paula A. Ortiz Francis X. Ruiz.
Instruction Sets and Pipelining Cover basics of instruction set types and fundamental ideas of pipelining Later in the course we will go into more depth.
An Introduction to 8086 Microprocessor.
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
IT253: Computer Organization Lecture 4: Instruction Set Architecture Tonga Institute of Higher Education.
4-1 Chapter 4 - The Instruction Set Architecture Department of Information Technology, Radford University ITEC 352 Computer Organization Principles of.
Computer Systems Organization CS 1428 Foundations of Computer Science.
ITEC 352 Lecture 12 ISA(3). Review Buses Memory ALU Registers Process of compiling.
Introduction to Computing Systems from bits & gates to C & beyond The Von Neumann Model Basic components Instruction processing.
Week 2.  Understand what the processor is and what it does.  Execute basic LMC programs.  Understand how CPU characteristics affect performance.
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.
Topic 1Topic 2Topic 3Topic 4Topic
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.
Execution of an instruction
CS 111 – Sept. 15 Chapter 2 – Manipulating data by performing instructions “What is going on in the CPU?” Commitment: –Please read through section 2.3.
Computer Architecture Memory, Math and Logic. Basic Building Blocks Seen: – Memory – Logic & Math.
Computer Architecture Lecture 03 Fasih ur Rehman.
1 A single-cycle MIPS processor  An instruction set architecture is an interface that defines the hardware operations which are available to software.
© GCSE Computing Candidates should be able to:  describe the characteristics of an assembler Slide 1.
Represents different voltage levels High: 5 Volts Low: 0 Volts At this raw level a digital computer is instructed to carry out instructions.
Computer Organization 1 Instruction Fetch and Execute.
COMPUTER ORGANISATION Sri.S.A.Hariprasad Sr.Lecturer R.V.C.E Bangalore.
Dale & Lewis Chapter 5 Computing components
COMPUTER ORGANIZATION AND ASSEMBLY LANGUAGE Lecture 21 & 22 Processor Organization Register Organization Course Instructor: Engr. Aisha Danish.
Processor Structure and Function Chapter8:. CPU Structure  CPU must:  Fetch instructions –Read instruction from memory  Interpret instructions –Instruction.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
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.
1 Basic Processor Architecture. 2 Building Blocks of Processor Systems CPU.
The Processor & its components. The CPU The brain. Performs all major calculations. Controls and manages the operations of other components of the computer.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
Computer Operation. Binary Codes CPU operates in binary codes Representation of values in binary codes Instructions to CPU in binary codes Addresses in.
Assembly language.
Control Unit Lecture 6.
Gunjeet Kaur Dronacharya Group of institutions
Microprocessor Systems Design I
Microprocessor Systems Design I
Prof. Sirer CS 316 Cornell University
Computer Architecture and Organization Miles Murdocca and Vincent Heuring Chapter 4 – The Instruction Set Architecture.
Computer Architecture
The Processor and Machine Language
Number Representations and Basic Processor Architecture
Computer Organization & Compilation Process
Introduction to Assembly Chapter 2
CSC 3210 Computer Organization and Programming
Introduction to Assembly Chapter 2
MARIE: An Introduction to a Simple Computer
Prof. Sirer CS 316 Cornell University
Introduction to Microprocessor Programming
COMS 361 Computer Organization
8051 ASSEMBLY LANGUAGE PROGRAMMING
Basic components Instruction processing
Objectives Describe common CPU components and their function: ALU Arithmetic Logic Unit), CU (Control Unit), Cache Explain the function of the CPU as.
Computer Architecture Assembly Language
Computer Operation 6/22/2019.
Presentation transcript:

1 The Instruction Set Architecture September 27 th, 2007 By: Corbin Johnson CS 146

2 What is the Instruction Set Architecture? It contains instructions to use and manipulate programmer-accessible hardware in a computer. It contains instructions to use and manipulate programmer-accessible hardware in a computer. in terms of in terms of place in a place in a computer computer

3 What is the relationship between the Instruction Set Architecture and Assembly / Machine language? An assembly / machine program is made up of the instructions in the ISA and makes use of registries in the ISA. An assembly / machine program is made up of the instructions in the ISA and makes use of registries in the ISA.

4 Here’s how it works Higher level languages (Java, C++, etc…) are translated into assembly / machine language by compilers. Higher level languages (Java, C++, etc…) are translated into assembly / machine language by compilers. When a user calls the program, the compiled program is loaded into RAM. When a user calls the program, the compiled program is loaded into RAM. The program then executes, line by line, until the Operating System takes back control of the computer. The program then executes, line by line, until the Operating System takes back control of the computer.

5 A Sample Computer: ARC The ARC has an ISA that is a subset of the ISA of the SPARC, or Scalable Processor Architecture processor developed by Sun in the mid 80’s. The ARC has an ISA that is a subset of the ISA of the SPARC, or Scalable Processor Architecture processor developed by Sun in the mid 80’s. Has most important features of SPARC but has left out most complex portions. Has most important features of SPARC but has left out most complex portions. ARC is considered a RISC or “Reduced Instruction Set Computer.” ARC is considered a RISC or “Reduced Instruction Set Computer.”

6 Goal: Program the ARC A program can be written for the ARC using the ISA of the ARC. A program can be written for the ARC using the ISA of the ARC. Discuss three main parts of ARC: Discuss three main parts of ARC: RAM RAM Processor (CPU) Processor (CPU) Instruction Set Instruction Set

7 Discuss three main parts of ARC: Discuss three main parts of ARC: RAM RAM Processor (CPU) Processor (CPU) Instruction Set Instruction Set 32 bit memory 32 bit memory Byte Addressable Byte Addressable Memory-mapped I/O Memory-mapped I/O

8 Discuss three main parts of ARC: Discuss three main parts of ARC: RAM RAM Processor (CPU) Processor (CPU) Instruction Set Instruction Set The OS The OS 2 11 bits of memory 2 11 bits of memory Only OS uses this Only OS uses thisarea

9 Discuss three main parts of ARC: Discuss three main parts of ARC: RAM RAM Processor (CPU) Processor (CPU) Instruction Set Instruction Set The User Space The User Space Undefined amount Undefined amount User’s program fills User’s program fills Into unused space Designed to work well Designed to work well If stack small and Program large or Vice versa.

10 Discuss three main parts of ARC: Discuss three main parts of ARC: RAM RAM Processor (CPU) Processor (CPU) Instruction Set Instruction Set The System Stack The System Stack Undefined amount Undefined amount Program’s execution Program’s execution Uses stack for storage Grows towards lower Grows towards lower Memory as user’s Space grows towards Higher memory.

11 Discuss three main parts of ARC: Discuss three main parts of ARC: RAM RAM Processor (CPU) Processor (CPU) Instruction Set Instruction Set Memory-Mapped I/O Memory-Mapped I/O Static slots Static slots Data talks with input Data talks with input And output devices

12 Discuss three main parts of ARC: Discuss three main parts of ARC: RAM RAM Processor (CPU) Processor (CPU) Instruction Set Instruction Set The CPU The CPU Executes programs Executes programs In main memory Contains Registries Contains Registries Holding data Four-Step cycle to Four-Step cycle to Execute program

13 Discuss three main parts of ARC: Discuss three main parts of ARC: RAM RAM Processor (CPU) Processor (CPU) Instruction Set Instruction Set The Four Step The Four Step Cycle Cycle 1) Fetch next instruction 2) Decode the instruction 3) Read operand in main memory if any 4) Execute instruction and store results, if any.

14 Discuss three main parts of ARC: Discuss three main parts of ARC: RAM RAM Processor (CPU) Processor (CPU) Instruction Set Instruction Set The registers The registers Positions in CPU that hold data during calculation Positions in CPU that hold data during calculation Special Registries: %r0, %sp, %link, %psr, % pc Special Registries: %r0, %sp, %link, %psr, % pc

15 Discuss three main parts of ARC: Discuss three main parts of ARC: RAM RAM Processor (CPU) Processor (CPU) Instruction Set Instruction Set The Arithmetic and Logic Unit The Arithmetic and Logic Unit Takes care of calculations that need to be executed Takes care of calculations that need to be executed Fed instructions by the Control Unit Fed instructions by the Control Unit

16 Discuss three main parts of ARC: Discuss three main parts of ARC: RAM RAM Processor (CPU) Processor (CPU) Instruction Set Instruction Set Some Features of the ISA: Some Features of the ISA: All of the instructions in the Instruction Set are 32 bit All of the instructions in the Instruction Set are 32 bit ARC is load-store: all operands must be either loaded to use or stored in memory to be stored ARC is load-store: all operands must be either loaded to use or stored in memory to be stored ARC is two’s compliment ARC is two’s compliment

17 Discuss three main parts of ARC: Discuss three main parts of ARC: RAM RAM Processor (CPU) Processor (CPU) Instruction Set Instruction Set Three different classes of instructions: Three different classes of instructions: Arithmetic and Logic Arithmetic and Logic Memory Access Memory Access Transfer of Control Transfer of Control

18 Three different classes of instructions: Three different classes of instructions: Arithmetic and Logic Arithmetic and Logic Memory Access Memory Access Transfer of Control Transfer of Control Arithmetic and Logic Arithmetic and Logic Includes instructions like Add and Subtract Includes instructions like Add and Subtract Also includes instructions like AND, OR and NOT. Also includes instructions like AND, OR and NOT.

19 Three different classes of instructions: Three different classes of instructions: Arithmetic and Logic Arithmetic and Logic Memory Access Memory Access Transfer of Control Transfer of Control Memory Access Memory Access Includes instructions load and store Includes instructions load and store Loads into registers and stores into memory slots in RAM Loads into registers and stores into memory slots in RAM

20 Three different classes of instructions: Three different classes of instructions: Arithmetic and Logic Arithmetic and Logic Memory Access Memory Access Transfer of Control Transfer of Control Instructions help get to different places in program Instructions help get to different places in program Place in ISA where conditionals first are seen (if statement, loops, etc…) Place in ISA where conditionals first are seen (if statement, loops, etc…) Essentially changes program counter register Essentially changes program counter register

21 The Syntax of the ARC Assembly Language The Mnemonic is a way for the programmer to remember the instruction’s name. The Mnemonic is a way for the programmer to remember the instruction’s name. A Compiler will take a written assembly language code and convert it to machine code. A Compiler will take a written assembly language code and convert it to machine code.

22 What’s that cc after addcc? CC stands for Condition Code and they are set in the PSR (it is a 32 bit registry) CC stands for Condition Code and they are set in the PSR (it is a 32 bit registry) There are 4: There are 4: Z: if the result of the instruction is zero, this flag is set. Z: if the result of the instruction is zero, this flag is set. N: if the most significant bit is 1, this bit is set N: if the most significant bit is 1, this bit is set C: if there is a carry out of the MSB or a borrow into it, this flag is set. C: if there is a carry out of the MSB or a borrow into it, this flag is set. V: Overflow. The result cannot be represented in 32 bits. V: Overflow. The result cannot be represented in 32 bits.

23 THE PSR (Processor Status Register)

24 More on The Syntax of the ARC Assembly Language Brackets [ ] around an operand means to load (or store) from (or in) the memory which is addressed by the operand within the brackets. Brackets [ ] around an operand means to load (or store) from (or in) the memory which is addressed by the operand within the brackets.

25 A few of the 35 instructions The ARC ISA has more than 35 instructions. The ARC ISA has more than 35 instructions. Memory: ld [%r ], %r1 Memory: ld [%r ], %r1 Arithmetic: addcc %r1, 129, %r1 Arithmetic: addcc %r1, 129, %r1 Control: call sub_r Control: call sub_r

26 From Assembly Language to Machine Code Each Assembly Language instruction is translated one line for one line (one to one). Each Assembly Language instruction is translated one line for one line (one to one). rd: destination registry Cond: based on the PSR, this executes differently Simm13: a user defined constant in 2’s compliment in 13 bits. Rs1: registry 1 in the CPU Disp30/Disp 22: 30/22 bit number is shifted to the left to achieve 32 bit destination of it’s function.

27 Summary Although not explicitly shown, this method will take an upper level program and convert it into actual things the computer can do. Although not explicitly shown, this method will take an upper level program and convert it into actual things the computer can do. Involves translation from the higher level into assembly language into machine code using the ARC ISA. Involves translation from the higher level into assembly language into machine code using the ARC ISA.