How Computers Work Lecture 3 Page 1 How Computers Work Lecture 3 A Direct Execution RISC Processor: The Unpipelined BETA.

Slides:



Advertisements
Similar presentations
How Computers Work Lecture 2 Assembly Tools Calling Conventions
Advertisements

ELEN 468 Advanced Logic Design
CS 151 DIGITAL Systems Design Lecture 34 Datapath Analysis.
LC-3 Computer LC-3 Instructions
S. Barua – CPSC 240 CHAPTER 5 THE LC-3 Topics Memory organization Registers Instruction set Opcodes.
The Processor: Datapath & Control
Savio Chau Single Cycle Controller Design Last Time: Discussed the Designing of a Single Cycle Datapath Control Datapath Memory Processor (CPU) Input Output.
ENGIN112 L34: Datapath Analysis November 24, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 34 Datapath Analysis.
L18 – Pipeline Issues 1 Comp 411 – Spring /03/08 CPU Pipelining Issues Finishing up Chapter 6 This pipe stuff makes my head hurt! What have you.
L17 – Pipeline Issues 1 Comp 411 – Fall /1308 CPU Pipelining Issues Finishing up Chapter 6 This pipe stuff makes my head hurt! What have you been.
Computer Structure - Datapath and Control Goal: Design a Datapath  We will design the datapath of a processor that includes a subset of the MIPS instruction.
Lecture 5 Sept 14 Goals: Chapter 2 continued MIPS assembly language instruction formats translating c into MIPS - examples.
L16- Building a Computer 1 Comp 411 – Spring /27/08 Building a Computer I wonder where this goes? Instruction Memory A D 0 1 MIPS Kit ALU AB.
Computer Science 210 Computer Organization The Instruction Execution Cycle.
6.004 – Fall /17/0L12 – Instruction Set 1 Designing an Instruction Set Lab 4 due today NEXT TUESDAY, 10/22!
Multiple-bus organization
COSC 3430 L08 Basic MIPS Architecture.1 COSC 3430 Computer Architecture Lecture 08 Processors Single cycle Datapath PH 3: Sections
How Computers Work Lecture 5 Page 1 How Computers Work Lecture 5 Memory Implementation.
6.004 – Fall /29/0L15 – Building a Beta 1 Building the Beta.
Processor: Datapath and Control
Lec 15Systems Architecture1 Systems Architecture Lecture 15: A Simple Implementation of MIPS Jeremy R. Johnson Anatole D. Ruslanov William M. Mongan Some.
Gary MarsdenSlide 1University of Cape Town Chapter 5 - The Processor  Machine Performance factors –Instruction Count, Clock cycle time, Clock cycles per.
Computer Organization CS224 Fall 2012 Lesson 22. The Big Picture  The Five Classic Components of a Computer  Chapter 4 Topic: Processor Design Control.
ECE 445 – Computer Organization
Computer Organization and Design Building a Computer!
IT253: Computer Organization Lecture 9: Making a Processor: Single-Cycle Processor Design Tonga Institute of Higher Education.
Our programmer needs to do this !
Computer Organization and Design Pipelining Montek Singh Dec 2, 2015 Lecture 16 (SELF STUDY – not covered on the final exam)
Computer Organization and Design Building a Computer! Montek Singh Nov 18-20, 2015 Lecture 14.
L17 – Pipeline Issues 1 Comp 411 – Fall /23/09 CPU Pipelining Issues Read Chapter This pipe stuff makes my head hurt! What have you been.
How Computers Work Lecture 4 Page 1 How Computers Work Lecture 4 Computer Arithmetic.
Single Cycle Controller Design
SRC: instruction formats Op-coderarb rc c Type D Op-code Type Aunused Op-codera Type Bc1 21 Op-coderarb.
Computer Architecture Lecture 6.  Our implementation of the MIPS is simplified memory-reference instructions: lw, sw arithmetic-logical instructions:
Introduction CPU performance factors
ELEN 468 Advanced Logic Design
Morgan Kaufmann Publishers The Processor
Morgan Kaufmann Publishers
Morgan Kaufmann Publishers The Processor
Prof. Sirer CS 316 Cornell University
Computer Organization and Design Building a Computer!
Decode and Operand Read
INDEX UNIT-III PPT SLIDES
Processor (I).
Computer Science 210 Computer Organization
Design of the Control Unit for Single-Cycle Instruction Execution
CS/COE0447 Computer Organization & Assembly Language
Building a Computer I wonder where this goes? MIPS Kit ALU 1
Computer Science 210 Computer Organization
Design of the Control Unit for One-cycle Instruction Execution
How Computers Work Lecture 13 Details of the Pipelined Beta
Building a Computer I wonder where this goes? MIPS Kit ALU 1
Topic 5: Processor Architecture Implementation Methodology
Instruction encoding We’ve already seen some important aspects of processor design. A datapath contains an ALU, registers and memory. Programmers and compilers.
Programmer’s View of the EAGLE
The Processor Lecture 3.2: Building a Datapath with Control
Topic 5: Processor Architecture
COMS 361 Computer Organization
Computer Organization and Design Building a Computer!
Prof. Sirer CS 316 Cornell University
Instruction encoding We’ve already seen some important aspects of processor design. A datapath contains an ALU, registers and memory. Programmers and compilers.
Building a Computer! Don Porter Lecture 14.
Computer Organization and Design Building a Computer!
RTL for the SRC pipeline registers
Example 1: (expression evaluation)
CS501 Advanced Computer Architecture
The Processor: Datapath & Control.
COMS 361 Computer Organization
Processor: Datapath and Control
CS/COE0447 Computer Organization & Assembly Language
Presentation transcript:

How Computers Work Lecture 3 Page 1 How Computers Work Lecture 3 A Direct Execution RISC Processor: The Unpipelined BETA

How Computers Work Lecture 3 Page 2 What you can do with very little: Each instruction class can be implemented using a few simple components. Components:

How Computers Work Lecture 3 Page 3 Review:   Model of Computation PC r0 r1 r2 r31 32 bits always 0 Processor State 32 bits (4 bytes) Instruction Memory next instr Fetch PC  + 1 Execute fetched instruction Repeat! Fetch/Execute Loop:

How Computers Work Lecture 3 Page 4 Review: BETA Instructions Two 32-bit Instruction Formats: UnusedRcRaOPCODERbOPCODERa16 bit Constant Rc

How Computers Work Lecture 3 Page 5 Review:  ALU Operations ADD(ra, rb, rc)rc  + What the machine sees (32-bit instruction word): What we prefer to see: symbolic ASSEMBLY LANGUAGE Alternative instruction format: ADDC(ra, const, rc)rc  + sext(const) “Add the contents of ra to the contents of rb; store the result in rc” SIMILARLY FOR: SUB, SUBC (optional) MUL, MULC DIV, DIVC BITWISE LOGIC: AND, ANDC OR, ORC XOR, XORC SHIFTS: SHL, SHR, SAR (shift left, right; shift arith right) COMPARES CMPEQ, CMPLT, CMPLE “Add the contents of ra to const; store the result in rc” UnusedRcRaOPCODERbOPCODERa16 bit Constant Rc

How Computers Work Lecture 3 Page 6 WD Memory WD Register File RA2 Memory RD2 WA RC WERF WEMEM WA WE A B A op B Register File RA1 RD1 RA2 RD2 RARBRC BSELASEL ALUFN WDSEL ALU Register File SEXT C 4:0 9:5 20:5 25:2131:26 OPCODE RA1 Memory RD1 PC Q +1 D PC Z 01 BRZ(R31,XADDR,XP) XADDR 01 2 ISEL PCSEL OPCODE A Descending Data Flow View of the Beta Operate class: Rc op

How Computers Work Lecture 3 Page 7 Combinational Read Port on Memory Memory A Q Address

How Computers Work Lecture 3 Page 8 Data Register Works like a camera –D = image –Q = picture –E = On/Off Switch –clock = shutter release button D E Clock Q

How Computers Work Lecture 3 Page 9 D Register w/ Enable clk D Q QD E E D Q E

How Computers Work Lecture 3 Page 10 CLK 2-Port Register File Register File (2-port) RA1RA2 WA WE WD RD1RD CLK Write Enable Write Address Write Data (independent Read addresses) (Independent Read Data) 32 What if (say) WA=RA1??? RD1 reads value from last cycle! Note: Always ZERO! WE WA WD RA RD A A new

How Computers Work Lecture 3 Page 11 Selector (a.k.a. Multiplexor / MUX) Output Q is selected to be 1 of N inputs N is a power of 2 K select inputs, K = log2(n) May be ganged to select one W-bit word out of N multi-bit words S S... D N-1 D0D0 D1D1 D2D2 D0D0 D1D1 D2D2... Q = D s KK W W

How Computers Work Lecture 3 Page 12 WD Memory WD Register File RA2 Memory RD2 WA RC WERF WEMEM WA WE A B A op B Register File RA1 RD1 RA2 RD2 RARBRC BSELASEL ALUFN WDSEL ALU Register File SEXT C 4:0 9:5 20:5 25:2131:26 OPCODE RA1 Memory RD1 PC Q +1 D PC Z 01 BRZ(R31,XADDR,XP) XADDR 01 2 ISEL PCSEL OPCODE A Descending Data Flow View of the Beta Operate class: Rc op

How Computers Work Lecture 3 Page 13 WD Memory WD Register File RA2 Memory RD2 WA RC WERF WEMEM WA WE A B A op B Register File RA1 RD1 RA2 RD2 RARBRC BSELASEL ALUFN WDSEL ALU Register File SEXT C 4:0 9:5 20:5 25:2131:26 OPCODE RA1 Memory RD1 PC Q +1 D PC Z 01 BRZ(R31,XADDR,XP) XADDR 01 2 ISEL PCSEL OPCODE A Descending Data Flow View of the Beta Operate class: Rc op C

How Computers Work Lecture 3 Page 14 Review:  Branches Note: “displacemen t” is coded as a CONSTANT in a field of the instruction! Conditional: rc = +1; then BRNZ(ra, label, rc)if nonzero then PC + displacement BRZ(ra, label, rc)if zero then PC + displacement Unconditional: rc = +1; then BRZ(r31, label, rc) PC + displacement Indirect: rc = +1; then JMP(ra, rc)PC

How Computers Work Lecture 3 Page 15 WD Memory WD Register File RA2 Memory RD2 WA RC WERF WEMEM WA WE A B A op B Register File RA1 RD1 RA2 RD2 RARBRC BSELASEL ALUFN WDSEL ALU Register File SEXT C 4:0 9:5 20:5 25:2131:26 OPCODE RA1 Memory RD1 PC Q +1 D PC Z 01 BRZ(R31,XADDR,XP) XADDR 01 2 ISEL PCSEL OPCODE A Descending Data Flow View of the Beta Rc +1; if =0 then PC +C

How Computers Work Lecture 3 Page 16 WD Memory WD Register File RA2 Memory RD2 WA RC WERF WEMEM WA WE A B A op B Register File RA1 RD1 RA2 RD2 RARBRC BSELASEL ALUFN WDSEL ALU Register File SEXT C 4:0 9:5 20:5 25:2131:26 OPCODE RA1 Memory RD1 PC Q +1 D PC Z 01 BRZ(R31,XADDR,XP) XADDR 01 2 ISEL PCSEL OPCODE A Descending Data Flow View of the Beta JMP: Rc +1; PC + C

How Computers Work Lecture 3 Page 17 Review:  Loads & Stores LD(ra, C, rc)rc  + sext(C)] > ST(rc, C, ra)Mem[ + sext(C)]  ST(ra, C, rc)Mem[ + sext(C)]  Old New

How Computers Work Lecture 3 Page 18 Straightening Out Store Old Format: ST(Rc, C, Ra) –Mem[ + C] –ST(R1, 2, R3) means Mem[ + 2] New Format: ST(Ra, C, Rc) –Mem[ + C] –ST(R1, 2, R3) means Mem[ + 2] Both versions of Store work “ from left to right ” in assembly language. Difference is only in the binary encoding of the instruction, and the hardware implementation ’ s decoding of the binary encoding.

How Computers Work Lecture 3 Page 19 WD Memory WD Register File RA2 Memory RD2 WA RC WERF WEMEM WA WE A B A op B Register File RA1 RD1 RA2 RD2 RARBRC BSELASEL ALUFN WDSEL ALU Register File SEXT C 4:0 9:5 20:5 25:2131:26 OPCODE RA1 Memory RD1 PC Q +1 D PC Z 01 BRZ(R31,XADDR,XP) XADDR 01 2 ISEL PCSEL OPCODE A Descending Data Flow View of the Beta LD : Rc +C]

How Computers Work Lecture 3 Page 20 WD Memory WD Register File RA2 Memory RD2 WA RC WERF WEMEM WA WE A B A op B Register File RA1 RD1 RA2 RD2 RARBRC BSELASEL ALUFN WDSEL ALU Register File SEXT C 4:0 9:5 20:5 25:2131:26 OPCODE RA1 Memory RD1 PC Q +1 D PC Z 01 BRZ(R31,XADDR,XP) XADDR 01 2 ISEL PCSEL OPCODE A Descending Data Flow View of the Beta ST: Mem[ +C]

How Computers Work Lecture 3 Page 21 LDR Load Relative Used for loading large (32 bit) constants with data from the instruction stream. Depends on the fact data and instruction memory are ports of one main memory. Use: LDR (label, Rc) RTL Description: Rc + Offset]> Note that Ra is ignored, Offset is calculated from label … LDR (label, R1) BR (label + 1) label: …

How Computers Work Lecture 3 Page 22 WD Memory WD Register File RA2 Memory RD2 WA RC WERF WEMEM WA WE A B A op B Register File RA1 RD1 RA2 RD2 RARBRC BSELASEL ALUFN WDSEL ALU Register File SEXT C 4:0 9:5 20:5 25:2131:26 OPCODE RA1 Memory RD1 PC Q +1 D PC Z 01 BRZ(R31,XADDR,XP) XADDR 01 2 ISEL PCSEL OPCODE A Descending Data Flow View of the Beta LDR : Rc +1+C]

How Computers Work Lecture 3 Page 23 Control Logic Truth Table Control Logic Inputs: OPCODEOPOPC Control Logic Outputs: WERF BSEL ALUFN Wr PCSEL ASEL WASEL WDSEL LDST BRZ BRNZJMPLDR(Illegal) RA2SEL Z YOU should be able to fill in this table! We can specify it via a table of the form

How Computers Work Lecture 3 Page 24 Next Time - How to Add