SRC: instruction formats Op-coderarb rc c3 0 11 1216 17 21 22 26 27 31 Type D Op-code 0 26 27 31 Type Aunused Op-codera 0 22 26 27 31 Type Bc1 21 Op-coderarb.

Slides:



Advertisements
Similar presentations
1 Lecture 3: MIPS Instruction Set Today’s topic:  More MIPS instructions  Procedure call/return Reminder: Assignment 1 is on the class web-page (due.
Advertisements

Lecture 5: MIPS Instruction Set
ARITHMETIC LOGIC SHIFT UNIT
CS1104 – Computer Organization PART 2: Computer Architecture Lecture 5 MIPS ISA & Assembly Language Programming.
LC-3 Computer LC-3 Instructions
LC-3 Instruction Set Architecture (Textbook’s Chapter 5)
Choice for the rest of the semester New Plan –assembler and machine language –Operating systems Process scheduling Memory management File system Optimization.
Chapters 5 - The LC-3 LC-3 Computer Architecture Memory Map
Pentium Addressing Modes
CS 300 – Lecture 6 Intro to Computer Architecture / Assembly Language Instructions.
1 Programmer’s View of the EAGLE R0 R1 R7 Register file IR PC CPU :::::: Main memory :
Chapter 4 The Von Neumann Model
Microprocessor Dr. Rabie A. Ramadan Al-Azhar University Lecture 7.
1. 2 Instructions: Words of the language understood by CPU Instruction set: CPU’s vocabulary Instruction Set Architecture (ISA): CPU’s vocabulary together.
Chapter 10 The Assembly Process. What Assemblers Do Translates assembly language into machine code. Assigns addresses to all symbolic labels (variables.
Chapter 5 The LC Instruction Set Architecture ISA = All of the programmer-visible components and operations of the computer memory organization.
The LC-3. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 5-2 Instruction Set Architecture ISA = All of the.
How Computers Work Lecture 3 Page 1 How Computers Work Lecture 3 A Direct Execution RISC Processor: The Unpipelined BETA.
Jump (op-code= 20) unconditional jump Forms allowed by the assembler: jump [ra + constant] jump [ra + variable] jump [ra + address] jump [ra + label] For.
Block diagram of a Microcoded Control unit
Instruction Execution (Load and Store instructions)
Execution time Execution Time (processor-related) = IC x CPI x T
A Uni-bus Data Path Implementation for the SRC
COMPUTER ARCHITECTURE & OPERATIONS I
Structural RTL for the br and brl instructions
Lecture 4: MIPS Instruction Set
ELEN 468 Advanced Logic Design
Introduction to 8085 Instructions
Computer Science 210 Computer Organization
Instruction Execution (Load and Store instructions)
External CPU Bus Activity
Overview Introduction General Register Organization Stack Organization
Decode and Operand Read
Computer Science 210 Computer Organization
Chapter 5 The LC-3.
Computer Architecture
The LC-3 Instruction Set Architecture Data Movement instructions
Chapter 2: Machines, Machine Languages, and Digital Logic
Falcon-E : Introduction
LC-3 Details and Examples
Computer Science 210 Computer Organization
Chapter 5 The LC-3.
Computer Architecture & Operations I
The University of Adelaide, School of Computer Science
Introduction to Computer Engineering
Chapter 8 Central Processing Unit
Data Transfers To be able to implement
SRC Exception Processing Mechanism
Instruction encoding We’ve already seen some important aspects of processor design. A datapath contains an ALU, registers and memory. Programmers and compilers.
Computer Architecture and the Fetch-Execute Cycle
Instruction encoding The ISA defines Format = Encoding
Fields in the FALCON-A Instruction
Programmer’s View of the EAGLE
Computer Science 210 Computer Organization
MIPS Assembly.
Classification of instructions
Chapter 4 The Von Neumann Model
Instruction encoding The ISA defines Format = Encoding
Instruction encoding The ISA defines Format = Encoding
Instruction encoding The ISA defines Format = Encoding
Execution time Execution Time (processor-related) = IC x CPI x T
RTL for the SRC pipeline registers
Central Processing Unit.
Reverse Assembly Typical problem:
Example 1: (expression evaluation)
CS501 Advanced Computer Architecture
Reverse Assembly Typical problem:
Problem: Consider the following two SRC code segments for implementing multiplication. Find which one is more efficient in terms of instruction count and.
7/6/
9/13/
Presentation transcript:

SRC: instruction formats Op-coderarb rc c Type D Op-code Type Aunused Op-codera Type Bc1 21 Op-coderarb Type C c2

CS501 Advanced Computer Architecture Lecture04 Dr.Noor Muhammad Sheikh

Encoding for the GPRs to be used in place of ra, rb, or rc RegisterCodeRegisterCodeRegisterCodeRegisterCode R000000R801000R R R100001R901001R R R200010R R R R300011R R R R400100R R R R500101R R R R600110R R R R700111R R R Notes: simple 5-bit encoding as shown above; ra, rb, rc are names of fields, used as “place-holders”, and can represent any one of these 32 registers. Except: rb =0 does not mean R0; explained later

Type A Op-code unused  Only two instructions  nop (op-code = 0) useful in pipelining  stop (op-code = 31)  Both are 0-operand

 three instructions; all three use relative addressing mode  ldr (op-code = 2 ) load register from memory using relative address ldr R3, 56R[3] M[PC+56]  lar (op-code = 6 ) load register with relative address lar R3, 56R[3] PC+56  str (op-code = 4) store register to memory using relative address str R8, 34M[PC+34] R[8]  the effective address is computed at run-time by adding a constant to the PC  makes the instructions relocatable Type B Op-codera c1 21 Note: R8 is register name and R[8] means contents of register R8

Type C Op-coderarb c2  three load/store instructions, plus three ALU instructions  ld (op-code = 1 ) load register from memory ld R3, 56 R[3] M[56] (rb field = 0) ld R3, 56(R5)R[3] M[56+R[5]] (rb field ≠ 0)  la (op-code = 5 ) load register with displacement address la R3, 56R[3] 56 la R3, 56(R5)R[3] 56+R[5]  st (op-code = 3 ) store register to memory st R8, 34M[34]R[8] st R8, 34(R6)M[34+R[6]] R[8] direct addressing mode Indexed addressing mode Immediate addressing mode Indexed addressing mode direct addressing mode

Type C (continued…) Op-coderarb c2  ….and the three ALU instructions  addi (op-code = 13) immediate 2’s complement addition addi R3, R4, 56 R[3] R[4]+56 (rb field = R4)  andi (op-code = 21) immediate logical AND andi R3, R4, 56R[3] R[4]&56  ori (op-code = 23) immediate logical OR ori R3, R4, 56R[3] R[4]~56 Note special symbol used for AND If the constant is negative, this becomes a subtract instruction register addressing mode

Type C (modified form) Op-coderarb unused  ….(additional) four shift instructions  shr (op-code = 26) shift right by using value in (5-bit) c3 field shr R3, R4, 7 shift R4 right 7 times in to R3  shra (op-code = 27) Arithmetic shift right by using value in c3 field shra R3, R4, 7Ashift R4 right 7 times in to R3  shl (op-code = 28) shift left by using value in (5-bit) c3 field shl R8, R5, 6shift R5 left 6 times in to R8  shc (op-code = 29) shift left? circular by using value in c3 field shc R3, R4, 3shift R4 circular 3 times in to R3 Note: If count field contains 0, then these instructions will use the modified Type D format 4 count All use immediate addressing mode

Type D  four ALU instructions, plus others explained on following slides  add (op-code = 12) 2’s C register addition add R3, R5, R6 R[3] R[5] + R[6]  sub (op-code = 14) 2’s C register subtraction sub R3, R5, R6R[3] R[5] - R[6]  and (op-code = 20) logical AND operation between registers and R8, R3, R4R[8] R[3] & R[4]  or (op-code = 22) logical OR operation between registers or R8, R3, R4R[8] R[3] ~ R[4] register addressing mode Op-coderarb rc unused

Type D (modified form)  … four register based shift instructions, plus…  shr (op-code = 26) shift right by using value in register rc shr R3, R4, R5 shift R4 right in to R3 using number in R5  shra (op-code = 27) Arithmetic shift right by using register rc shra R3, R4, R5 Shift R4 right as above  shl (op-code = 28) shift left by using register rc shl R8, R5, R6 shift R5 left in to R8 using number in R6  shc (op-code = 29) shift circular by using register rc shc R3, R4, R6 shift R4 circular in to R3 using value in R6 Op-coderarb rc unused All use the register addressing mode

Type D (modified forms for branch instr )  … plus two branch instructions  br (op-code = 8) branch to address in rb depending on condition in rc (five possible conditions) brzr R3, R4 branch to address in R3 (if R4 == 0) brnz R3, R4 branch to address in R3 (if R4 ≠ 0) brpl R3, R4 branch to address in R3 (if R4 ≥ 0) brmi R3, R4 branch to address in R3 (if R4 < 0) br R3 branch to address in R3 (unconditional) Op-codeunusedrb rc unused cond

Type D (modified forms for branch instr )  brl (op-code = 9) branch to address in rb depending on condition in rc. Additionally, copy the PC in to ra before branching Op-coderarb rc unused cond Branch and link examples Function brlzr R1,R3, R4R[1] PC, then branch to address in R3 (if R4 == 0) brlnz R1,R3, R4R[1] PC, then branch to address in R3 (if R4 ≠ 0) brlpl R1,R3, R4R[1] PC, then branch to address in R3 (if R4≥ 0) brlmi R1,R3, R4R[1] PC, then branch to address in R3 (if R4 < 0) brl R1,R3R[1] PC, then ALWAYS branch to address in R3 brlnv R1R[1] PC, NEVER BRANCH

Condition Codes Op-codeunusedrb rc unused cond Mnemonicc3<2..0> Branch Condition brlnv000Link but never branch* br, brl001Unconditional branch brzr, brlzr010Branch if rc is zero brnz, brlnz011Branch if rc is not zero brpl, brlpl100Branch if rc is positive brmi, brlmi101Branch if rc is negative * “Branch never” i.e., brnv, does not exist

9301minus Table 2.6, page 58, text