CS170 Computer Organization and Architecture I

Slides:



Advertisements
Similar presentations
Henk Corporaal TUEindhoven 2011
Advertisements

Lecture 13: 10/8/2002CS170 Fall CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University.
1 Lecture 3: Instruction Set Architecture ISA types, register usage, memory addressing, endian and alignment, quantitative evaluation.
EECC551 - Shaaban #1 Lec # 2 Fall Instruction Set Architecture (ISA) “... the attributes of a [computing] system as seen by the programmer,
CS1104 – Computer Organization PART 2: Computer Architecture Lecture 5 MIPS ISA & Assembly Language Programming.
Chapter 2 Instructions: Language of the Computer
1 Instructions: Language of the Machine More primitive than higher level languages e.g., no sophisticated control flow Very restrictive e.g., MIPS Arithmetic.
S. Barua – CPSC 440 CHAPTER 2 INSTRUCTIONS: LANGUAGE OF THE COMPUTER Goals – To get familiar with.
Lecture 5 Sept 14 Goals: Chapter 2 continued MIPS assembly language instruction formats translating c into MIPS - examples.
1  1998 Morgan Kaufmann Publishers Chapter 3 Text in blue is by N. Guydosh Updated 1/27/04 Instructions: Language of the Machine.
©UCB CPSC 161 Lecture 5 Prof. L.N. Bhuyan
1  2004 Morgan Kaufmann Publishers Instructions: bne $t4,$t5,Label Next instruction is at Label if $t4≠$t5 beq $t4,$t5,Label Next instruction is at Label.
1  1998 Morgan Kaufmann Publishers Machine Instructions: Language of the Machine Lowest level of programming, control directly the hardware Assembly instructions.
April 23, 2001Systems Architecture I1 Systems Architecture I (CS ) Lecture 9: Assemblers, Linkers, and Loaders * Jeremy R. Johnson Mon. April 23,
Oct. 25, 2000Systems Architecture I1 Systems Architecture I (CS ) Lecture 9: Alternative Instruction Sets * Jeremy R. Johnson Wed. Oct. 25, 2000.
Small constants are used quite frequently (50% of operands) e.g., A = A + 5; B = B + 1; C = C - 18; Solutions? Why not? put 'typical constants' in memory.
 1998 Morgan Kaufmann Publishers MIPS arithmetic All instructions have 3 operands Operand order is fixed (destination first) Example: C code: A = B +
Chapter 2 CSF 2009 The MIPS Assembly Language. Stored Program Computers Instructions represented in binary, just like data Instructions and data stored.
EEL5708/Bölöni Lec 8.1 9/19/03 September, 2003 Lotzi Bölöni Fall 2003 EEL 5708 High Performance Computer Architecture Lecture 5 Intel 80x86.
Computer Organization CS224 Fall 2012 Lessons 7 and 8.
Chapter 2 — Instructions: Language of the Computer — 1 Memory Operands Main memory used for composite data – Arrays, structures, dynamic data To apply.
DR. SIMING LIU SPRING 2016 COMPUTER SCIENCE AND ENGINEERING UNIVERSITY OF NEVADA, RENO Session 7, 8 Instruction Set Architecture.
Computer Organization Instructions Language of The Computer (MIPS) 2.
Instruction Set Architecture Chapter 3 – P & H. Introduction Instruction set architecture interface between programmer and CPU Good ISA makes program.
Lecture 16: 10/29/2002CS170 Fall CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University.
1  1998 Morgan Kaufmann Publishers Instructions: Language of the Machine More primitive than higher level languages e.g., no sophisticated control flow.
Lecture 17: 10/31/2002CS170 Fall CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University.
1/11/02CSE ISA's part 2 Instruction Set Architectures Part 2 I/O systemInstr. Set Proc. Compiler Operating System Application Digital Design Circuit.
Computer Architecture & Operations I
Computer Architecture & Operations I
Overview of Instruction Set Architectures
How objects are located in memory
MIPS Instruction Set Advantages
Part of the Assembler Language Programmers Toolbox
CS2100 Computer Organisation
A Closer Look at Instruction Set Architectures
Instruction Set Architecture
Chapter 4 The Von Neumann Model
ELEN 468 Advanced Logic Design
Microcomputer Programming
William Stallings Computer Organization and Architecture 8th Edition
The University of Adelaide, School of Computer Science
Computer Architecture (CS 207 D) Instruction Set Architecture ISA
CS170 Computer Organization and Architecture I
Instructions - Type and Format
Systems Architecture I (CS ) Lecture 5: MIPS Instruction Set*
CS149D Elements of Computer Science
Henk Corporaal TUEindhoven 2010
CSCE Fall 2013 Prof. Jennifer L. Welch.
The University of Adelaide, School of Computer Science
September 24 Test 1 review More programming
The Processor Lecture 3.1: Introduction & Logic Design Conventions
Part II Instruction-Set Architecture
Computer Instructions
Computer Architecture
CSCE Fall 2012 Prof. Jennifer L. Welch.
3.
COMS 361 Computer Organization
COMS 361 Computer Organization
Introduction to Microprocessor Programming
Arrays versus Pointers
Instruction Set Principles
COMS 361 Computer Organization
Machine Instructions.
CPU Structure CPU must:
Systems Architecture I (CS ) Lecture 5: MIPS Instruction Set*
9/27: Lecture Topics Memory Data transfer instructions
Instruction Set Architecture
Computer Organization
Chapter 4 The Von Neumann Model
Presentation transcript:

CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University Lecture 21: 11/14/2002 Lecture 21: 11/14/2002 CS170 Fall 2002

Outline A look at other instruction sets PowerPC Intel 80x86 Fallacies and Pitfalls Chapter 3 conclusion Lecture 21: 11/14/2002 CS170 Fall 2002

Power PC1/3 Another RISC example (made by IBM and Motorola, and used in Apple Macintosh) 32 integer registers, instructions 32 bits long Two more addressing modes Indexed addressing Allow 2 registers to be added together, similar to base address and offset (array index) add $t0, $a0, $s3  lw $t1,$a0+$s3 lw $t1, 0($t0) Update addressing Automatically increment the base register to point to next word each time data is transferred lw $t0,4($s3)  lwu $t0,4($s3) addi $s3,$s3,4 Lecture 21: 11/14/2002 CS170 Fall 2002

Power PC2/3 Lecture 21: 11/14/2002 CS170 Fall 2002

Power PC3/3 Load multiple and store multiple Transfer up to 32 words of data in a single instruction Special counter register, separate from the other 32 registers, to try to improve performance of a for loop In MIPS Loop: addi $t0,$t0,-1 #$t0 = $t0-1 bne $t0,$zero,Loop # if $t0 != 0 go to Loop In Power PC bc Loop,ctr != 0 # $ctr = $ctr-1; # if $ctr != 0 go to Loop Lecture 21: 11/14/2002 CS170 Fall 2002

Intel 80x861/7 1978 Intel 8086 (assembly language extension to 8080 (8-bit)) 16 bit architecture, all internal registers 16 bits. Dedicated uses not considered general-purpose register architecture 1980 Intel 8087 (floating-point coprocessor) (relies on a stack and not registers) 1982 80286 (address space 24 bits) 1985 80386 (32-bits architecture, 32-bits registers, 32-bits address space) 1989-1995 80486, Pentium, and Pentium Pro 1997 MMX architecture, uses floating-point stack to accelerate multimedia and communication applications. Pentium II Pentium III Pentium 4 (2.8 GHz Aug. 2002) Lecture 21: 11/14/2002 CS170 Fall 2002

Intel 80x862/7 80386 register set Lecture 21: 11/14/2002 CS170 Fall 2002

Intel 80x863/7 Instruction types for arithmetic, logical, and data transfer instructions (two-operand instructions) Source/Destination operand Second source operand Register Register Register Immediate Register Memory Memory Register Memory Immediate Must have one operand that acts as both source/destination (MIPS allows separate registers for source and destination) One of the operands can be in memory but not both Lecture 21: 11/14/2002 CS170 Fall 2002

Intel 80x864/7 Addressing Modes Mode Description MIPS equivalent Register Indirect Address is in a register lw $s0,0($s1) Based mode with 8 or 32-bit displacement Address is contents of base register plus displacement lw $s0,100($s1) (16-bit displacement) Base plus scaled Index Address is Base + (2scale * index) Where scale can be 0, 1, 2, or 3 scale = 0, address not scaled Scale =1, 16-bit data mul $t0,$s2,4 add $t0,$t0,$s1 lw $s0,0($t0) (scale = 2) Base plus scaled Index with 8 or 32-bit displacement Address is Base + (2scale*index) +displacement lw $s0,100($t0) Lecture 21: 11/14/2002 CS170 Fall 2002

Intel 80x865/7 Integer Operations 8086 support for both 8-bit and 16-bit data types (word) 80386 32-bits addresses and data (double words) Every operation works on both 8-bit data and on one longer data size (16 or 32-bits) Four major classes Data movement instructions (move, push, and pop) Arithmetic and Logic Instructions Control Flow (conditional branches, unconditional jumps, calls, and returns) Conditional branches are based on condition codes (flags) set as a side effect of operation, most are used to compare the value of a result to zero. For argument: occur as part of normal operations and are faster to test than to compare registers in MIPS (beq and bne) Against argument: compare to zero extends operation time, and programmer has to use compare instructions to test a value that is not the result of an operation String instructions (string move and compare) Lecture 21: 11/14/2002 CS170 Fall 2002

Intel 80x866/7 Typical 80x86 instructions In addition, see figure 3.33 Lecture 21: 11/14/2002 CS170 Fall 2002

Intel 80x867/7 Instruction Encoding Instructions vary from 1 to 17 bytes in length Opcode byte usually contains a bit saying whether the operand is 8 or 32 bits (1-bit w) 1-bit d direction of move from or to memory For some instructions, the opcode may include the addressing mode and the register. Some instructions use a post-byte (extra opcode byte) which contains the addressing mode information Lecture 21: 11/14/2002 CS170 Fall 2002

Fallacies and Pitfalls More powerful instructions mean higher performance One feature in 80x86 allows to repeat the following instruction until a counter counts down to zero First method: move data in memory (32-bit memory to memory moves) performed on 133-MHz Pentium can move data at about 40 MB/sec Standard method: load data into registers and then store registers back to memory (code replicated to reduce loop overhead) copies at about 60 MB/sec (1.5 times faster) Another method: use large floating-point registers on 80x86 instead of integer registers copies at about 80 MB/sec (2 times faster) Write in assembly language to obtain the higher performance Compilers in some cases can do a better job generating an optimized code than a human programmer writing an assembly language program Forgetting that sequential word addresses in machines with byte addressing do not differ by one byte. Lecture 21: 11/14/2002 CS170 Fall 2002

Ch. 3 Conclusion In designing an ISA, we need to strike a balance between Number of instructions needed to execute a program The number of clock cycles needed to execute a program The clock speed Four design principles to achieve that balance Simplicity favors regularity Smaller is faster Good design demands good compromises Make the common case fast MIPS instructions covered (See Figure 3.37) MIPS instruction classes and correspondence to high-level language constructs, and percentage of instruction classes executed for two programs (See Figure 3.38) Lecture 21: 11/14/2002 CS170 Fall 2002