Learning Outcomes. Spiral 2 3. DeMorgan Equivalents NEGATIVE (ACTIVE LO) LOGIC. Negative Logic One hot State Assignment System Design Examples

Similar documents
ICS 151 Final. (Last Name) (First Name)

Solutions. ICS 151 Final. Q1 Q2 Q3 Q4 Total Credit Score. Instructions: Student ID. (Last Name) (First Name) Signature

First Name: Last Name: Lab Cover Page. Teaching Assistant to whom you are submitting

Exam #2 EE 209: Fall 2017

Controller Implementation--Part I. Cascading Edge-triggered Flip-Flops

Chapter # 1: Introduction

EE 42/100 Lecture 24: Latches and Flip Flops. Rev B 4/21/2010 (2:04 PM) Prof. Ali M. Niknejad

IES Digital Mock Test

Digital Logic Circuits

DIGITAL DESIGN WITH SM CHARTS

Course Overview. Course Overview

Chapter 9. sequential logic technologies

Chapter 9. sequential logic technologies

Understanding Engineers #2

UNIT-IV Combinational Logic

1. The decimal number 62 is represented in hexadecimal (base 16) and binary (base 2) respectively as

(CSC-3501) Lecture 6 (31 Jan 2008) Seung-Jong Park (Jay) CSC S.J. Park. Announcement

UNIVERSITY OF BOLTON SCHOOL OF ENGINEERING BENG (HONS) ELECTRICAL & ELECTRONICS ENGINEERING SEMESTER TWO EXAMINATION 2017/2018

Practical Workbook Logic Design & Switching Theory

Chapter 5 Sequential Logic Circuits Part II Hiroaki Kobayashi 7/11/2011

Datapath Components. Multipliers, Counters, Timers, Register Files

Combinational Circuits DC-IV (Part I) Notes

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-378:

Lecture 02: Digital Logic Review

2014 Paper E2.1: Digital Electronics II

COMPUTER ORGANIZATION & ARCHITECTURE DIGITAL LOGIC CSCD211- DEPARTMENT OF COMPUTER SCIENCE, UNIVERSITY OF GHANA

I hope you have completed Part 2 of the Experiment and is ready for Part 3.

Spec. Instructor: Center

Chapter 3 Digital Logic Structures

Chapter # 1: Introduction

On Built-In Self-Test for Adders

EECS-140/141 Introduction to Digital Logic Design Lecture 7:Sequential Logic Basics

LOGIC GATES AND LOGIC CIRCUITS A logic gate is an elementary building block of a Digital Circuit. Most logic gates have two inputs and one output.

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-2700:

8.1. Unit 8. Fundamental Digital Building Blocks: Decoders & Multiplexers

Department of Electronics and Communication Engineering

Written exam IE1204/5 Digital Design Friday 13/

LIST OF EXPERIMENTS. KCTCET/ /Odd/3rd/ETE/CSE/LM

Topic Notes: Digital Logic

SRV ENGINEERING COLLEGE SEMBODAI RUKMANI VARATHARAJAN ENGINEERING COLLEGE SEMBODAI

MSI Design Examples. Designing a circuit that adds three 4-bit numbers

LOGIC DIAGRAM: HALF ADDER TRUTH TABLE: A B CARRY SUM. 2012/ODD/III/ECE/DE/LM Page No. 1

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-2700:

QUIZ. What do these bits represent?

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-2700:

5. (Adapted from 3.25)

Field Programmable Gate Array

Chapter 3. H/w s/w interface. hardware software Vijaykumar ECE495K Lecture Notes: Chapter 3 1

Finite State Machines CS 64: Computer Organization and Design Logic Lecture #16

Brought to you by. Priti Srinivas Sajja. PS01CMCA02 Course Content. Tutorial Practice Material. Acknowldgement References. Website pritisajja.

Adder Comparator 7 segment display Decoder for 7 segment display D flip flop Analysis of sequential circuits. Sequence detector

Computer Arithmetic (2)

Digital Electronics. Functions of Combinational Logic

Analog I/O. ECE 153B Sensor & Peripheral Interface Design Winter 2016

Department of Electronics & Telecommunication Engg. LAB MANUAL. B.Tech V Semester [ ] (Branch: ETE)

An Analysis of Multipliers in a New Binary System

EXPERIMENT NO 1 TRUTH TABLE (1)

Memory, Latches, & Registers

Hardware Implementation of BCH Error-Correcting Codes on a FPGA

DIGITAL ELECTRONICS. Methods & diagrams : 1 Graph plotting : - Tables & analysis : - Questions & discussion : 6 Performance : 3

Unit-6 PROGRAMMABLE INTERRUPT CONTROLLERS 8259A-PROGRAMMABLE INTERRUPT CONTROLLER (PIC) INTRODUCTION

Chapter 5 Sequential Logic Circuits Part II Hiroaki Kobayashi 6/30/2008

Midterm Exam ECE 448 Spring Thursday Section. (15 points)

COMBINATIONAL CIRCUIT

Learning Outcomes. Spiral 2 8. Digital Design Overview LAYOUT

CHAPTER 5 DESIGN OF COMBINATIONAL LOGIC CIRCUITS IN QCA

A-PDF Split DEMO : Purchase from to remove the watermark 114 FSM

Lecture 2. Digital Basics

B.E. SEMESTER III (ELECTRICAL) SUBJECT CODE: X30902 Subject Name: Analog & Digital Electronics

Computer Architecture and Organization: L08: Design Control Lines

Chapter 3 Digital Logic Structures

Types of Control. Programmed Non-programmed. Program Counter Hardwired

Combinational Logic Circuits. Combinational Logic

2 Logic Gates THE INVERTER. A logic gate is an electronic circuit which makes logic decisions. It has one output and one or more inputs.

3.1 There are three basic logic functions from which all circuits can be designed: NOT (invert), OR, and

ENGG1015: lab 3. Sequential Logic

COMBINATIONAL and SEQUENTIAL LOGIC CIRCUITS Hardware implementation and software design

6.111 Lecture # 19. Controlling Position. Some General Features of Servos: Servomechanisms are of this form:

Implementing Logic with the Embedded Array

Introduction. BME208 Logic Circuits Yalçın İŞLER

BCD Adder. Lecture 21 1

ANALOG TO DIGITAL (ADC) and DIGITAL TO ANALOG CONVERTERS (DAC)

CS302 Digital Logic Design Solved Objective Midterm Papers For Preparation of Midterm Exam

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) SUMMER-16 EXAMINATION Model Answer

Chapter 3 Describing Logic Circuits Dr. Xu

E2.11/ISE2.22 Digital Electronics II

UNIVERSITI MALAYSIA PERLIS

Module -18 Flip flops

Lecture 3: Logic circuit. Combinational circuit and sequential circuit

Introduction (concepts and definitions)

Fan in: The number of inputs of a logic gate can handle.

Circuits in CMOS VLSI. Darshana Sankhe

Computer Architecture and Organization:

Unit 3. Logic Design

Datapath Components. Control vs. Datapath, Registers, Adders (Binary Addition) Copyright (c) 2012 Sean Key

Portland State University MICROCONTROLLERS

An Optimized Wallace Tree Multiplier using Parallel Prefix Han-Carlson Adder for DSP Processors

Mixed Synchronous/Asynchronous State Memory for Low Power FSM Design

Logic Design I (17.341) Fall Lecture Outline

Winter 14 EXAMINATION Subject Code: Model Answer P a g e 1/28

Transcription:

2-3. Learning Outcomes 2-3.2 Spiral 2 3 Negative Logic One hot State Assignment System Design Examples I understand the active low signal convention and how to interface circuits that use both active high and active low signals I can take any state diagram and create a corresponding state machine using one hot implementation by using one FF per state and creating the D input circuit by converting each incoming transition arrow to a state into a logic gate and ORing them together I understand how to decompose an algorithm into states for each step and appropriate datapath units for each operator Mark Redekopp 2-3.3 DeMorgan Equivalents 2-3.4 = = NEGATIVE (ACTIVE LO) LOGIC = =

2-3.5 2-3.6 Negative Logic Why Active low Recall it is up to us humans to to the two voltage levels Thus, far we ve used (unknowingly) the logic convention where means true and means false In logic means true and means false Some digital circuits are better at (draining/sucking) electric current than (producing) current volts =true/on (Value/Meaning) volts =false/off (Value/Meaning) Active-hi output Active-low output =false/off Logic Convention time =true/on time Logic Convention LED is on when gate outputs '' LED is on when gate outputs '' 2-3.7 2-3.8 Negative Logic AND Function Negative Logic OR Function Traditional P.L. AND N.L. AND function N.L. AND = P.L. OR Traditional P.L. OR N.L. OR function N.L. OR = P.L. AND P.L. X Y P.L. AND P.L. Z N.L. X Y P.L. AND N.L. AND N.L. Z N.L. X Y N.L. AND N.L. Z P.L. X Y P.L. OR P.L. Z N.L. X Y P.L. OR N.L. OR N.L. Z X Y Z X Y Z X Y Z X Y Z X Y Z X Y Z Traditional AND gate functionality assumes positive logic convention Given negative logic signals, we can invert to positive logic, perform the AND operation, then convert back to negative logic However, we then see that an OR gate implements the negative logic AND function Traditional OR gate functionality assumes positive logic convention Given negative logic signals, we can invert to positive logic, perform the OR operation, then convert back to negative logic However, we then see that an AND gate implements the negative logic OR function

2-3.9 2-3. Negative Logic Active hi vs. Active low A negative logic OR function is equivalent to an AND gate = A negative logic AND function is equivalent to an OR gate = These are the preferred way of showing the N.L. functions because the inversion bubbles explicitly show where N.L. is being converted to P.L. and the basic gate schematics retain their meaning (when we see an AND gate we know we re doing some king of AND function with the bubbles indicating N.L.) Active hi convention = on/true/active = off/false/inactive Active low convention = on/true/active = off/false/inactive To convert between conventions 2-3. 2-3.2 Enables Decoder w/ Active Low Enable and Outputs When E=, inputs is ignored Since E=, all outputs = A /D /D When E=, inputs will cause the appropriate output to go active Since E=, outputs will function normally B Enable /E /D2 /D3 Bubbles and signals starting with a slash '/' indicate an active-low input or output not an inverter the inverters are actually in the logic diagram on the next pages

Active Lo Outputs 2-3.3 Active Lo Enable 2-3.4 When E=inactive (inactive means ), Outputs turn off (off means ) When E=active (active means ), Selected outputs turn on (on means ) When E=inactive (inactive means ), Outputs turn off (off means ) When E=active (active means ), Selected outputs turn on (on means ) Active Lo Enable 2-3.5 Decoder w/ Multiple Enables 2-3.6 When a decoder has multiple enables, all enables for the decoder to be enabled When E=inactive (inactive means ), Outputs turn off (off means ) When E=active (active means ), Selected outputs turn on (on means ) 3 Enables /G must equal /G2 must equal and E must equal

2-3.7 2-3.8 Active Low CLR and PRESET Active Low CLR and PRESET The reset signal might also be active low ( = Reset, = Normal operations) FFs can be made with active low /CLR & /PRE Need to be able to initialize Q to a known value ( or ) /RESET /RESET Logic PRE D CLK CLR Q _ When /RESET =, /CLR is activated and Q is forced to Logic PRE D CLK CLR Q Q* = _ When /RESET =, /CLR is inactive and Q looks at D at each clock edge /RESET _ /RESET _ 2-3.9 Digital System Representation 2-3.2 Turn Sensor S State Diagram Turn Sensor S2 Overall sensor output S = S + S2 ONE HOT STATE ASSIGNMENT Main Street Raw inputs S S2 Input Function Logic (IFL) Conditioned inputs S Next State Logic (NSL) FF inputs State Memory (SM) FF outputs Output Function Logic (OFL) Outputs

Encoded State Assignment Review State Diagrams. States 2. Transition Conditions 3. Outputs State Machines require sequential logic to remember the current state (w/ just combo logic we could only look at the current value of X, but now we can take 4 separate actions when X=) On Reset (power on) X= Sinit F= X= X= X= X= S S F= F= X= X= X= State Diagram for Sequence Detector State Machine. State Memory => FF s n FF s => 2 n states 2. Next State Logic (NSL) + Input Function Logic (IFL) combinational logic for FF inputs 3. Output Function Logic (OFL) MOORE: f(state) MEALY: f(state + inputs) (Input) (Next State) (Current State) X D Q D Q OFL S F= NSL D D SM Q Q Q Q 2-3.2 (Output) F State Assignment Design of the traffic light controller with main turn arrow Represent states with some binary code, but what kind? Encoded: 3 States => : =SSG, =MSG, =MTG One hot: Separate FF per state: =SSG, =MSG, =MTG Turn Sensor S2 Main Street Turn Sensor S Overall sensor output S = S + S2 2-3.22 State Diagram CLK 2-3.23 2-3.24 NSL Implementation in Hot Method NSL Implementation in Hot Method In one hot assignment, NSL is designed by simple observation For each state, examine each transition Each incoming arrow will be one case in our logic We can just each condition together Describe each transition as a combination of what state it originates from & any associated conditions Ex. Two arrows converge on MS: Q MS should be on the next clock when Current state is...or Current state is AND Q SS Q MT Q MS SS MT MS One-hot State Assignment Two arrows converge on MS: Q MS should be on the next clock when Current state is MT...OR Current stat is SS AND S= Q* MS = D MS = Q MT + Q SS S Q* MT = D MT = Q* SS = D SS = What about initial state? Preset the appropriate flop. Q SS Q MT Q MS SS MT MS One-hot State Assignment

2-3.25 Multiplication Techniques 2-3.26 Array Multiplier (Combinational) Add and Shift Method (Sequential) MULTIPLICATION TECHNIQUES A multiplier unit can be Purely Combinational: Each partial product is produced in and fed into an of adders to generate the product Sequential and Combinational: Produce and add partial product at a time ( ) Combinational Multiplier Analysis 2-3.27 Add and Shift Method 2-3.28 Large Area due to bit adders n because the first adder adds the first two partial products and then each adder afterwards adds one more partial product Propagation delay is in two dimensions proportional to Sequential algorithm n bit * n bit multiply Adds partial product per clock Shift running sum bit right each clock Three n bit Registers, Adder At start: M = Multiplicand Q = Multiplier A = Answer => initialized to After completion A and Q concatenate to form 2n bit answer

C A Q Cout Add and Shift Hardware = M * = Q 2-3.29 Add and Shift Algorithm C=, A= Repeat the following If Q[] =, A = Else if Q[] =, A= Shift bit ( ) 2-3.3 Cin M * 2-3.3 Add and Shift Multiplication = M * = Q = Ans C A Q 2-3.32 Cout M = C A Q Cin M

Add and Shift Multiplication C A Q Cout Cin M = M * = Q = Ans Final Product Finished M = C A Q * + + - + -- + --- Add Shift Add Shift No Add Shift Add Shift = 2-3.33 * Example C A Q Cout Cin M C= M= A= Q= Description A=A+M Shift Right C,A,Q A=A+ Shift Right C,A,Q A=A+M Shift Right C,A,Q A=A+ Shift Right C,A,Q 2-3.34 2-3.35 2-3.36 Sequential Multiplier Analysis Digital System Design Pros: Cons: Control and Datapath Unit paradigm Separate logic into datapath elements that operate on data and control elements that generate control signals for datapath elements Datapath: Adders, muxes, comparators, counters, registers (w/ enables) Control Unit: State machines/sequencers clk reset Control Control Signals Condition Signals Data Inputs Datapath Data Outputs

2-3.37 2-3.38 Let's Practice our Design Skills Break design into control and datapath This is the datapath Adder 2 to mux 2 shift registers (A/Q) normal reg (M) FF w/ Enable (C) C A Q Cout Cin State Machine Control From our high level datapath we can arrive at a high level state diagram M 2-3.39 2-3.4 Refining our Design Sample Shift Register But now we need to refine our design to actual components, specific control bits, etc. Shift registers come in many flavors, we'll just look at one example 4 bit Bi directional Shift Register RST: synchronous reset S[:]: Hold, Right Shift, Left Shift, or Load DSL and DSR Data to shift in from left or right CLK ACLR S S Q*[3:] (case), X X X Q[3:] X X Reset Q[3:] Hold D SR,Q[3:] Right Q[2:],D SL Left D[:3] Load

2-3.4 2-3.42 Shift Registers Complete the DataPath Assume you build the state machine below and produce 4-signals that tell us which state we are in: Qwait Qadd Qsh Qdone 2-3.43 2-3.44 Encoders Another common datapath component Opposite function of decoders Takes in 2 n inputs and produces an n bit number I SIMPLE & PRIORITY ENCODERS Assume One active input I I2 I3 I4 I5 I6 Binary Encoder Y Y Y2 That number input gets encoded in binary I7 4

2-3.45 2-3.46 Encoders Encoders What s inside an encoder? What s inside an encoder? I I I 2 I 3 I 4 I 5 I 6 I 7 Y 2 Y Y I I I2 I3 I4 I5 I6 I7 Binary Encoder Y Y Y2 I I I 2 I 3 I 4 I 5 I 6 I 7 Y 2 Y Y I I I2 I3 I4 I5 I6 I7 Binary Encoder Y Y Y2 Deriving equations for Y, Y, Y 2 is made simpler because of the assumption that only input can be active at a time. Y 2 = Y = Y = 2-3.47 2-3.48 Encoders Problems A simple binary encoder can be made with just gates There is a problem Our assumption is that only input can be active at a time What happens if 2 or more inputs are active or if inputs are active

2-3.49 2-3.5 2 or More Active Inputs Active Inputs What if I5 and I2 are active at the same time? Substitute values into equation Output will be = 7 Output is neither 2 nor 5, it s something different, 7 I I I2 I3 I4 I5 I6 I7 Binary Encoder Y Y Y2 Y 2 = I4 + I5 + I6 + I7 Y = I2 + I3 + I6 + I7 Y = I + I3 + I5 + I7 What if no inputs are active? Substitute values into equation Output will be Problem: means that input was active Can t between when means input was active or no inputs was active I I I2 I3 I4 I5 I6 I7 Binary Encoder Y Y Y2 I I I2 I3 I4 I5 I6 I7 Binary Encoder Y Y Y2 2-3.5 2-3.52 Priority Encoders Priority Encoders Fix the 2 problems seen above Problem of more than 2 active inputs Assign priority to inputs and only encode the highest priority active input Problem of zero active inputs Create an extra output to indicate if any inputs are active We will call this output the Valid output (/V) Fix the 2 problems seen above Problem of more than 2 active inputs Assign priority to inputs and only encode the highest priority active input Problem of zero active inputs Create an extra output to indicate if any inputs are active If multiple inputs are active only the highest priority active input (I5) is encoded Lowest priority Highest priority / V = Valid (a.k.a /EO=Enabled Output) is active if ANY inputs are active No inputs are active Output is still but /V tells us that this is not because I was active / V = Valid (a.k.a /EO=Enabled Output) is inactive if no inputs are active

2-3.53 2-3.54 Encoder Application: Interrupts Encoder Application: Interrupts I/O Devices in a computer need to request attention from the CPU they need to interrupt the processor CPU cannot have a dedicated line to each I/O device (too many inputs and outputs) plus it can only service one device at a time Solution: Priority Encoder /INT input of CPU indicates SOME device is requesting attention INT_ID inputs identify who is requesting attention Sound Network Card USB Ctrl. Processor (CPU) Sound Network Card USB Ctrl. Keyboard Keyboard I I I2 Y I3 I4 Priority Encoder Y I5 I6 Y2 I7 /V Processor (CPU) INT_ID /INT 2-3.55 2-3.56 Encoder Application: Interrupts Example: Sound and Network request interrupt at the same time Network is highest priority and is encoded After network is handled, sound will cause interrupt Sound Network Card USB Ctrl. Keyboard I I I2 Y I3 I4 Priority Encoder Y I5 I6 Y2 I7 /V 3 = Processor (CPU) INT_ID /INT VENDING MACHINE

2-3.57 2-3.58 Vending Machine Controller Digital System Design Consider a vending machine that sells Coke, Diet Coke, Sprite and Dr. Pepper Drinks cost Sensors indicate (for clock cycle) when a user has entered a nickel, dime, quarter, or dollar bill Max. input amount is (beyond that the machine is not responsible for counting) Individual buttons for each drink allow the user to select their drink and if at least $ has been entered, a release signal for each drink should be asserted Making change will be considered in a future lab Control and Datapath Unit paradigm Separate logic into datapath elements that operate on data and control elements that generate control signals for datapath elements Datapath: Adders, muxes, comparators, counters, registers (w/ enables) Control Unit: State machines/sequencers clk reset Data Inputs Control Signals Control Datapath Condition Signals Data Outputs 2-3.59 2-3.6 Money Collection & Release FSM Money Collection Datapath Consider the state machine and datapth only for money collection and release signal generation Pseudocode for collection algorithm:

Sample Operation Waveform 2-3.6 CLK /RESET SNSR25 BTN_DP LD M M >= State REL_EN REL_DP