Circuit Optimization CS 3220 Fall 2014 Hadi Esmaeilzadeh Georgia Institute of Technology Some slides adopted from Prof. Milos Prvulovic.

Slides:



Advertisements
Similar presentations
Single-Cycle Processor Design CS 3220 Fall 2014 Hadi Esmaeilzadeh Georgia Institute of Technology Some slides adopted from Prof. Milos.
Advertisements

Number Representation and Logic Design CS 3220 Fall 2014 Hadi Esmaeilzadeh Georgia Institute of Technology Some slides adopted from.
Addition (2). Outline Full Adder 3-Bit Adder 2’s Complement Subtraction.
1 ALUs. 2 Topics: ALU Overview - core of the integer datapath - 2 operands, 32-bits wide, plus control signals Exercise: A simple multiplier.
Kevin Walsh CS 3410, Spring 2010 Computer Science Cornell University Arithmetic See: P&H Chapter 3.1-3, C.5-6.
Binary Addition. Binary Addition (1) Binary Addition (2)
CS 61C L29 Combinational Logic Blocks (1) Garcia, Spring 2004 © UCB Lecturer PSOE Dan Garcia inst.eecs.berkeley.edu/~cs61c.
1 Foundations of Software Design Lecture 3: How Computers Work Marti Hearst Fall 2002.
Instruction Counter Address [3..0] CLK Instruction ROM 0000: : : : : Inst [6..0] Control Unit.
1 Lecture 4: Arithmetic for Computers (Part 3) CS 447 Jason Bakos.
Computer Structure - The ALU Goal: Build an ALU  The Arithmetic Logic Unit or ALU is the device that performs arithmetic and logical operations in the.
CS 61C L15 Blocks (1) A Carle, Summer 2005 © UCB inst.eecs.berkeley.edu/~cs61c/su05 CS61C : Machine Structures Lecture #15: Combinational Logic Blocks.
CS 61C L15 State & Blocks (1) A Carle, Summer 2006 © UCB inst.eecs.berkeley.edu/~cs61c/su06 CS61C : Machine Structures Lecture #15: State 2 and Blocks.
Lecture # 12 University of Tehran
CS 352 : Computer Organization and Design University of Wisconsin-Eau Claire Dan Ernst Constructing a Computer Creating a general purpose computing device.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Logic Circuits I.
+ CS 325: CS Hardware and Software Organization and Architecture Combinational Circuits 1.
Fall 2004EE 3563 Digital Systems Design EE 3563 Comparators  Comparators determine if two binary inputs are equal  Some will signal greater than/less.
Chapter 6-1 ALU, Adder and Subtractor
Number Systems and Arithmetic or Computers go to elementary school Reading – Peer Instruction Lecture Materials for Computer Architecture by Dr.
ECEN 248 Lab 4: Multiplexer Based Arithmetic Logic Unit
1 Arithmetic Logic Unit ALU. 2 The Bus Concept 3 CPU Building Blocks  Registers (IR, PC, ACC)  Control Unit (CU)  Arithmetic Logic Unit (ALU)
CS3350B Computer Architecture Winter 2015 Lecture 5.4: Combinational Logic Blocks Marc Moreno Maza [Adapted from lectures.
4. Computer Maths and Logic 4.2 Boolean Logic Logic Circuits.
1 Lecture 6 BOOLEAN ALGEBRA and GATES Building a 32 bit processor PH 3: B.1-B.5.
CDA 3101 Fall 2013 Introduction to Computer Organization The Arithmetic Logic Unit (ALU) and MIPS ALU Support 20 September 2013.
Lecture 18: Hardware for Arithmetic Today’s topic –Intro to Boolean functions (Continued) –Designing an ALU 1.
COMP541 Arithmetic Circuits
IT253: Computer Organization Lecture 9: Making a Processor: Single-Cycle Processor Design Tonga Institute of Higher Education.
A four function ALU A 00 ADD B MUX SUB 11 Result AND OR
IT253: Computer Organization
Kavita Bala CS 3410, Spring 2014 Computer Science Cornell University.
CS 1308 – Computer Literacy and the Internet Building the CPU.
MIPS ALU. Building from the adder to ALU ALU – Arithmetic Logic Unit, does the major calculations in the computer, including – Add – And – Or – Sub –
1  2004 Morgan Kaufmann Publishers Lets Build a Processor Almost ready to move into chapter 5 and start building a processor First, let’s review Boolean.
Cpu control.1 2/14 Datapath Components for Lab The Processor! ( th ed)
Branch Prediction CS 3220 Fall 2014 Hadi Esmaeilzadeh Georgia Institute of Technology Some slides adopted from Prof. Milos Prvulovic.
Gates AND, OR, NOT NAND, NOR Combinational logic No memory A set of inputs uniquely and unambiguously specifies.
MIPS ALU. Exercise – Design a selector? I need a circuit that takes two input bits, a and b, and a selector bit s. The function is that if s=0, f=a. if.
Computer Organization and Design Arithmetic & Logic Circuits Montek Singh Nov 2, 2015 Lecture 11.
How does a Computer Add ? Logic Gates within chips: AND Gate A B Output OR Gate A B Output A B A B
Combinational Circuits
CS161 – Design and Architecture of Computer Systems
Lecture 11: Hardware for Arithmetic
Computer Science 210 Computer Organization
Homework Reading Machine Projects Labs
Computer Organization and Design Arithmetic & Logic Circuits
Basics Combinational Circuits Sequential Circuits Ahmad Jawdat
Computer Science 210 Computer Organization
Computer Organization and Design Arithmetic & Logic Circuits
Computer Organization and Design Arithmetic & Logic Circuits
Arithmetic Circuits Didn’t I learn how
minecraft.gamepedia.com/Tutorials/Basic_Logic_Gates
Computer Organization and Design Arithmetic & Logic Circuits
HALF ADDER FULL ADDER Half Subtractor.
MIPS ALU.
Enemies make you stronger, allies make you weaker. Frank Herbert
EEL 3705 / 3705L Digital Logic Design
Lecture 11: Hardware for Arithmetic
robosavvy.com/forum/viewtopic.php?p=32542
Homework Reading Machine Projects Labs
COMS 361 Computer Organization
Multiple function unit design
ECE 352 Digital System Fundamentals
Combinational Circuits
ECE 352 Digital System Fundamentals
Computer Organization and Design Arithmetic Circuits
MIPS ALU.
MIPS ALU.
Arithmetic and Logic Circuits
Presentation transcript:

Circuit Optimization CS 3220 Fall 2014 Hadi Esmaeilzadeh Georgia Institute of Technology Some slides adopted from Prof. Milos Prvulovic

What is on the FPGA chip? 3 Apr 2014Logic Optimization2

An FPGA Logic Element (LE) 3 Apr 2014Logic Optimization3

FPGA Logic Elements 3 Apr 2014Logic Optimization4

Inside a Logic Element 3 Apr 2014Logic Optimization5

The ALU  With enough optimization, ALU by itself may become the critical path – Don’t try any of this until ALU is on the critical path!  It needs to add, subtract, and, or, nor, etc. – Depending on which instruction is currently in A stage  What we used before simplifies the R stage – No need to “decode” ALU operation, just feed IR[3:0] to ALU as control signal  But decoding still happens! – Must decide which operation produces the ALU output! – All operations get done, then a MUX to choose And it’s a large and slow MUX  We can do (much) better than that 3 Apr 2014Logic Optimization6

A (Much) Better ALU  Overall ALU latency is – Time for longest operation, plus – Time to select between that and other results  Which is the longest operation – What does + do? – What does – do? – What does < do? – What does <= do? – What does OR do? – … 3 Apr 2014Logic Optimization7

Aha!  Obviously AND, OR, XOR and their cousins are way faster than their cousins – Let’s just do them all, select between them (don’t care what is selected if this isn’t a logic op) – The whole thing done way before adder value is ready  But +,-,<,<= need to use an add/sub unit – One add/sub unit for all three, or one for each? 3 Apr 2014Logic Optimization8

One +,- unit?  Good: – Less hardware (32 one-bit adders with carry bits) – No need to select between ADD and SUB afterwards  Bad: – Must account for time to flip second operand (for SUB) before the adder/subtracter can begin its work! – Must use a full 1-bit adder for LSB bit If ADD was separate, it can use a half-adder (no carry-in) for the LSB But SUB needs Cin to be 1, so it uses full adders for all 16 bits  Turns out both bad things don’t matter! – Why? Hint: What would be the longest path if we have an adder and a separate subtractor, then chose between their results? 3 Apr 2014Logic Optimization9

What about LT,LE,GT,EQ,NE,etc.?  How do we do LT?  How do we do EQ?  How do we do LTE?  What about NE, GT, GTE? 3 Apr 2014Logic Optimization10

One ADD/SUB unit  So we have a single adder with – 32-bit data inputs (aluin1, aluin2) – A one bit carry-in input  Controlled by a new addsub control signal – If adding, don’t flip aluin2 bits, Cin is 0 – If subtracting (for – or for <), flip aluin2, Cin is 1  After this, we need to – For ADD, SUB: ADD/SUB output goes to aluout – For logic operations: logic unit output goes to aluout – For LT: MSB of ADD/SUB output goes to LSB of ALU 3 Apr 2014Logic Optimization11

Producing ALU output  So we have – Logic result – Add/sub result – Comparison result  We have three control signals, each enables one of these to get to ALU output – Can use a tri-state bus for ALU output, use enable signals to output results of different sub-units – Can “and” each with its enable signal, then “or” those to get final ALU result Almost identical to what tri-state bus ends up doing – Can use MUXes to select among these three One 3-input MUX controlled by a 2-bit signal Better: 2-input MUX for the faster two sub-units, control by 1-bit signal 2-input MUX between that and slowest one, another 1-bit control 3 Apr 2014Logic Optimization12