Computer Architecture CSE 3322 Lecture 2 NO CLASS MON Sept 1 Course WEB SITE crystal.uta.edu/~jpatters
Computer Generations Overview GenerationTechnologyPrinciple Product Adj Price/ Perfomance RelaysResearch Model NA
Computer Generations Overview GenerationTechnologyPrinciple Product Adj Price/ Perfomance RelaysResearch Model NA Vacuum Tubes Mag Core Commercial Monsters 1 (UNIVAC )
Computer Generations Overview GenerationTechnologyPrinciple Product Adj Price/ Perfomance RelaysResearch Model NA Vacuum Tubes Mag Core Commercial Monsters 1 (UNIVAC ) Transistors Mag Core Most Large Corp/Univ 318
Computer Generations Overview GenerationTechnologyPrinciple Product Adj Price/ Perfomance RelaysResearch Model NA Vacuum Tubes Mag Core Commercial Monsters 1 (UNIVAC ) Transistors Mag Core Most Large Corp/Univ Integrated Circuits DRAM Minicomputer 13K
Computer Generations Overview GenerationTechnologyPrinciple Product Adj Price/ Perfomance RelaysResearch Model NA Vacuum Tubes Mag Core Commercial Monsters 1 (UNIVAC ) Transistors Mag Core Most Large Corp/Univ Integrated Circuits DRAM Minicomputer 13K VLSI DRAM Personal Computer 239M
Technological Growth DRAM Growth: 4X Capacity Every 3 Years
Technological Growth DRAM Growth: 4X Capacity Every 3 Years Workstation Performance Improvement: 54% per year or 2X every18 months
Technological Growth DRAM Growth: 4X Capacity Every 3 Years Workstation Performance Improvement: 54% per year or 2X every18 months Disk Drive Growth: Capacity More than 2x every year
Technological Growth DRAM Growth: 4X Capacity Every 3 Years Workstation Performance Improvement: 54% per year or 2X every18 months Disk Drive Growth: Capacity More than 2x every year All Continue to Drive Price /Performance Improvements
· Click The Picture To Share It With Your Friends ·
Five Components of Computers Input Output Memory Control Datapath Processor
Instruction Set Design Key Element in the Architecture –Function, Cost, Performance, etc.
Instruction Set Design Key Element in the Architecture –Function, Cost, Performance, etc. Typical Machine Instructions –Data Transfers ( reg-reg, reg-mem, mem-reg) –Arithmetic (add, subtract, multiply) –Logic & String (boolean, bit manipulations) –Program Control ( branches, jumps) –Input/Output Operations
Instruction Set Design Study the MIPS Architecture
Instruction Set Design Study the MIPS Architecture A WORD is 32 bits or 4 bytes wide for Registers and Memory
Instruction Set Design Study the MIPS Architecture A WORD is 32 bits or 4 bytes wide for Registers and Memory Each byte has Memory Address starting at 0
Instruction Set Design Study the MIPS Architecture A WORD is 32 bits or 4 bytes wide for Registers and Memory Each byte has Memory Address starting at 0 WORD Addresses start at 0 and are multiples of 4
Instruction Set Design Study the MIPS Architecture A WORD is 32 bits or 4 bytes wide for Registers and Memory Each byte has Memory Address starting at 0 WORD Addresses start at 0 and are multiples of 4 Big-endian Byte 0, Byte 1, Byte 2, Byte 3 Little-endian Byte 3, Byte 2, Byte 1, Byte 0
Instruction Set Design Study the MIPS Architecture A WORD is 32 bits or 4 bytes wide for Registers and Memory Each byte has Memory Address starting at 0 WORD Addresses start at 0 and are multiples of 4 Big-endian Byte 0, Byte 1, Byte 2, Byte 3 Little-endian Byte 3, Byte 2, Byte 1, Byte 0 32 Registers with Conventions on Use
b3 b2 b1 b0 b7 b6 b5 b4 b11 b10 b9 b8 bM Memory Registers N bits
MIPS Assembly Instructions Instruction Example Meaning add add $s1, $s2, $s3 $s1 = $s2 + $s3 subtract sub $s1, $s2, $s3 $s1 = $s2 - $s3 $s1, $s2, $s3, … are registers. The $ indicates a Register in the MIPS Assembly Language
MIPS Assembly Instructions Instruction Example Meaning add add $s1, $s2, $s3 $s1 = $s2 + $s3 subtract sub $s1, $s2, $s3 $s1 = $s2 - $s3 $s1, $s2, $s3, … are registers. The $ indicates a Register in the MIPS Assembly Language Also $s2 + $s3 $s1
Machine Instruction Format Instr Format op rs rt rd shamt funct add R 0 reg reg reg 0 32 sub R 0 reg reg reg 0 34 bits R Type Instruction op : opcode rd : register destination operand rs : reg source 1 operand shamt : shift amount rt : reg source 2 operand funct : function code – variant of operation
Machine Instruction Format Instr Format op rs rt rd shamt funct add R bits add $t0, $s2, $t0 where $t0 is reg 8, $s2 is reg 18 $t0 = $s2 + $t0
Machine Instruction Format Instr Format op rs rt rd shamt funct add R bits Example of Machine Language Instruction op rs rt rd shamt funct add $t0, $s2, $t0 where $t0 is reg 8, $s2 is reg 18 $t0 = $s2 + $t0
MIPS Assembly Instructions Instruction Example Meaning load word lw $s1, 300 ($s2) $s1 = Mem[$s2+300] store word sw $s1, 300 ($s2) Mem[$s2+300] = $s1 $s1, $s2, $s3, … are registers 300 is a constant
Machine Instruction Format Instr Format op rs rt address/ immediate lw I 35 reg reg constant sw I 43 reg reg constant bits I Type Instruction op : opcode rs : reg address operand rt : reg destination or source operand lw $s1, 300 ($s2)
C statement: A[i] = h + A[i] A[i] & h are integers where A is an array with base in $s3 h is in $s1 i is in $s2
A[i] A[3] A[2] A[1] A[0] Base + 4 * i Base + 12 Base + 8 Base + 4 Base Words in an Array in memory are 4 bytes apart, so the Address increments by 4. C statement: A[i] = h + A[i], A[i] & h are integers where A is an array with base in $s3 h is in $s1 i is in $s2
Compiles into assembly code: # denotes comments C statement: A[i] = h + A[i] where A is an array with base in $s3 h is in $s1 i is in $s2
Compiles into assembly code: # denotes comments # Compute Address of A[i]: Base + 4*i C statement: A[i] = h + A[i] where A is an array with base in $s3 h is in $s1 i is in $s2
Compiles into assembly code: # Compute Address of A[i ]: Base + 4*i add $t1, $s2, $s2 # Temp reg $t1 = i + i =2i add $t1, $t1, $t1 # Temp reg $t1 = 2i +2i = 4i C statement: A[i] = h + A[i] where A is an array with base in $s3 h is in $s1 i is in $s2
Compiles into assembly code: # Compute Address of A[i ]: Base + 4*i add $t1, $s2, $s2 # Temp reg $t1 = i + i =2i add $t1, $t1, $t1 # Temp reg $t1 = 2i +2i = 4i add $t1, $t1, $s3# $t1 = address of A[i] C statement: A[i] = h + A[i] where A is an array with base in $s3 h is in $s1 i is in $s2
Compiles into assembly code: # Compute Address of A[i ]: Base + 4*i add $t1, $s2, $s2 # Temp reg $t1 = i + i =2i add $t1, $t1, $t1 # Temp reg $t1 = 2i +2i = 4i add $t1, $t1, $s3# $t1 = address of A[i] # Compute the new A[i] lw $t2, 0($t1)# Temp reg $t2 = A[i] C statement: A[i] = h + A[i] where A is an array with base in $s3 h is in $s1 i is in $s2
Compiles into assembly code: # Compute Address of A[i] : Base + 4*i add $t1, $s2, $s2 # Temp reg $t1 = i + i =2i add $t1, $t1, $t1 # Temp reg $t1 = 2i +2i = 4i add $t1, $t1, $s3# $t1 = address of A[i] # Compute the new A[i] lw $t2, 0($t1)# Temp reg $t2 = A[i] add $t2, $t2, $s1# $t2 = A[i] + h C statement: A[i] = h + A[i] where A is an array with base in $s3 h is in $s1 i is in $s2
Compiles into assembly code: # Compute Address of A[i] : Base + 4*i add $t1, $s2, $s2 # Temp reg $t1 = i + i =2i add $t1, $t1, $t1 # Temp reg $t1 = 2i +2i = 4i add $t1, $t1, $s3# $t1 = address of A[i] # Compute the new A[i] lw $t2, 0($t1)# Temp reg $t2 = A[i] add $t2, $t2, $s1# $t2 = A[i] + h sw $t2, 0($t1)# Store $t2 into A[i] C statement: A[i] = h + A[i] where A is an array with base in $s3 h is in $s1 i is in $s2
lw $t2, 0($t1)# Temp reg $t2 = A[i] add $t2, $t2, $s1# $t2 = A[i] + h sw $t2, 0($t1)# Store $t2 into A[i] $s1~17, $t1~9, $t2~10 Translate to MIPS Machine language using decimal op rs rt rd address/shamt funct
lw $t2, 0($t1)# Temp reg $t2 = A[i] add $t2, $t2, $s1# $t2 = A[i] + h sw $t2, 0($t1)# Store $t2 into A[i] $s1~17, $t1~9, $t2~10 Translate to MIPS Machine language using decimal op rs rt rd address/shamt funct 35
lw $t2, 0($t1)# Temp reg $t2 = A[i] add $t2, $t2, $s1# $t2 = A[i] + h sw $t2, 0($t1)# Store $t2 into A[i] $s1~17, $t1~9, $t2~10 Translate to MIPS Machine language using decimal op rs rt rd address/shamt funct
lw $t2, 0($t1)# Temp reg $t2 = A[i] add $t2, $t2, $s1# $t2 = A[i] + h sw $t2, 0($t1)# Store $t2 into A[i] $s1~17, $t1~9, $t2~10 Translate to MIPS Machine language using decimal op rs rt rd address/shamt funct
lw $t2, 0($t1)# Temp reg $t2 = A[i] add $t2, $t2, $s1# $t2 = A[i] + h sw $t2, 0($t1)# Store $t2 into A[i] $s1~17, $t1~9, $t2~10 Translate to MIPS Machine language using decimal op rs rt rd address/shamt funct
lw $t2, 0($t1)# Temp reg $t2 = A[i] add $t2, $t2, $s1# $t2 = A[i] + h sw $t2, 0($t1)# Store $t2 into A[i] $s1~17, $t1~9, $t2~10 Translate to MIPS Machine language using decimal op rs rt rd address/shamt funct Translate to MIPS Machine language using binary
lw $t2, 0($t1)# Temp reg $t2 = A[i] add $t2, $t2, $s1# $t2 = A[i] + h sw $t2, 0($t1)# Store $t2 into A[i] $s1~17, $t1~9, $t2~10 Translate to MIPS Machine language using decimal op rs rt rd address/shamt funct Translate to MIPS Machine language using binary
lw $t2, 0($t1)# Temp reg $t2 = A[i] add $t2, $t2, $s1# $t2 = A[i] + h sw $t2, 0($t1)# Store $t2 into A[i] $s1~17, $t1~9, $t2~10 Translate to MIPS Machine language using decimal op rs rt rd address/shamt funct Translate to MIPS Machine language using binary
Two Key Principles Instructions are represented the same as numbers Programs are stored in memory to be read or written just like numbers
Two Key Principles Instructions are represented as numbers Programs are stored in memory to be read or written just like numbers This is the Stored Program Concept –Programs can operate on other programs!