Mehmet Can Vuran, Instructor University of Nebraska-Lincoln Acknowledgement: Overheads adapted from those provided by the authors of the textbook.

Slides:



Advertisements
Similar presentations
2. Getting Started Heejin Park College of Information and Communications Hanyang University.
Advertisements

P.Rajasekar & C.M.T.Karthigeyan Asst.Professor SRM University, Kattankulathur 8/22/2011 School of Computing, Department of IT 1.
SE 292 (3:0) High Performance Computing L2: Basic Computer Organization R. Govindarajan
CH10 Instruction Sets: Characteristics and Functions
Low-Level Programming Languages and Pseudocode
Block Diagram of Intel 8086 Engr.M.Zakir Shaikh
Execution Cycle. Outline (Brief) Review of MIPS Microarchitecture Execution Cycle Pipelining Big vs. Little Endian-ness CPU Execution Time 1 IF ID EX.
PSSA Preparation.
Instruction execution and sequencing
ARM versions ARM architecture has been extended over several versions.
Overheads for Computers as Components 2nd ed.
Chapter 3 โพรเซสเซอร์และการทำงาน The Processing Unit
CPSC 330 Fall 1999 HW #1 Assigned September 1, 1999 Due September 8, 1999 Submit in class Use a word processor (although you may hand-draw answers to Problems.
THUMB Instructions: Branching and Data Processing
Goal: Write Programs in Assembly
Chapter 2 Instruction Set Architecture
Machine Instructions Operations
1 Lecture 3: Instruction Set Architecture ISA types, register usage, memory addressing, endian and alignment, quantitative evaluation.
INSTRUCTION SET ARCHITECTURES
Machine Instructions Operations 1 ITCS 3181 Logic and Computer Systems 2015 B. Wilkinson Slides4-1.ppt Modification date: March 18, 2015.
Chapter 2.
Instruction Set Architecture Classification According to the type of internal storage in a processor the basic types are Stack Accumulator General Purpose.
TK 2633 Microprocessor & Interfacing
Execution of an instruction
TK 2633 Microprocessor & Interfacing Lecture 3: Introduction to 8085 Assembly Language Programming (2) 1 Prepared By: Associate Prof. Dr Masri Ayob.
S. Barua – CPSC 440 CHAPTER 2 INSTRUCTIONS: LANGUAGE OF THE COMPUTER Goals – To get familiar with.
Room: E-3-31 Phone: Dr Masri Ayob TK 2633 Microprocessor & Interfacing Lecture 1: Introduction to 8085 Assembly Language.
Chapter 4 Processor Technology and Architecture. Chapter goals Describe CPU instruction and execution cycles Explain how primitive CPU instructions are.
Lecture 5 Sept 14 Goals: Chapter 2 continued MIPS assembly language instruction formats translating c into MIPS - examples.
11/11/05ELEC CISC (Complex Instruction Set Computer) Veeraraghavan Ramamurthy ELEC 6200 Computer Architecture and Design Fall 2005.
What is an instruction set?
Unit -II CPU Organization By- Mr. S. S. Hire. CPU organization.
Arithmetic for Computers
Machine Instruction Characteristics
Instruction Set Architecture
Dr Mohamed Menacer College of Computer Science and Engineering Taibah University CS-334: Computer.
Chapter 2-2 Assembly Instructions Number Systems Number Systems Assembly Instructions Assembly Instructions Branch Branch Next Lecture Next Lecture  Addressing.
Execution of an instruction
Computer Architecture and Organization
Computer Architecture EKT 422
Computer Architecture Lecture 03 Fasih ur Rehman.
Chapter 10 Instruction Sets: Characteristics and Functions Felipe Navarro Luis Gomez Collin Brown.
What is a program? A sequence of steps
Group # 3 Jorge Chavez Henry Diaz Janty Ghazi German Montenegro.
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.
Instruction Sets: Characteristics and Functions  Software and Hardware interface Machine Instruction Characteristics Types of Operands Types of Operations.
CSC 221 Computer Organization and Assembly Language Lecture 06: Machine Instruction Characteristics.
Computer Architecture & Operations I
Computer Architecture & Operations I
A Closer Look at Instruction Set Architectures
Microprocessor Systems Design I
Microprocessor Systems Design I
Architecture Review Instruction Set Architecture
A Closer Look at Instruction Set Architectures
The University of Adelaide, School of Computer Science
Chapter 8 Central Processing Unit
ECEG-3202 Computer Architecture and Organization
Chapter 9 Instruction Sets: Characteristics and Functions
ECEG-3202 Computer Architecture and Organization
Introduction to Microprocessor Programming
Chapter 10 Instruction Sets: Characteristics and Functions
Presentation transcript:

Mehmet Can Vuran, Instructor University of Nebraska-Lincoln Acknowledgement: Overheads adapted from those provided by the authors of the textbook

AND, OR, and NOT. Others by composition. Syntax similar to arithmetic, however, operations are bit-parallel: corresponding bits of the operands are operated on independently and concurrently. Using RISC-style instructions, all operands are in registers or specified as immediate values: Or R4, R2, R3 And R5, R6, #0xFF 16-bit immediate is zero-extended to 32 bits 3

Shifting binary value left/right = mult/div by 2 Arithmetic shift preserves sign in MS bit Rotate copies bits from one end to other end Shift amount in register or given as immediate Carry flag (discussed later) may be involved Examples: LShiftLR3, R3, #2 (mult by 4) RotateLR3, R3, #2 (MS bits to LS bits) 4

5

6

7

8

Binary coded decimal (BCD): Use 8 bytes to code each decimal digit 4 bits are sufficient to code 0-9 Problem: Pack two BCD digits, stored one per byte packed into a single byte. 9

Pointer set to 1 st byte for index-mode access to load 1 st digit, which is shifted to upper bits Upper bits of 2 nd digit are cleared by ANDing ORing combines 2 nd digit with shifted 1 st digit for result of two packed digits in a single byte 32-bit registers, but only 8 lowest bits relevant 10

Given two BCD digits, stored one per byte, pack them into a single byte. Variable:#LOC= Addr. of Unpacked Data #PACKED = Addr. of Packed Data Packed Data Temporary Register:R2R3 R4 11

Not always implemented in hardware Iterative hardware algorithms may result in slower execution time than add and subtract Signed integer multiplication of n-bit numbers produces a product with as many as 2n bits Processor truncates product to fit in a register: MultiplyRk, Ri, Rj(Rk [Ri] [Rj]) For general case, 2 registers may hold result Integer division produces quotient as result: Divide Rk, Ri, Rj(Rk [Ri] / [Rj]) Remainder is discarded or placed in a register 12

Assembly-language instructions express the actions to be performed by processor circuitry Assembler converts to machine instructions Three-operand RISC instructions require enough bits in single word to identify registers 16-bit immediates must be supported Instruction must include bits for OP code Call instruction also needs bits for address 13

14

Complex instruction set computer (CISC) Many addressing modes Many operations Reduced instruction set computer (RISC) Load/store Fixed-size and Pipelinable instructions. 16

CISC instructions: Memory reference not constrained to only load/store Instructions may be larger than one word Typically use two-operand instruction format, with at least one operand in a register Implementation of C A B using CISC: MoveRi, A AddRi, B MoveC, Ri 17

Move instruction equivalent to Load/Store But also can transfer immediate values and possibly between two memory locations Arithmetic instructions may employ addressing modes for operands in memory: SubtractLOC, Ri Add Rj, 16(Rk) 18

CISC style has other modes not usual for RISC Autoincrement mode: effective address given by register contents; after accessing operand, register contents incremented to point to next Useful for adjusting pointers in loop body: Add SUM, (Ri) MoveByte(Rj), Rk Automatically increment by 4 for words, and by 1 for bytes 19

Autodecrement mode: before accessing operand, register contents are decremented, then new contents provide effective address Notation in assembly language: Add Rj, (Ri) Use autoinc. & autodec. for stack operations: Move (SP), NEWITEM(push) Move ITEM, (SP) (pop) 20

Processor can maintain information on results to affect subsequent conditional branches Results from arithmetic/comparison & Move Condition code flags in a status register: N (negative) 1 if result negative, else 0 Z (zero) 1 if result zero, else 0 V (overflow) 1 if overflow occurs, else 0 C (carry) 1 if carry-out occurs, else 0 21

CISC branches check condition code flags For example, decrementing a register with a positive value causes N and Z flags to be cleared if result is not zero A branch to check logic condition N Z 0: Branch>0LOOP Other branches test conditions for,,,, Also Branch_if_overflow and Branch_if_carry Consider CISC-style list-summing program: 22

23

RISC characteristics include: simple addressing modes all instructions fitting in a single word fewer total instructions arithmetic/logic operations on registers load/store architecture for data transfers more instructions executed per program Simpler instructions make it easier to design faster hardware (e.g., use of pipelining) 24

CISC characteristics include: more complex addressing modes instructions spanning more than one word more instructions for complex tasks arithmetic/logic operations on memory memory-to-memory data transfers fewer instructions executed per program Complexity makes it somewhat more difficult to design fast hardware, but still possible 25

Single processing unit (or multi-core) External memory Small register Simple compiler Complicated instruction set A – input a string of characters from I/O port Intel x86, Motorola 68xxx, National Semiconductor Requires less frequent memory access Makes sense when memory was expensive Dominates PC market (Intel x86) 26

Move complexity from silicon to compiler Smaller form factor Better energy efficiency less heat! Load/store architecture Only memory access instructions are load and store Other instructions performed on registers MIPS, Sun SPARC, ARM, Atmel AVR, Microchip PIC iX (iPod, iPhone, iPad), BB, PlayStation (1,2,3), … 27

Pipelined Instruction Execution Simultaneously Execute an instruction Decode the next instruction Fetch the third Improved efficiency 28CSCE 230 – Computer Organization

Complex instruction set Smaller code size Longer instruction time Simpler instruction set Larger code size Shorter instruction time Smaller size Lower power consumption 29CSCE 230 – Computer Organization

Read the following example to illustrate RISC vs. CISC programming style on your own and contact me or a TA if you have any questions. 30

First example program computes: First elements of each array, A(0) and B(0), are stored at memory locations AVEC and BVEC Consider RISC and CISC versions of program Use Multiply instruction on pairs of elements and accumulate sum with Add instruction Some processors have MultiplyAccumulate 31

32

33

Second example searches for 1 st occurrence of pattern string P in target string T String P has length m and string T has length n Algorithm to implement in RISC/CISC styles: 34

35

36

Many fundamental concepts presented: memory locations, byte addressability addressing modes and instruction execution subroutines and the processor stack assembly-language and register-transfer notation RISC-style and CISC-style instruction sets Later chapters build on these concepts 37