Instruction Counter Address [3..0] CLK Instruction ROM 0000: 000 0000 0001: 001 0001 0010: 010 0010 0011: 100 0000 0100: 011 0000 Inst [6..0] Control Unit.

Slides:



Advertisements
Similar presentations
Memory. Memory.
Advertisements

Machine cycle.
Part 4: combinational devices
CS/COE1541: Introduction to Computer Architecture Datapath and Control Review Sangyeun Cho Computer Science Department University of Pittsburgh.
Fetch Execute Cycle – In Detail -
Adding the Jump Instruction
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
Datorteknik DigitalCircuits bild 1 Combinational circuits Changes at inputs propagate at logic speed to outputs Not clocked No internal state (memoryless)
Changes in input values are reflected immediately (subject to the speed of light and electrical delays) on the outputs Each gate has an associated “electrical.
Microprocessor and Microcontroller
Computer Systems. Computer System Components Computer Networks.
CS-447– Computer Architecture Lecture 12 Multiple Cycle Datapath
Levels in Processor Design
Microprocessor Design
Recap – Our First Computer WR System Bus 8 ALU Carry output A B S C OUT F 8 8 To registers’ input/output and clock inputs Sequence of control signal combinations.
Lecture 16: Basic CPU Design
Lab 10 RT methodology (cont’d) Example 1 – a counter Example 2 – a repetitive-adder multiplier.
Processor I CPSC 321 Andreas Klappenecker. Midterm 1 Thursday, October 7, during the regular class time Covers all material up to that point History MIPS.
Fall 2007 L16: Memory Elements LECTURE 16: Clocks Sequential circuit design The basic memory element: a latch Flip Flops.
Pipelining By Toan Nguyen.
Lecture 24: CPU Design Today’s topic –Multi-Cycle ALU –Introduction to Pipelining 1.
Some Useful Circuits Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University.
Control pins and Writing Microcode. Simple architecture Recall our architecture from the previous week It was a simple bus architecture “Control” was.
Rabie A. Ramadan Lecture 3
COSC 3430 L08 Basic MIPS Architecture.1 COSC 3430 Computer Architecture Lecture 08 Processors Single cycle Datapath PH 3: Sections
EE204 L12-Single Cycle DP PerformanceHina Anwar Khan EE204 Computer Architecture Single Cycle Data path Performance.
IT253: Computer Organization Lecture 9: Making a Processor: Single-Cycle Processor Design Tonga Institute of Higher Education.
Team DataPath Research Computer Architechture. PC and IF in the Processor.
MicroComputer Engineering DigitalCircuits slide 1 Combinational circuits Changes at inputs propagate at logic speed to outputs Not clocked No internal.
1. Building A CPU  We’ve built a small ALU l Add, Subtract, SLT, And, Or l Could figure out Multiply and Divide  What about the rest l How do.
Microarchitecture. Outline Architecture vs. Microarchitecture Components MIPS Datapath 1.
Sequential Logic Computer Organization II 1 © McQuain A clock is a free-running signal with a cycle time. A clock may be either high or.
More on Pipelining 1 CSE 2312 Computer Organization and Assembly Language Programming Vassilis Athitsos University of Texas at Arlington.
HOW COMPUTERS WORK THE CPU & MEMORY. THE PARTS OF A COMPUTER.
Datapath and Control AddressInstruction Memory Write Data Reg Addr Register File ALU Data Memory Address Write Data Read Data PC Read Data Read Data.
More on Pipelining 1 CSE 2312 Computer Organization and Assembly Language Programming Vassilis Athitsos University of Texas at Arlington.
1 CSE 140L Discussion How to design your CPU (and how it works!)
COM181 Computer Hardware Lecture 6: The MIPs CPU.
Control units In the last lecture, we introduced the basic structure of a control unit, and translated our assembly instructions into a binary representation.
1 CS/COE0447 Computer Organization & Assembly Language Chapter 5 Part 3.
Chapter 4 From: Dr. Iyad F. Jafar Basic MIPS Architecture: Multi-Cycle Datapath and Control.
Exam-like questions.
CS161 – Design and Architecture of Computer Systems
CS161 – Design and Architecture of Computer Systems
Clocks A clock is a free-running signal with a cycle time.
Basics of digital systems
Morgan Kaufmann Publishers
The Register File and ALU
von Neumann Architecture CPU
CS/COE0447 Computer Organization & Assembly Language
MIPS processor continued
Single-Cycle CPU DataPath.
How does the CPU work? CPU’s program counter (PC) register has address i of the first instruction Control circuits “fetch” the contents of the location.
4-Bit Counter Spencer Canavan.
Levels in Processor Design
Levels in Processor Design
von Neumann Architecture CPU
The Processor Lecture 3.1: Introduction & Logic Design Conventions
Levels in Processor Design
Branch instructions We’ll implement branch instructions for the eight different conditions shown here. Bits 11-9 of the opcode field will indicate the.
Levels in Processor Design
Control units In the last lecture, we introduced the basic structure of a control unit, and translated our assembly instructions into a binary representation.
ECE 352 Digital System Fundamentals
Review: The whole processor
Levels in Processor Design
Objectives Describe common CPU components and their function: ALU Arithmetic Logic Unit), CU (Control Unit), Cache Explain the function of the CPU as.
Computer Architecture
COMS 361 Computer Organization
Processor: Datapath and Control
Presentation transcript:

Instruction Counter Address [3..0] CLK Instruction ROM 0000: : : : : Inst [6..0] Control Unit (Instruction Decoder) Instruction [6..4] Register File Arithmetic Logic Unit ALU Out [3..0] ALU_Out R1Out [3..0] R2Out [3..0] Add Mult ALU_Sel R1 Inst [3..0] R1_en R2 R2_en R3 R3_en Reg_Clr R1_Sel Reg_Clr R1_enR2_enR3_enR1_SelReg_ClrALU_Sel

Instruction Counter Address [3..0] CLK Instruction ROM 0000: : : : : Inst [6..0] Instruction [6..4] Register File Arithmetic Logic Unit ALU Out [3..0] ALU_Out R1Out [3..0] R2Out [3..0] Add Mult ALU_Sel R1 Inst [3..0] R1_en R2 R2_en R3 R3_en Reg_Clr R1_Sel Reg_Clr Clock cycle 0 Start! 0% through clock cycle Instruction Counter is initially at 0 and will output 0 (and increment its counter). Initially, control unit is outputting 0 for everything, so all the registers are not enabled, the muxes select input 0, and they are all being cleared. Note, the rest of the system is still outputting data, but right now it’s all “junk” because we have no idea what the values are, nor do we care Control Unit (Instruction Decoder) R1_enR2_enR3_enR1_SelReg_ClrALU_Sel ????

Instruction Counter Address [3..0] CLK Instruction ROM 0000: : : : : Inst [6..0] Instruction [6..4] Register File Arithmetic Logic Unit ALU Out [3..0] ALU_Out R1Out [3..0] R2Out [3..0] Add Mult ALU_Sel R1 R1_en R2 R2_en R3 R3_en Reg_Clr R1_Sel Reg_Clr Clock cycle 0 5% through clock cycle Instruction ROM will output the data at the address it is fed. Since it is fed 0000, it will output the first instruction. Control Unit receives the first 3 bits of the instruction to determine what to do. Register file ALSO gets the data, but since control unit was previously outputting 0 for everything, it doesn’t really matter since the register file is effectively turned off Control Unit (Instruction Decoder) R1_enR2_enR3_enR1_SelReg_ClrALU_Sel Inst [3..0] ???? ????

Instruction Counter Address [3..0] CLK Instruction ROM 0000: : : : : Inst [6..0] Instruction [6..4] Register File Arithmetic Logic Unit ALU Out [3..0] ALU_Out R1Out [3..0] R2Out [3..0] Add Mult ALU_Sel R1 R1_en R2 R2_en R3 R3_en Reg_Clr R1_Sel Reg_Clr Clock cycle 0 8% through clock cycle Control unit decodes the instruction and determines what to do by setting all the output pins accordingly. This is an init instruction, so the control unit will set Reg_Clr high to clear out our registers. This clears the register, and the registers ignore whatever is being sent into it. Our CPU is now stable, and it will remain this way until the next clock cycle. The registers will update on the next clock cycle, so it still currently outputs ???? Control Unit (Instruction Decoder) R1_enR2_enR3_enR1_SelReg_ClrALU_Sel D 1 D Inst [3..0] ???? 0000 ????

Instruction Counter Address [3..0] CLK Instruction ROM 0000: : : : : Inst [6..0] Instruction [6..4] Register File Arithmetic Logic Unit ALU Out [3..0] ALU_Out R1Out [3..0] R2Out [3..0] Add Mult ALU_Sel R1 R1_en R2 R2_en R3 R3_en Reg_Clr R1_Sel Reg_Clr Clock cycle 1 0% through clock cycle Instruction counter now outputs a 0001 because the clock rising edge makes it increment. Registers are now outputting 000 as well, this happens as soon as the next clock cycle begins Control Unit (Instruction Decoder) R1_enR2_enR3_enR1_SelReg_ClrALU_Sel D 1 D Inst [3..0] 0000 ???? 0000 ???? 0000 ????

Instruction Counter Address [3..0] CLK Instruction ROM 0000: : : : : Inst [6..0] Instruction [6..4] Register File Arithmetic Logic Unit ALU Out [3..0] ALU_Out R1Out [3..0] R2Out [3..0] Add Mult ALU_Sel R1 R1_en R2 R2_en R3 R3_en Reg_Clr R1_Sel Reg_Clr Clock cycle 1 5% through clock cycle Instruction ROM now will output the data stored in address 0001, which is Both adder and multiplier start to work on the new data now Control Unit (Instruction Decoder) R1_enR2_enR3_enR1_SelReg_ClrALU_Sel D 1 D Inst [3..0] 0000 ???? 0000 ???? 0000 ????

Instruction Counter Address [3..0] CLK Instruction ROM 0000: : : : : Inst [6..0] Instruction [6..4] Register File Arithmetic Logic Unit ALU Out [3..0] ALU_Out R1Out [3..0] R2Out [3..0] Add Mult ALU_Sel R1 R1_en R2 R2_en R3 R3_en Reg_Clr R1_Sel Reg_Clr Clock cycle 1 8% through clock cycle Control unit receives the new instruction and decodes it. Register file also gets the new data It is a move instruction into register 1, so control unit sets the control lines accordingly. Because of this, R1 will receive 0001 through the mux. R2 also receives 0001 but since R2_en is off, it will ignore that. But nothing happens until the next clock cycle Control Unit (Instruction Decoder) R1_enR2_enR3_enR1_SelReg_ClrALU_Sel D Inst [3..0] 0000 ???? ????

Instruction Counter Address [3..0] CLK Instruction ROM 0000: : : : : Inst [6..0] Instruction [6..4] Register File Arithmetic Logic Unit ALU Out [3..0] ALU_Out R1Out [3..0] R2Out [3..0] Add Mult ALU_Sel R1 R1_en R2 R2_en R3 R3_en Reg_Clr R1_Sel Reg_Clr Clock cycle 1 14% through clock cycle Adder finally finishes and calculates the proper value Control Unit (Instruction Decoder) R1_enR2_enR3_enR1_SelReg_ClrALU_Sel D Inst [3..0] 0000 ???? ????

Instruction Counter Address [3..0] CLK Instruction ROM 0000: : : : : Inst [6..0] Instruction [6..4] Register File Arithmetic Logic Unit ALU Out [3..0] ALU_Out R1Out [3..0] R2Out [3..0] Add Mult ALU_Sel R1 R1_en R2 R2_en R3 R3_en Reg_Clr R1_Sel Reg_Clr Clock cycle 1 25% through clock cycle Multiplier finally finishes. Our ALU_Sel control line is a “don’t care” however so the ALU will be outputting either the adder or multiplier output. We don’t care which one though since R3_en is 0, so we won’t store it either way. The key point however is that the ALU still does its job every cycle regardless. The CPU is stable now, and will stay like this until the next clock cycle Control Unit (Instruction Decoder) R1_enR2_enR3_enR1_SelReg_ClrALU_Sel D Inst [3..0] 0000 ????

Instruction Counter Address [3..0] CLK Instruction ROM 0000: : : : : Inst [6..0] Instruction [6..4] Register File Arithmetic Logic Unit ALU Out [3..0] ALU_Out R1Out [3..0] R2Out [3..0] Add Mult ALU_Sel R1 R1_en R2 R2_en R3 R3_en Reg_Clr R1_Sel Reg_Clr Clock cycle 2 0% through clock cycle New clock cycle! Counter increments again, is now 2. The registers also will immediately output their new value too Control Unit (Instruction Decoder) R1_enR2_enR3_enR1_SelReg_ClrALU_Sel D Inst [3..0] ????

Instruction Counter Address [3..0] CLK Instruction ROM 0000: : : : : Inst [6..0] Instruction [6..4] Register File Arithmetic Logic Unit ALU Out [3..0] ALU_Out R1Out [3..0] R2Out [3..0] Add Mult ALU_Sel R1 R1_en R2 R2_en R3 R3_en Reg_Clr R1_Sel Reg_Clr Clock cycle 2 5% through clock cycle Instruction ROM will now output the instruction at address 0010, which is Control Unit (Instruction Decoder) R1_enR2_enR3_enR1_SelReg_ClrALU_Sel D Inst [3..0] ????

Instruction Counter Address [3..0] CLK Instruction ROM 0000: : : : : Inst [6..0] Instruction [6..4] Register File Arithmetic Logic Unit ALU Out [3..0] ALU_Out R1Out [3..0] R2Out [3..0] Add Mult ALU_Sel R1 R1_en R2 R2_en R3 R3_en Reg_Clr R1_Sel Reg_Clr Clock cycle 2 7% through clock cycle Control unit decodes the new instruction, which is 010, which is a move into register 2. It will set the control lines. The register file also gets the new value and it will be fed the new value, but it won’t do anything until the next clock cycle Control Unit (Instruction Decoder) R1_enR2_enR3_enR1_SelReg_ClrALU_Sel D 0 D Inst [3..0] ????

Instruction Counter Address [3..0] CLK Instruction ROM 0000: : : : : Inst [6..0] Instruction [6..4] Register File Arithmetic Logic Unit ALU Out [3..0] ALU_Out R1Out [3..0] R2Out [3..0] Add Mult ALU_Sel R1 R1_en R2 R2_en R3 R3_en Reg_Clr R1_Sel Reg_Clr Clock cycle 2 25% through clock cycle Adder and multiplier are finished, but once again the ALU out is a don’t care so we don’t know what is being output. R2_en is 1, so R2 will store 0010 at the rising edge of the clock cycle, and R1 and R2 will just ignore their input and keep their current values. Our system is stable and will wait like this until the next clock cycle Control Unit (Instruction Decoder) R1_enR2_enR3_enR1_SelReg_ClrALU_Sel D 0 D Inst [3..0] ???? 0000 ????

Instruction Counter Address [3..0] CLK Instruction ROM 0000: : : : : Inst [6..0] Instruction [6..4] Register File Arithmetic Logic Unit ALU Out [3..0] ALU_Out R1Out [3..0] R2Out [3..0] Add Mult ALU_Sel R1 R1_en R2 R2_en R3 R3_en Reg_Clr R1_Sel Reg_Clr Clock cycle 3 0% through clock cycle New clock cycle Control Unit (Instruction Decoder) R1_enR2_enR3_enR1_SelReg_ClrALU_Sel D 0 D Inst [3..0] ???? 0000 ????

Instruction Counter Address [3..0] CLK Instruction ROM 0000: : : : : Inst [6..0] Instruction [6..4] Register File Arithmetic Logic Unit ALU Out [3..0] ALU_Out R1Out [3..0] R2Out [3..0] Add Mult ALU_Sel R1 R1_en R2 R2_en R3 R3_en Reg_Clr R1_Sel Reg_Clr 0011 Control Unit (Instruction Decoder) R1_enR2_enR3_enR1_SelReg_ClrALU_Sel D 0 0 Inst [3..0] ???? 0000 ???? 0000 Clock cycle 3 15% through clock cycle Control unit decoded the instruction, which is an add of R1 and R2 and store in R3. It sets the proper control lines. 0001

Instruction Counter Address [3..0] CLK Instruction ROM 0000: : : : : Inst [6..0] Instruction [6..4] Register File Arithmetic Logic Unit ALU Out [3..0] ALU_Out R1Out [3..0] R2Out [3..0] Add Mult ALU_Sel R1 R1_en R2 R2_en R3 R3_en Reg_Clr R1_Sel Reg_Clr 0011 Control Unit (Instruction Decoder) R1_enR2_enR3_enR1_SelReg_ClrALU_Sel D 0 0 Inst [3..0] ???? Clock cycle 3 25% through clock cycle Adder and multiplier are done. But ALU_Sel is set to 0 because we want the adder output, so that is what gets sent to R3. Our CPU is now stable and will wait until the next clock cycle. At the rising edge, R3 will store the ALU_Out value, which is 0011.

Instruction Counter Address [3..0] CLK Instruction ROM 0000: : : : : Inst [6..0] Instruction [6..4] Register File Arithmetic Logic Unit ALU Out [3..0] ALU_Out R1Out [3..0] R2Out [3..0] Add Mult ALU_Sel R1 R1_en R2 R2_en R3 R3_en Reg_Clr R1_Sel Reg_Clr 0100 Control Unit (Instruction Decoder) R1_enR2_enR3_enR1_SelReg_ClrALU_Sel D 0 0 Inst [3..0] ???? Clock cycle 4 0% through clock cycle Another new clock cycle!

Instruction Counter Address [3..0] CLK Instruction ROM 0000: : : : : Inst [6..0] Instruction [6..4] Register File Arithmetic Logic Unit ALU Out [3..0] ALU_Out R1Out [3..0] R2Out [3..0] Add Mult ALU_Sel R1 R1_en R2 R2_en R3 R3_en Reg_Clr R1_Sel Reg_Clr 0100 Control Unit (Instruction Decoder) R1_enR2_enR3_enR1_SelReg_ClrALU_Sel D Inst [3..0] Clock cycle 4 15% through clock cycle Instruction decoded, it is a move R3 into R1. So we set our control lines to enable R1, and to set R1_Sel to 1, which will select the R3 output.

Instruction Counter Address [3..0] CLK Instruction ROM 0000: : : : : Inst [6..0] Instruction [6..4] Register File Arithmetic Logic Unit ALU Out [3..0] ALU_Out R1Out [3..0] R2Out [3..0] Add Mult ALU_Sel R1 R1_en R2 R2_en R3 R3_en Reg_Clr R1_Sel Reg_Clr 0100 Control Unit (Instruction Decoder) R1_enR2_enR3_enR1_SelReg_ClrALU_Sel D Inst [3..0] ???? Clock cycle 4 25% through clock cycle Our adder and multiplier is done, but we don’t care what the outputs are. Our system is stable and will wait until the next clock cycle. At the rising edge, R1 will store The other registers will stay the same.