CSC 252: Processor Architecture

Size: px
Start display at page:

Download "CSC 252: Processor Architecture"

Transcription

1 S 252: Processor rchitecture Hardware omponents of a omputer System Processor atapath ontrol Input and Output devices 2/21/ /21/ The Principle of bstraction Grouping principle Levels/layers of abstraction by which each layer only needs to understand that immediately above and below it 2/21/ Set rchitecture ssembly Language View Processor state Registers,, s addl, movl, leal, How instructions are encoded as bytes Layer of bstraction bove: how to program machine Processor executes instructions in a sequence elow: what needs to be built Use variety of tricks to make it run fast.g., execute multiple instructions pplication Program ompiler simultaneously 2/21/ IS PU esign ircuit esign hip Layout OS S 256/456 - Spring

2 asic Issues in Set esign Goal: find a language that makes it easy to build both the hardware and the compiler while maximizing performance and minimizing cost What operations (and how many) should be provided How (and how many) operands are specified What data types and sizes How to encode these into consistent instruction formats Typical Operations ata movement rithmetic Logical Shift ontrol (jump/branch) Subroutine linkage Interrupt Synchronization ultimedia 2/21/ /21/ Register Immediate Register indirect isplacement Indexed irect (or absolute) indirect uto- Scaled indexed ddressing odes Scaled Indexed ddressing ode ost General Form (Rb,Ri,S) em[reg[rb]+s*reg[ri]+ ] : onstant displacement 1, 2, or 4 bytes Rb: ase register: ny of 8 integer registers Ri: Index register: ny, except for %esp S: Scale: 1, 2, 4, or 8 Special ases (Rb,Ri) (Rb,Ri) (Rb,Ri,S) em[reg[rb]+reg[ri]] em[reg[rb]+reg[ri]+] em[reg[rb]+s*reg[ri]] 2/21/ /21/ S 256/456 - Spring

3 Format an be fixed length simpler decoding variable length higher code density/smaller program Large instruction word (encoding multiple instructions and dependences among those instructions) If we have many operands per instruction and many addressing modes, we need an address specifier per operand/result If we have a load-store architecture with 1 address per instruction and one or two addressing modes, we can encode the addressing mode in the opcode 2/21/ IS Sets omplex Set omputer ominant style through mid-80 s Philosophy dd instructions to perform typical programming tasks Variable length encodings Variable execution times ultiple formats for specifying operands Implementation artifacts hidden from machine-level programs Stack-oriented instruction set Use stack to pass arguments, save program counter xplicit push and pop instructions ny instruction can access addl %eax, 12(%ebx,%ecx,4) requires read and write omplex address calculation ondition codes 2/21/ Set as side effect of arithmetic and logical instructions RIS Sets Reduced Set omputer Internal project at I, later popularized by Hennessy (Stanford) and Patterson (erkeley) Fewer, simpler instructions ight take more to get given task done an execute them with small and fast hardware Fixed length encoding Simple addressing formats (typically just base+displacement) Register-oriented instruction set any more (typically 32) registers Use for arguments, return pointer, temporaries Only load and store instructions can access No ondition codes - test instructions return 0/1 in register Implementation artifacts exposed to machine-level programs 2/21/ $0 $1 $2 $3 $4 $5 $6 $7 $8 $9 $10 $11 $12 $13 $14 $15 $0 $at $v0 $v1 $a0 $a1 $a2 $a3 $t0 $t1 $t2 $t3 $t4 $t5 $t6 $t7 IPS Registers onstant 0 Reserved Temp. Return Values Procedure arguments aller Save Temporaries: ay be overwritten by called procedures $16 $17 $18 $19 $20 $21 $22 $23 $24 $25 $26 $27 $28 $29 $30 $31 $s0 $s1 $s2 $s3 $s4 $s5 $s6 $s7 $t8 $t9 $k0 $k1 $gp $sp $s8 $ra allee Save Temporaries: ay not be overwritten by called procedures aller Save Temp Reserved for Operating Sys Global Pointer Stack Pointer allee Save Temp Return ddress 2/21/ S 256/456 - Spring

4 R-R IPS xamples Op Ra Rb Rd Fn addu $3,$2,$1 # Register add: $3 = $2+$1 R-I Op Ra Rb Immediate addu $3,$2, 3145 # Immediate add: $3 = $ sll $3,$2,2 # Shift left: $3 = $2 << 2 ranch Op Ra Rb Offset beq $3,$2,dest # ranch when $3 = $2 Load/Store Op Ra Rb Offset lw $3,16($2) # Load Word: $3 = [$2+16] 2/21/2008sw $3,16($2) # Store Word: [$2+16] = $3 13 IS vs. RIS Original ebate Strong opinions! IS proponents---easy for compiler, fewer code bytes RIS proponents---better for optimizing compilers, can make run fast with simple chip design urrent Status For desktop processors, choice of IS not a technical issue With enough hardware, can make anything run fast ode compatibility more important For embedded processors, RIS makes sense Smaller, cheaper, less power 2/21/ Overview of Logic esign Fundamental Hardware Requirements ommunication How to get values from one place to another omputation Storage its are Our Friends verything expressed in terms of values 0 and 1 ommunication Low or high voltage on wire omputation ompute oolean functions Storage Store bits of information 2/21/ a b omputing with Logic Gates out a b out a out out = a && b out = a b out =!a Outputs are oolean functions of inputs Respond continuously to changes in inputs With some, small delay Voltage nd Or Not Rising elay Falling elay a && b b 2/21/ Time a S 256/456 - Spring

5 ombinational ircuits cyclic Network 0 rithmetic Logic Unit Primary Inputs Primary Outputs Y X L U OF ZF F X + Y Y X L U OF ZF F X - Y Y X L U OF ZF F X & Y Y X L U OF ZF F X ^ Y cyclic Network of Logic Gates ontinously responds to changes on primary inputs Primary outputs become (after some delay) oolean functions of primary inputs 2/21/ ombinational logic ontinuously responding to inputs ontrol signal selects function computed orresponding to 4 arithmetic/logical operations in Y86 lso computes values for condition codes 2/21/ Sequential Logic: and ontrol Sequential: Output depends on the current input values and the previous sequence of input values. re yclic: Output of a gate feeds its input at some future time. : Remember results of previous operations Use them as inputs. xample of use: uild registers and units. 2/21/ s Signal used to synchronize activity in a processor very operation must be completely in the time between two clock pulses (or rising edges) --- the cycle time aximum clock rate (frequency) determined by the slowest logic path in the circuit (the critical path) 2/21/ S 256/456 - Spring

6 ata dge-triggered Latch T Trigger Only in latching mode for brief period T Rising clock edge Value latched depends on data as clock rises Output remains stable at Time all other times 2/21/ R S Q i 7 i 6 i 5 i 4 i 3 i 2 i 1 i 0 Registers Structure Stores word of data ifferent from program registers seen in assembly code ollection of edge-triggered latches Loads input on rising edge of clock 2/21/ o 7 o 6 o 5 o 4 o 3 o 2 o 1 o 0 I O Input = y State = x x Register Operation Output = x Stores data bits Rising clock For most of time acts as barrier between input and output s clock rises, loads input State = y Output = y 2/21/ y In Load State achine xample Load In Out omb. Logic 0 L U 0 1 UX ccumulator circuit Load or accumulate on each cycle 2/21/ Out x 0 x 1 x 2 x 3 x 4 x 5 x 0 x 0 +x 1 x 0 +x 1 +x 2 x 3 x 3 +x 4 x 3 +x 4 +x 5 S 256/456 - Spring

7 Random-ccess Read ports Register Stores multiple words of ddress input specifies which word to read or write Register Holds values of program registers %eax, %esp, etc. Register identifier serves as address I 8 implies no read or write performed ultiple Ports val src val src an read and/or write multiple words in one cycle 2/21/2008 ach has separate address and data input/output 25 W valw dstw Write port x 2 val src val src 2 2 Register x Register Register File Timing x W valw dstw y 2 Reading Like combinational logic Output data generated based on input address fter some delay Writing Like register Update only as clock rises Rising clock Register 2/21/ y W valw dstw uilding locks ombinational Logic ompute oolean functions of inputs ontinuously respond to input changes Operate on data and implement control Storage lements Store bits ddressable memories Non-addressable registers Loaded only as clock rises Register 2/21/ val src val src fun L U W valw dstw 0 UX 1 = Y86 Processor State Program registers %eax %ecx %edx %ebx %esi %edi %esp %ebp ondition codes OF ZF SF Program Registers Same 8 as with I32. ach 32 bits ondition odes Single-bit flags set by arithmetic or logical instructions OF: Overflow ZF: Zero SF:Negative Program ounter Indicates address of instruction yte-addressable storage array Words stored in little-endian byte order 2/21/ S 256/456 - Spring

8 Format Y86 s 1--6 bytes of information read from an determine instruction length from first byte Not as many instruction types, and simpler encoding than with I32 ach accesses and modifies some part(s) of the program state ncoding Registers ach register has 4-bit I %eax %ecx %edx %ebx %esi %edi %esp %ebp Same encoding as in I32 Register I 8 indicates no register Will use this in our hardware design in multiple places /21/ /21/ xample ddition Generic Form addl r, r 6 0 r r dd value in register r to that in register r Store result in register r Note that Y86 only allows addition to be applied to register data Set condition codes based on result e.g., addl %eax,%esi ncoding: Two-byte encoding First indicates instruction type Second gives source and destination registers ncoded Representation rithmetic and Logical Operations ode dd addl r, r 6 0 r r Subtract (r from r) nd subl r, r 6 1 r r andl r, r 6 2 r r xclusive-or Function ode xorl r, r 6 3 r r Refer to generically as OPl ncodings differ only by function code Low-order 4 bits in first instruction byte Set condition codes as side effect 2/21/ /21/ S 256/456 - Spring

9 rrmovl r, r 2 0 r r ove Operations irmovl V, r r V Register --> Register Immediate --> Register ove xamples I32 Y86 ncoding movl $0xabcd, %edx irmovl $0xabcd, %edx cd ab movl %esp, %ebx rrmovl %esp, %ebx movl -12(%ebp),%ecx movl %esi,0x41c(%esp) mrmovl -12(%ebp),%ecx rmmovl %esi,0x41c(%esp) f4 ff ff ff c rmmovl r, (r) 4 0 r r Register --> movl $0xabcd, (%eax) movl %eax, 12(%eax,%edx) mrmovl (r), r 5 0 r r --> Register movl (%ebp,%eax,4),%ecx Like the I32 movl instruction Simpler format for addresses Give different names to keep them distinct 2/21/ /21/ Y86 Set yte nop 0 0 halt 1 0 rrmovl r, r 2 0 r r irmovl V, r r V addl 6 0 subl 6 1 andl 6 2 xorl 6 3 rmmovl r, (r) 4 0 r r jmp 7 0 mrmovl (r), r 5 0 r r jle 7 1 OPl r, r 6 fn r r jl 7 2 jxx est 7 fn est je 7 3 call est 8 0 est jne 7 4 ret 9 0 jge 7 5 pushl r 0 r 8 jg 7 6 2/21/2008 popl r 0 r 8 35 SQ Hardware Structure State Program counter register () ondition code register () Register File emories ccess same space ata: for reading/writing program data : for reading instructions Flow Read instruction at address specified by Process through stages Update program counter ecode icode, ifun r, r 2/21/ new val, val ddr, ata ch alu, alu src, src dst, dst val ata val val, val Register S 256/456 - Spring

10 SQ Stages Read instruction from instruction ecode Read program registers ompute value or address Read or write data Write ack Write program registers Update program counter ecode icode, ifun r, r 2/21/ new val, val ddr, ata ch alu, alu src, src dst, dst val ata val val, val Register icode ifun r r Format ecoding Optional Optional 5 0 r r byte icode:ifun Optional register byte r:r Optional constant word 2/21/ xecuting rith./logical Operation Read 2 bytes ecode Read operand registers Perform operation Set condition codes OPl r, r 6 fn r r o nothing Update register Update Increment by 2 2/21/ Stage omputation: rith/log. Ops ecode Write OPl r, r icode:ifun 1 [] r:r 1 [+1] +2 val R[r] val R[r] val val OP val Set R[r] val back update Read instruction byte Read register byte ompute next Read operand Read operand Perform operation Set condition code register result Update Formulate instruction execution as sequence of simple steps Use same general form for all instructions 2/21/ S 256/456 - Spring

11 Read 6 bytes ecode Read operand registers ompute effective address xecuting rmmovl rmmovl r, (r) 4 0 r r Write to o nothing Update Increment by 6 Stage omputation: rmmovl rmmovl r, (r) icode:ifun 1 [] Read instruction byte r:r 1 [+1] Read register byte 4 [+2] Read displacement +6 ompute next ecode val R[r] Read operand val R[r] Read operand val val + ompute effective address 4 [val] val Write value to Write back update Update Use for address computation 2/21/ /21/ Read 2 bytes ecode Read stack pointer Increment stack pointer by 4 xecuting popl popl r b 0 r 8 Read from old stack pointer Update stack pointer Write result to register Update Increment by 2 2/21/ ecode Write Stage omputation: popl popl r icode:ifun 1 [] r:r 1 [+1] +2 val R[%esp] val R [%esp] val val + 4 val 4 [val] R[%esp] val back R[r] val update Use to stack pointer ust update two registers Popped value New stack pointer Read instruction byte Read register byte ompute next Read stack pointer Read stack pointer Increment stack pointer Read from stack Update stack pointer result Update 2/21/ S 256/456 - Spring

12 xecuting Jumps jxx est 7 fn est fall thru: target: XX XX XX XX Not taken Taken ecode Stage omputation: Jumps jxx est icode:ifun 1 [] 4 [+1] +5 Read instruction byte Read destination address Fall through address Read 5 bytes Increment by 5 ecode o nothing etermine whether to take branch based on jump condition and condition codes o nothing o nothing Update Set to est if branch taken or to ed if not branch 2/21/ Write ch ond(,ifun) back update ch? : ompute both addresses Take branch? Update hoose based on setting of condition codes and branch condition 2/21/ Read 5 bytes Increment by 5 ecode Read stack pointer ecrement stack pointer by 4 xecuting call call est 8 0 est return: target: XX XX XX XX Write ed to new value of stack pointer Update stack pointer Update Set to est 2/21/ Stage omputation: call call est icode:ifun 1 [] Read instruction byte 4 [+1] +5 Read destination address ompute return point ecode val R[%esp] Read stack pointer val val + 4 ecrement stack pointer 4 [val] Write return value on stack Write R[%esp] val Update stack pointer back update Set to destination Use to decrement stack pointer Store ed 2/21/ S 256/456 - Spring

13 xecuting ret ret 9 0 Stage omputation: ret ret icode:ifun 1 [] Read instruction byte return: Read 1 byte ecode Read stack pointer Increment stack pointer by 4 XX XX Read return address from old stack pointer Update stack pointer Update Set to return address 2/21/ ecode val R[%esp] Read operand stack pointer val R[%esp] Read operand stack pointer val val + 4 Increment stack pointer val 4 [val] Read return address Write R[%esp] val Update stack pointer back update val Set to return address Use to stack pointer Read return address from 2/21/ ecode Write omputation Steps icode,ifun r,r val, src val, src val ond code val dst back dst update OPl r, r icode:ifun 1 [] r:r 1 [+1] +2 val R[r] val R[r] val val OP val Set R[r] val Read instruction byte Read register byte [Read constant word] ompute next Read operand Read operand Perform operation Set condition code register [ read/write] result [ result] Update ll instructions follow same general pattern iffer in what gets computed on each step 2/21/ ecode Write back update omputation Steps icode,ifun r,r val, src val, src val ond code val dst dst call est icode:ifun 1 [] 4 [+1] +5 val R[%esp] val val [val] R[%esp] val Read instruction byte [Read register byte] Read constant word ompute next [Read operand ] Read operand Perform operation [Set condition code reg.] [ read/write] [ result] result Update ll instructions follow same general pattern iffer in what gets computed on each step 2/21/ S 256/456 - Spring

14 omputed Values SQ Hardware new New icode code ifun function rinstr. Register rinstr. Register constant Incremented ecode src Register I src Register I dst estination Register dst estination Register val Register value val Register value val result ch ranch flag val Value from Key lue boxes: predesigned hardware blocks.g., memories, Gray boxes: control logic escribe in HL White ovals: labels for signals Thick lines: 32- bit word values Thin lines: 4-8 bit values otted lines: 1- bit values ecode ch icode ifun r em. control r read write val ata ddr val data out ata val fun. val Register dst dst src src dst dst src src 2/21/ /21/ Possible Implementation Strategies Single-cycle control ulti-cycle control Pipelined (in-order execution) Superscalar and out-of-order execution Single-ycle ontrol annot use any hardware unit twice in one cycle ultiple datapath elements (e.g., and er) if needed for multiple purposes ultiple reads or writes to or register require multiporting cycle must accommodate instruction with the longest latency 2/21/ /21/ S 256/456 - Spring

15 ulti-cycle ontrol Split single instruction into multiple pieces individual pieces using hardwired finite state machine (FS) or microprogramming an finish simple instructions in fewer cycles an run clock faster Still execute a single instruction at a time Pipelined atapath ultiple instructions overlapped in execution Improve throughput, not individual instruction execution time xploit parallelism among instructions in a sequential stream alance length of each stage. Ideally - Time between instrs pipelined = Time between instrs non-pipelined /Number of pipe stages 2/21/ /21/ Hazards SQ Hardware new New val Structural (e.g., instruction/data fetch) ontrol (e.g., jeq) ata (e.g., add followed by sub reading dst register of add) Stages occur in sequence One operation in process at a time ch em. control read write val ata ddr data out ata fun. val val dst dst src src dst dst src src ecode Register icode ifun r r 2/21/ /21/ S 256/456 - Spring

16 S Hardware em. control read write val ata data out dding Pipeline Registers val, val W_icode, W_val W_val, W_val, W_dst, W_dst ddr ata val val Still sequential implementation Reorder stage to put at beginning Stage Task is to select for current instruction ased on results computed by previous instruction Processor State is no longer stored in register ut, can determine based on other stored information ecode ch icode ifun r picode r val val fun. Register pch pval pval pvalp val dst dst src src dst dst src src ecode ch icode, icode, ifun r, r pstate ddr, ata alu, alu src, src dst, dst ata val val, val Register ecode _icode, _ch, _val W icode, ifun, r, r, ddr, ata ch d_src, d_src val alu, alu ata val val, val f_ Register pred 2/21/ /21/ F Select current Read instruction ompute ed ecode Read program registers Operate Read or write data Write ack Update register W Pipeline Stages ecode W_icode, W_val icode, ifun, r, r, ddr, ata 2/21/ _icode, _ch, _val F ch d_src, d_src val alu, alu ata W_val, W_val, W_dst, W_dst val val, val f_ Register pred PIP- Hardware Pipeline registers hold intermediate values from instruction execution Forward (Upward) Paths Values passed from one stage to next annot jump past stages e.g., passes through decode 2/21/ W ecode F icode _ch em. control r f_ Select read write val val dst dst ata ddr Select data out data in icode ch val val dst dst fun. Register dst dst _val icode ifun val val dst dst src src icode ifun r e_ch pred d_rval Predict src d_src W_val W_val _val W_val src d_src S 256/456 - Spring

17 Feedback Paths Predicted Guess value of next ranch information Jump taken/not-taken Fall-through or target address Return point Read from Register updates To register write ports 2/21/ W ecode F icode _ch em. control r f_ Select read write val val dst dst ata ddr Select data out data in icode ch val val dst dst d_rval fun. Register dst dst Predict _val icode ifun val val dst dst src src icode ifun r e_ch pred src d_src W_val W_val _val W_val src d_src Predicting the Instr valid F icode ifun r Split yte 0 Select pred Start fetch of new instruction after current one has completed fetch stage Not enough time to reliably determine next instruction Guess which instruction will follow Recover if prediction was incorrect 2/21/ r lign ytes 1-5 Need Need regids Predict _icode _ch _val W_icode W_val Our Prediction Strategy s that on t Transfer ontrol Predict next to be lways reliable all and Unconditional Jumps Predict next to be (destination) lways reliable onditional Jumps Predict next to be (destination) Only correct if branch is taken Typically right 60% of time Return on t try to predict 2/21/ Recovering from isprediction Instr valid F icode ifun r ispredicted Jump Will see branch flag once instruction reaches stage an get fall-through from val Return Will get return when ret reaches write-back stage Split 2/21/ yte 0 Select pred r lign ytes 1-5 Need Need regids Predict _icode _ch _val W_icode W_val S 256/456 - Spring

18 -level Parallelism Pipelining/super-pipelining Out-of-order execution Super-scalar multiple instructions per pipeline stage ependences Very Large Word (VLIW) ultiple instructions per pipeline stage ependences taken care of by compiler isclaimer Parts of the slides were developed by the course text authors: ave O Hallaron and Randy ryant. The slides are intended for the sole purpose of instruction of computer organization at the University of Rochester. ll copyrighted materials belong to their original owner(s). 2/21/ /21/ S 256/456 - Spring

Computer Science 104:! Y86 & Single Cycle Processor Design!

Computer Science 104:! Y86 & Single Cycle Processor Design! Computer Science 104: Y86 & Single Cycle Processor Design Alvin R. Lebeck Slides based on those from Randy Bryant 1 CS:APP Administrative Homework #4 My office hours today 11:30-12:30 Reading: text 4.3

More information

Instruction Set Architecture

Instruction Set Architecture CS:APP Chapter 4 Computer Architecture Instruction Set Architecture Randal E. Bryant Carnegie Mellon University http://csapp.cs.cmu.edu CS:APP Instruction Set Architecture Assembly Language View Processor

More information

Instruction Set Architecture

Instruction Set Architecture CS:APP Chapter 4 Computer Architecture Instruction Set Architecture Randal E. Bryant Carnegie Mellon University http://csapp.cs.cmu.edu CS:APP Instruction Set Architecture Assembly Language View! Processor

More information

Computer Science 104:! Y86 & Single Cycle Processor Design!

Computer Science 104:! Y86 & Single Cycle Processor Design! Computer Science 104:! Y86 & Single Cycle Processor Design! Alvin R. Lebeck! Slides based on those from Randy Bryant 1! CS:APP! CS:APP! Administrative! 2! CS:APP! Instruction Set Architecture! Application!

More information

CISC 360 Instruction Set Architecture

CISC 360 Instruction Set Architecture CISC 360 Instruction Set Architecture Michela Taufer October 9, 2008 Powerpoint Lecture Notes for Computer Systems: A Programmer's Perspective, R. Bryant and D. O'Hallaron, Prentice Hall, 2003 Chapter

More information

Instruction Set Architecture

Instruction Set Architecture CISC 360 Instruction Set Architecture Michela Taufer October 9, 2008 Powerpoint Lecture Notes for Computer Systems: A Programmer's Perspective, R. Bryant and D. O'Hallaron, Prentice Hall, 2003 Chapter

More information

Instruction Set Architecture

Instruction Set Architecture CS:APP Chapter 4 Computer Architecture Instruction Set Architecture Randal E. Bryant adapted by Jason Fritts http://csapp.cs.cmu.edu CS:APP2e Hardware Architecture - using Y86 ISA For learning aspects

More information

Y86 Processor State. Instruction Example. Encoding Registers. Lecture 7A. Computer Architecture I Instruction Set Architecture Assembly Language View

Y86 Processor State. Instruction Example. Encoding Registers. Lecture 7A. Computer Architecture I Instruction Set Architecture Assembly Language View Computer Architecture I Instruction Set Architecture Assembly Language View Processor state Registers, memory, Instructions addl, movl, andl, How instructions are encoded as bytes Layer of Abstraction

More information

Y86 Instruction Set. SEQ Hardware Structure. SEQ Stages. Sequential Implementation. Lecture 8 Computer Architecture III.

Y86 Instruction Set. SEQ Hardware Structure. SEQ Stages. Sequential Implementation. Lecture 8 Computer Architecture III. Building Blocks Combinational Logic Compute Boolean functions of inputs Continuously respond to input changes Operate on data and implement control Storage Elements Store bits Lecture 8 Computer rchitecture

More information

Giving credit where credit is due

Giving credit where credit is due JDEP 284H Foundations of Computer Systems Processor rchitecture III: Sequential Implementation Dr. Steve Goddard goddard@cse.unl.edu Giving credit where credit is due Most of slides for this lecture are

More information

cmovxx ra, rb 2 fn ra rb irmovl V, rb rb V rmmovl ra, D(rB) 4 0 ra rb D mrmovl D(rB), ra 5 0 ra rb D OPl ra, rb 6 fn ra rb jxx Dest 7 fn Dest

cmovxx ra, rb 2 fn ra rb irmovl V, rb rb V rmmovl ra, D(rB) 4 0 ra rb D mrmovl D(rB), ra 5 0 ra rb D OPl ra, rb 6 fn ra rb jxx Dest 7 fn Dest Instruction Set Architecture Instruction Set Architecture CSci 2021: Machine Architecture and Organization Lecture #16, February 25th, 2015 Your instructor: Stephen McCamant Based on slides originally

More information

Chapter 4! Processor Architecture!

Chapter 4! Processor Architecture! Chapter 4! Processor Architecture!! Y86 Instruction Set Architecture! Instructor: Dr. Hyunyoung Lee! Texas A&M University! Based on slides provided by Randal E. Bryant, CMU Why Learn Processor Design?!

More information

Sequential Implementation

Sequential Implementation CS:APP Chapter 4 Computer Architecture Sequential Implementation Randal E. Bryant adapted by Jason Fritts http://csapp.cs.cmu.edu CS:APP2e Hardware Architecture - using Y86 ISA For learning aspects of

More information

Background: Sequential processor design. Computer Architecture and Systems Programming , Herbstsemester 2013 Timothy Roscoe

Background: Sequential processor design. Computer Architecture and Systems Programming , Herbstsemester 2013 Timothy Roscoe Background: Sequential processor design Computer Architecture and Systems Programming 252 0061 00, Herbstsemester 2013 Timothy Roscoe Overview Y86 instruction set architecture Processor state Instruction

More information

Giving credit where credit is due

Giving credit where credit is due CSC 230J Computer Organization Processor rchitecture V: aking the Pipelined Implementation ork r. Steve Goddard goddard@cse.unl.edu http://cse.unl.edu/~goddard/courses/csc230j Giving credit where credit

More information

CS:APP Chapter 4 Computer Architecture Sequential Implementation

CS:APP Chapter 4 Computer Architecture Sequential Implementation CS:APP Chapter 4 Computer Architecture Sequential Implementation Randal E. Bryant Carnegie Mellon University http://csapp.cs.cmu.edu CS:APP Y86 Instruction Set Byte 0 1 2 3 4 5 nop 0 0 halt 1 0 rrmovl

More information

CS429: Computer Organization and Architecture

CS429: Computer Organization and Architecture CS429: Computer Organization and Architecture Warren Hunt, Jr. and Bill Young Department of Computer Sciences University of Texas at Austin Last updated: October 1, 2014 at 12:03 CS429 Slideset 6: 1 Topics

More information

Giving credit where credit is due

Giving credit where credit is due CSCE 230J Computer Organization Processor Architecture III: Sequential Implementation Dr. Steve Goddard goddard@cse.unl.edu http://cse.unl.edu/~goddard/courses/csce230j Giving credit where credit is due

More information

Chapter 4! Processor Architecture!!

Chapter 4! Processor Architecture!! Chapter 4! Processor Architecture!! Sequential Implementation! Instructor: Dr. Hyunyoung Lee! Texas A&M University! Based on slides provided by Randal E. Bryant, CMU Topics Covered! Hardware Control Language

More information

Computer Science 104:! Y86 & Single Cycle Processor Design!

Computer Science 104:! Y86 & Single Cycle Processor Design! Computer Science 104: Y86 & Single Cycle Processor Design Alvin R. Lebeck Slides based on those from Randy Bryant CS:APP Administrative HW #4 Due tomorrow tonight HW #5 up soon ing: 4.1-4.3 Today Review

More information

CS:APP Chapter 4 Computer Architecture Logic Design Randal E. Bryant Carnegie Mellon University

CS:APP Chapter 4 Computer Architecture Logic Design Randal E. Bryant Carnegie Mellon University S:PP hapter 4 omputer rchitecture Logic esign Randal E. Bryant arnegie Mellon University http://csapp.cs.cmu.edu S:PP Overview of Logic esign Fundamental Hardware Requirements ommunication How to get values

More information

CISC: Stack-intensive procedure linkage. [Early] RISC: Register-intensive procedure linkage.

CISC: Stack-intensive procedure linkage. [Early] RISC: Register-intensive procedure linkage. CISC: Stack-intensive procedure linkage. The stack is used for procedure arguments and return addresses. [Early] RISC: Register-intensive procedure linkage. Registers are used for procedure arguments and

More information

Processor Architecture

Processor Architecture Processor Architecture God created the integers, all else is the work of man Leopold Kronecker (He believed in the reduction of all mathematics to arguments involving only the integers and a finite number

More information

Processor Architecture II! Sequential! Implementation!

Processor Architecture II! Sequential! Implementation! Processor Architecture II! Sequential! Implementation! Lecture 6, April 14 th 2011 Alexandre David Slides by Randal E. Bryant! Carnegie Mellon University! Y86 Instruction Set! Byte! 0 1 2 3 4 5 nop 0 0

More information

Computer Organization Chapter 4. Prof. Qi Tian Fall 2013

Computer Organization Chapter 4. Prof. Qi Tian Fall 2013 Computer Organization Chapter 4 Prof. Qi Tian Fall 2013 1 Topics Dec. 6 (Friday) Final Exam Review Record Check Dec. 4 (Wednesday) 5 variable Karnaugh Map Quiz 5 Dec. 2 (Monday) 3, 4 variables Karnaugh

More information

CS:APP Chapter 4 Computer Architecture Sequential Implementation

CS:APP Chapter 4 Computer Architecture Sequential Implementation CS:APP Chapter 4 Computer Architecture Sequential Implementation Randal E. Bryant Carnegie Mellon University http://csapp.cs.cmu.edu CS:APP Y86 Instruction Set Byte 0 1 2 3 4 5 nop 0 0 halt 1 0 rrmovl

More information

CS:APP Chapter 4! Computer Architecture! Sequential! Implementation!

CS:APP Chapter 4! Computer Architecture! Sequential! Implementation! CS:APP Chapter 4! Computer Architecture! Sequential! Implementation! Randal E. Bryant! Carnegie Mellon University! http://csapp.cs.cmu.edu CS:APP2e! Y86 Instruction Set #1! Byte! 0 1 2 3 4 5 halt 0 0 nop

More information

Chapter 4 Processor Architecture: Y86 (Sections 4.1 & 4.3) with material from Dr. Bin Ren, College of William & Mary

Chapter 4 Processor Architecture: Y86 (Sections 4.1 & 4.3) with material from Dr. Bin Ren, College of William & Mary Chapter 4 Processor Architecture: Y86 (Sections 4.1 & 4.3) with material from Dr. Bin Ren, College of William & Mary 1 Outline Introduction to assembly programing Introduction to Y86 Y86 instructions,

More information

Systems I. Datapath Design II. Topics Control flow instructions Hardware for sequential machine (SEQ)

Systems I. Datapath Design II. Topics Control flow instructions Hardware for sequential machine (SEQ) Systems I Datapath Design II Topics Control flow instructions Hardware for sequential machine (SEQ) Executing Jumps jxx Dest 7 fn Dest fall thru: XX XX Not taken target: XX XX Taken Fetch Decode Read 5

More information

Computer Organization: A Programmer's Perspective

Computer Organization: A Programmer's Perspective A Programmer's Perspective Instruction Set Architecture Gal A. Kaminka galk@cs.biu.ac.il Outline: CPU Design Background Instruction sets Logic design Sequential Implementation A simple, but not very fast

More information

Systems I. Pipelining II. Topics Pipelining hardware: registers and feedback paths Difficulties with pipelines: hazards Method of mitigating hazards

Systems I. Pipelining II. Topics Pipelining hardware: registers and feedback paths Difficulties with pipelines: hazards Method of mitigating hazards Systems I Pipelining II Topics Pipelining hardware: registers and feedback paths ifficulties with pipelines: hazards Method of mitigating hazards Adding Pipeline Registers val, valm _icode, _valm rite

More information

Computer Architecture I: Outline and Instruction Set Architecture. CENG331 - Computer Organization. Murat Manguoglu

Computer Architecture I: Outline and Instruction Set Architecture. CENG331 - Computer Organization. Murat Manguoglu Computer Architecture I: Outline and Instruction Set Architecture CENG331 - Computer Organization Murat Manguoglu Adapted from slides of the textbook: http://csapp.cs.cmu.edu/ Outline Background Instruction

More information

CPSC 313, Summer 2013 Final Exam Date: June 24, 2013; Instructor: Mike Feeley

CPSC 313, Summer 2013 Final Exam Date: June 24, 2013; Instructor: Mike Feeley CPSC 313, Summer 2013 Final Exam Date: June 24, 2013; Instructor: Mike Feeley This is a closed-book exam. No outside notes. Electronic calculators are permitted. You may remove the last two pages of the

More information

God created the integers, all else is the work of man Leopold Kronecker

God created the integers, all else is the work of man Leopold Kronecker Sequential Hardware God created the integers, all else is the work of man Leopold Kronecker (He believed in the reduction of all mathematics to arguments involving only the integers and a finite number

More information

CS:APP Chapter 4 Computer Architecture Pipelined Implementation

CS:APP Chapter 4 Computer Architecture Pipelined Implementation CS:APP Chapter 4 Computer Architecture Pipelined Implementation Part II Randal. Bryant Carnegie ellon University http://csapp.cs.cmu.edu CS:APP Overview ata Hazards ake the pipelined processor work! Instruction

More information

CISC Fall 2009

CISC Fall 2009 Michela Taufer October 20, 2009 Powerpoint Lecture Notes for Computer Systems: A Programmer's Perspective, R. Bryant and D. O'Hallaron, Prentice Hall, 2003 Y86 Instruction Set Byte 0 1 2 3 4 5 nop 0 0

More information

Michela Taufer CS:APP

Michela Taufer CS:APP ichela Taufer CS:APP Powerpoint Lecture Notes for Computer Systems: A Programmer's Perspective, R. Bryant and. O'Hallaron, Prentice Hall, 2003 Overview 2 CISC 360 Faʼ08 Pipeline Stages W_icode, W_val W

More information

CS:APP Chapter 4 Computer Architecture Sequential Implementation

CS:APP Chapter 4 Computer Architecture Sequential Implementation CS:APP Chapter 4 Computer Architecture Sequential Implementation Randal E. Bryant Carnegie Mellon University CS:APP Y86 Instruction Set Byte ra rb ra rb V rb rb V ra D rb ra rb D D rb ra ra rb D ra rb

More information

Byte. cmovle 7 1. halt 0 0 addq 6 0 nop 1 0 subq 6 1 cmovxx ra, rb 2 fn ra rb andq 6 2 irmovq V, rb 3 0 F rb V xorq 6 3. cmovl 7 2.

Byte. cmovle 7 1. halt 0 0 addq 6 0 nop 1 0 subq 6 1 cmovxx ra, rb 2 fn ra rb andq 6 2 irmovq V, rb 3 0 F rb V xorq 6 3. cmovl 7 2. Y86-6 Instruc&on Set Computer rchitecture Sequen&al Implementa&on CSCI 202: Machine rchitecture and Organiza&on Byte 0 2 3 5 6 7 8 9 2 fn r rb irmovq V, rb 3 0 F rb V 0 r rb Pen- Chung Yew epartment Computer

More information

CPSC 313, Winter 2016 Term 1 Sample Date: October 2016; Instructor: Mike Feeley

CPSC 313, Winter 2016 Term 1 Sample Date: October 2016; Instructor: Mike Feeley CPSC 313, Winter 2016 Term 1 Sample Date: October 2016; Instructor: Mike Feeley NOTE: This sample contains all of the question from the two CPSC 313 midterms for Summer 2015. This term s midterm will be

More information

CPSC 121: Models of Computation. Module 10: A Working Computer

CPSC 121: Models of Computation. Module 10: A Working Computer CPSC 121: Models of Computation The 10th online quiz is due Tuesday, March 26 th at 17:00. Assigned reading for the quiz: Epp, 4th edition: 6.1, 7.1 Epp, 3rd edition: 5.1, 6.1 Rosen, 6th edition: 2.1,

More information

Systems I. Datapath Design II. Topics Control flow instructions Hardware for sequential machine (SEQ)

Systems I. Datapath Design II. Topics Control flow instructions Hardware for sequential machine (SEQ) Systems I Datapath Design II Topics Control flow instructions Hardware for sequential machine (SEQ) Executing Jumps jxx Dest 7 fn Dest fall thru: XX XX Not taken target: XX XX Taken Read 5 bytes Increment

More information

Processor Architecture I. Alexandre David

Processor Architecture I. Alexandre David Processor Architecture I Alexandre David Overview n Introduction: from transistors to gates. n and from gates to circuits. n 4.1 n 4.2 n Micro+macro code. 12-04-2011 CART - Aalborg University 2 Evolution

More information

CPSC 121: Models of Computation. Module 10: A Working Computer

CPSC 121: Models of Computation. Module 10: A Working Computer CPSC 121: Models of Computation Module 10: A Working Computer Module 10: A Working Computer???build a computer that is?able to 1. How can we?execute a user-defined program? We are finally able to answer

More information

CSE2421 FINAL EXAM SPRING Name KEY. Instructions: Signature

CSE2421 FINAL EXAM SPRING Name KEY. Instructions: Signature CSE2421 FINAL EXAM SPRING 2013 Name KEY Instructions: This is a closed-book, closed-notes, closed-neighbor exam. Only a writing utensil is needed for this exam. No calculators allowed. If you need to go

More information

Computer Science 104:! Y86 & Single Cycle Processor Design!

Computer Science 104:! Y86 & Single Cycle Processor Design! Computer Science 104:! Y86 & Single Cycle Processor Design! Alvin R. Lebeck! Slides based on those from Randy Bryant CS:APP! Administrative! 2! CS:APP! Y86 Instruction Set! Byte! 0 1 2 3 4 5 nop 0 0 halt

More information

CISC 662 Graduate Computer Architecture. Classifying ISA. Lecture 3 - ISA Michela Taufer. In a CPU. From Source to Assembly Code

CISC 662 Graduate Computer Architecture. Classifying ISA. Lecture 3 - ISA Michela Taufer. In a CPU. From Source to Assembly Code IS 662 Graduate omputer rchitecture Lecture 3 - IS Michela Taufer lassifying IS Powerpoint Lecture Notes from John Hennessy and David Patterson s: omputer rchitecture, 4th edition ---- dditional teaching

More information

Where Have We Been? Logic Design in HCL. Assembly Language Instruction Set Architecture (Y86) Finite State Machines

Where Have We Been? Logic Design in HCL. Assembly Language Instruction Set Architecture (Y86) Finite State Machines Where Have We Been? Assembly Language Instruction Set Architecture (Y86) Finite State Machines States and Transitions Events Where Are We Going? Tracing Instructions at the Register Level Build a CPU!

More information

For Tuesday. Finish Chapter 4. Also, Project 2 starts today

For Tuesday. Finish Chapter 4. Also, Project 2 starts today For Tuesday Finish Chapter 4 Also, Project 2 starts today 1 Sequential Y86 Implementation 1. Fetch From icode (4 bits) & ifun (4 bits) [valc (4bytes)] Calc valp 2. Decode: get ra [rb] [%esp] 3. Execute

More information

Reading assignment. Chapter 3.1, 3.2 Chapter 4.1, 4.3

Reading assignment. Chapter 3.1, 3.2 Chapter 4.1, 4.3 Reading assignment Chapter 3.1, 3.2 Chapter 4.1, 4.3 1 Outline Introduc5on to assembly programing Introduc5on to Y86 Y86 instruc5ons, encoding and execu5on 2 Assembly The CPU uses machine language to perform

More information

Process Layout and Function Calls

Process Layout and Function Calls Process Layout and Function Calls CS 6 Spring 07 / 8 Process Layout in Memory Stack grows towards decreasing addresses. is initialized at run-time. Heap grow towards increasing addresses. is initialized

More information

cmovxx ra, rb 2 fn ra rb irmovq V, rb 3 0 F rb V rmmovq ra, D(rB) 4 0 ra rb mrmovq D(rB), ra 5 0 ra rb OPq ra, rb 6 fn ra rb jxx Dest 7 fn Dest

cmovxx ra, rb 2 fn ra rb irmovq V, rb 3 0 F rb V rmmovq ra, D(rB) 4 0 ra rb mrmovq D(rB), ra 5 0 ra rb OPq ra, rb 6 fn ra rb jxx Dest 7 fn Dest Instruction Set Architecture Computer Architecture: Instruction Set Architecture CSci 2021: Machine Architecture and Organization Lecture #16, February 24th, 2016 Your instructor: Stephen McCamant Based

More information

Second Part of the Course

Second Part of the Course CSC 2400: Computer Systems Towards the Hardware 1 Second Part of the Course Toward the hardware High-level language (C) assembly language machine language (IA-32) 2 High-Level Language g Make programming

More information

CSC 252: Computer Organization Spring 2018: Lecture 11

CSC 252: Computer Organization Spring 2018: Lecture 11 CSC 252: Computer Organization Spring 2018: Lecture 11 Instructor: Yuhao Zhu Department of Computer Science University of Rochester Action Items: Assignment 3 is due March 2, midnight Announcement Programming

More information

Wrap-Up. Lecture 10 Computer Architecture V. Performance Metrics. Overview. CPI for PIPE (Cont.) CPI for PIPE. Clock rate

Wrap-Up. Lecture 10 Computer Architecture V. Performance Metrics. Overview. CPI for PIPE (Cont.) CPI for PIPE. Clock rate Lecture 10 Computer Architecture V Overview rap-up of PIP esign Performance analysis etch stage design xceptional conditions odern High-Performance Processors Out-of-order execution rap-up 10 1 atorarkitektur

More information

Wrap-Up. Lecture 10 Computer Architecture V. Performance Metrics. Overview. CPI for PIPE (Cont.) CPI for PIPE. Clock rate

Wrap-Up. Lecture 10 Computer Architecture V. Performance Metrics. Overview. CPI for PIPE (Cont.) CPI for PIPE. Clock rate Lecture 10 Computer Architecture V Overview rap-up of PIP esign Performance analysis etch stage design xceptional conditions rap-up Performance etrics Clock rate easured in egahertz or Gigahertz unction

More information

Introduction. Chapter 4. Instruction Execution. CPU Overview. University of the District of Columbia 30 September, Chapter 4 The Processor 1

Introduction. Chapter 4. Instruction Execution. CPU Overview. University of the District of Columbia 30 September, Chapter 4 The Processor 1 Chapter 4 The Processor Introduction CPU performance factors Instruction count etermined by IS and compiler CPI and Cycle time etermined by CPU hardware We will examine two MIPS implementations simplified

More information

Processor Architecture

Processor Architecture Processor Architecture Jinkyu Jeong (jinkyu@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu SSE2030: Introduction to Computer Systems, Spring 2018, Jinkyu Jeong (jinkyu@skku.edu)

More information

Processor Architecture. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Processor Architecture. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University Processor Architecture Jin-Soo Kim (jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Moore s Law Gordon Moore @ Intel (1965) 2 Computer Architecture Trends (1)

More information

Overview. CS429: Computer Organization and Architecture. Y86 Instruction Set. Building Blocks

Overview. CS429: Computer Organization and Architecture. Y86 Instruction Set. Building Blocks Overview CS429: Computer Organization and Architecture Dr. Bill Young Department of Computer Sciences University of Texas at Austin Last updated: March 15, 2018 at 10:54 How do we build a digital computer?

More information

Sequential CPU Implementation.

Sequential CPU Implementation. Sequential CPU Implementation Y86 Instruction Set P259 Byte 0 1 2 3 4 5 nop 0 0 halt 1 0 rrmovl ra, rb 2 0 ra rb irmovl V, rb 3 0 8 rb V rmmovl ra, D(rB) 4 0 ra rb D mrmovl D(rB), ra 5 0 ra rb D OPl ra,

More information

Wrap-Up. CS:APP Chapter 4 Computer Architecture. Overview. Performance Metrics. CPI for PIPE. Randal E. Bryant. Carnegie Mellon University

Wrap-Up. CS:APP Chapter 4 Computer Architecture. Overview. Performance Metrics. CPI for PIPE. Randal E. Bryant. Carnegie Mellon University CS:APP Chapter 4 Computer Architecture rap-up Overview rap-up of PIP esign Performance analysis etch stage design xceptional conditions odern High-Performance Processors Out-of-order execution Randal.

More information

Intel x86-64 and Y86-64 Instruction Set Architecture

Intel x86-64 and Y86-64 Instruction Set Architecture CSE 2421: Systems I Low-Level Programming and Computer Organization Intel x86-64 and Y86-64 Instruction Set Architecture Presentation J Read/Study: Bryant 3.1 3.5, 4.1 Gojko Babić 03-07-2018 Intel x86

More information

CS241 Computer Organization Spring 2015 IA

CS241 Computer Organization Spring 2015 IA CS241 Computer Organization Spring 2015 IA-32 2-10 2015 Outline! Review HW#3 and Quiz#1! More on Assembly (IA32) move instruction (mov) memory address computation arithmetic & logic instructions (add,

More information

Giving credit where credit is due

Giving credit where credit is due CSC 230J Computer Organization Processor Architecture VI: rap-up r. Steve Goddard goddard@cse.unl.edu Giving credit where credit is due ost of slides for this lecture are based on slides created by r.

More information

Stage Computation: Arith/Log. Ops

Stage Computation: Arith/Log. Ops Stage Computation: Arith/Log. Ops OPl ra, rb Fetch icode:ifun M 1 [PC] ra:rb M 1 [PC+1] Read instruction byte Read register byte back valp PC+2 vala R[rA] valb R[rB] vale valb OP vala Set CC R[rB] vale

More information

CS241 Computer Organization Spring Addresses & Pointers

CS241 Computer Organization Spring Addresses & Pointers CS241 Computer Organization Spring 2015 Addresses & Pointers 2-24 2015 Outline! Addresses & Pointers! leal - load effective address! Condition Codes & Jumps! conditional statements: if-then-else! conditional

More information

Foundations of Computer Systems

Foundations of Computer Systems 18-600 Foundations of Computer Systems Lecture 7: Processor Architecture & Design John P. Shen & Gregory Kesden September 20, 2017 Lecture #7 Processor Architecture & Design Lecture #8 Pipelined Processor

More information

administrivia today start assembly probably won t finish all these slides Assignment 4 due tomorrow any questions?

administrivia today start assembly probably won t finish all these slides Assignment 4 due tomorrow any questions? administrivia today start assembly probably won t finish all these slides Assignment 4 due tomorrow any questions? exam on Wednesday today s material not on the exam 1 Assembly Assembly is programming

More information

Turning C into Object Code Code in files p1.c p2.c Compile with command: gcc -O p1.c p2.c -o p Use optimizations (-O) Put resulting binary in file p

Turning C into Object Code Code in files p1.c p2.c Compile with command: gcc -O p1.c p2.c -o p Use optimizations (-O) Put resulting binary in file p Turning C into Object Code Code in files p1.c p2.c Compile with command: gcc -O p1.c p2.c -o p Use optimizations (-O) Put resulting binary in file p text C program (p1.c p2.c) Compiler (gcc -S) text Asm

More information

COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 4. The Processor

COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 4. The Processor COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface 5 th Edition Chapter 4 The Processor Introduction CPU performance factors Instruction count Determined by ISA and compiler CPI and Cycle

More information

Assembly I: Basic Operations. Computer Systems Laboratory Sungkyunkwan University

Assembly I: Basic Operations. Computer Systems Laboratory Sungkyunkwan University Assembly I: Basic Operations Jin-Soo Kim (jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Moving Data (1) Moving data: movl source, dest Move 4-byte ( long )

More information

Machine-Level Programming II: Control and Arithmetic

Machine-Level Programming II: Control and Arithmetic Machine-Level Programming II: Control and Arithmetic CSCI 2400: Computer Architecture Instructor: David Ferry Slides adapted from Bryant & O Hallaron s slides 1 Today Complete addressing mode, address

More information

CSC 2400: Computer Systems. Towards the Hardware: Machine-Level Representation of Programs

CSC 2400: Computer Systems. Towards the Hardware: Machine-Level Representation of Programs CSC 2400: Computer Systems Towards the Hardware: Machine-Level Representation of Programs Towards the Hardware High-level language (Java) High-level language (C) assembly language machine language (IA-32)

More information

CS61 Section Solutions 3

CS61 Section Solutions 3 CS61 Section Solutions 3 (Week of 10/1-10/5) 1. Assembly Operand Specifiers 2. Condition Codes 3. Jumps 4. Control Flow Loops 5. Procedure Calls 1. Assembly Operand Specifiers Q1 Operand Value %eax 0x104

More information

CSC 8400: Computer Systems. Machine-Level Representation of Programs

CSC 8400: Computer Systems. Machine-Level Representation of Programs CSC 8400: Computer Systems Machine-Level Representation of Programs Towards the Hardware High-level language (Java) High-level language (C) assembly language machine language (IA-32) 1 Compilation Stages

More information

Credits to Randy Bryant & Dave O Hallaron

Credits to Randy Bryant & Dave O Hallaron Mellon Machine Level Programming II: Arithmetic & Control Lecture 4, March 10, 2011 Alexandre David Credits to Randy Bryant & Dave O Hallaron from Carnegie Mellon 1 Today Complete addressing mode, address

More information

Chapter 4. The Processor

Chapter 4. The Processor Chapter 4 The Processor Introduction CPU performance factors Instruction count Determined by ISA and compiler CPI and Cycle time Determined by CPU hardware We will examine two MIPS implementations A simplified

More information

Assembly I: Basic Operations. Jo, Heeseung

Assembly I: Basic Operations. Jo, Heeseung Assembly I: Basic Operations Jo, Heeseung Moving Data (1) Moving data: movl source, dest Move 4-byte ("long") word Lots of these in typical code Operand types Immediate: constant integer data - Like C

More information

Chapter 4. Instruction Execution. Introduction. CPU Overview. Multiplexers. Chapter 4 The Processor 1. The Processor.

Chapter 4. Instruction Execution. Introduction. CPU Overview. Multiplexers. Chapter 4 The Processor 1. The Processor. COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface 5 th Edition COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface 5 th Edition Chapter 4 The Processor The Processor - Introduction

More information

ASSEMBLY I: BASIC OPERATIONS. Jo, Heeseung

ASSEMBLY I: BASIC OPERATIONS. Jo, Heeseung ASSEMBLY I: BASIC OPERATIONS Jo, Heeseung MOVING DATA (1) Moving data: movl source, dest Move 4-byte ("long") word Lots of these in typical code Operand types Immediate: constant integer data - Like C

More information

COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 4. The Processor

COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 4. The Processor COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface 5 th Edition Chapter 4 The Processor COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface 5 th Edition The Processor - Introduction

More information

Process Layout, Function Calls, and the Heap

Process Layout, Function Calls, and the Heap Process Layout, Function Calls, and the Heap CS 6 Spring 20 Prof. Vern Paxson TAs: Devdatta Akhawe, Mobin Javed, Matthias Vallentin January 9, 20 / 5 2 / 5 Outline Process Layout Function Calls The Heap

More information

Computer Hardware Engineering

Computer Hardware Engineering Computer Hardware ngineering IS2, spring 25 Lecture 6: Pipelined Processors ssociate Professor, KTH Royal Institute of Technology ssistant Research ngineer, University of California, Berkeley Slides version.

More information

Function Calls COS 217. Reading: Chapter 4 of Programming From the Ground Up (available online from the course Web site)

Function Calls COS 217. Reading: Chapter 4 of Programming From the Ground Up (available online from the course Web site) Function Calls COS 217 Reading: Chapter 4 of Programming From the Ground Up (available online from the course Web site) 1 Goals of Today s Lecture Finishing introduction to assembly language o EFLAGS register

More information

Chapter 4. The Processor

Chapter 4. The Processor Chapter 4 The Processor Introduction CPU performance factors Instruction count Determined by ISA and compiler CPI and Cycle time Determined by CPU hardware We will examine two MIPS implementations A simplified

More information

COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface. 5 th. Edition. Chapter 4. The Processor

COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface. 5 th. Edition. Chapter 4. The Processor COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface 5 th Edition Chapter 4 The Processor Introduction CPU performance factors Instruction count Determined by ISA and compiler CPI and Cycle

More information

CPSC 313, Summer 2013 Final Exam Solution Date: June 24, 2013; Instructor: Mike Feeley

CPSC 313, Summer 2013 Final Exam Solution Date: June 24, 2013; Instructor: Mike Feeley CPSC 313, Summer 2013 Final Exam Solution Date: June 24, 2013; Instructor: Mike Feeley 1 (10 marks) This question is concerned with the general principles of pipelining, dependencies and hazards. First,

More information

COMPUTER ORGANIZATION AND DESIGN

COMPUTER ORGANIZATION AND DESIGN COMPUTER ORGANIZATION AND DESIGN 5 Edition th The Hardware/Software Interface Chapter 4 The Processor 4.1 Introduction Introduction CPU performance factors Instruction count CPI and Cycle time Determined

More information

The Hardware/Software Interface CSE351 Spring 2013

The Hardware/Software Interface CSE351 Spring 2013 The Hardware/Software Interface CSE351 Spring 2013 x86 Programming II 2 Today s Topics: control flow Condition codes Conditional and unconditional branches Loops 3 Conditionals and Control Flow A conditional

More information

Machine Level Programming II: Arithmetic &Control

Machine Level Programming II: Arithmetic &Control Machine Level Programming II: Arithmetic &Control Arithmetic operations Control: Condition codes Conditional branches Loops Switch Kai Shen 1 2 Some Arithmetic Operations Two Operand Instructions: Format

More information

Assembly level Programming. 198:211 Computer Architecture. (recall) Von Neumann Architecture. Simplified hardware view. Lecture 10 Fall 2012

Assembly level Programming. 198:211 Computer Architecture. (recall) Von Neumann Architecture. Simplified hardware view. Lecture 10 Fall 2012 19:211 Computer Architecture Lecture 10 Fall 20 Topics:Chapter 3 Assembly Language 3.2 Register Transfer 3. ALU 3.5 Assembly level Programming We are now familiar with high level programming languages

More information

Machine-Level Programming II: Arithmetic & Control. Complete Memory Addressing Modes

Machine-Level Programming II: Arithmetic & Control. Complete Memory Addressing Modes Machine-Level Programming II: Arithmetic & Control CS-281: Introduction to Computer Systems Instructor: Thomas C. Bressoud 1 Complete Memory Addressing Modes Most General Form D(Rb,Ri,S)Mem[Reg[Rb]+S*Reg[Ri]+

More information

Sungkyunkwan University

Sungkyunkwan University - 2 - Complete addressing mode, address computation (leal) Arithmetic operations Control: Condition codes Conditional branches While loops - 3 - Most General Form D(Rb,Ri,S) Mem[ Reg[ R b ] + S Reg[ R

More information

CS 31: Intro to Systems ISAs and Assembly. Kevin Webb Swarthmore College February 9, 2016

CS 31: Intro to Systems ISAs and Assembly. Kevin Webb Swarthmore College February 9, 2016 CS 31: Intro to Systems ISAs and Assembly Kevin Webb Swarthmore College February 9, 2016 Reading Quiz Overview How to directly interact with hardware Instruction set architecture (ISA) Interface between

More information

CS 31: Intro to Systems ISAs and Assembly. Kevin Webb Swarthmore College September 25, 2018

CS 31: Intro to Systems ISAs and Assembly. Kevin Webb Swarthmore College September 25, 2018 CS 31: Intro to Systems ISAs and Assembly Kevin Webb Swarthmore College September 25, 2018 Overview How to directly interact with hardware Instruction set architecture (ISA) Interface between programmer

More information

Compiler Construction D7011E

Compiler Construction D7011E Compiler Construction D7011E Lecture 8: Introduction to code generation Viktor Leijon Slides largely by Johan Nordlander with material generously provided by Mark P. Jones. 1 What is a Compiler? Compilers

More information

Computer Systems Laboratory Sungkyunkwan University

Computer Systems Laboratory Sungkyunkwan University ARM & IA-32 Jin-Soo Kim (jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu ARM (1) ARM & MIPS similarities ARM: the most popular embedded core Similar basic set

More information

Machine-Level Programming II: Arithmetic & Control /18-243: Introduction to Computer Systems 6th Lecture, 5 June 2012

Machine-Level Programming II: Arithmetic & Control /18-243: Introduction to Computer Systems 6th Lecture, 5 June 2012 n Mello Machine-Level Programming II: Arithmetic & Control 15-213/18-243: Introduction to Computer Systems 6th Lecture, 5 June 2012 Instructors: Gregory Kesden The course that gives CMU its Zip! Last Time:

More information

CS3330 Exam 1 Spring Name: CS3330 Spring 2015 Exam 1 Page 1 of 6 ID: KEY

CS3330 Exam 1 Spring Name: CS3330 Spring 2015 Exam 1 Page 1 of 6  ID: KEY S3330 Spring 2015 xam 1 Page 1 of 6 mail I: KY S3330 xam 1 Spring 2015 Name: irections: Put the letter of your selection or the short answer requested in the box. Write clearly: if we are unsure what you

More information