Download presentation
Presentation is loading. Please wait.
Published byLucas Hill Modified over 9 years ago
1
CHAPTER 2 Instruction Set Architecture 3/21/2016 1
2
Topics for Discussion Review of Chapter 1: introduction What is computer organization? What will you learn in this course? Motherboard CPU: microprocessor Memory Instruction set architecture Stored program computer Interface between software and hardware Instructions Design principles Instructions, registers, and memory Simple instructions types and formats 3/21/2016 2
3
Computer Organization Is the study of major components of a modern digital computer, their organization and assembly, and the architecture and inner workings of these components. It also deals with design principles for a good performance. 3/21/2016 3
4
What will you learn in this course? How are high level language (HLL) translated to the language of the hardware. How does hardware execute instructions? What is the interface between hardware and software? How does the software instruct (or control) the hardware to perform the needed function? What determines the performance of a program? How can a program improve performance? Original program, its translation, effectiveness of the hardware, other special techniques such as pipelining What techniques can by hardware designers to improve performance? 3/21/2016 4
5
Mother Board Figure 1.10 Contains packages of integrated circuit chips (IC chips) including a processor, cache (several), memory (DRAM), connections for IO devices (networks, disks) 3/21/2016 5
6
Central Processing Unit (CPU) See Fig 1.9 Example: Intel 80386 80486 Pentium Main components of a CPU are datapath and control unit Datapath is the component of the processor that performs (arithmetic) operations Control is the component of the processor that commands the datapath, memory, IO device according to instruction of the program Cache provides but fast memory that acts as a buffer for slower /larger memory outside the chip. 3/21/2016 6
7
IC chip manufacturing process Lets discuss Fig. 1.14 and 1.15 Silicon is a semiconductor: by adding appropriate elements, it can be turned into a conductor, insulator or can be made to switch between the two. 3/21/2016 7
8
Instruction set Architecture An important abstraction between hardware and software. Lets discuss this concept. Computer operation is historically called an instruction. Instructions stored similar to data in a memory give rise to an important foundational concept called the stored program computer. 3/21/2016 8
9
C to MIPS instruction Consider a C language statement: f = (g + h) – ( i + j)Compile add t0, g, h add t1,i, j sub f,t0,t1 Design principle 1: simplicity favors regularity In the above example: all instructions have 3 operands 3/21/2016 9
10
Register set Where do the data get stored in the CPU? Named locations called registers? How many? Typical small compared to memory sizes. Registers: MIPS-32 has 32 register Denoted by s0, s1, etc. $s0, $s5 Temporary registers are denoted by $t0, $t1 3/21/2016 10
11
C to MIPS instruction (Take 2 with registers) Consider a C language statement: f = (g + h) – ( i + j) Compile add $t0, $s1, $s2 add $t1,$s3,$s4 sub $s0,$t0,$t1 Design principle 2: Smaller is faster Memory available as registers is 32 in number 3/21/2016 11
12
Memory Operations Data and instructions are stored in memory outside the CPU. Data is loaded from memory and stored in memory. Load word (lw) Store word (sw) 32 resgiters 2 30 words or 2 32 addressable locations or bytes 3/21/2016 12
13
C language to Memory instructions g = h + A[8]Compile lw $t0, 32($s3) add $s1, $s2, $t0 sw $t0,48($s3) Base register concept: base register is $s3 and Offset of 32 for 8 words and offset of 48 for 12 words 3/21/2016 13
14
Instruction Types add and sub lw and sw Now lets see how we can deal with a constant value data. Consider C language statement: x = x +4 Too complex: lw $t0, AddrConst($s1) add $s3,$s3,$t0 Instead how about: addi $s3,$s3,4 Summary is in Fig.2.4 Design principle 3: Make the common case fast. Example “addi” instead of add an constant from memory. 3/21/2016 14
15
Instruction format –R type Op 6 bits RS 5 bits Rt 5 bits Rd 5 bits Shamt 5 bits funct 6 bits Can we use the same format for addi and add? Then we will Have only 11 bit constant 3/21/2016 15
16
Instruction format – I type Op 6 bits Rs 5 bits Rt 5 bits Constant or address 16 bits Design principle 4: good design demands good compromise; Keep instruction length same needing different formats ; I and R type are examples 3/21/2016 16
17
Summary Figure 2.7 very nicely summarizes all we learned so far. MIPS operands MIPS memory MIPS Assembly language MIPS instructions type and formats And of course, the four design principles. 3/21/2016 17
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.