The MIPS Instruction Set
|
|
- Lucy Cannon
- 7 years ago
- Views:
Transcription
1 The MIPS Instruction Set MIPS is a Reduced Instruction Set Computer (RISC), Characterized By: It is a Load-Store Machine. Computation Is Done On Data In Registers, i.e., Operands of Arithmetic And Logical Operations Do Not Reside In Memory. Data Is Moved Between Memory And Registers Before Being Used and Back To Memory After Computation Is Finished By Load and Store Instructions A Relatively Small Number Of Instructions and Data Types All Instructions Are Of The Same Length There Are A Very Small Number Of Instruction Formats (3) There Are A Small Number Of Addressing Modes - Three For Accessing Operands (Register-Direct, Based, Immediate) and One For Computing Jump Addresses (PC-Relative) Courtesy D. Rennels Set 2 ( 1-30 ) M. Louie - v.11
2 MIPS R2000 / R3000 ISA Programmable Storage: Byte Addressable R0 R1 R Addresses 2 30 Memory Words; 1 Word = 4 Bytes Bit General Purpose Registers - R1 - R31 General Purpose - Register 0 = Constant Value 0 PC = Program Counter Register R31 PC LO HI F0 F2 F4 F1 F3 F5 F30 Single Precision Double Precision F31 Set 2 ( 2-30 ) M. Louie - v.11
3 MIPS R2000/R3000 ISA (Floating Point) 32 Floating Point Registers (F0-F31) - Double Precision = 16 FP Register Pairs - Single Precision = 16 FP Registers (Even Addresses) HI,LO Registers for 64-Bit Integer Arithmetic Results - HI,LO = 64-Bit Integer Product (Multiplication) - LO=Quotient, HI=Remainder (Division) Set 2 ( 3-30 ) M. Louie - v.11
4 MIPS Instruction Formats R-Type Instructions OP RS RT RD Shamt Func 6 Bits 5 Bits 5 Bits 5 Bits 5 Bits 6 Bits Here is the meaning of each field name in the MIPS instructions: - OP: Operation of the instruction - RS: The First Register Source Operand - RT: The Second Register Source Operand - RD: The Register Destination Operand; it gets the result of the operation - SHAMT: Shift Amount (This term is explained in Chapter 4; You will not need it until then) - Func: Function; This field selects the variant of the operation in the OP Field For convenience we will express values of fields as decimal digits Patterson & Hennessy Set 2 ( 4-30 ) M. Louie - v.11
5 MIPS Instruction Formats I-Type Instructions OP RS RT Address 6 Bits 5 Bits 5 Bits 16 Bits Immediate Addressing Format - addi, ori, andi Data Transfer Instructions - lw, sw Conditional Branch - beq, bne. Patterson & Hennessy Set 2 ( 5-30 ) M. Louie - v.11
6 MIPS Addressing Modes Instruction Formats Register (direct) OP RS RT RD Register Immediate OP RS RT Immed Base + Index OP RS RT Immed Register Memory PC-Relative OP RS RT Immed PC Memory Courtesy D. Patterson Set 2 ( 6-30 ) M. Louie - v.11
7 Four Basic MIPS Instructions MIPS Assembly Language Category Instruction Example Meaning Comments Arithmetic Add add $1,$2,$3 $1=$2+$3 3 Ops Data in Reg Subtract sub $1,$2,$3 $1=$2-$3 3 Ops Data in Reg Data Transfer Load Word lw $1,100($2) $1=Memory[$2+100] Data from Mem to Reg Store Word sw $1,100($2) Memory[$2+100]=$1 Data from Reg to Mem Patterson & Hennessy Set 2 ( 7-30 ) M. Louie - v.11
8 Four Basic MIPS Instructions MIPS Machine Language Name Fmt Example add R add $1,$2,$3 sub R sub $1,$2,$3 lw I lw $1,100($2) sw I sw $1,100($2) Field Size 6 bits 5 bits 5 bits 5 bits 5bits 6 bits All Instructions 32 Bits Fmt R R op rs rt rd shamt func Arithmetic Instruction Fmt Fmt I I op rs rt Address Data Transfer Fmt Patterson & Hennessy Set 2 ( 8-30 ) M. Louie - v.11
9 Assembly and Machine Language Programs for a Simple Example A[i] = h + A[i]; is compiled into: lw $8,Astart($19) # Temporary reg $8 gets A[i] add $8,$18,$8 # Temporary reg $8 gets h + A[i] sw $8,Astart($19) # Stores h + A[i] back into A[i] op rs rt (rd) (shamt) address/ func Patterson & Hennessy Set 2 ( 9-30 ) M. Louie - v.11
10 Multiply / Divide Start Multiply, Divide - MULT rs, rt - MULTU rs, rt - DIV rs, rt - DIVU rs,rt Registers Move Result From Multiply, Divide - MFHI rd - MFLO rd Move To HI or LO - MTHI rd - MTLO rd HI LO Courtesy D. Patterson Set 2 ( ) M. Louie - v.11
11 Immediate Addressing in MIPS Example: - The add instruction that has one constant operand is called add immediate or addi. To add 4 to reg. 29, with result in reg. 28: addi $28,$29,4 # $28 = $ What is the Corresponding MIPS Machine Code Answer: - The Instruction Is The Following Machine Code (Using Decimal # s): OP RS RT Immediate In Binary It Is: Patterson & Hennessy Set 2 ( ) M. Louie - v.11
12 Adding The Conditional Branch and Jump Instructions Compare Two Registers and If Condition is Met, Goto Label L Category Instruction Example Meaning Comments Conditional Branch branch on equal beq $1,$2,L if $1 == $2 goto L Equal Test and Branch branch on not equal bne $1,$2,L if $1!= $2 goto L Not Equal Test and Branch set on less than slt $1,$2,$3 if $2<$3 $1=1 else $1=0 Compare for less than; set register with result. Used with beq/bne for branch on less than Unconditional Jump jump j L goto L jump to target address jump register jr $31 goto $31 for switch and procedure return Patterson & Hennessy Set 2 ( ) M. Louie - v.11
13 MIPS jump, branch, compare Instructions Examples: Let Label L be at a word offset F from PC+4 Instruction Example Meaning Comments branch on equal beq $1,$2,L if $1==$2 goto PC+4+(F*4) Equal Test; PC relative branch on not eq bne $1,$2,L if $1!= $2 goto PC+4+(F*4) Not Equal Test; PC relative set on less than slt $1,$2,$3 if $2<$3 $1=1 else $1=0 Compare less than, 2 s comp set less than imm. slti $1,$2,100 if $2<100 $1=1 else $1=0 Compare < constant, 2 s comp set less than uns. sltu $1,$2,$3 if $2<$3 $1=1 else $1=0 Compare less than, natural no. set l.t. imm. uns. sltiu $1,$2,100 if $2<100 $1=1 else $1=0 Compare < constant, natural jump j L goto L Jump to target address jump register jr $31 goto $31 For switch, procedure return jump and link jal L $31=PC+4, goto L For procedure call Courtesy D. Patterson Set 2 ( ) M. Louie - v.11
14 Branch Instructions are PC Relative For branches/jumps, 16-bit Address Field is a word offset to Label L For branches, PC <- PC (Address Field)*4. For jumps, (Address Field)*4 replaces the lower bits of (PC+4) (e.g., let PC=16 and Label L at address 100). Name Fmt Example Comments beq I beq $1,$2,L bne I bne $1,$2,L slt R slt $1,$2,$3 j J 2 25 j L jr R jr $31 Field Size 6 bits 5 bits 5 bits 5 bits 5bits 6 bits All Instructions 32 Bits Fmt R R op rs rt rd shamt func Arithmetic Fmt Fmt I I op rs rt Address Data Transfer Fmt, branch Fmt Patterson & Hennessy Set 2 ( ) M. Louie - v.11
15 A Coding Example with Conditional Branches Example: - In the following C code segment, f,g,h,i, and j are variables: if (i == j) goto L1; f = g + h; L1: f = f - i; - Assuming that the five variables correspond to five registers $16 through $20, what is the compiled MIPS code? Answer: - The Compiled Program (Assembly Code) is: beq $19,$20,L1 # goto L1 if i equals j add $16,$17,$18 # f = g + h L1:sub $16,$16,$19 # f = f - i What would the machine code look like for this? Patterson & Hennessy Set 2 ( ) M. Louie - v.11
16 Another C Compilation Example C Code: Loop:g = g + A[i]; i = i+ j; if (i!= h) goto Loop; Assembly Code: Loop:mult $19,$10 # (HI,LO) regs = i*4 mflo $9 # reg $9 = least sig. 32 product bits lw $8,Astart($9)# Temporary reg $8 = A[i] add $17,$17,$8 # g = g + A[i] add $19,$19,$20 # i = i + j bne $19,$18,Loop # goto Loop if i!= h Patterson & Hennessy Set 2 ( ) M. Louie - v.11
17 An Example Using a Case Statement C Code: switch (k) { case 0: f = i + j; break; case 1: f = g + h; break; case 2: f = g - h; break; case 3; f = i - j; break; } The following MIPS assembly language will work, provided four words in memory, starting at location JumpTable, have addresses corresponding to the labels L0,L1,L2, and L3 respectively. Since we are using the variable k to index into this array of words, we must first multiply by 4 to turn k into its byte address equivalent. Loop: mult $10,$21 # (HI,LO) regs = k*4 mflo $9 # Temp reg $9 = least sig. 32 product bits lw $8,JumpTable($9) # Temp reg $8 = Jumptable[k] jr $8 # Jump based on register $8 L0: add $16,$19,$20 # k=0 so f gets i+j j Exit L1: add $16,$17,$18 # k=1 so f gets g+h j Exit L2: sub $16,$17,$18 # k=2 so f gets g-h j Exit L3: sub $16,$19,$20 # k=3 so f gets i-j Exit: Patterson & Hennessy Set 2 ( ) M. Louie - v.11
18 Why are Stacks So Great? Stacking of Procedure Calls & Returns and Environments A CALL B B CALL C C A A B A B C RET RET RET A A B Some Machines Provide a Memory Stack as Part of the Architecture Sometimes Stacks are Implemented via Software Convention (e.g., MIPS) Courtesy D. Patterson Set 2 ( ) M. Louie - v.11
19 Call-Return Linkage: Stack Frames HIMEM ARGS Callee Save Regs (old FP, RA) Local Variables FP Reference Args and Local Vars at Fixed (negative) Offset From FP SP LOMEM Grows and shrinks during expression evalution Many Variations on Stacks Possible (up/down, last pushed / next) Courtesy D. Patterson Set 2 ( ) M. Louie - v.11
20 Definitions for MIPS Procedure Call Convention Stack Frame -- A block of memory on the stack for the procedure call environment. Purpose: - Holds values passed as arguments to the procedure - Store values that the calling procedure needs after the callee returns - Provides storage space for local variables Caller-Saved Registers -- Registers 8-15, 24, and 25. Assumed temporary values that the callee can overwrite without restoring before returning Callee-Saved Registers -- Registers Assumed long-lived values that the callee can overwrite but must restore before returning Reserved Registers -- Registers 1, 26, and 27. Strictly used by the operating system and assembler. Not to be used by user programs or compilers Global Register -- Register 28. Pointer to a program s static data Argument Registers -- Registers 4-7. For passing proc. call arguments Stack Pointer -- Register 29. Pointer to last allocated word on the stack Set 2 ( ) M. Louie - v.11
21 MIPS Procedure Call Convention Before the caller makes the procedure call, the caller: 1.1 Pushes onto the stack caller-saved register values and argument register values that the caller wants to use after the callee returns 1.2 Stores procedure call arguments in regs. 4-7 and pushes any remaining arguments onto the stack for the callee stack frame When the procedure is invoked, the callee then: 2.1 Allocates memory on the stack for its stack frame 2.2 Saves environment registers (e.g. reg. 31: return addr., and reg. 30: frame pointer) and callee-saved registers onto the stack so that the callee can alter them and then restore them before returning 2.3 Updates the frame pointer to point to the callee stack frame Just before the callee returns, the callee: 3.1 Puts return values in registers Restores regs. saved in Step 2.2 (above) and pops the stack frame Set 2 ( ) M. Louie - v.11
22 MIPS Uses a Jump and Link Instruction for Procedure Calls Category Instruction Example Meaning Comments Unconditional Jump jump j L goto L jump to target address jump register jr $31 goto $31 for switch statements jump and link jal L $31=PC+4, goto L for procedure call Name Fmt Example Comments jal J jal L (L s addr. =1000) PROG PROC PROC Save Reg Push PC+4 Save Reg Push PC+4 Save Reg Push PC+4 Courtesy D. Rennels Set 2 ( ) M. Louie - v.11
23 Details of the MIPS Instruction Set Register Zero always has the value Zero (even if you try to write to it) Jump/Link instr. puts the Return Addr PC+4 into the Link Register All instructions change all 32-bits of the destination register (including lui,lb,lh) and all read all 32-bits of sources (add,sub,and,or,...) Immediate Arithmetic and Logical Instructions are Extended as Follows: - Logical Immediates are Zero Extended to 32 Bits - Arithmetic Immediates are Sign Extended to 32 Bits The data loaded by the instruction lb and lh are extended as follows: - lbu,lhu are Zero Extended - lb,lh are Sign Extended Overflow can occur in these Arithmetic and Logical instructions: - add,sub,addl - It cannot occur in addu, subu, addiu, and, or,xor, nor, shifts, mult, multu, div, divu Courtesy D. Patterson Set 2 ( ) M. Louie - v.11
24 Complex Instruction Set Computers (CISC) - Multiple Length Instruction Formats - More Addressing Modes - Typical Memory Operands can be used in Arithmetic and Logical operations - An instruction may do several things (e.g., Test, Decrement, and Branch) The Reasons for this are historic - There were few registers in early machines, so a Load-Store Architecture would be Inefficient (Why?) - Memory was Expensive and Slow - Making special short instructions reduced memory bandwidth - Each instruction took several clock cycles so Compound Instructions could speed up programs Modern Technology caused the development of RISC machines: - More registers in the processor - Pipelining to execute one instruction every clock cycle - Cheaper Faster Memory Courtesy D. Rennels Set 2 ( ) M. Louie - v.11
25 IA-32 Intel Instruction Set Architecture IA-32: Intel s 32-bit instruction set architecture for the Pentium, P6 family (including Pentium Pro, Pentium II, Celeron, Pentium III), and Pentium 4 Software compatibility -- Applications written for the Pentium will also run on the Pentium 4 Newer Pentium generations improve hardware performance: - Pentium - 2 pipelines to execute up to 2 instructions per clock. Separate instruction and data caches; each 1 cache level. 32-bit registers but internal data paths of 128 and 256 bits for fast data transfers - Pentium Pro - Executes up to 3 instructions per clock. 2 cache levels - Pentium II - Enlarged instruction and data caches - Pentium III - New set of 128-bit registers - Pentium 4 - Significantly higher clock speeds. 144 new instructions for high performance arithmetic operations and memory management operations. High speed processor-memory bus. Hennessy & Patterson Set 2 ( ) M. Louie - v.11
26 Intel Pentium 4 32-bit Architecture Basic execution environment: - Basic program execution registers: 8 general purpose registers 6 segment registers Flags register, and Instruction Pointer register - Floating point unit (FPU) registers: 8 FPU data registers FPU control register, FPU status register, FPU instruction pointer, FPU operand pointer, FPU tag register, FPU opcode register - Eight 64-bit registers and eight 128-bit registers for high performance single-instruction, multiple-data stream operations - 5 control registers identify the current operating mode and characteristics of the currently executing task Set 2 ( ) M. Louie - v.11
27 Pentium 4 Memory Segment Segment = Logical unit of memory up to 4 GBytes of Contiguous Memory - For isolation of separate code, data, and stack modules in memory Segment Registers: Pointers to the base of 16 current segments Offset: Logical memory address location with respect to a segment base Address translation when using segments: - Segment base address + Offset = Logical linear memory address Segment Descriptors Linear Memory Segment Register Access Rights Segment Size Base Address Segment Logical Memory Address Offset Set 2 ( ) M. Louie - v.11
28 Pentium 4 Addressing Modes Instructions act on zero or more operands. Operands may be located in: - The Instruction itself (immediate operand) - Register - Memory location - I/O Port Memory Addressing Modes - Displacement (Absolute Address) - Base Register (Register Indirect) - Base Register + Displacement - (Index Register * Scale) + Displacement - Base Register + Index Register + Displacement) - Base Register + (Index Register * Scale) + Displacement Set 2 ( ) M. Louie - v.11
29 Some Pentium 4 Operations Over 330 Operations Some Control Operations JNZ Short-Label Jump if non-zero to target instruction CALL Target Subroutine Call-- save environment info & jump RET Pop return address from stack & jump LOOP Short-Label Loop Branch, Decrement CX reg., Jump if CX!=0 Some Data Transfer Operations CMOVcc Do a move operation if flags=specific state PUSH SOURCE Push operand onto stack & decrement stack ptr. POP SOURCE Pop operand from stack & increment stack ptr. Some Arithmetic and Logical Operations FSINCOS Sine & Cosine; operand & result on stack XADD DEST,SOURCE Exchange DEST/SOURCE values; DEST=DEST+SOURCE BSF DEST,SOURCE Find position of least-signif. 1-bit in SOURCE BOUND INDEX,LOWER,UPPER Checks if array INDEX is in LOWER/UPPER bounds Some Software Support Operations ENTER SIZE,NEST-LVL Create a procedure stack frame VERW SOURCE Check if SOURCE segment is accessible/writable Set 2 ( ) M. Louie - v.11
30 Pentium 4 General Instruction Format Instruction Prefixes Opcode ModR/M SIB Displacement Immediate Up to four prefixes of 1-byte each (optional) 1 or 2 byte opcode 1-byte (if required) 1-byte (if required) Address displacement of 1, 2, or 4 bytes (if required) Immediate data of 1, 2, or 4 bytes (if required) Mod Reg/ Opcode R/M Scale Index Base - Instruction format: 1 to 16 bytes in length - Mod: Addressing mode for operand in memory - Reg/Opcode: Register number or 3 more bits of opcode - R/M: Register number or combined with Mod for an addressing mode - SIB: For addressing modes requiring Scale, Index, or Base - Instruction prefixes: Override default segment, operand size or address size; Indicate probable result of a conditional branch; Cause an instruction to be repeated for an entire string Intel Set 2 ( ) M. Louie - v.11
Reduced Instruction Set Computer (RISC)
Reduced Instruction Set Computer (RISC) Focuses on reducing the number and complexity of instructions of the ISA. RISC Goals RISC: Simplify ISA Simplify CPU Design Better CPU Performance Motivated by simplifying
More informationInstruction Set Architecture
Instruction Set Architecture Consider x := y+z. (x, y, z are memory variables) 1-address instructions 2-address instructions LOAD y (r :=y) ADD y,z (y := y+z) ADD z (r:=r+z) MOVE x,y (x := y) STORE x (x:=r)
More informationInstruction Set Architecture. or How to talk to computers if you aren t in Star Trek
Instruction Set Architecture or How to talk to computers if you aren t in Star Trek The Instruction Set Architecture Application Compiler Instr. Set Proc. Operating System I/O system Instruction Set Architecture
More informationTypy danych. Data types: Literals:
Lab 10 MIPS32 Typy danych Data types: Instructions are all 32 bits byte(8 bits), halfword (2 bytes), word (4 bytes) a character requires 1 byte of storage an integer requires 1 word (4 bytes) of storage
More informationStack machines The MIPS assembly language A simple source language Stack-machine implementation of the simple language Readings: 9.1-9.
Code Generation I Stack machines The MIPS assembly language A simple source language Stack-machine implementation of the simple language Readings: 9.1-9.7 Stack Machines A simple evaluation model No variables
More informationOverview. CISC Developments. RISC Designs. CISC Designs. VAX: Addressing Modes. Digital VAX
Overview CISC Developments Over Twenty Years Classic CISC design: Digital VAX VAXÕs RISC successor: PRISM/Alpha IntelÕs ubiquitous 80x86 architecture Ð 8086 through the Pentium Pro (P6) RJS 2/3/97 Philosophy
More informationReview: MIPS Addressing Modes/Instruction Formats
Review: Addressing Modes Addressing mode Example Meaning Register Add R4,R3 R4 R4+R3 Immediate Add R4,#3 R4 R4+3 Displacement Add R4,1(R1) R4 R4+Mem[1+R1] Register indirect Add R4,(R1) R4 R4+Mem[R1] Indexed
More informationTranslating C code to MIPS
Translating C code to MIPS why do it C is relatively simple, close to the machine C can act as pseudocode for assembler program gives some insight into what compiler needs to do what's under the hood do
More informationInstruction Set Architecture (ISA)
Instruction Set Architecture (ISA) * Instruction set architecture of a machine fills the semantic gap between the user and the machine. * ISA serves as the starting point for the design of a new machine
More informationIntroduction to MIPS Assembly Programming
1 / 26 Introduction to MIPS Assembly Programming January 23 25, 2013 2 / 26 Outline Overview of assembly programming MARS tutorial MIPS assembly syntax Role of pseudocode Some simple instructions Integer
More informationChapter 2 Topics. 2.1 Classification of Computers & Instructions 2.2 Classes of Instruction Sets 2.3 Informal Description of Simple RISC Computer, SRC
Chapter 2 Topics 2.1 Classification of Computers & Instructions 2.2 Classes of Instruction Sets 2.3 Informal Description of Simple RISC Computer, SRC See Appendix C for Assembly language information. 2.4
More informationMIPS Assembler and Simulator
MIPS Assembler and Simulator Reference Manual Last Updated, December 1, 2005 Xavier Perséguers (ing. info. dipl. EPF) Swiss Federal Institude of Technology xavier.perseguers@a3.epfl.ch Preface MIPS Assembler
More informationCOMP 303 MIPS Processor Design Project 4: MIPS Processor Due Date: 11 December 2009 23:59
COMP 303 MIPS Processor Design Project 4: MIPS Processor Due Date: 11 December 2009 23:59 Overview: In the first projects for COMP 303, you will design and implement a subset of the MIPS32 architecture
More informationCPU Organization and Assembly Language
COS 140 Foundations of Computer Science School of Computing and Information Science University of Maine October 2, 2015 Outline 1 2 3 4 5 6 7 8 Homework and announcements Reading: Chapter 12 Homework:
More informationComputer Organization and Architecture
Computer Organization and Architecture Chapter 11 Instruction Sets: Addressing Modes and Formats Instruction Set Design One goal of instruction set design is to minimize instruction length Another goal
More informationA single register, called the accumulator, stores the. operand before the operation, and stores the result. Add y # add y from memory to the acc
Other architectures Example. Accumulator-based machines A single register, called the accumulator, stores the operand before the operation, and stores the result after the operation. Load x # into acc
More informationIntel 8086 architecture
Intel 8086 architecture Today we ll take a look at Intel s 8086, which is one of the oldest and yet most prevalent processor architectures around. We ll make many comparisons between the MIPS and 8086
More informationLecture Outline. Stack machines The MIPS assembly language. Code Generation (I)
Lecture Outline Code Generation (I) Stack machines The MIPS assembl language Adapted from Lectures b Profs. Ale Aiken and George Necula (UCB) A simple source language Stack- machine implementation of the
More informationInstruction Set Design
Instruction Set Design Instruction Set Architecture: to what purpose? ISA provides the level of abstraction between the software and the hardware One of the most important abstraction in CS It s narrow,
More informationAdvanced Computer Architecture-CS501. Computer Systems Design and Architecture 2.1, 2.2, 3.2
Lecture Handout Computer Architecture Lecture No. 2 Reading Material Vincent P. Heuring&Harry F. Jordan Chapter 2,Chapter3 Computer Systems Design and Architecture 2.1, 2.2, 3.2 Summary 1) A taxonomy of
More informationMore MIPS: Recursion. Computer Science 104 Lecture 9
More MIPS: Recursion Computer Science 104 Lecture 9 Admin Homework Homework 1: graded. 50% As, 27% Bs Homework 2: Due Wed Midterm 1 This Wed 1 page of notes 2 Last time What did we do last time? 3 Last
More informationLSN 2 Computer Processors
LSN 2 Computer Processors Department of Engineering Technology LSN 2 Computer Processors Microprocessors Design Instruction set Processor organization Processor performance Bandwidth Clock speed LSN 2
More informationAssembly Language Programming
Assembly Language Programming Assemblers were the first programs to assist in programming. The idea of the assembler is simple: represent each computer instruction with an acronym (group of letters). Eg:
More informationCSE 141 Introduction to Computer Architecture Summer Session I, 2005. Lecture 1 Introduction. Pramod V. Argade June 27, 2005
CSE 141 Introduction to Computer Architecture Summer Session I, 2005 Lecture 1 Introduction Pramod V. Argade June 27, 2005 CSE141: Introduction to Computer Architecture Instructor: Pramod V. Argade (p2argade@cs.ucsd.edu)
More informationMICROPROCESSOR AND MICROCOMPUTER BASICS
Introduction MICROPROCESSOR AND MICROCOMPUTER BASICS At present there are many types and sizes of computers available. These computers are designed and constructed based on digital and Integrated Circuit
More informationWinter 2002 MID-SESSION TEST Friday, March 1 6:30 to 8:00pm
University of Calgary Department of Electrical and Computer Engineering ENCM 369: Computer Organization Instructors: Dr. S. A. Norman (L01) and Dr. S. Yanushkevich (L02) Winter 2002 MID-SESSION TEST Friday,
More informationa storage location directly on the CPU, used for temporary storage of small amounts of data during processing.
CS143 Handout 18 Summer 2008 30 July, 2008 Processor Architectures Handout written by Maggie Johnson and revised by Julie Zelenski. Architecture Vocabulary Let s review a few relevant hardware definitions:
More informationAn Introduction to Assembly Programming with the ARM 32-bit Processor Family
An Introduction to Assembly Programming with the ARM 32-bit Processor Family G. Agosta Politecnico di Milano December 3, 2011 Contents 1 Introduction 1 1.1 Prerequisites............................. 2
More informationComputer Systems Architecture
Computer Systems Architecture http://cs.nott.ac.uk/ txa/g51csa/ Thorsten Altenkirch and Liyang Hu School of Computer Science University of Nottingham Lecture 10: MIPS Procedure Calling Convention and Recursion
More informationLecture 8: Binary Multiplication & Division
Lecture 8: Binary Multiplication & Division Today s topics: Addition/Subtraction Multiplication Division Reminder: get started early on assignment 3 1 2 s Complement Signed Numbers two = 0 ten 0001 two
More informationComputer organization
Computer organization Computer design an application of digital logic design procedures Computer = processing unit + memory system Processing unit = control + datapath Control = finite state machine inputs
More informationInstruction Set Architecture (ISA) Design. Classification Categories
Instruction Set Architecture (ISA) Design Overview» Classify Instruction set architectures» Look at how applications use ISAs» Examine a modern RISC ISA (DLX)» Measurement of ISA usage in real computers
More informationMIPS Assembly Code Layout
Learning MIPS & SPIM MIPS assembly is a low-level programming language The best way to learn any programming language is to write code We will get you started by going through a few example programs and
More informationEECS 427 RISC PROCESSOR
RISC PROCESSOR ISA FOR EECS 427 PROCESSOR ImmHi/ ImmLo/ OP Code Rdest OP Code Ext Rsrc Mnemonic Operands 15-12 11-8 7-4 3-0 Notes (* is Baseline) ADD Rsrc, Rdest 0000 Rdest 0101 Rsrc * ADDI Imm, Rdest
More informationMore on Pipelining and Pipelines in Real Machines CS 333 Fall 2006 Main Ideas Data Hazards RAW WAR WAW More pipeline stall reduction techniques Branch prediction» static» dynamic bimodal branch prediction
More informationEC 362 Problem Set #2
EC 362 Problem Set #2 1) Using Single Precision IEEE 754, what is FF28 0000? 2) Suppose the fraction enhanced of a processor is 40% and the speedup of the enhancement was tenfold. What is the overall speedup?
More informationComputer Architecture Lecture 2: Instruction Set Principles (Appendix A) Chih Wei Liu 劉 志 尉 National Chiao Tung University cwliu@twins.ee.nctu.edu.
Computer Architecture Lecture 2: Instruction Set Principles (Appendix A) Chih Wei Liu 劉 志 尉 National Chiao Tung University cwliu@twins.ee.nctu.edu.tw Review Computers in mid 50 s Hardware was expensive
More informationCHAPTER 7: The CPU and Memory
CHAPTER 7: The CPU and Memory The Architecture of Computer Hardware, Systems Software & Networking: An Information Technology Approach 4th Edition, Irv Englander John Wiley and Sons 2010 PowerPoint slides
More informationX86-64 Architecture Guide
X86-64 Architecture Guide For the code-generation project, we shall expose you to a simplified version of the x86-64 platform. Example Consider the following Decaf program: class Program { int foo(int
More information1 Classical Universal Computer 3
Chapter 6: Machine Language and Assembler Christian Jacob 1 Classical Universal Computer 3 1.1 Von Neumann Architecture 3 1.2 CPU and RAM 5 1.3 Arithmetic Logical Unit (ALU) 6 1.4 Arithmetic Logical Unit
More informationCS412/CS413. Introduction to Compilers Tim Teitelbaum. Lecture 20: Stack Frames 7 March 08
CS412/CS413 Introduction to Compilers Tim Teitelbaum Lecture 20: Stack Frames 7 March 08 CS 412/413 Spring 2008 Introduction to Compilers 1 Where We Are Source code if (b == 0) a = b; Low-level IR code
More informationCentral Processing Unit (CPU)
Central Processing Unit (CPU) CPU is the heart and brain It interprets and executes machine level instructions Controls data transfer from/to Main Memory (MM) and CPU Detects any errors In the following
More information5 MIPS Assembly Language
103 5 MIPS Assembly Language Today, digital computers are almost exclusively programmed using high-level programming languages (PLs), eg, C, C++, Java The CPU fetch execute cycle, however, is not prepared
More information2) Write in detail the issues in the design of code generator.
COMPUTER SCIENCE AND ENGINEERING VI SEM CSE Principles of Compiler Design Unit-IV Question and answers UNIT IV CODE GENERATION 9 Issues in the design of code generator The target machine Runtime Storage
More information8085 INSTRUCTION SET
DATA TRANSFER INSTRUCTIONS Opcode Operand Description 8085 INSTRUCTION SET INSTRUCTION DETAILS Copy from source to destination OV Rd, Rs This instruction copies the contents of the source, Rs register
More informationInstruction Set Architecture
CS:APP Chapter 4 Computer Architecture Instruction Set Architecture Randal E. Bryant adapted by Jason Fritts http://csapp.cs.cmu.edu CS:APP2e Hardware Architecture - using Y86 ISA For learning aspects
More informationLecture 7: Machine-Level Programming I: Basics Mohamed Zahran (aka Z) mzahran@cs.nyu.edu http://www.mzahran.com
CSCI-UA.0201-003 Computer Systems Organization Lecture 7: Machine-Level Programming I: Basics Mohamed Zahran (aka Z) mzahran@cs.nyu.edu http://www.mzahran.com Some slides adapted (and slightly modified)
More informationChapter 7D The Java Virtual Machine
This sub chapter discusses another architecture, that of the JVM (Java Virtual Machine). In general, a VM (Virtual Machine) is a hypothetical machine (implemented in either hardware or software) that directly
More informationM A S S A C H U S E T T S I N S T I T U T E O F T E C H N O L O G Y DEPARTMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE
M A S S A C H U S E T T S I N S T I T U T E O F T E C H N O L O G Y DEPARTMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE 1. Introduction 6.004 Computation Structures β Documentation This handout is
More informationThe AVR Microcontroller and C Compiler Co-Design Dr. Gaute Myklebust ATMEL Corporation ATMEL Development Center, Trondheim, Norway
The AVR Microcontroller and C Compiler Co-Design Dr. Gaute Myklebust ATMEL Corporation ATMEL Development Center, Trondheim, Norway Abstract High Level Languages (HLLs) are rapidly becoming the standard
More informationMACHINE ARCHITECTURE & LANGUAGE
in the name of God the compassionate, the merciful notes on MACHINE ARCHITECTURE & LANGUAGE compiled by Jumong Chap. 9 Microprocessor Fundamentals A system designer should consider a microprocessor-based
More informationAn Introduction to the ARM 7 Architecture
An Introduction to the ARM 7 Architecture Trevor Martin CEng, MIEE Technical Director This article gives an overview of the ARM 7 architecture and a description of its major features for a developer new
More informationChapter 4 Lecture 5 The Microarchitecture Level Integer JAVA Virtual Machine
Chapter 4 Lecture 5 The Microarchitecture Level Integer JAVA Virtual Machine This is a limited version of a hardware implementation to execute the JAVA programming language. 1 of 23 Structured Computer
More informationA SystemC Transaction Level Model for the MIPS R3000 Processor
SETIT 2007 4 th International Conference: Sciences of Electronic, Technologies of Information and Telecommunications March 25-29, 2007 TUNISIA A SystemC Transaction Level Model for the MIPS R3000 Processor
More informationEmbedded Systems. Review of ANSI C Topics. A Review of ANSI C and Considerations for Embedded C Programming. Basic features of C
Embedded Systems A Review of ANSI C and Considerations for Embedded C Programming Dr. Jeff Jackson Lecture 2-1 Review of ANSI C Topics Basic features of C C fundamentals Basic data types Expressions Selection
More informationComputer Architectures
Computer Architectures 2. Instruction Set Architectures 2015. február 12. Budapest Gábor Horváth associate professor BUTE Dept. of Networked Systems and Services ghorvath@hit.bme.hu 2 Instruction set architectures
More informationPART B QUESTIONS AND ANSWERS UNIT I
PART B QUESTIONS AND ANSWERS UNIT I 1. Explain the architecture of 8085 microprocessor? Logic pin out of 8085 microprocessor Address bus: unidirectional bus, used as high order bus Data bus: bi-directional
More informationTHUMB Instruction Set
5 THUMB Instruction Set This chapter describes the THUMB instruction set. Format Summary 5-2 Opcode Summary 5-3 5. Format : move shifted register 5-5 5.2 Format 2: add/subtract 5-7 5.3 Format 3: move/compare/add/subtract
More informationIntroducción. Diseño de sistemas digitales.1
Introducción Adapted from: Mary Jane Irwin ( www.cse.psu.edu/~mji ) www.cse.psu.edu/~cg431 [Original from Computer Organization and Design, Patterson & Hennessy, 2005, UCB] Diseño de sistemas digitales.1
More informationDivide: Paper & Pencil. Computer Architecture ALU Design : Division and Floating Point. Divide algorithm. DIVIDE HARDWARE Version 1
Divide: Paper & Pencil Computer Architecture ALU Design : Division and Floating Point 1001 Quotient Divisor 1000 1001010 Dividend 1000 10 101 1010 1000 10 (or Modulo result) See how big a number can be
More informationPROBLEMS (Cap. 4 - Istruzioni macchina)
98 CHAPTER 2 MACHINE INSTRUCTIONS AND PROGRAMS PROBLEMS (Cap. 4 - Istruzioni macchina) 2.1 Represent the decimal values 5, 2, 14, 10, 26, 19, 51, and 43, as signed, 7-bit numbers in the following binary
More informationChapter 5 Instructor's Manual
The Essentials of Computer Organization and Architecture Linda Null and Julia Lobur Jones and Bartlett Publishers, 2003 Chapter 5 Instructor's Manual Chapter Objectives Chapter 5, A Closer Look at Instruction
More informationİSTANBUL AYDIN UNIVERSITY
İSTANBUL AYDIN UNIVERSITY FACULTY OF ENGİNEERİNG SOFTWARE ENGINEERING THE PROJECT OF THE INSTRUCTION SET COMPUTER ORGANIZATION GÖZDE ARAS B1205.090015 Instructor: Prof. Dr. HASAN HÜSEYİN BALIK DECEMBER
More informationDesign of Pipelined MIPS Processor. Sept. 24 & 26, 1997
Design of Pipelined MIPS Processor Sept. 24 & 26, 1997 Topics Instruction processing Principles of pipelining Inserting pipe registers Data Hazards Control Hazards Exceptions MIPS architecture subset R-type
More information150127-Microprocessor & Assembly Language
Chapter 3 Z80 Microprocessor Architecture The Z 80 is one of the most talented 8 bit microprocessors, and many microprocessor-based systems are designed around the Z80. The Z80 microprocessor needs an
More information1 The Java Virtual Machine
1 The Java Virtual Machine About the Spec Format This document describes the Java virtual machine and the instruction set. In this introduction, each component of the machine is briefly described. This
More informationCS352H: Computer Systems Architecture
CS352H: Computer Systems Architecture Topic 9: MIPS Pipeline - Hazards October 1, 2009 University of Texas at Austin CS352H - Computer Systems Architecture Fall 2009 Don Fussell Data Hazards in ALU Instructions
More informationInstruction Set Architecture
Instruction Set Architecture Arquitectura de Computadoras Arturo Díaz D PérezP Centro de Investigación n y de Estudios Avanzados del IPN adiaz@cinvestav.mx Arquitectura de Computadoras ISA- 1 Instruction
More informationExceptions in MIPS. know the exception mechanism in MIPS be able to write a simple exception handler for a MIPS machine
7 Objectives After completing this lab you will: know the exception mechanism in MIPS be able to write a simple exception handler for a MIPS machine Introduction Branches and jumps provide ways to change
More informationPipeline Hazards. Structure hazard Data hazard. ComputerArchitecture_PipelineHazard1
Pipeline Hazards Structure hazard Data hazard Pipeline hazard: the major hurdle A hazard is a condition that prevents an instruction in the pipe from executing its next scheduled pipe stage Taxonomy of
More informationpicojava TM : A Hardware Implementation of the Java Virtual Machine
picojava TM : A Hardware Implementation of the Java Virtual Machine Marc Tremblay and Michael O Connor Sun Microelectronics Slide 1 The Java picojava Synergy Java s origins lie in improving the consumer
More informationVLIW Processors. VLIW Processors
1 VLIW Processors VLIW ( very long instruction word ) processors instructions are scheduled by the compiler a fixed number of operations are formatted as one big instruction (called a bundle) usually LIW
More informationSMIPS Processor Specification
SMIPS Processor Specification 6.884 Spring 25 - Version: 25215 1 Introduction SMIPS is the version of the MIPS instruction set architecture (ISA) we ll be using for the processors we implement in 6.884.
More informationAddressing The problem. When & Where do we encounter Data? The concept of addressing data' in computations. The implications for our machine design(s)
Addressing The problem Objectives:- When & Where do we encounter Data? The concept of addressing data' in computations The implications for our machine design(s) Introducing the stack-machine concept Slide
More informationComputer Organization and Components
Computer Organization and Components IS5, fall 25 Lecture : Pipelined Processors ssociate Professor, KTH Royal Institute of Technology ssistant Research ngineer, University of California, Berkeley Slides
More informationCentral Processing Unit Simulation Version v2.5 (July 2005) Charles André University Nice-Sophia Antipolis
Central Processing Unit Simulation Version v2.5 (July 2005) Charles André University Nice-Sophia Antipolis 1 1 Table of Contents 1 Table of Contents... 3 2 Overview... 5 3 Installation... 7 4 The CPU
More informationCS:APP Chapter 4 Computer Architecture Instruction Set Architecture. CS:APP2e
CS:APP Chapter 4 Computer Architecture Instruction Set Architecture CS:APP2e Instruction Set Architecture Assembly Language View Processor state Registers, memory, Instructions addl, pushl, ret, How instructions
More informationAn Overview of Stack Architecture and the PSC 1000 Microprocessor
An Overview of Stack Architecture and the PSC 1000 Microprocessor Introduction A stack is an important data handling structure used in computing. Specifically, a stack is a dynamic set of elements in which
More informationMicroprocessor and Microcontroller Architecture
Microprocessor and Microcontroller Architecture 1 Von Neumann Architecture Stored-Program Digital Computer Digital computation in ALU Programmable via set of standard instructions input memory output Internal
More informationADVANCED PROCESSOR ARCHITECTURES AND MEMORY ORGANISATION Lesson-12: ARM
ADVANCED PROCESSOR ARCHITECTURES AND MEMORY ORGANISATION Lesson-12: ARM 1 The ARM architecture processors popular in Mobile phone systems 2 ARM Features ARM has 32-bit architecture but supports 16 bit
More informationMACHINE INSTRUCTIONS AND PROGRAMS
CHAPTER 2 MACHINE INSTRUCTIONS AND PROGRAMS CHAPTER OBJECTIVES In this chapter you will learn about: Machine instructions and program execution, including branching and subroutine call and return operations
More information18-447 Computer Architecture Lecture 3: ISA Tradeoffs. Prof. Onur Mutlu Carnegie Mellon University Spring 2013, 1/18/2013
18-447 Computer Architecture Lecture 3: ISA Tradeoffs Prof. Onur Mutlu Carnegie Mellon University Spring 2013, 1/18/2013 Reminder: Homeworks for Next Two Weeks Homework 0 Due next Wednesday (Jan 23), right
More informationTraditional IBM Mainframe Operating Principles
C H A P T E R 1 7 Traditional IBM Mainframe Operating Principles WHEN YOU FINISH READING THIS CHAPTER YOU SHOULD BE ABLE TO: Distinguish between an absolute address and a relative address. Briefly explain
More informationIntroduction to RISC Processor. ni logic Pvt. Ltd., Pune
Introduction to RISC Processor ni logic Pvt. Ltd., Pune AGENDA What is RISC & its History What is meant by RISC Architecture of MIPS-R4000 Processor Difference Between RISC and CISC Pros and Cons of RISC
More informationFaculty of Engineering Student Number:
Philadelphia University Student Name: Faculty of Engineering Student Number: Dept. of Computer Engineering Final Exam, First Semester: 2012/2013 Course Title: Microprocessors Date: 17/01//2013 Course No:
More informationInterpreters and virtual machines. Interpreters. Interpreters. Why interpreters? Tree-based interpreters. Text-based interpreters
Interpreters and virtual machines Michel Schinz 2007 03 23 Interpreters Interpreters Why interpreters? An interpreter is a program that executes another program, represented as some kind of data-structure.
More informationIn the Beginning... 1964 -- The first ISA appears on the IBM System 360 In the good old days
RISC vs CISC 66 In the Beginning... 1964 -- The first ISA appears on the IBM System 360 In the good old days Initially, the focus was on usability by humans. Lots of user-friendly instructions (remember
More informationIntel Architecture Software Developer s Manual
Intel Architecture Software Developer s Manual Volume 1: Basic Architecture NOTE: The Intel Architecture Software Developer s Manual consists of three volumes: Basic Architecture, Order Number 243190;
More informationA3 Computer Architecture
A3 Computer Architecture Engineering Science 3rd year A3 Lectures Prof David Murray david.murray@eng.ox.ac.uk www.robots.ox.ac.uk/ dwm/courses/3co Michaelmas 2000 1 / 1 6. Stacks, Subroutines, and Memory
More information612 CHAPTER 11 PROCESSOR FAMILIES (Corrisponde al cap. 12 - Famiglie di processori) PROBLEMS
612 CHAPTER 11 PROCESSOR FAMILIES (Corrisponde al cap. 12 - Famiglie di processori) PROBLEMS 11.1 How is conditional execution of ARM instructions (see Part I of Chapter 3) related to predicated execution
More informationl C-Programming l A real computer language l Data Representation l Everything goes down to bits and bytes l Machine representation Language
198:211 Computer Architecture Topics: Processor Design Where are we now? C-Programming A real computer language Data Representation Everything goes down to bits and bytes Machine representation Language
More informationPentium vs. Power PC Computer Architecture and PCI Bus Interface
Pentium vs. Power PC Computer Architecture and PCI Bus Interface CSE 3322 1 Pentium vs. Power PC Computer Architecture and PCI Bus Interface Nowadays, there are two major types of microprocessors in the
More informationIntroduction to MIPS Programming with Mars
Introduction to MIPS Programming with Mars This week s lab will parallel last week s lab. During the lab period, we want you to follow the instructions in this handout that lead you through the process
More informationKeil C51 Cross Compiler
Keil C51 Cross Compiler ANSI C Compiler Generates fast compact code for the 8051 and it s derivatives Advantages of C over Assembler Do not need to know the microcontroller instruction set Register allocation
More informationEE361: Digital Computer Organization Course Syllabus
EE361: Digital Computer Organization Course Syllabus Dr. Mohammad H. Awedh Spring 2014 Course Objectives Simply, a computer is a set of components (Processor, Memory and Storage, Input/Output Devices)
More informationEE282 Computer Architecture and Organization Midterm Exam February 13, 2001. (Total Time = 120 minutes, Total Points = 100)
EE282 Computer Architecture and Organization Midterm Exam February 13, 2001 (Total Time = 120 minutes, Total Points = 100) Name: (please print) Wolfe - Solution In recognition of and in the spirit of the
More informationExecution Cycle. Pipelining. IF and ID Stages. Simple MIPS Instruction Formats
Execution Cycle Pipelining CSE 410, Spring 2005 Computer Systems http://www.cs.washington.edu/410 1. Instruction Fetch 2. Instruction Decode 3. Execute 4. Memory 5. Write Back IF and ID Stages 1. Instruction
More informationMICROPROCESSOR. Exclusive for IACE Students www.iace.co.in iacehyd.blogspot.in Ph: 9700077455/422 Page 1
MICROPROCESSOR A microprocessor incorporates the functions of a computer s central processing unit (CPU) on a single Integrated (IC), or at most a few integrated circuit. It is a multipurpose, programmable
More informationThe Java Virtual Machine and Mobile Devices. John Buford, Ph.D. buford@alum.mit.edu Oct 2003 Presented to Gordon College CS 311
The Java Virtual Machine and Mobile Devices John Buford, Ph.D. buford@alum.mit.edu Oct 2003 Presented to Gordon College CS 311 Objectives Review virtual machine concept Introduce stack machine architecture
More informationHC12 Assembly Language Programming
HC12 Assembly Language Programming Programming Model Addressing Modes Assembler Directives HC12 Instructions Flow Charts 1 Assembler Directives In order to write an assembly language program it is necessary
More information