Processor Data Path and Control Diana Palsetia UPenn

Slides:



Advertisements
Similar presentations
P.Rajasekar & C.M.T.Karthigeyan Asst.Professor SRM University, Kattankulathur 8/22/2011 School of Computing, Department of IT 1.
Advertisements

Adders Used to perform addition, subtraction, multiplication, and division (sometimes) Half-adder adds rightmost (least significant) bit Full-adder.
The von Neumann Model – Chapter 4 COMP 2620 Dr. James Money COMP
Chapter 4 The Von Neumann Model
Chapter 4 The Von Neumann Model
Execution Cycle. Outline (Brief) Review of MIPS Microarchitecture Execution Cycle Pipelining Big vs. Little Endian-ness CPU Execution Time 1 IF ID EX.
Chapter 1. Basic Structure of Computers
Control path Recall that the control path is the physical entity in a processor which: fetches instructions, fetches operands, decodes instructions, schedules.
ARITHMETIC LOGIC SHIFT UNIT
Chapter 5 The LC-3.
Chapter 4 - ISA 1.The Von Neumann Model. 4-2 The Stored Program Computer 1943: ENIAC Presper Eckert and John Mauchly -- first general electronic computer.
CHAPTER 4 COMPUTER SYSTEM – Von Neumann Model
LC-3 Instruction Set Architecture (Textbook’s Chapter 5)
LC-3 Architecture Patt and Patel Ch. 4 1.
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.
Chapter Five The Processor: Datapath and Control.
LC-3 Instruction Set Architecture
Overview von Neumann Model Components of a Computer Some Computer Organization Models The Computer Bus An Example Organization: The LC-3.
The Processor Data Path & Control Chapter 5 Part 1 - Introduction and Single Clock Cycle Design N. Guydosh 2/29/04.
Computer Science 210 Computer Organization The Instruction Execution Cycle.
The von Neumann Model – Chapter 4 COMP 2620 Dr. James Money COMP
Introduction to Computing Systems from bits & gates to C & beyond Chapter 4 The Von Neumann Model Basic components Instruction processing.
Introduction to Computing Systems from bits & gates to C & beyond The Von Neumann Model Basic components Instruction processing.
EXECUTION OF COMPLETE INSTRUCTION
Chapter 4 The Von Neumann Model
The von Neumann Model – Chapter 4
Introduction to Computer Engineering CS/ECE 252, Fall 2009 Prof. Mark D. Hill Computer Sciences Department University of Wisconsin – Madison.
Chapter 5 The LC Instruction Set Architecture ISA = All of the programmer-visible components and operations of the computer memory organization.
The von Neumann Model – Chapter 4 COMP 2620 Dr. James Money COMP
© BYU LC3-DC Page 1 ECEn 224 LC3-DC Designing The LC-3 Control IR PC enaMARMenaPC enaALU enaMDR ALU AB.
Processor Data Path and Control How they work together.
Von Neumann Model Computer Organization I 1 September 2009 © McQuain, Feng & Ribbens The Stored Program Computer 1945: John von Neumann –
Chapter 4 The Von Neumann Model
Designing a CPU –Reading a programs instruction from memory –Decoding the instruction –Executing the instruction –Transferring Data to/From memory / IO.
Introduction to Computing Systems and Programming The LC-2.
Click to edit Master title style Click to edit Master text styles – –Second level Third level – –Fourth level » »Fifth level 1 – –Second level Third level.
Logic Gates Dr.Ahmed Bayoumi Dr.Shady Elmashad. Objectives  Identify the basic gates and describe the behavior of each  Combine basic gates into circuits.
LC-3 Datapath ECE/CS 252, Fall 2010 Prof. Mikko Lipasti Department of Electrical and Computer Engineering University of Wisconsin – Madison.
Dr.Ahmed Bayoumi Dr.Shady Elmashad
CS161 – Design and Architecture of Computer Systems
Chapter 4 The Von Neumann Model
COSC121: Computer Systems: Review
Chapter 4 The Von Neumann Model
Introduction to Computer Engineering
Chapter 4 The Von Neumann Model
Computer Science 210 Computer Organization
Design of the Control Unit for Single-Cycle Instruction Execution
Chapter 4 The Von Neumann Model
Computer Science 210 Computer Organization
Chapter 5 The LC-3.
Design of the Control Unit for One-cycle Instruction Execution
Introduction to Computer Engineering
Topic 6 LC-3.
The Von Neumann Model Basic components Instruction processing
Introduction to Computer Engineering
Levels in Processor Design
The Processor Lecture 3.1: Introduction & Logic Design Conventions
Computer Architecture
COMS 361 Computer Organization
Chapter 4 The Von Neumann Model
The Stored Program Computer
Basic components Instruction processing
The Processor: Datapath & Control.
Introduction to Computer Engineering
Introduction to Computer Engineering
Introduction to Computer Engineering
Introduction to Computer Engineering
Processor: Datapath and Control
Chapter 4 The Von Neumann Model
Instruction Set Architecture
Presentation transcript:

Processor Data Path and Control Diana Palsetia UPenn

What Do We Know? Already discovered: What’s next? Gates (AND, OR..) Combinational logic circuits (decoders, mux) Memory (latches, flip-flops) Sequential logic circuits (state machines) Simple processors (programmable traffic sign) What’s next? Apply all this to build a working processor

Von Neumann Model MEMORY MAR MDR INPUT OUTPUT Keyboard Monitor Mouse Scanner Disk OUTPUT Monitor Printer LED Disk PROCESSING UNIT ALU TEMP CONTROL UNIT PC IR

LC-3 Processor Von Nuemann Model CONTROL UNIT Notice all the “floating” control lines; they really come from FSM.

LC-3 Data Path CONTROL UNIT The data path of a computer is all the logic used to process information Filled arrow = info to be processed. Unfilled arrow = control signal.

One More Device Tri-state buffer Allows wires to be “shared” NOT an inverter! Device with a special output that can take a third state (i.e. besides 0 and 1) Allows wires to be “shared” Alternative to mux Only one source may drive at a time! Usually used to control data over a bus D Q E D Q 1 Z E Z = “high impedance” state

Data Path Components Global bus Memory and I/O Set of wires that carry 16-bit signals to many components Inputs to bus are controlled by triangle structure called tri-state devices Place signal on bus when enabled Only one (16-bit) signal should be enabled at a time Control unit decides which signal “drives” the bus Any number of components can read bus Register only captures bus data if write-enabled by the control unit Memory and I/O Control signals and data registers for memory and I/O devices Memory: MAR, MDR (also control signal for read/write) Input (keyboard): KBSR, KBDR Output (text display): DSR, DDR

LC-3 Data Path CONTROL UNIT Filled arrow = info to be processed. Unfilled arrow = control signal.

Data Path Components (cont.) ALU Input: register file or sign-extended bits from IR (immediate field) Output: bus; used by… Condition code registers Register file Memory and I/O registers Register File Two read addresses, one write address (3 bits each) Input: 16 bits from bus Result of ALU operation or memory (or I/O) read Outputs: two 16-bit Used by ALU, PC, memory address Data for store instructions passes through ALU

Data Path Components (contd..) PC and PCMUX Three inputs to PC, controlled by PCMUX Current PC plus 1 (normal operation) Adder output (BR, JMP, …) Bus (TRAP) MAR and MARMUX Some inputs to MAR, controlled by MARMUX Zero-extended IR[7:0] (used for TRAP; more later) Adder output (LD, ST, …)

Data Path Components (cont..) Condition Code Logic Looks at value (from ALU) on bus and generates N, Z, P signals N,Z,P Registers are set only when control unit enables them Control Unit For each stage in instruction processing decides: Who drives the bus? Which registers are write enabled? Which operation should ALU perform? Lets Look at Instruction Processing next..

Instructions Fundamental unit of work Constituents Opcode: operation to be performed Operands: data/locations to be used for operation Encoded as a sequence of bits (just like data!) Sometimes have a fixed length (e.g., 16 or 32 bits) Atomic: operation is either executed completely, or not at all

Instruction Processing DECODE instruction EVALUATE ADDRESS FETCH OPERANDS EXECUTE operation STORE result FETCH instruction from mem.

Instruction Processing: FETCH Idea Put next instruction in IR & increment PC Steps Load contents of PC into MAR Increment PC Send “read” signal to memory Read contents of MDR, store in IR F D EA OP EX S

FETCH in LC-3 Control Load PC into MAR (inc PC) Data CONTROL UNIT

FETCH in LC-3 Control Load PC into MAR Data Read Memory CONTROL UNIT

FETCH in LC-3 Control Data Load PC into MAR Read Memory Copy MDR into IR CONTROL UNIT Q: What if we didn’t have MDR/MAR? A: Couldn’t have bus!

Instruction Processing: DECODE Identify opcode In LC-3, always first four bits of instruction 4-to-16 decoder asserts control line corresponding to desired opcode Identify operands from the remaining bits Depends on opcode e.g., for LDR, last six bits give offset e.g., for ADD, last three bits name source operand #2 F D EA OP EX S

DECODE in LC-3 CONTROL UNIT Decoding usually a part of the Control Unit but can be seperate

Instruction Processing: EVALUATE ADDRESS Compute address For loads and stores For control-flow instructions Examples Add offset to base register (as in LDR) Add offset to PC (as in LD and BR) F D EA OP EX S

EVALUATE ADDRESS in LC-3 Load/Store CONTROL UNIT

Instruction Processing: FETCH OPERANDS Get source operands for operation Examples Read data from register file (ADD) Load data from memory (LDR) F D EA OP EX S

FETCH OPERANDS in LC-3 ADD CONTROL UNIT

FETCH OPERANDS in LC-3 LDR CONTROL UNIT

Instruction Processing: EXECUTE Actually perform operation Examples Send operands to ALU and assert ADD signal Do nothing (e.g., for loads and stores) F D EA OP EX S

EXECUTE in LC-3 ADD CONTROL UNIT

Instruction Processing: STORE Write results to destination Register or memory Examples Result of ADD is placed in destination reg. Result of load instruction placed in destination reg. For store instruction, place data in memory Set MDR Assert WRITE signal to memory F D EA OP EX S

STORE in LC-3 ADD This should probably be part of EXEC phase CONTROL UNIT This should probably be part of EXEC phase

STORE in LC-3 LDR CONTROL UNIT

STORE in LC-3 STORE Set MDR CONTROL UNIT

STORE in LC-3 STORE Set MDR Assert “write” CONTROL UNIT

Time to Complete One Instruction It takes fixed number of clock ticks (repetition of rising or falling edge) to execute each instruction The time interval between ticks is known as clock cycle Thus instruction performance is measured in clock cycles Hence the clock sequences each phase of an instruction by raising the right signals as the right time So what determines the time between ticks i.e. the length of the clock cycle?

Clocking Methodology Defines when signals can be read and when they can be written It is important to specify the timing of reads and writes because, if a value is written at the same time it is read, the value of read could be old, new or mix of both All values are stored on clock edge (edge-triggered) i.e. within a defined interval of time (length of the clock cycle) In a processor, since only memory elements can store values this means that Any collection of combinational logic must have its inputs coming from a set of memory elements and its outputs written into a set of memory elements

Clocking Methodology (contd..) The length of the clock cycle is determined as follows: The time necessary for the signals to reach memory element 2 defines the length of the clock cycle i.e. minimum clock cycle time must be at least as great as the maximum propagation delay of the circuit