CS501 Advanced Computer Architecture

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
CS1104 – Computer Organization PART 2: Computer Architecture Lecture 5 MIPS ISA & Assembly Language Programming.
ELEN 468 Advanced Logic Design
Instruction Set Architecture
Instruction Set Architecture & Design
Computer Architecture CPSC 321 E. J. Kim. Overview Logical Instructions Shifts.
9-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL x86 Instructions Part.
Number One Tom Bozic Ian Nuber Greg Ramsey Henry Romero Matt Unangst.
Lecture 5 Sept 14 Goals: Chapter 2 continued MIPS assembly language instruction formats translating c into MIPS - examples.
Parul Polytechnic Institute Parul Polytechnic Institute Subject Code : Name Of Subject : Microprocessor and assembly language programming Name.
Programming Models CT213 – Computing Systems Organization.
Instruction Set Design by Kip R. Irvine (c) Kip Irvine, All rights reserved. You may modify and copy this slide show for your personal use,
1 Programmer’s View of the EAGLE R0 R1 R7 Register file IR PC CPU :::::: Main memory :
Machine Instruction Characteristics
Microprocessor Dr. Rabie A. Ramadan Al-Azhar University Lecture 7.
A summary of TOY. 4 Main Components Data Processor Control Processor Memory Input/Output Device.
EET 4250 Instruction Representation & Formats Acknowledgements: Some slides and lecture notes for this course adapted from Prof. Mary Jane Penn.
Jump (op-code= 20) unconditional jump Forms allowed by the assembler: jump [ra + constant] jump [ra + variable] jump [ra + address] jump [ra + label] For.
CS Computer Organization Numbers and Instructions Dr. Stephen P. Carl.
8 085Microprocessor Temp Reg (8) Accumulator (A reg) Flag flip flops(8) Instruction Register (8) Arithmetic Logic Unit ALU Instruction Decoder and Machine.
SRC: instruction formats Op-coderarb rc c Type D Op-code Type Aunused Op-codera Type Bc1 21 Op-coderarb.
F453 Module 8: Low Level Languages 8.2: Features of Low-Level Languages.
Computer Architecture. Instruction Set “The collection of different instructions that the processor can execute it”. Usually represented by assembly codes,
Signal Name Direction w.r.t. Printer Function Summary Pin# (25-DB) CPU
Data Transfers, Addressing, and Arithmetic
Control Unit Lecture 6.
Assembly Language Programming of 8085
Microprocessor T. Y. B. Sc..
COMPUTER ARCHITECTURE & OPERATIONS I
Structural RTL for the br and brl instructions
Assembly Language Assembly Language
Lecture 4: MIPS Instruction Set
ELEN 468 Advanced Logic Design
Lecture Set 5 The 8051 Instruction Set.
Introduction to 8085 Instructions
RISC Concepts, MIPS ISA Logic Design Tutorial 8.
Prof. Sirer CS 316 Cornell University
Assembly Language Programming Part 2
Decode and Operand Read
The University of Adelaide, School of Computer Science
INDEX UNIT-III PPT SLIDES
Data Processing Instructions
BASIC COMPUTER ORGANIZATION AND DESIGN
Falcon-E : Introduction
BIC 10503: COMPUTER ARCHITECTURE
Computer Architecture & Operations I
The University of Adelaide, School of Computer Science
ECE232: Hardware Organization and Design
Data Transfers To be able to implement
Instruction encoding We’ve already seen some important aspects of processor design. A datapath contains an ALU, registers and memory. Programmers and compilers.
Instruction encoding The ISA defines Format = Encoding
Fields in the FALCON-A Instruction
Programmer’s View of the EAGLE
Classification of instructions
Prof. Sirer CS 316 Cornell University
UCSD ECE 111 Prof. Farinaz Koushanfar Fall 2018
Instruction encoding We’ve already seen some important aspects of processor design. A datapath contains an ALU, registers and memory. Programmers and compilers.
Instruction Set Principles
Overheads for Computers as Components 2nd ed.
MIPS Assembly.
RTL for the SRC pipeline registers
CNET 315 Microprocessor & Assembly Language
Example 1: (expression evaluation)
Reverse Assembly Typical problem:
COMPUTER ORGANIZATION AND ARCHITECTURE
Computer Architecture Assembly Language
7/6/
Lecture 1: SIC Architecture
UNIT – III Microprogrammed Control
Presentation transcript:

CS501 Advanced Computer Architecture Lecture08 Dr.Noor Muhammad Sheikh

Review

FALCON-A Instruction formats Type I 15 Op-code unused 11 10 15 11 10 8 7 Type II Op-code ra c2 15 11 10 8 7 5 4 Type III Op-code ra rb c1 15 11 10 8 7 5 4 2 1 Type IV Op-code ra rb rc unused

Encoding for the GPRs to be used in place of ra, rb, or rc Registers Code R0 000*** R1 001 R2 010 R3 011 R4 100 R5 101 R6 110 R7 111

Type I five instructions 15 Op-code unused 11 10 five instructions nop (op-code = 21) may be useful in pipelining reset (op-code = 30 ) halt (op-code = 31) int (op-code = 26) iret (op-code= 27) All are 0-operand

Type II movi (op-code = 7 ) load register with a constant ra 8 10 11 15 c2 7 movi (op-code = 7 ) load register with a constant movi R3, 56 R[3] ← 56 in (op-code = 24) load register from input device in R3, 57 R[3] ← IO[57] out (op-code = 25) move from register to output device out R7, 34 IO[34] ← R[7] ret (op-code=23) return from subroutine using register ret R3 PC ← R[3]

Type II jz (op-code= 19) jump if zero ra 8 10 11 15 c2 7 jz (op-code= 19) jump if zero jz r3, [4] (R[3]=0): PC← PC+ 4; jnz (op-code= 18) jump if not zero jnz r4, [variable] (R[4]≠0): PC← PC+ variable; jpl (op-code= 16) jump if positive jpl r3, [label] (R[3]≥0): PC ← PC+ (label-PC); jmi (op-code= 17) jump if negative jmi r7, [address] (R[7]<0): PC← PC+ address;

Type II jump (op-code= 20) unconditional jump ra 8 10 11 15 c2 7 1. Constant, Variable, address or (label – PC) should be in the range -128 to + 127 2. IF jump [r0+a] is used, it means jump [a] 3. jump [-r2] is not allowed by the assembler 4. Target address should always be EVEN jump (op-code= 20) unconditional jump Forms allowed by the assembler: jump [ra + constant] jump [ra + variable] jump [ra + address] jump [ra + label] For all the above instructions: (ra=0):PC← PC+(8αC2<7>)©C2<7..0>, (ra≠0):PC← R[ra]+(8αC2<7>)©C2<7..0>; C2 is computed by sign extending the constant, variable, address, or (label –PC) Types of unconditional jumps possible: Direct Indirect PC relative (near) Register relative (far)

Type III andi (op-code = 9 ) and constant to register 15 11 10 8 7 5 4 Op-code ra rb c1 andi (op-code = 9 ) and constant to register andi r4, r3, 5 R[4] R[3] & 5 addi (op-code = 1 ) add constant to register addi r4, r3,4 R[4] R[3] + 4 subi (op-code = 3 ) subtract constant from register subi r5, r7, 9 R[5] R[7] - 9 ori (op-code= 11) or register with constant ori r4, r7, 3 R[4] R[7] ~ 3

Type III shiftl r4, r3, 7 shiftr r4, r3,9 15 11 10 8 7 5 4 Op-code ra rb c1 shiftl (op-code = 12 ) shift register left shiftl r4, r3, 7 shiftr (op-code = 13 ) shift register right shiftr r4, r3,9 asr (op-code = 15 ) arithmetic shift right asr r1, r2, 5 load (op-code= 29) load register from memory load r1, [r4 +15] R[1] M[R[4]+15] store (op-code= 28) store register to memory store r6, [r7+13] M[R[7]+13] R[6]

Type III Modified mov (op-code = 6 ) register to register ra rb 4 5 7 8 10 11 15 unused mov (op-code = 6 ) register to register mov r4, r3 R[4] R[3] not (op-code = 14 ) invert register not r4, r2 R[4] !R[2] call (op-code = 22 ) call subroutine call r4, r3 R[4] PC, PC R[3]

Type IV add (op-code = 0 ) add register to register ra rb rc unused 1 2 4 5 7 8 10 11 15 add (op-code = 0 ) add register to register and r4, r3, r5 R[4] R[3] +R[5] sub (op-code = 2 ) subtract reg from reg sub r4, r3, r5 R[4] R[3] – R[5] mul (op-code = 4 ) multiply mul r5, r7, r1 R[0] © R[5] ← R[5]*R[1] div (op-code= 5) divide div r4, r7, r2 R[4]←R[0] ©R[7]/R[2],R[0]←R[0] ©R[7]%R[2] and (op-code= 8) and register to register and r1, r4, r5 R[1] R[4] & R[5] or (op-code= 10) or register to register or r6, r7,r2 R[6] R[7] ~ R[2]

FUNCTIONAL GROUPS OF INSTRUCTIONS Control Instruction Mnemonic opcode No operation nop 10101 (21) call 10110 (22) return ret 10111 (23) interrupt int 11010 (26) Interrupt return iret 11011 (27) reset 11110 (30) halt 11111 (31)

FUNCTIONAL GROUPS OF INSTRUCTIONS Data Transfer Instructions Mnemonic opcode move mov 00110 (6) Move immediate movi 00111 (7) Input to register in 11000 (24) Output from register out 11001 (25) Load from memory load 11101 (29) Store into memory store 11100 (28)

FUNCTIONAL GROUPS OF INSTRUCTIONS jump instruction Mnemonic opcode jump if positive jpl 10000 (16) jump if negative jmi 10001 (17) jump if not zero jnz 10010 (18) jump if zero jz 10011 (19) jump 10100 (20)

FUNCTIONAL GROUPS OF INSTRUCTIONS Arithmetic instruction Mnemonic opcode Add add 00000 (0) Add immediate addi 00001 (1) Subtract sub 00010 (2) Subtract immediate subi 00011 (3) Multiply mul 00100 (4) Divide div 00101 (5)

FUNCTIONAL GROUPS OF INSTRUCTIONS Logic Instruction Mnemonic opcode And and 01000 (8) And immediate andi 01001 (9) Or or 01010 (10) Or immediate ori 01011 (11) Shift left shiftl 01100 (12) Shift right shiftr 01101 (13) Not not 01110 (14) Arithmetic shift right asr 01111 (15)

Example 1: Identify the types of following FALCON-A instructions and specify the values in the fields Instruction Type ra rb rc c1 c2 movi r1, 2 add r1,r2,r3 nop load r2,[r5 + 6] jz r0, [3]

Example 1: Identify the types of following FALCON-A instructions and specify the values in the fields Instruction Type ra rb rc c1 c2 movi r1, 2 II r1 - 2 add r1,r2,r3 IV r2 r3 nop I load r2,[r5 + 6] III r5 6 jz r0, [3] r0 3

Example 1: Identify the types of following FALCON-A instructions and specify the values in the fields Instruction Machine Code ra rb rc c1 c2 movi r1, 2 3902h r1 - 2 add r1,r2,r3 014Ch r2 r3 nop A800h load r2,[r5 + 6] EAA6h r5 6 jz r0, [3] 9803h r0 3

Example 2: Identify the addressing modes and RTL description (meaning) for the following FALCON-A instructions Instruction Addressing mode RTL description (meaning) load r2,[r4 + 8] jnz r1,[54] shiftl r1,r2,4 addi r3,r6,2 sub r1, r7,r2

Example 2: Identify the addressing modes and RTL description (meaning) for the following FALCON-A instructions Instruction Addressing mode RTL description (meaning) load r2,[r4 + 8] Displacement R[2] M[R[4]+8] jnz r1, [54] Relative (R[1]≠0): PC PC+54 shiftl r1,r2,4 Immediate Shift r2 left 4 times and store in r1 addi r3,r6,2 R[3] R[6]+2 sub r1, r7,r2 Register R[1] R[7]-R[2]

Example 3: Specify the condition for the branch instruction and the status of the PC after the branch instruction executes with a true branch condition Instruction Condition PC status jz r2,[35] jump [12] jnz r6, [3] jpl r1, [45] jmi r2, [20]

Example 3: Specify the condition for the branch instruction and the status of the PC after the branch instruction executes with a true branch condition Instruction Condition PC status jz r2,[35] If R[2]==0 PC PC+35 jump [12] always PC PC+12 jnz r6, [3] If R[6] ≠ 0 PC PC+3 jpl r1, [45] If R[1] ≥ 0 PC PC+45 jmi r2, [20] If R[2] < 0 PC PC+20

Example 4: Specify the binary encoding of the different fields in the following FALCON-A instructions. Instruction TYPE opcode ra rb rc C1(5 bits) OR C2(8 bits) store r4, [r1+8] sub r3,r6,r5 shiftr r4,r6,9 jump [10] halt

Example 4: Specify the binary encoding of the different fields in the following FALCON-A instructions. Instruction TYPE opcode ra rb rc C1(5 bits) OR C2(8 bits) store r4, [r1+8] III 11100 100 001 - 01000 sub r3,r6,r5 IV 00010 011 110 101 shiftr r4,r6,9 01101 01001 jump [10] II 10100 0000 1010 halt I 11111