1 CSE 140L Discussion How to design your CPU (and how it works!)

Slides:



Advertisements
Similar presentations
ES 112 Project 2 bit ALU.
Advertisements

Chapter 9 Computer Design Basics. 9-2 Datapaths Reminding A digital system (or a simple computer) contains datapath unit and control unit. Datapath: A.
EEM 486 EEM 486: Computer Architecture Lecture 4 Designing a Multicycle Processor.
Instruction Counter Address [3..0] CLK Instruction ROM 0000: : : : : Inst [6..0] Control Unit.
VHDL Development for ELEC7770 VLSI Project Chris Erickson Graduate Student Department of Electrical and Computer Engineering Auburn University, Auburn,
1 COMP541 Datapaths II Montek Singh Mar 22, 2007.
Levels in Processor Design
Microprocessor Design
Lec 17 Nov 2 Chapter 4 – CPU design data path design control logic design single-cycle CPU performance limitations of single cycle CPU multi-cycle CPU.
331 W10.1Spring :332:331 Computer Architecture and Assembly Language Spring 2005 Week 10 Building a Multi-Cycle Datapath [Adapted from Dave Patterson’s.
Chapter 4 Sections 4.1 – 4.4 Appendix D.1 and D.2 Dr. Iyad F. Jafar Basic MIPS Architecture: Single-Cycle Datapath and Control.
COSC 3430 L08 Basic MIPS Architecture.1 COSC 3430 Computer Architecture Lecture 08 Processors Single cycle Datapath PH 3: Sections
Processor: Datapath and Control
EE204 L12-Single Cycle DP PerformanceHina Anwar Khan EE204 Computer Architecture Single Cycle Data path Performance.
CPE232 Basic MIPS Architecture1 Computer Organization Multi-cycle Approach Dr. Iyad Jafar Adapted from Dr. Gheith Abandah slides
Let’s look at a normal lw instruction first… 1. 2 Register file addresscontent 6 (00110) (00111) OpcodeSource register Destination register.
A four function ALU A 00 ADD B MUX SUB 11 Result AND OR
CDA 3101 Fall 2013 Introduction to Computer Organization Multicycle Datapath 9 October 2013.
Datapath and Control Unit Design
Design of a 8-bit RISC Micro controller Core By Ayush Mittal( ) Rakesh Kumar Sahoo( ) Under Guidance of Dr. M.B.Srinivas.
ALU (Continued) Computer Architecture (Fall 2006).
Microarchitecture. Outline Architecture vs. Microarchitecture Components MIPS Datapath 1.
Computer Architecture Lecture 9 MIPS ALU and Data Paths Ralph Grishman Oct NYU.
Register Transfer Languages (RTL)
1 ECE243 CPU Modification Lab. 2 You will add new insts to a CPU A CPU that implements mini ISA exists –you can compile it, load it onto DE2, run programs.
Datapath and Control AddressInstruction Memory Write Data Reg Addr Register File ALU Data Memory Address Write Data Read Data PC Read Data Read Data.
ECE 2110: Introduction to Digital Systems Chapter 6 Combinational Logic Design Practices Multiplexers.
Chapter 4 From: Dr. Iyad F. Jafar Basic MIPS Architecture: Single-Cycle Datapath and Control.
Digital Design Lecture 8 Combinatorial Logic (Continued)
1 CS/COE0447 Computer Organization & Assembly Language Chapter 5 Part 2.
Chapter 4 From: Dr. Iyad F. Jafar Basic MIPS Architecture: Multi-Cycle Datapath and Control.
Discrete Systems I Lecture 10 Adder and ALU Profs. Koike and Yukita.
Combinational Circuits
CS161 – Design and Architecture of Computer Systems
CS161 – Design and Architecture of Computer Systems
Control & Execution Finite State Machines for Control MIPS Execution.
Computer Science 210 Computer Organization
More Devices: Control (Making Choices)
Combinational Logic Circuits
Morgan Kaufmann Publishers The Processor
Morgan Kaufmann Publishers
von Neumann Architecture CPU
Control & Execution Finite State Machines for Control MIPS Execution.
Computer Science 210 Computer Organization
CS/COE0447 Computer Organization & Assembly Language
CS/COE0447 Computer Organization & Assembly Language
Team A.W.E.S.O.M.- O 4000 February 13, 2007.
Drawbacks of single cycle implementation
Levels in Processor Design
Morgan Kaufmann Publishers The Processor
Topic 5: Processor Architecture Implementation Methodology
Rocky K. C. Chang 6 November 2017
Levels in Processor Design
von Neumann Architecture CPU
Topic 5: Processor Architecture
April 3 Fun with MUXes Implementing arbitrary logical functions
Enhancing Data Path M 4-bit Reg X A L U
Homework Reading Machine Projects Labs
A register design with parallel load input
Levels in Processor Design
Control Unit (single cycle implementation)
Levels in Processor Design
ECE 352 Digital System Fundamentals
Combinational Circuits
Foundations for Datapath Design
Control Unit for Multiple Cycle Implementation
Levels in Processor Design
Control Unit for Multiple Cycle Implementation
FloorPlan for Multicycle MIPS
Control Unit (single cycle implementation)
Presentation transcript:

1 CSE 140L Discussion How to design your CPU (and how it works!)

CPU Design First read the specification and make sure you totally understand it. We only have 8 instructions. For today’s discussion, we will concentrate only on the first six. Looking at the ISA, we must first determine what our CPU requires. How many registers? (We need 3 registers) What operations (and hence modules) do we need in our ALU? (We have to support an adder and a multiplier) We can start designing both the ALU and register file now.

Datapath Our ALU will be pretty simple: Two data inputs, two modules, and one output, with a MUX that determines which one it is. Arithmetic Logic Unit ALU Out [3..0] Add Mul t ALU_Sel Data1 [3…0] Data2 [3…0]

Datapath The reg file is more complex: We need 3 registers, each with their own enable lines. We also need a MUX in front of R1 so that we can select what data to send to it (either from the move instruction or from R3 instruction). Register File ALU_Out R1Out [3..0] R2Out [3..0] R1 Inst [3..0] R1_en R2 R2_en R3 R3_en Reg_Clr R1_Sel Reg_Clr

Control Path Once we have that figured out, we need to examine the control lines required. Our ALU will only require one control line, ALU_Sel, to determine which operation to support. Our register file however will require more. The init instruction will be done via a “CLR” line into all our registers. Each register will have its own register enable line. And finally we will need to a control line to the multiplexer that determines the input into R1 (either from the move instruction, or from R3). We then need to figure out what the control unit should do for each instruction. This just requires us to go through each of the instructions, draw out the state table for each of the outputs, and figure out what each instruction should be doing.

Control Path We then need to figure out what the control unit should do for each instruction. This just requires us to go through each of the instructions, draw out the state table for each of the outputs, and figure out what each instruction should be doing. We can have don’t cares too. InstR1_enR2_enR3_enR1_SelReg_CLRALU_Sel DC DC

Control Path Once we have finished that table we can draw out the logic. In this lab, let’s design the control unit using VHDL instead of an ugly schematic. begin process(instr) begin if (instr(2 downto 0) = "000") then clr <= '1'; r1_sel <= '0'; r1_en <= '1'; r2_en <= '1'; r3_en <= '1'; comp_en <= '1'; pc_en <= '0'; res_sel <= '0'; end if; if (instr(2 downto 0) = "001") then clr <= '0'; r1_sel <= '0'; r1_en <= '1'; r2_en <= '0'; r3_en <= '0'; comp_en <= '0'; pc_en <= '0'; res_sel <= '1'; end if;

Control Path The end result will be a control path unit that will read in the first 3 bits of our instruction (the opcode) and will output the proper values for each of the control lines. Control Unit (Instruction Decoder) Instruction [6..4] R1_enR2_enR3_enR1_SelReg_ClrALU_Sel