INSTRUCTION SET ARCHITECTURE

Size: px
Start display at page:

Download "INSTRUCTION SET ARCHITECTURE"

Transcription

1 INSTRUCTION SET ARCHITECTURE Slides by: Pedro Tomás Additional reading: Computer Architecture: A Quantitative Approach, 5th edition, Appendix A, John L. Hennessy and David A. Patterson, Morgan Kaufmann, 2011 ADVANCED COMPUTER ARCHITECTURES ARQUITECTURAS AVANÇADAS DE COMPUTADORES (AAC)

2 Outline 2 Instruction Set Architecture (ISA) Classes of ISA RISC vs CISC architectures Memory addressing modes and data organization Typical set of instructions

3 Instruction Set Architecture (ISA) Machine vs Assembly code 3 An instruction in machine code generally corresponds to a set of bits that can be generally structured as: OPCODE Identification of the operation OPERANDS Set of source and/or destination operands MODE (optional) Addressing mode of the operation CONDITION (optional) Instruction execution condition OPCODE MODE CONDITION OPERANDS The same operation can be represented in assembly code as: <Mnemonic> <operand listing>

4 Instruction Set Architecture (ISA) CLASSES 4 Instructions can be divided into the following classes: 1. Stack 2. Accumulator 3. Register-Memory 4. Register-Register / Load-Store Modern architectures typically support multiple classes of ISAs Further details

5 Instruction Set Architecture (ISA) Classes STACK 5 A B Stack architectures typically have no explicit operands, since operation on the stack is implicit SP Stack Pointer SP Stack Pointer A SP Stack Pointer A B There are two basic operations: PUSH into the stack POP out of the stack (1) Empty Stack (2) After pushing a value into the stack PUSH (3) After pushing another value into the stack PUSH A+B Operations on the stack require: 1. POP operands 2. Compute operation 3. PUSH result SP Stack Pointer A+B (4) After an addition operation ADD ALU SP Stack Pointer (5) After taking a value from the stack POP

6 Instruction Set Architecture (ISA) Classes ACCUMULATOR 6 Memory Memory Architectures based on an accumulator typically have: Operation Select X 1 ALU X 2 A B C 13-5 LOAD X 1 ALU X 2 An implicit operand, the accumulator (ACC) An explicit operand, which can be an immediate (constant value) or a memory address The destination operand is typically the accumulator A B C Memory 13-5 ACC (1) Acummulator-based architecture ADD ACC X 1 ALU 8 X 2 A B C ACC 13 (2) After loading a value to the accumulator LOAD A Memory ACC X 1 ALU 8 X 2 (3) After adding a value with the accumulator ADD B (4) Storing the result back into memory STORE C

7 Instruction Set Architecture (ISA) Classes REGISTER-MEMORY 7 Register-memory ISAs: Memory Registers Typically have two operands, where one is a register and the other a memory address May allow multiple addressing modes: Immediate Register Direct Register indirect Indexed Implicit (next slides ) Example: Operation Select X 1 ALU MOV Ra,A ; Ra M[A] ADD Ra,B ; Ra Ra + M[B] MOV C,Ra ; M[C] Ra X 2 Register memory architecture

8 Instruction Set Architecture (ISA) Classes REGISTER-REGISTER / LOAD-STORE 8 Register-register (also known as load/store) ISAs: Typically have one destination operand plus two source operands All operands are registers Access to the memory is available only through LOAD or STORE instructions Require additional general-use registers Leads to longer programs and larger memory sizes Memory Example: Operation Select LOAD STORE X 1 ALU Register-register / Load-Store architecture LD Ra,A ; Ra M[A] LD Rb,B ; Rb M[B] ADD Rc,Ra,Rb ; Rc Ra + Rb ST C,Rc ; M[C] Rc X 2 Registers

9 Instruction Set Architecture (ISA) RISC vs CISC 9 Based on a register-register / load store class of ISA Lower number of instructions and addressing modes Fixed-size (#bits) instructions Instructions can be executed in a single clock cycle Higher instruction throughput Can support multiple classes of ISAs, including stack, registermemory and register-register Higher number of instructions and addressing modes Variable-size (#bits) instructions Reduces the required length of Assembly code Modern CISC processors (e.g., Intel) operate as RISC by performing real-time translation from CISC to a reduced set of micro-operations

10 Instruction addressing modes 10 Mode Example Meaning REGISTER ADD R4,R3 r[4] r[4] + r[3] IMMEDIATE ADD R4,#3 r[4] r[4] + 3 DIRECT ADD R4,(1001) r[4] r[4] + M[ 1001 ] REGISTER INDIRECT ADD R4,(R3) r[4] r[4] + M[ r[3] ] DISPLACEMENT ADD R4,100(R3) r[4] r[4] + M[ r[3] ] INDEXED ADD R4,(R1+R3) r[4] r[4] + M[ r[1] + r[3] ] MEMORY INDIRECT ADD R4,@(R3) r[4] r[4] + M[ M[ r[3] ] ] AUTO-INCREMENT ADD R4,(R3)+ r[4] r[4] + M[ r[3] ] r[3] r[3] + d AUTO-DECREMENT ADD R4,-(R3) r[3] r[3] - d r[4] r[4] + M[ r[3] ] SCALED ADD R4,100(R2)[R3] R[4] R[4] + M[ r[2] + r[3]*d] Depending on the architecture implementation, some addressing modes may required the use of additional special-purpose register. In this example, the auto-increment, auto-decrement and scaled addressing modes require the use of an additional register to store the value d.

11 Miss-alignments in memory access 11 When the addressed object is longer (in #bits) than the memory width miss-alignments can occur Memory Consider the typical memory organization where each memory address stores an 8-bit object Accessing a single byte never generates a miss-alignment 8000h 8001h 8002h 8003h 8004h 8005h 8006h 8007h 8008h 8-bits Aligned 8-bits Aligned

12 Miss-alignments in memory access 12 When the addressed object is longer (in #bits) than the memory width miss-alignments can occur Memory Consider the typical memory organization where each memory address stores an 8-bit object Accessing a half-word (2 bytes) generates a miss-alignment whenever the address is not even (i.e., multiple of 2) 8000h 8001h 8002h 8003h 8004h 8005h 8006h 8007h 8008h 16-bits Miss-aligned Aligned 16-bits A miss-aligned memory access may require two clock cycles to complete (depends on the processor word width)

13 Miss-alignments in memory access 13 When the addressed object is longer (in #bits) than the memory width miss-alignments can occur Memory Consider the typical memory organization where each memory address stores an 8-bit object Accessing a word (4 bytes) generates a miss-alignment whenever the address is not multiple of h 8001h 8002h 8003h 8004h 8005h 8006h 8007h 8008h 32-bits Miss-aligned Aligned 32-bits A miss-aligned memory access may require two clock cycles to complete (depends on the processor word width)

14 Miss-alignments in memory access 14 To simplify memory access some processors do not allow missaligned memory addressing. In such cases the processor may use more than the required memory space to store the variable. E.g., for an 32-bit architecture (i.e., with 32-bit registers) storing one char (byte) in memory may use 32 bits (depends on the compiler). Some compilers also avoid using miss-aligned memory addresses to increase processing speed.

15 Data organization in memory 15 Consider storing a 32-bit hexadecimal number in memory: 06AB434Ch The word the number can be divided into the 4 bytes: 06h ABh 43h 4Ch Memory Memory Storing the value in memory organized can be done as follows: 8000h 8001h 06h ABh 8000h 8001h 4Ch 43h Little Endian: Store less significant byte in the lower address Big Endian: Store most significant byte in the 8002h 8003h 8004h 8005h 8006h 8007h 8008h 43h 4Ch 8002h 8003h 8004h 8005h 8006h 8007h 8008h ABh 06h lower address Big Endian style Little Endian style

16 Data organization in memory 16 Consider storing a 32-bit hexadecimal number in memory: 06AB434Ch The word the number can be divided into the 4 bytes: 06h ABh 43h 4Ch Storing the value in memory organized can be done Little as follows: Little Endian: Store less significant byte in the Address h1 0 lower address 8005h Big Endian: Big Endian Store most significant byte in the lower address 8000h 8001h 8002h 8003h 8006h 8007h 8008h Memory 06h ABh 06h ABh 43h 4Ch 43h 4Ch 4Ch 43h ABh 06h Big Endian style 8000h 8001h 8002h 8003h 8004h 8005h 8006h 8007h 8008h Memory 4Ch 43h ABh 06h Little Endian style

17 Data organization in memory 17 Example of Endian-ness in computer architectures: MIPS and Microblaze are big endian Intel x86, x86_64 are little endian ARM is bi-endian (i.e., supports both modes) (in ARM architectures endian-ness is defined by the interconnection network to the main memory) IMPORTANT NOTICE: Endian-ness is just the translating of data from memory to registers; in registers endian-ness has no meaning

18 Instruction Set Architecture (ISA) Example data transfer operations 18 Description Assembly Operation Register/Memory Memory/Register Move MOV opa,opb opa opb Exchange ou SWAP XCH opa,opb opa opb, opb opa Register Memory Load LD opa,opb opa M[opB] Store ST opa,opb M[opA] opb Stack Register/Memory Push PUSH opa (defined in following slides) Pop POP opa (defined in following slides) I/O Register/Memory Input IN opa,porto opa peripheral Output OUT Porto,opB peripheral opb

19 Instruction Set Architecture (ISA) Example arithmetic operations 19 Description Assembly Operation Increment INC opa,opb opa opb + 1 Decrement DEC opa,opb opa opb 1 Add ADD opa,opb,opc opa opb + opc Subtract SUB opa,opb,opc opa opb opc Multiply MUL opa,opb,opc opa opb x opc Divide DIV opa,opb,opc opa opb / opc Negate NEG opa,opb opa - opb Some processors define operations conditioned to state bits. Example: ADD.NZ opa,opb,opc ; se S(Z)=0 opa opb + opc ; se S(Z)=1 NOP

20 Status register 20 The status register stores information regarding the previously executed instructions Example: STATUS REGISTER: Previous result gave an overflow Previous result had carry out Previous result was negative Previous result was zero Not all instructions change the status register, e.g., logic instructions do not update the overflow bit

21 Instruction Set Architecture (ISA) Example logic operations 21 Description Assembly Operation Clear CLR opa opa 0 Complement NOT opa,opb opa! opb And AND opa,opb opa opa opb Or OR opa,opb opa opa opb Exclusive-or XOR opa,opb opa opa opb Clear Carry CLC S(C) 0 Set Carry STC S(C) 1 Complement Carry CMC S(C)! S(C)

22 Instruction Set Architecture (ISA) Example shift operations 22 Description Assembly Operation Logic shift left (LSL) SHL opa opa LSL opa Logic shift right (LSR) SHR opa opa LSR opb Arithmetic shift left (ASL) SHLA opa opa ASL opa Arithmetic shift right (ASR) SHRA opa opa ASR opb Rotate left (ROL) ROL opa opa ROL opa Rotate Right (ROR) ROR opa opa ROR opb Rotate left with Carry (ROLC) ROLC opa opa ROLC opa Rotate Right with Carry (RORC) RORC opa opa RORC opb

23 Instruction Set Architecture (ISA) Example control operations 23 Description Assembly Operation Branch BR.cond opa Relative jump (PC PC + OpA) Jump JMP.cond opa Absolute jump (PC OpA) Test & Branch TB.cond... Test and relative jump Test & Jump TJ.cond... Test and absolute jump Skip next instruction SKP.cond... Skip instruction Jump and Link JMPL.cond opa Function call in RISC processors Call procedure CALL.cond opa Function call in CISC processors Return RET.cond Return from function call (CISC) Test instruction to be used before a condicional Jump or Branch instruction Compare (Escrita dos bits de estado) Test (Escrita dos bits de estado) CMP opa,opb TEST opa,opb Operand compare through subtraction (updates status register bits Z,N,C,V) Operand compare through logic AND (updates status register bit Z) All control instructions can be conditional or inconditional; some processors also implement conditional data insctructions.

24 Instruction Set Architecture (ISA) Example status-based conditions 24 Description Assembly Example If zero, S(Z)=1.Z ADD.Z If not zero, S(Z)=0.NZ BR.NZ If Negative, S(N)=1.N BR.Z If not Negative, S(N)=0.NN JMP.NZ If Carry, S(C)=1.C CALL.C If not Carry, S(C)=0.NC CALL.NC If Overflow, S(V)=1.V RET.V If not Overflow, S(V)=0.NV SKP.NV

25 Instruction Set Architecture (ISA) Example test conditions 25 Description Assembly Condition If higher.h opa > opb If higher or equal.he opa opb If Lower.L opa < opb If Lower or equal.le opa opb If equal.e opa = opb If not equal.ne opa opb CONDITIONS FOR SIGNED NUMBERS Description Assembly Condition If greater.g opa > opb If greater or equal.ge opa opb If Less.L opa < opb If Less or equal.le opa opb

26 26 Next lesson Hardware implementation of a RISC processor MIPS ISA Designing a simple MIPS-like processor

TYPES OF INTERRUPTS: -

TYPES OF INTERRUPTS: - There are 3 types of interrupts. TYPES OF INTERRUPTS: - External Interrupts. Internal Interrupts. Software interrupts. Hardware Interrupts (1) External interrupts come from I/O devices, from a timing device

More information

10-1 C D Pearson Education, Inc. M. Morris Mano & Charles R. Kime LOGIC AND COMPUTER DESIGN FUNDAMENTALS, 4e

10-1 C D Pearson Education, Inc. M. Morris Mano & Charles R. Kime LOGIC AND COMPUTER DESIGN FUNDAMENTALS, 4e 10-1 C D E A B 10-2 A B A B C (A B) C D A A B (A B) C E D (A B) C D E (A B) C + D E (A B) C 10-3 Opcode Mode Address or operand 10-4 Memory 250 Opcode Mode PC = 250 251 ADRS 252 Next instruction ACC Opcode:

More information

TABLE 9-1. Symbolic Convention for Addressing Modes. Register indirect LDA (R1) ACC M[ R1] Refers to Figure 9-4. Addressing mode. Symbolic convention

TABLE 9-1. Symbolic Convention for Addressing Modes. Register indirect LDA (R1) ACC M[ R1] Refers to Figure 9-4. Addressing mode. Symbolic convention T-236 Symbolic Convention for Addressing Modes TABLE 9-1 Symbolic Convention for Addressing Modes Refers to Figure 9-4 Addressing mode Symbolic convention Register transfer Effective address Contents of

More information

COMPUTER HARDWARE. Instruction Set Architecture

COMPUTER HARDWARE. Instruction Set Architecture COMPUTER HARDWARE Instruction Set Architecture Overview Computer architecture Operand addressing Addressing architecture Addressing modes Elementary instructions Data transfer instructions Data manipulation

More information

CSIS1120A. 10. Instruction Set & Addressing Mode. CSIS1120A 10. Instruction Set & Addressing Mode 1

CSIS1120A. 10. Instruction Set & Addressing Mode. CSIS1120A 10. Instruction Set & Addressing Mode 1 CSIS1120A 10. Instruction Set & Addressing Mode CSIS1120A 10. Instruction Set & Addressing Mode 1 Elements of a Machine Instruction Operation Code specifies the operation to be performed, e.g. ADD, SUB

More information

Computer Organization CS 206 T Lec# 2: Instruction Sets

Computer Organization CS 206 T Lec# 2: Instruction Sets Computer Organization CS 206 T Lec# 2: Instruction Sets Topics What is an instruction set Elements of instruction Instruction Format Instruction types Types of operations Types of operand Addressing mode

More information

ISA and RISCV. CASS 2018 Lavanya Ramapantulu

ISA and RISCV. CASS 2018 Lavanya Ramapantulu ISA and RISCV CASS 2018 Lavanya Ramapantulu Program Program =?? Algorithm + Data Structures Niklaus Wirth Program (Abstraction) of processor/hardware that executes 3-Jul-18 CASS18 - ISA and RISCV 2 Program

More information

COSC 6385 Computer Architecture. Instruction Set Architectures

COSC 6385 Computer Architecture. Instruction Set Architectures COSC 6385 Computer Architecture Instruction Set Architectures Spring 2012 Instruction Set Architecture (ISA) Definition on Wikipedia: Part of the Computer Architecture related to programming Defines set

More information

Introduction. 3 major parts of CPU : Fig Design Examples of simple CPU. In this chapter : Chap. 8. Chap. 8 Central Processing Unit

Introduction. 3 major parts of CPU : Fig Design Examples of simple CPU. In this chapter : Chap. 8. Chap. 8 Central Processing Unit Central Processing Unit 8-1 Introduction 3 major parts of CPU : Fig. 8-1 1) Register Set 2) ALU 3) Control Design Examples of simple CPU Hardwired Control : Chap. 5 Microprogrammed Control : Chap. 7 In

More information

Instruction Sets: Characteristics and Functions Addressing Modes

Instruction Sets: Characteristics and Functions Addressing Modes Instruction Sets: Characteristics and Functions Addressing Modes Chapters 10 and 11, William Stallings Computer Organization and Architecture 7 th Edition What is an Instruction Set? The complete collection

More information

COMPUTER ORGANIZATION & ARCHITECTURE

COMPUTER ORGANIZATION & ARCHITECTURE COMPUTER ORGANIZATION & ARCHITECTURE Instructions Sets Architecture Lesson 5a 1 What are Instruction Sets The complete collection of instructions that are understood by a CPU Can be considered as a functional

More information

ARM Assembly Language. Programming

ARM Assembly Language. Programming Outline: ARM Assembly Language the ARM instruction set writing simple programs examples Programming hands-on: writing simple ARM assembly programs 2005 PEVE IT Unit ARM System Design ARM assembly language

More information

Advanced Computer Architecture-CS501. Vincent P. Heuring&Harry F. Jordan Chapter 2 Computer Systems Design and Architecture

Advanced Computer Architecture-CS501. Vincent P. Heuring&Harry F. Jordan Chapter 2 Computer Systems Design and Architecture Lecture Handout Computer Architecture Lecture No. 4 Reading Material Vincent P. Heuring&Harry F. Jordan Chapter 2 Computer Systems Design and Architecture 2.3, 2.4,slides Summary 1) Introduction to ISA

More information

Lecture 4: Instruction Set Architecture

Lecture 4: Instruction Set Architecture Lecture 4: Instruction Set Architecture ISA types, register usage, memory addressing, endian and alignment, quantitative evaluation Reading: Textbook (5 th edition) Appendix A Appendix B (4 th edition)

More information

Page 1. Structure of von Nuemann machine. Instruction Set - the type of Instructions

Page 1. Structure of von Nuemann machine. Instruction Set - the type of Instructions Structure of von Nuemann machine Arithmetic and Logic Unit Input Output Equipment Main Memory Program Control Unit 1 1 Instruction Set - the type of Instructions Arithmetic + Logical (ADD, SUB, MULT, DIV,

More information

By: Dr. Hamed Saghaei

By: Dr. Hamed Saghaei By: Dr. Hamed Saghaei The AVR RISC Microcontroller supports powerful and efficient addressing modes for access to the program memory (Flash) and data memory (SRAM). This section describes the different

More information

Fig: Computer memory with Program, data, and Stack. Blog - NEC (Autonomous) 1

Fig: Computer memory with Program, data, and Stack. Blog -   NEC (Autonomous) 1 Central Processing Unit 1. Stack Organization A useful feature that is included in the CPU of most computers is a stack or last in, first out (LIFO) list. A stack is a storage device that stores information

More information

INSTRUCTION SET AND EXECUTION

INSTRUCTION SET AND EXECUTION SECTION 6 INSTRUCTION SET AND EXECUTION Fetch F1 F2 F3 F3e F4 F5 F6 Decode D1 D2 D3 D3e D4 D5 Execute E1 E2 E3 E3e E4 Instruction Cycle: 1 2 3 4 5 6 7 MOTOROLA INSTRUCTION SET AND EXECUTION 6-1 SECTION

More information

Architecture. Digital Computer Design

Architecture. Digital Computer Design Architecture Digital Computer Design Architecture The architecture is the programmer s view of a computer. It is defined by the instruction set (language) and operand locations (registers and memory).

More information

Instruction Set Architecture

Instruction Set Architecture C Fortran Ada etc. Basic Java Instruction Set Architecture Compiler Assembly Language Compiler Byte Code Nizamettin AYDIN naydin@yildiz.edu.tr http://www.yildiz.edu.tr/~naydin http://akademik.bahcesehir.edu.tr/~naydin

More information

Instruction Sets Ch 9-10

Instruction Sets Ch 9-10 Instruction Sets Ch 9-10 Characteristics Operands Operations Addressing Instruction Formats 1 Instruction Set (käskykanta) Collection of instructions that CPU understands Only interface to CPU from outside

More information

Instruction Sets Ch 9-10

Instruction Sets Ch 9-10 Instruction Sets Ch 9-10 Characteristics Operands Operations Addressing Instruction Formats 1 Instruction Set (käskykanta) Collection of instructions that CPU understands Only interface to CPU from outside

More information

CSCE 5610: Computer Architecture

CSCE 5610: Computer Architecture HW #1 1.3, 1.5, 1.9, 1.12 Due: Sept 12, 2018 Review: Execution time of a program Arithmetic Average, Weighted Arithmetic Average Geometric Mean Benchmarks, kernels and synthetic benchmarks Computing CPI

More information

Chapter 2 Instructions Sets. Hsung-Pin Chang Department of Computer Science National ChungHsing University

Chapter 2 Instructions Sets. Hsung-Pin Chang Department of Computer Science National ChungHsing University Chapter 2 Instructions Sets Hsung-Pin Chang Department of Computer Science National ChungHsing University Outline Instruction Preliminaries ARM Processor SHARC Processor 2.1 Instructions Instructions sets

More information

Grundlagen Microcontroller Processor Core. Günther Gridling Bettina Weiss

Grundlagen Microcontroller Processor Core. Günther Gridling Bettina Weiss Grundlagen Microcontroller Processor Core Günther Gridling Bettina Weiss 1 Processor Core Architecture Instruction Set Lecture Overview 2 Processor Core Architecture Computes things > ALU (Arithmetic Logic

More information

AVR ISA & AVR Programming (I) Lecturer: Sri Parameswaran Notes by: Annie Guo

AVR ISA & AVR Programming (I) Lecturer: Sri Parameswaran Notes by: Annie Guo AVR ISA & AVR Programming (I) Lecturer: Sri Parameswaran Notes by: Annie Guo 1 Lecture Overview AVR ISA AVR Instructions & Programming (I) Basic construct implementation 2 Atmel AVR 8-bit RISC architecture

More information

Practical Malware Analysis

Practical Malware Analysis Practical Malware Analysis Ch 4: A Crash Course in x86 Disassembly Revised 1-16-7 Basic Techniques Basic static analysis Looks at malware from the outside Basic dynamic analysis Only shows you how the

More information

Computer Organization

Computer Organization Computer Organization (Instruction set Architecture & Assembly Language Programming) KR Chowdhary Professor & Head Email: kr.chowdhary@gmail.com webpage: krchowdhary.com Department of Computer Science

More information

Instruction Set Design

Instruction Set Design Instruction Set Design software instruction set hardware CPE442 Lec 3 ISA.1 Instruction Set Architecture Programmer's View ADD SUBTRACT AND OR COMPARE... 01010 01110 10011 10001 11010... CPU Memory I/O

More information

ECE 471 Embedded Systems Lecture 5

ECE 471 Embedded Systems Lecture 5 ECE 471 Embedded Systems Lecture 5 Vince Weaver http://www.eece.maine.edu/ vweaver vincent.weaver@maine.edu 17 September 2013 HW#1 is due Thursday Announcements For next class, at least skim book Chapter

More information

SOEN228, Winter Revision 1.2 Date: October 25,

SOEN228, Winter Revision 1.2 Date: October 25, SOEN228, Winter 2003 Revision 1.2 Date: October 25, 2003 1 Contents Flags Mnemonics Basic I/O Exercises Overview of sample programs 2 Flag Register The flag register stores the condition flags that retain

More information

Instruction Set. Instruction Sets Ch Instruction Representation. Machine Instruction. Instruction Set Design (5) Operation types

Instruction Set. Instruction Sets Ch Instruction Representation. Machine Instruction. Instruction Set Design (5) Operation types Instruction Sets Ch 10-11 Characteristics Operands Operations Addressing Instruction Formats Instruction Set Collection of instructions that CPU understands Only interface to CPU from outside CPU executes

More information

CHAPTER 8: Central Processing Unit (CPU)

CHAPTER 8: Central Processing Unit (CPU) CS 224: Computer Organization S.KHABET CHAPTER 8: Central Processing Unit (CPU) Outline Introduction General Register Organization Stack Organization Instruction Formats Addressing Modes 1 Major Components

More information

AVR ISA & AVR Programming (I) Lecturer: Sri Parameswaran Notes by: Annie Guo

AVR ISA & AVR Programming (I) Lecturer: Sri Parameswaran Notes by: Annie Guo AVR ISA & AVR Programming (I) Lecturer: Sri Parameswaran Notes by: Annie Guo 1 Lecture Overview AVR ISA AVR Instructions & Programming (I) Basic construct implementation 2 Atmel AVR 8-bit RISC architecture

More information

Instruction Set Architecture. "Speaking with the computer"

Instruction Set Architecture. Speaking with the computer Instruction Set Architecture "Speaking with the computer" The Instruction Set Architecture Application Compiler Instr. Set Proc. Operating System I/O system Instruction Set Architecture Digital Design

More information

8051 Overview and Instruction Set

8051 Overview and Instruction Set 8051 Overview and Instruction Set Curtis A. Nelson Engr 355 1 Microprocessors vs. Microcontrollers Microprocessors are single-chip CPUs used in microcomputers Microcontrollers and microprocessors are different

More information

AVR ISA & AVR Programming (I)

AVR ISA & AVR Programming (I) AVR ISA & AVR Programming (I) Lecturer: Sri Parameswaran Notes by: Annie Guo Week 1 1 Lecture Overview AVR ISA AVR Instructions & Programming (I) Basic construct implementation Week 1 2 1 Atmel AVR 8-bit

More information

CN310 Microprocessor Systems Design

CN310 Microprocessor Systems Design CN310 Microprocessor Systems Design Instruction Set (AVR) Nawin Somyat Department of Electrical and Computer Engineering Thammasat University Outline Course Contents 1 Introduction 2 Simple Computer 3

More information

Central Processing Unit

Central Processing Unit Central Processing Unit Networks and Embedded Software Module.. by Wolfgang Neff Components () lock diagram Execution Unit Control Unit Registers rithmetic logic unit DD, SU etc. NOT, ND etc. us Interface

More information

55:132/22C:160, HPCA Spring 2011

55:132/22C:160, HPCA Spring 2011 55:132/22C:160, HPCA Spring 2011 Second Lecture Slide Set Instruction Set Architecture Instruction Set Architecture ISA, the boundary between software and hardware Specifies the logical machine that is

More information

Architecture & Instruction set of 8085 Microprocessor and 8051 Micro Controller

Architecture & Instruction set of 8085 Microprocessor and 8051 Micro Controller of 8085 microprocessor 8085 is pronounced as "eighty-eighty-five" microprocessor. It is an 8-bit microprocessor designed by Intel in 1977 using NMOS technology. It has the following configuration 8-bit

More information

Instruction Set Principles and Examples. Appendix B

Instruction Set Principles and Examples. Appendix B Instruction Set Principles and Examples Appendix B Outline What is Instruction Set Architecture? Classifying ISA Elements of ISA Programming Registers Type and Size of Operands Addressing Modes Types of

More information

Review Questions. 1 The DRAM problem [5 points] Suggest a solution. 2 Big versus Little Endian Addressing [5 points]

Review Questions. 1 The DRAM problem [5 points] Suggest a solution. 2 Big versus Little Endian Addressing [5 points] Review Questions 1 The DRAM problem [5 points] Suggest a solution 2 Big versus Little Endian Addressing [5 points] Consider the 32-bit hexadecimal number 0x21d3ea7d. 1. What is the binary representation

More information

CENG 450: Instruction Set (16-bit)

CENG 450: Instruction Set (16-bit) CENG 450: Instruction Set (16-bit) In this lab, you will design and implement a pipelined 16-bit processor on FPGA. The instructions set of the processor is as follows: Instructions Set We use a RISC-like

More information

A First Look at Microprocessors

A First Look at Microprocessors A First Look at Microprocessors using the The General Prototype Computer (GPC) model Part 2 Can you identify an opcode to: Decrement the contents of R1, and store the result in R5? Invert the contents

More information

INSTITUTO SUPERIOR TÉCNICO. Architectures for Embedded Computing

INSTITUTO SUPERIOR TÉCNICO. Architectures for Embedded Computing UNIVERSIDADE TÉCNICA DE LISBOA INSTITUTO SUPERIOR TÉCNICO Departamento de Engenharia Informática for Embedded Computing MEIC-A, MEIC-T, MERC Lecture Slides Version 3.0 - English Lecture 03 Title: Processor

More information

CPU Architecture and Instruction Sets Chapter 1

CPU Architecture and Instruction Sets Chapter 1 CPU Architecture and Instruction Sets Chapter 1 1 Is CPU Architecture Relevant for DBMS? CPU design focuses on speed resulting in a 55%/year improvement since 1987: If CPU performance in database code

More information

CSCI 402: Computer Architectures. Instructions: Language of the Computer (1) Fengguang Song Department of Computer & Information Science IUPUI

CSCI 402: Computer Architectures. Instructions: Language of the Computer (1) Fengguang Song Department of Computer & Information Science IUPUI To study Chapter 2: CSCI 402: Computer Architectures Instructions: Language of the Computer (1) Fengguang Song Department of Computer & Information Science IUPUI Contents 2.1-2.3 Introduction to what is

More information

Chapter 2. Instruction Set. RISC vs. CISC Instruction set. The University of Adelaide, School of Computer Science 18 September 2017

Chapter 2. Instruction Set. RISC vs. CISC Instruction set. The University of Adelaide, School of Computer Science 18 September 2017 COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface RISC-V Edition Chapter 2 Instructions: Language of the Computer These slides are based on the slides by the authors. The slides doesn t

More information

Programming of 8085 microprocessor and 8051 micro controller Study material

Programming of 8085 microprocessor and 8051 micro controller Study material 8085 Demo Programs Now, let us take a look at some program demonstrations using the above instructions Adding Two 8-bit Numbers Write a program to add data at 3005H & 3006H memory location and store the

More information

INSTRUCTION LEVEL PARALLELISM

INSTRUCTION LEVEL PARALLELISM INSTRUCTION LEVEL PARALLELISM Slides by: Pedro Tomás Additional reading: Computer Architecture: A Quantitative Approach, 5th edition, Chapter 2 and Appendix H, John L. Hennessy and David A. Patterson,

More information

3.0 Instruction Set. 3.1 Overview

3.0 Instruction Set. 3.1 Overview 3.0 Instruction Set 3.1 Overview There are 16 different P8 instructions. Research on instruction set usage was the basis for instruction selection. Each instruction has at least two addressing modes, with

More information

Computer Organization and Technology Processor and System Structures

Computer Organization and Technology Processor and System Structures Computer Organization and Technology Processor and System Structures Assoc. Prof. Dr. Wattanapong Kurdthongmee Division of Computer Engineering, School of Engineering and Resources, Walailak University

More information

Chapter 2A Instructions: Language of the Computer

Chapter 2A Instructions: Language of the Computer Chapter 2A Instructions: Language of the Computer Copyright 2009 Elsevier, Inc. All rights reserved. Instruction Set The repertoire of instructions of a computer Different computers have different instruction

More information

Instructions: Language of the Computer

Instructions: Language of the Computer Instructions: Language of the Computer Tuesday 22 September 15 Many slides adapted from: and Design, Patterson & Hennessy 5th Edition, 2014, MK and from Prof. Mary Jane Irwin, PSU Summary Previous Class

More information

ก AVR Microcontrollers

ก AVR Microcontrollers ก AVR Microcontrollers. ก ก AVR Microcontrollers Architecture 1 Instruction Execution Timing The Parallel Instruction Fetches and Instruction Executions Single Cycle ALU Operation AVR Microcontrollers

More information

CSEE 3827: Fundamentals of Computer Systems

CSEE 3827: Fundamentals of Computer Systems CSEE 3827: Fundamentals of Computer Systems Lecture 15 April 1, 2009 martha@cs.columbia.edu and the rest of the semester Source code (e.g., *.java, *.c) (software) Compiler MIPS instruction set architecture

More information

CNIT 127: Exploit Development. Ch 1: Before you begin. Updated

CNIT 127: Exploit Development. Ch 1: Before you begin. Updated CNIT 127: Exploit Development Ch 1: Before you begin Updated 1-14-16 Basic Concepts Vulnerability A flaw in a system that allows an attacker to do something the designer did not intend, such as Denial

More information

ECE232: Hardware Organization and Design

ECE232: Hardware Organization and Design ECE232: Hardware Organization and Design Lecture 2: Hardware/Software Interface Adapted from Computer Organization and Design, Patterson & Hennessy, UCB Overview Basic computer components How does a microprocessor

More information

Typical Processor Execution Cycle

Typical Processor Execution Cycle Typical Processor Execution Cycle Instruction Fetch Obtain instruction from program storage Instruction Decode Determine required actions and instruction size Operand Fetch Locate and obtain operand data

More information

Understand the factors involved in instruction set

Understand the factors involved in instruction set A Closer Look at Instruction Set Architectures Objectives Understand the factors involved in instruction set architecture design. Look at different instruction formats, operand types, and memory access

More information

LEO-1 Homebrew Computer

LEO-1 Homebrew Computer LEO-1 Homebrew Computer Architecture Rev 1.10, 5th January 2017, John Croudy The LEO-1 is a complete 16-bit computer system featuring the LEO-1 CPU, a custom-designed CPU. This CPU s architecture was inspired

More information

Lecture 2 Assembly Language

Lecture 2 Assembly Language Lecture 2 Assembly Language Computer and Network Security 9th of October 2017 Computer Science and Engineering Department CSE Dep, ACS, UPB Lecture 2, Assembly Language 1/37 Recap: Explorations Tools assembly

More information

CSE 141 Computer Architecture Spring Lecture 3 Instruction Set Architecute. Course Schedule. Announcements

CSE 141 Computer Architecture Spring Lecture 3 Instruction Set Architecute. Course Schedule. Announcements CSE141: Introduction to Computer Architecture CSE 141 Computer Architecture Spring 2005 Lecture 3 Instruction Set Architecute Pramod V. Argade April 4, 2005 Instructor: TAs: Pramod V. Argade (p2argade@cs.ucsd.edu)

More information

Slides for Lecture 6

Slides for Lecture 6 Slides for Lecture 6 ENCM 501: Principles of Computer Architecture Winter 2014 Term Steve Norman, PhD, PEng Electrical & Computer Engineering Schulich School of Engineering University of Calgary 28 January,

More information

UNIT-II. Part-2: CENTRAL PROCESSING UNIT

UNIT-II. Part-2: CENTRAL PROCESSING UNIT Page1 UNIT-II Part-2: CENTRAL PROCESSING UNIT Stack Organization Instruction Formats Addressing Modes Data Transfer And Manipulation Program Control Reduced Instruction Set Computer (RISC) Introduction:

More information

CSCI 402: Computer Architectures. Instructions: Language of the Computer (1) Fengguang Song Department of Computer & Information Science IUPUI

CSCI 402: Computer Architectures. Instructions: Language of the Computer (1) Fengguang Song Department of Computer & Information Science IUPUI Starting Chapter 2: CSCI 402: Computer Architectures Instructions: Language of the Computer (1) Fengguang Song Department of Computer & Information Science IUPUI Contents 2.1 and 2.3 What is instruction?

More information

EN164: Design of Computing Systems Lecture 09: Processor / ISA 2

EN164: Design of Computing Systems Lecture 09: Processor / ISA 2 EN164: Design of Computing Systems Lecture 09: Processor / ISA 2 Professor Sherief Reda http://scale.engin.brown.edu Electrical Sciences and Computer Engineering School of Engineering Brown University

More information

Microcontroller Intel [Instruction Set]

Microcontroller Intel [Instruction Set] Microcontroller Intel 8051 [Instruction Set] Structure of Assembly Language [ label: ] mnemonic [operands] [ ;comment ] Example: MOV R1, #25H ; load data 25H into R1 2 8051 Assembly Language Registers

More information

Chapter 1. Computer Abstractions and Technology. Lesson 3: Understanding Performance

Chapter 1. Computer Abstractions and Technology. Lesson 3: Understanding Performance Chapter 1 Computer Abstractions and Technology Lesson 3: Understanding Performance Manufacturing ICs 1.7 Real Stuff: The AMD Opteron X4 Yield: proportion of working dies per wafer Chapter 1 Computer Abstractions

More information

Assembly Language Programming of 8085

Assembly Language Programming of 8085 Assembly Language Programming of 8085 Topics 1. Introduction 2. Programming model of 8085 3. Instruction set of 8085 4. Example Programs 5. Addressing modes of 8085 6. Instruction & Data Formats of 8085

More information

Chapter 2. Instruction Set Design. Computer Architectures. software. hardware. Which is easier to change/design??? Tien-Fu Chen

Chapter 2. Instruction Set Design. Computer Architectures. software. hardware. Which is easier to change/design??? Tien-Fu Chen Computer Architectures Chapter 2 Tien-Fu Chen National Chung Cheng Univ. chap2-0 Instruction Set Design software instruction set hardware Which is easier to change/design??? chap2-1 Instruction Set Architecture:

More information

ENGN1640: Design of Computing Systems Topic 03: Instruction Set Architecture Design

ENGN1640: Design of Computing Systems Topic 03: Instruction Set Architecture Design ENGN1640: Design of Computing Systems Topic 03: Instruction Set Architecture Design Professor Sherief Reda http://scale.engin.brown.edu School of Engineering Brown University Spring 2016 1 ISA is the HW/SW

More information

The Assembly Language of the Boz 5

The Assembly Language of the Boz 5 The Assembly Language of the Boz 5 The Boz 5 uses bits 31 27 of the IR as a five bit opcode. Of the possible 32 opcodes, only 26 are implemented. Op-Code Mnemonic Description 00000 HLT Halt the Computer

More information

Chapter 2. Instructions: Language of the Computer. Adapted by Paulo Lopes

Chapter 2. Instructions: Language of the Computer. Adapted by Paulo Lopes Chapter 2 Instructions: Language of the Computer Adapted by Paulo Lopes Instruction Set The repertoire of instructions of a computer Different computers have different instruction sets But with many aspects

More information

CSCI 2121 Computer Organization and Assembly Language PRACTICE QUESTION BANK

CSCI 2121 Computer Organization and Assembly Language PRACTICE QUESTION BANK CSCI 2121 Computer Organization and Assembly Language PRACTICE QUESTION BANK Question 1: Choose the most appropriate answer 1. In which of the following gates the output is 1 if and only if all the inputs

More information

The MIPS Instruction Set Architecture

The MIPS Instruction Set Architecture The MIPS Set Architecture CPS 14 Lecture 5 Today s Lecture Admin HW #1 is due HW #2 assigned Outline Review A specific ISA, we ll use it throughout semester, very similar to the NiosII ISA (we will use

More information

Chapter 15. ARM Architecture, Programming and Development Tools

Chapter 15. ARM Architecture, Programming and Development Tools Chapter 15 ARM Architecture, Programming and Development Tools Lesson 5 ARM 16-bit Thumb Instruction Set 2 - Thumb 16 bit subset Better code density than 32-bit architecture instruction set 3 Basic Programming

More information

Microprocessors 1. The 8051 Instruction Set. Microprocessors 1 1. Msc. Ivan A. Escobar Broitman

Microprocessors 1. The 8051 Instruction Set. Microprocessors 1 1. Msc. Ivan A. Escobar Broitman Microprocessors 1 The 8051 Instruction Set Microprocessors 1 1 Instruction Groups The 8051 has 255 instructions Every 8-bit opcode from 00 to FF is used except for A5. The instructions are grouped into

More information

Instructions: MIPS ISA. Chapter 2 Instructions: Language of the Computer 1

Instructions: MIPS ISA. Chapter 2 Instructions: Language of the Computer 1 Instructions: MIPS ISA Chapter 2 Instructions: Language of the Computer 1 PH Chapter 2 Pt A Instructions: MIPS ISA Based on Text: Patterson Henessey Publisher: Morgan Kaufmann Edited by Y.K. Malaiya for

More information

Assembly Language Programming of 8085

Assembly Language Programming of 8085 Assembly Language Programming of 8085 1. Introduction A microprocessor executes instructions given by the user Instructions should be in a language known to the microprocessor Microprocessor understands

More information

Computer Architecture. MIPS Instruction Set Architecture

Computer Architecture. MIPS Instruction Set Architecture Computer Architecture MIPS Instruction Set Architecture Instruction Set Architecture An Abstract Data Type Objects Registers & Memory Operations Instructions Goal of Instruction Set Architecture Design

More information

Math 230 Assembly Programming (AKA Computer Organization) Spring 2008

Math 230 Assembly Programming (AKA Computer Organization) Spring 2008 Math 230 Assembly Programming (AKA Computer Organization) Spring 2008 MIPS Intro II Lect 10 Feb 15, 2008 Adapted from slides developed for: Mary J. Irwin PSU CSE331 Dave Patterson s UCB CS152 M230 L10.1

More information

Review of instruction set architectures

Review of instruction set architectures Review of instruction set architectures Outline ISA and Assembly Language RISC vs. CISC Instruction Set Definition (MIPS) 2 ISA and assembly language Assembly language ISA Machine language 3 Assembly language

More information

Instruction-set Design Issues: what is the ML instruction format(s) ML instruction Opcode Dest. Operand Source Operand 1...

Instruction-set Design Issues: what is the ML instruction format(s) ML instruction Opcode Dest. Operand Source Operand 1... Instruction-set Design Issues: what is the format(s) Opcode Dest. Operand Source Operand 1... 1) Which instructions to include: How many? Complexity - simple ADD R1, R2, R3 complex e.g., VAX MATCHC substrlength,

More information

CISC 662 Graduate Computer Architecture. Lecture 4 - ISA MIPS ISA. In a CPU. (vonneumann) Processor Organization

CISC 662 Graduate Computer Architecture. Lecture 4 - ISA MIPS ISA. In a CPU. (vonneumann) Processor Organization CISC 662 Graduate Computer Architecture Lecture 4 - ISA MIPS ISA Michela Taufer http://www.cis.udel.edu/~taufer/courses Powerpoint Lecture Notes from John Hennessy and David Patterson s: Computer Architecture,

More information

CA226 Advanced Computer Architecture

CA226 Advanced Computer Architecture Table of Contents Stephen Blott 1 Instruction-Set Architectures (ISAs) The functionality of a processor is defined by its: instruction-set architecture (ISA) e.g. 8086, MIPS, ARM,

More information

instruction 1 Fri Oct 13 13:05:

instruction 1 Fri Oct 13 13:05: instruction Fri Oct :0:0. Introduction SECTION INSTRUCTION SET This section describes the aressing modes and instruction types.. Aressing Modes The CPU uses eight aressing modes for flexibility in accessing

More information

3.1 DATA MOVEMENT INSTRUCTIONS 45

3.1 DATA MOVEMENT INSTRUCTIONS 45 3.1.1 General-Purpose Data Movement s 45 3.1.2 Stack Manipulation... 46 3.1.3 Type Conversion... 48 3.2.1 Addition and Subtraction... 51 3.1 DATA MOVEMENT INSTRUCTIONS 45 MOV (Move) transfers a byte, word,

More information

ARM Assembly Programming

ARM Assembly Programming Introduction ARM Assembly Programming The ARM processor is very easy to program at the assembly level. (It is a RISC) We will learn ARM assembly programming at the user level and run it on a GBA emulator.

More information

VE7104/INTRODUCTION TO EMBEDDED CONTROLLERS UNIT III ARM BASED MICROCONTROLLERS

VE7104/INTRODUCTION TO EMBEDDED CONTROLLERS UNIT III ARM BASED MICROCONTROLLERS VE7104/INTRODUCTION TO EMBEDDED CONTROLLERS UNIT III ARM BASED MICROCONTROLLERS Introduction to 32 bit Processors, ARM Architecture, ARM cortex M3, 32 bit ARM Instruction set, Thumb Instruction set, Exception

More information

CISC 662 Graduate Computer Architecture. Lecture 4 - ISA

CISC 662 Graduate Computer Architecture. Lecture 4 - ISA CISC 662 Graduate Computer Architecture Lecture 4 - ISA Michela Taufer http://www.cis.udel.edu/~taufer/courses Powerpoint Lecture Notes from John Hennessy and David Patterson s: Computer Architecture,

More information

IAS Computer. Instructions

IAS Computer. Instructions IAS Computer Instructions The IAS computer was designed in the 1940's and built in the early 1950's by John von Neumann at the Princeton Institute for Advanced Studies. It can arguably be called the father

More information

Instruction-set Design Issues: what is the ML instruction format(s) ML instruction Opcode Dest. Operand Source Operand 1...

Instruction-set Design Issues: what is the ML instruction format(s) ML instruction Opcode Dest. Operand Source Operand 1... Instruction-set Design Issues: what is the format(s) Opcode Dest. Operand Source Operand 1... 1) Which instructions to include: How many? Complexity - simple ADD R1, R2, R3 complex e.g., VAX MATCHC substrlength,

More information

Lecture 5. EEE3410 Microcontroller Applications Department of Electrical Engineering Assembly Language Programming (1)

Lecture 5. EEE3410 Microcontroller Applications Department of Electrical Engineering Assembly Language Programming (1) Department of Electrical Engineering Lecture 5 8051 Assembly Language Programming (1) 1 In this Lecture 8051 programming model Assembly language syntax Operation codes and operands Machine instructions

More information

Lecture 5: Instruction Set Architectures II. Take QUIZ 2 before 11:59pm today over Chapter 1 Quiz 1: 100% - 29; 80% - 25; 60% - 17; 40% - 3

Lecture 5: Instruction Set Architectures II. Take QUIZ 2 before 11:59pm today over Chapter 1 Quiz 1: 100% - 29; 80% - 25; 60% - 17; 40% - 3 Lecture 5: Instruction Set Architectures II Announcements Turn in Homework #1 XSPIM tutorials in PAI 5.38 during TA office hours Tue Feb 2: 2-3:30pm Wed Feb 3: 1:30-3pm Thu Feb 4: 3-4:30pm Take QUIZ 2

More information

EC-801 Advanced Computer Architecture

EC-801 Advanced Computer Architecture EC-801 Advanced Computer Architecture Lecture 5 Instruction Set Architecture I Dr Hashim Ali Fall 2018 Department of Computer Science and Engineering HITEC University Taxila!1 Instruction Set Architecture

More information

Digital Blocks Semiconductor IP

Digital Blocks Semiconductor IP 805 SFR Bus Digital Blocks Semiconductor IP 805 Microcontroller Configurable Peripherals General Description The Digital Blocks (Configurable Peripherals) Microcontroller Verilog IP Core is complaint with

More information

CHAPTER 5 A Closer Look at Instruction Set Architectures

CHAPTER 5 A Closer Look at Instruction Set Architectures CHAPTER 5 A Closer Look at Instruction Set Architectures 5.1 Introduction 293 5.2 Instruction Formats 293 5.2.1 Design Decisions for Instruction Sets 294 5.2.2 Little versus Big Endian 295 5.2.3 Internal

More information

The von Neumann Architecture. IT 3123 Hardware and Software Concepts. The Instruction Cycle. Registers. LMC Executes a Store.

The von Neumann Architecture. IT 3123 Hardware and Software Concepts. The Instruction Cycle. Registers. LMC Executes a Store. IT 3123 Hardware and Software Concepts February 11 and Memory II Copyright 2005 by Bob Brown The von Neumann Architecture 00 01 02 03 PC IR Control Unit Command Memory ALU 96 97 98 99 Notice: This session

More information