MicroComputer Engineering DigitalCircuits slide 1 Combinational circuits Changes at inputs propagate at logic speed to outputs Not clocked No internal.

Slides:



Advertisements
Similar presentations
Chapter 4: Combinational Logic
Advertisements

Control path Recall that the control path is the physical entity in a processor which: fetches instructions, fetches operands, decodes instructions, schedules.
Datorteknik DigitalCircuits bild 1 Combinational circuits Changes at inputs propagate at logic speed to outputs Not clocked No internal state (memoryless)
CHAPTER 3 Sequential Logic/ Circuits.  Concept of Sequential Logic  Latch and Flip-flops (FFs)  Shift Registers and Application  Counters (Types,
Digital Logic Chapter 5 Presented by Prof Tim Johnson
ReturnNext  Latch : a sequential device that watches all of its inputs continuously and changes its outputs at any time, independent of a clocking signal.
331 W08.1Spring :332:331 Computer Architecture and Assembly Language Spring 2006 Week 8: Datapath Design [Adapted from Dave Patterson’s UCB CS152.
Flip-Flops Last time, we saw how latches can be used as memory in a circuit. Latches introduce new problems: We need to know when to enable a latch. We.
LOGIC GATES ADDERS FLIP-FLOPS REGISTERS Digital Electronics Mark Neil - Microprocessor Course 1.
1 Lecture 28 Timing Analysis. 2 Overview °Circuits do not respond instantaneously to input changes °Predictable delay in transferring inputs to outputs.
CS 300 – Lecture 3 Intro to Computer Architecture / Assembly Language Sequential Circuits.
1  1998 Morgan Kaufmann Publishers Chapter Five The Processor: Datapath and Control.
1 COMP541 Datapaths II Montek Singh Mar 22, 2007.
11/16/2004EE 42 fall 2004 lecture 331 Lecture #33: Some example circuits Last lecture: –Edge triggers –Registers This lecture: –Example circuits –shift.
Chapter Five The Processor: Datapath and Control.
CS 61C L15 Blocks (1) A Carle, Summer 2005 © UCB inst.eecs.berkeley.edu/~cs61c/su05 CS61C : Machine Structures Lecture #15: Combinational Logic Blocks.
Shift Instructions (1/4)
Combinational Comparators
COMPUTER ARCHITECTURE & OPERATIONS I Instructor: Hao Ji.
ENGIN112 L26: Shift Registers November 3, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 26 Shift Registers.
ECE 232 L9.Mult.1 Adapted from Patterson 97 ©UCBCopyright 1998 Morgan Kaufmann Publishers ECE 232 Hardware Organization and Design Lecture 9 Computer Arithmetic.
Fall 2007 L16: Memory Elements LECTURE 16: Clocks Sequential circuit design The basic memory element: a latch Flip Flops.
The Processor Data Path & Control Chapter 5 Part 1 - Introduction and Single Clock Cycle Design N. Guydosh 2/29/04.
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.
CS3350B Computer Architecture Winter 2015 Lecture 5.2: State Circuits: Circuits that Remember Marc Moreno Maza [Adapted.
Objectives: Given input logice levels, state the output of an RS NAND and RS NOR. Given a clock signal, determine the PGT and NGT. Define “Edge Triggered”
Some Useful Circuits Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University.
EECS 370 Discussion 1 xkcd.com. EECS 370 Discussion Topics Today: – Floating Point – Finite State Machines – Combinational Logic – Sequential Logic 2.
COE 202: Digital Logic Design Sequential Circuits Part 1
Flip Flop
1 Registers and Counters A register consists of a group of flip-flops and gates that affect their transition. An n-bit register consists of n-bit flip-flops.
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
SEQUENTIAL CIRCUITS Component Design and Use. Register with Parallel Load  Register: Group of Flip-Flops  Ex: D Flip-Flops  Holds a Word of Data 
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Lecture 17 Dr. Shi Dept. of Electrical and Computer Engineering.
Fall EE 333 Lillevik 333f06-l8 University of Portland School of Engineering Computer Organization Lecture 8 Detailed MIPS datapath Timing overview.
Abdullah Said Alkalbani University of Buraimi
CDA 3101 Fall 2013 Introduction to Computer Organization The Arithmetic Logic Unit (ALU) and MIPS ALU Support 20 September 2013.
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.
Logic Design / Processor and Control Units Tony Diep.
Chapter 6 – Digital Electronics – Part 1 1.D (Data) Flip Flops 2.RS (Set-Reset) Flip Flops 3.T Flip Flops 4.JK Flip Flops 5.JKMS Flip Flops Information.
Synchronous Sequential Circuits by Dr. Amin Danial Asham.
1  1998 Morgan Kaufmann Publishers Simple Implementation Include the functional units we need for each instruction Why do we need this stuff?
CS61C L24 State Elements : Circuits that Remember (1) Garcia, Fall 2014 © UCB Senior Lecturer SOE Dan Garcia inst.eecs.berkeley.edu/~cs61c.
CS151 Introduction to Digital Design Chapter 5: Sequential Circuits 5-1 : Sequential Circuit Definition 5-2: Latches 1Created by: Ms.Amany AlSaleh.
Latches, Flip Flops, and Memory ECE/CS 252, Fall 2010 Prof. Mikko Lipasti Department of Electrical and Computer Engineering University of Wisconsin – Madison.
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Dr. Shi Dept. of Electrical and Computer Engineering.
CHAPTER 11 LATCHES AND FLIP-FLOPS This chapter in the book includes: Objectives Study Guide 11.1Introduction 11.2Set-Reset Latch 11.3Gated D Latch 11.4Edge-Triggered.
Copyright © 2001 Stephen A. Edwards All rights reserved Busses  Wires sometimes used as shared communication medium  Think “party-line telephone”  Bus.
Combinational Circuits
Flip Flops Lecture 10 CAP
Combinational circuits
Chap 7. Register Transfers and Datapaths
Processor (I).
Latches and Flip-flops
MIPS processor continued
Registers and Counters Register : A Group of Flip-Flops. N-Bit Register has N flip-flops. Each flip-flop stores 1-Bit Information. So N-Bit Register Stores.
Inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture #21 State Elements: Circuits that Remember Hello to James Muerle in the.
Elec 2607 Digital Switching Circuits
Single-Cycle CPU DataPath.
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN
CSE 370 – Winter Sequential Logic - 1
Levels in Processor Design
Levels in Processor Design
Levels in Processor Design
Combinational Circuits
Levels in Processor Design
Digital Circuits and Logic
Instructor: Michael Greenbaum
Processor: Datapath and Control
Presentation transcript:

MicroComputer Engineering DigitalCircuits slide 1 Combinational circuits Changes at inputs propagate at logic speed to outputs Not clocked No internal state (memoryless)

MicroComputer Engineering DigitalCircuits slide 2 Example I O 11 & & I2 I1 I0 O 1

MicroComputer Engineering DigitalCircuits slide 3 NOT combinational & & S R - latch (has a state) D Q D - flip-flop (clocked, no path)

MicroComputer Engineering DigitalCircuits slide 4 Combinational logic can be connected into sequences - can be connected parallel 1111 & 1

MicroComputer Engineering DigitalCircuits slide 5 Combinatorial loop This is OK: But what is this? 1 1 1

MicroComputer Engineering DigitalCircuits slide 6 Combinationial loop Impossible! Logical nonsense Electrical trouble

MicroComputer Engineering DigitalCircuits slide 7 Combinational loop This is a “combinational loop” We must never have, or form, a combinational loop

MicroComputer Engineering DigitalCircuits slide 8 How is this usually solved? D Q “The edge-triggered flip-flop!”

MicroComputer Engineering DigitalCircuits slide 9 The edge-triggered flip-flop! Never a combinational path from in to out A memory device, holds the value of “Q” until “clocked” Ignores the value at “in” until “clocked” D Q in out

MicroComputer Engineering DigitalCircuits slide 10 Beginners explanation Flipflop “samples” its input at the rising edge and presents that value on the output. D Q t clock 1 0 A “rising edge” A “falling edge”

MicroComputer Engineering DigitalCircuits slide 11 Flip flops in the circuit We will put flip flops in our circuit (Good for “breaking” combinational loops) and clock them all with the same clock D Q

MicroComputer Engineering DigitalCircuits slide 12 Setup time, t setup t he time the D input must be stable before the rising edge of the flip-flop. Hold time, t hold t he time the D input must be stable after the rising edge of the clock If the setup or hold time parameters are violated the Q output will be either logic 0, logic 1 or the flip-flop will enter a metastable state, but will eventually become a valid logic level. setup t hold t 1, 0 or metastable! D Clk Q Timing of a positive edge triggered D flip-flop

MicroComputer Engineering DigitalCircuits slide 13 Clock to output delay pLH(CQ) t pHL(CQ) t setup t hold t 1, 0 or metastable! D Clk Q Clock-to-output delay, t p The delay of a low to high transition and the delay of a high to low transition may be different.

MicroComputer Engineering DigitalCircuits slide 14 Example 1 BAD OK D Q 1 Suppose the flip flop holds a “1”. Let’s clock this circuit...

MicroComputer Engineering DigitalCircuits slide 15 Example D Q Holding Clock “pulse” one “clock cycle”

MicroComputer Engineering DigitalCircuits slide 16 Example D Q Samples the “0”

MicroComputer Engineering DigitalCircuits slide 17 Example D Q The exact instant that the output changes!

MicroComputer Engineering DigitalCircuits slide 18 Example D Q the circuit becomes stable again A very short time later... Called a logic “delay” (Propagation through the combinational logic)

MicroComputer Engineering DigitalCircuits slide 19 Example D Q until the next clocking And it stays like that....

MicroComputer Engineering DigitalCircuits slide 20 Combinational logic in the MIPS Zero extend box Sign extend box Controllable sign/zero extend box “Tap box” (pick out fields of bits) Shift left two bits

MicroComputer Engineering DigitalCircuits slide 21 Zero extend box 16 In[0..15] Out[16..31] Out[0..15] 16 zeroes !

MicroComputer Engineering DigitalCircuits slide 22 Sign extend box 16 In[0..15] Out[16..31] Out[0..15] In[15] copied 16 times

MicroComputer Engineering DigitalCircuits slide 23 Controllable zero / sign extend box 16 In[0..15] Out[16..31] Out[0..15] In[15] & Control

MicroComputer Engineering DigitalCircuits slide 24 Tap box Contains no logic circuits Regroup input bits Opcode field Instruction Rs field Rt field Rd field Immediate field

MicroComputer Engineering DigitalCircuits slide 25 Shift left two bits 32 Out bit [2..31*] In bit [0..31] Out bit 1 Out bit * Two bits lost

MicroComputer Engineering DigitalCircuits slide 26 Arbitrary logic Given a truth table: A B C D X Y Z Digital design Logic ABCDABCD XYZXYZ

MicroComputer Engineering DigitalCircuits slide 27 So, it’s enough just to have the truth table..... We have tools to build the “logic box” “Logic synthesis”

MicroComputer Engineering DigitalCircuits slide 28 The multiplexor Special truth table: A B Cont Out Easy to generalise to “A, B, C, D....” A B Cont Out

MicroComputer Engineering DigitalCircuits slide 29 Shifters Two kinds: logical-- value shifted in is always "0" arithmetic-- on right shifts, sign extend msblsb"0" msblsb"0" Note: these are single bit shifts. A given instruction might request 0 to 32 bits to be shifted!

MicroComputer Engineering DigitalCircuits slide 30 Example: 4 bit Logical Right Shifter If added Right-to-left connections could support Rotate (not in MIPS but found in ISAs) A0A1A2A3 S0 S1 ”0”

MicroComputer Engineering DigitalCircuits slide 31 Example: 4 bit logical Right Shifter II Shift two bits right A0A1A2A3 S0 = 0 S1 = 1 ”0” A0A1 A2A3 A2A3 ”0”

MicroComputer Engineering DigitalCircuits slide 32 Example: 4 bit Right Shifter III If added Right-to-left connections could support Rotate (not in MIPS but found in ISAs) A0A1A2A3 S0 = 0 S1 = 1 ”0” A0A1 A2A3 A2 A3 ”0” A2 A3”0”

MicroComputer Engineering DigitalCircuits slide 33 General Shift Right Scheme 16 bit using MUXes If added Right-to-left connections could support Rotate (not in MIPS but found in ISAs)

MicroComputer Engineering DigitalCircuits slide 34 Barrel Shifter (remember?) Technology-dependent solutions: 1 transistor per switch:

MicroComputer Engineering DigitalCircuits slide 35 What about adders? A[0] A[1].... A[31] B[0] B[31]C[0] C[1].... C[31] Impractical to represent by truth table Exponential in number of input bits 32 A B C+

MicroComputer Engineering DigitalCircuits slide 36 Adders are special..... We’ll talk about them later Also, multipliers Let’s just assume they exist

MicroComputer Engineering DigitalCircuits slide 37 Subtract ? A - B ? = A + NOT (B) + 1 Yes, there’s an easier way A B 1 + +

MicroComputer Engineering DigitalCircuits slide 38 Controllable Add / Sub ? Subtract Add Choose ABAB

MicroComputer Engineering DigitalCircuits slide 39 How it’s really done 32 =1 32 A B Choose Carry in +

MicroComputer Engineering DigitalCircuits slide 40 What’s the point of this ? The ALU is combinational Must have control signals to choose! 32 ALU Control points

MicroComputer Engineering DigitalCircuits slide bit wide inverter ? In bit[31] In bit[30] In bit[1] In bit[0] Out bit[31] Out bit[30] Out bit[1] Out bit[0] Easier to draw!

MicroComputer Engineering DigitalCircuits slide 42 Same idea : 32 - bit wide multiplexors 32 - bit wide clocked registers, such as the –Program counter –write back data register D Q 32 Clock signal not drawn

MicroComputer Engineering DigitalCircuits slide 43 Memories ? Register file Instruction memory Data memory We’ll treat these as combinational (not “clocked”)