ECE 274 Digital Logic. Digital Design. Datapath Components Shifters, Comparators, Counters, Multipliers Digital Design

Similar documents
ECE 274 Digital Logic Fall 2009 Digital Design

Digital Design. Chapter 1: Introduction

ECE 274 Digital Logic

Digital Design. Sequential Logic Design -- Controllers. Copyright 2007 Frank Vahid

Exercise 1-1. The Sine Wave EXERCISE OBJECTIVE DISCUSSION OUTLINE. Relationship between a rotating phasor and a sine wave DISCUSSION

CS 135: Computer Architecture I. Boolean Algebra. Basic Logic Gates

Synchronous Machine Parameter Measurement

METHOD OF LOCATION USING SIGNALS OF UNKNOWN ORIGIN. Inventor: Brian L. Baskin

CHAPTER 2 LITERATURE STUDY

Synchronous Machine Parameter Measurement

Lecture 20. Intro to line integrals. Dan Nichols MATH 233, Spring 2018 University of Massachusetts.

Synchronous Generator Line Synchronization

9.4. ; 65. A family of curves has polar equations. ; 66. The astronomer Giovanni Cassini ( ) studied the family of curves with polar equations

Section 17.2: Line Integrals. 1 Objectives. 2 Assignments. 3 Maple Commands. 1. Compute line integrals in IR 2 and IR Read Section 17.

The Discussion of this exercise covers the following points:

ECE 274 Digital Logic Spring Digital Design. Combinational Logic Design Process and Common Combinational Components Digital Design

Example. Check that the Jacobian of the transformation to spherical coordinates is

Module 9. DC Machines. Version 2 EE IIT, Kharagpur

Convolutional Networks. Lecture slides for Chapter 9 of Deep Learning Ian Goodfellow

EE Controls Lab #2: Implementing State-Transition Logic on a PLC

University of North Carolina-Charlotte Department of Electrical and Computer Engineering ECGR 4143/5195 Electrical Machinery Fall 2009

Experiment 3: Non-Ideal Operational Amplifiers

To provide data transmission in indoor

ABB STOTZ-KONTAKT. ABB i-bus EIB Current Module SM/S Intelligent Installation Systems. User Manual SM/S In = 16 A AC Un = 230 V AC

10.4 AREAS AND LENGTHS IN POLAR COORDINATES

ECE 274 Digital Logic. Digital Design. RTL Design RTL Design Method. RTL Design Memory Components

(CATALYST GROUP) B"sic Electric"l Engineering

Experiment 3: Non-Ideal Operational Amplifiers

MOS Transistors. Silicon Lattice

MATH 118 PROBLEM SET 6

Student Book SERIES. Patterns and Algebra. Name

Experiment 3: The research of Thevenin theorem

Spiral Tilings with C-curves

ECE 274 Digital Logic Fall Digital Design. RTL Design RTL Design Method: Preview Example. RTL Design RTL Design Method

Homework #1 due Monday at 6pm. White drop box in Student Lounge on the second floor of Cory. Tuesday labs cancelled next week

Polar Coordinates. July 30, 2014

CAL. NX15 DUO-DISPLAY QUARTZ

LECTURE 9: QUADRATIC RESIDUES AND THE LAW OF QUADRATIC RECIPROCITY

Understanding Basic Analog Ideal Op Amps

Algorithms for Memory Hierarchies Lecture 14

SOLVING TRIANGLES USING THE SINE AND COSINE RULES

Topic 20: Huffman Coding

Application Note. Differential Amplifier

Math Circles Finite Automata Question Sheet 3 (Solutions)

& Y Connected resistors, Light emitting diode.

CS2204 DIGITAL LOGIC & STATE MACHINE DESIGN fall 2008

Section 16.3 Double Integrals over General Regions

Direct Current Circuits. Chapter Outline Electromotive Force 28.2 Resistors in Series and in Parallel 28.3 Kirchhoff s Rules 28.

Engineer-to-Engineer Note

Lecture 16: Four Quadrant operation of DC Drive (or) TYPE E Four Quadrant chopper Fed Drive: Operation

Kirchhoff s Rules. Kirchhoff s Laws. Kirchhoff s Rules. Kirchhoff s Laws. Practice. Understanding SPH4UW. Kirchhoff s Voltage Rule (KVR):

The Math Learning Center PO Box 12929, Salem, Oregon Math Learning Center

Datapath Components. Multipliers, Counters, Timers, Register Files

1 tray of toffee 1 bar of toffee. 10 In the decimal number, 0 7, the 7 refers to 7 tenths or

Geometric quantities for polar curves

REVIEW, pages

MAXIMUM FLOWS IN FUZZY NETWORKS WITH FUNNEL-SHAPED NODES

Area-Time Efficient Digit-Serial-Serial Two s Complement Multiplier

Ultra Low Cost ACCELEROMETER

Mixed CMOS PTL Adders

Ultra Low Cost ACCELEROMETER

ISSCC 2006 / SESSION 21 / ADVANCED CLOCKING, LOGIC AND SIGNALING TECHNIQUES / 21.5

Engineer-to-Engineer Note

Safety Relay Unit. Main contacts Auxiliary contact Number of input channels Rated voltage Model Category. possible 24 VAC/VDC G9SA-501.

Three-Phase Synchronous Machines The synchronous machine can be used to operate as: 1. Synchronous motors 2. Synchronous generators (Alternator)

Direct Current Circuits

MEASURE THE CHARACTERISTIC CURVES RELEVANT TO AN NPN TRANSISTOR

Vector Calculus. 1 Line Integrals

Array chip resistors size ARC241/ARC242 ARV241/ARV242

EQ: What are the similarities and differences between matrices and real numbers?

EET 438a Automatic Control Systems Technology Laboratory 5 Control of a Separately Excited DC Machine

Student Book SERIES. Fractions. Name

Alternating-Current Circuits

Using Compass 3 to Program the Senso Diva Page 1

A Development of Earthing-Resistance-Estimation Instrument

Products no longer available

Domination and Independence on Square Chessboard

Math 116 Calculus II

Job Sheet 2. Variable Speed Drive Operation OBJECTIVE PROCEDURE. To install and operate a Variable Speed Drive.

Dataflow Language Model. DataFlow Models. Applications of Dataflow. Dataflow Languages. Kahn process networks. A Kahn Process (1)

SLOVAK UNIVERSITY OF TECHNOLOGY Faculty of Material Science and Technology in Trnava. ELECTRICAL ENGINEERING AND ELECTRONICS Laboratory exercises

Arduino for Model Railroaders

MC14541B. Programmable Timer

Regular languages can be expressed as regular expressions.

Chapter 2 Literature Review

Sequential Logic (2) Synchronous vs Asynchronous Sequential Circuit. Clock Signal. Synchronous Sequential Circuits. FSM Overview 9/10/12

CS2204 DIGITAL LOGIC & STATE MACHINE DESIGN SPRING 2005

Series. Teacher. Numbers

Device installation. AFR 1xx - Feature Description of the Smart Load. AFR1xx 145 % 200 %

OPERATING INSTRUCTION

Engineer To Engineer Note

First Round Solutions Grades 4, 5, and 6

A Simple Approach to Control the Time-constant of Microwave Integrators

DP400 / DM350. Inverter. Total Solutions from the Single Source Provider DP400 PULSED MAG - PULSED MIG CO2 - MAG - MIG - FCAW

Make Your Math Super Powered

Study on SLT calibration method of 2-port waveguide DUT

Compared to generators DC MOTORS. Back e.m.f. Back e.m.f. Example. Example. The construction of a d.c. motor is the same as a d.c. generator.

Rectangular type APS-10 to 15 Series

Translate and Classify Conic Sections

SECOND EDITION STUDENT BOOK GRADE

Transcription:

ECE 27 Digitl Logic Shifters, Comprtors, Counters, Multipliers Digitl Design..7 Digitl Design Chpter : Slides to ccompny the textbook Digitl Design, First Edition, by Frnk Vhid, John Wiley nd Sons Publishers, 2007. http://www.ddvhid.com Copyright 2007 Frnk Vhid Instructors of courses requiring Vhid's Digitl Design textbook (published by John Wiley nd Sons) hve permission to modify nd use these slides for customry course-relted ctivities, subject to keeping this copyright notice in plce nd unmodified. These slides my be posted s unnimted pdf versions on publicly-ccessible course websites.. PowerPoint source (or pdf with nimtions) my not be posted to publicly-ccessible websites, but my be posted for students on internl protected sites or distributed directly to students by other electronic mens. Instructors my mke printouts of the slides vilble to students for resonble photocopying chrge, without incurring roylties. Any other use requires explicit permission. Instructors my obtin PowerPoint source or obtin specil use permissions from Wiley see http://www.ddvhid.com for informtion. Shifters. Shifter Exmple: Temperture Averger Shifting (e.g., left shifting 00 yies 00) useful for: Mnipulting bits Converting seril dt to prllel (remember erlier bove-mirror disply exmple with shift registers) Shift left once is sme s multiplying by 2 (00 (3) becomes 00 (6)) Why? Essentilly ppending 0 -- Note tht multiplying deciml number by 0 ccomplished just be ppending 0, i.e., by shifting left (55 becomes 550) i3 i2 i i0 Shift right once sme s dividing by 2 << Symbol i3 i2 i i0 q3 q2 q q0 Left shifter in i3 i2 i i0 0 0 0 0 q3 q2 q q0 Shifter with left shift or no shift in sh inr shl shr 2 0 2 0 2 0 2 0 s0 s q3 q2 q q0 Shifter with left shift, right shift, nd no shift inl 3 Four registers storing history of tempertures Wnt to output the verge of those tempertures Add, then divide by four Sme s shift right by 2 Use three dders, nd right shift by two 0000 (7) 00000 (8) 0000 (2) 00 (5) T R Rb Rc Rd clk + + + shift in 0 0000 (2) divide by 0 >>2 00000 (0) Rvg Tvg

Brrel Shifter in A shifter tht cn shift by ny mount 0 0 0 0 sh -bit brrel left shift cn shift left by 0,, 2, or 3 positions q3 q2 q q0 8-bit brrel left shifter cn shift left by Shift by shifter uses 2x muxes. 8x 0,, 2, 3,, 5, 6, or 7 positions mux solution for 8-bit brrel shifter: too (Shifting n 8-bit number by 8 positions mny wires. is pointless -- you just lose ll the bits) Q: xyz=??? to Cou design using 8x muxes nd lots shift by 5? 8 I 000000 of wires Too mny wires x sh << in 0 More elegnt design 8 000000 (by ) Chin three shifters:, 2, nd 0 Cn chieve ny shift of 0..7 by y sh <<2 in 0 enbling the correct combintion of 8 those three shifters, i.e., shifts shou 000000 sum to desired mount z sh << in 0 i3 i2 i i0 Net result: shift by 5: 8 000000 (by ) Q 5 Comprtors N-bit equlity comprtor: Outputs if two N-bit numbers re equl -bit equlity comprtor with inputs A nd B 3 must equl b3, 2 = b2, = b, 0 = b0 Two bits re equl if both, or both 0 eq = (3b3 + 3 b3 ) * (2b2 + 2 b2 ) * (b + b ) * (0b0 + 0 b0 ) Recll tht XNOR outputs if its two input bits re the sme eq = (3 xnor b3) * (2 xnor b2) * ( xnor b) * (0 xnor b0) 3 b3 2 b2 b 0 b0 00 = 0? 0 0 0 0 eq ( ) 0 3 2 0 b3 b2 b b0 -bit equlity comprtor eq ( b ).5 6 Mgnitude Comprtor Mgnitude Comprtor N-bit mgnitude comprtor Indictes whether A>B, A=B, or A<B, for its two N-bit inputs A nd B How to design? Consider how compre by hnd. First compre 3 nd b3. If equl, compre 2 nd b2. And so on. Stop if comprison not equl -- whichever s bit is is greter. If never see unequl bit pir, A=B. A=0 B=00 0 00 Equl 0 00 Equl 0 00 Unequl So A > B By-hnd exmple leds to ide for design Strt t left, compre ech bit pir, pss results to the right Ech bit pir clled stge Ech stge hs 3 inputs indicting results of higher stge, psses results to lower stge 3 b3 2 b2 b 0 b0 Igt Ieq Ilt Stge 3 Stge 2 ( ) Stge Stge 0 AgtB AeqB AltB 7 0 Igt 3 2 0 b3 b2 b b0 Ieq -bit mgnitude comprtor 0 Ilt ( b ) AgtB AeqB AltB 8 2

Mgnitude Comprtor Mgnitude Comprtor Exmple: Minimum of Two Numbers Igt Ieq Ilt 3 b3 2 b2 b 0 b0 AgtB AeqB AltB Design combintionl component tht computes the minimum of two 8-bit numbers Stge 3 Stge 2 Stge Stge 0 Ech stge: out_gt = in_gt + (in_eq * * b ) A>B (so fr) if lredy determined in higher stge, or if higher stges equl but in this stge = nd b=0 out_lt = in_lt + (in_eq * * b) A<B (so fr) if lredy determined in higher stge, or if higher stges equl but in this stge =0 nd b= out_eq = in_eq * ( XNOR b) A=B (so fr) if lredy determined in higher stge nd in this stge =b too Simple circuit inside ech stge, just few gtes (not shown) 9 0 Counters.6 Counter Exmple: Above Mirror Disply N-bit up-counter: N-bit register tht cn increment (dd ) to its own vlue on ech clock cycle 0000, 000, 000, 00,..., 0,, 0000 Note how count rolls over from to 0000 Terminl (lst) count, tc, equls during vlue just before rollover Internl design Register, incrementer, nd N-input AND gte to detect terminl count 0 -bit up-counter -bit up-counter 0 000 00 000 00 0 0000 000... t c -bit register C + Recll bove-mirror disply exmple from Chpter 2 Assumed component tht incremented xy input ech time button pressed: 00, 0, 0,, 00, 0, 0,, 00,... Cn use 2-bit up-counter Assumes mode= for just one clock cycle during ech button press Recll Button press synchronizer circuit mode clk 2-bit up c ou n t er t c c c0 x y 2 3

Counter Exmple: Hz Pulse Genertor Using 256 Hz Oscilltor Down-Counter Suppose hve 256 Hz oscilltor, but wnt Hz pulse Hz is pulse per second -- useful for keeping time Design using 8-bit upcounter, use tc output s pulse Counts from 0 to 255 (256 counts), so pulses tc every 256 cycles 8-bit up-counter osc (256 Hz) 8 p (unused) ( Hz) -bit down-counter, 0, 0, 00,, 00, 000, 000, 0000,, Terminl count is 0000 Use NOR gte to detect Need decrementer (-) design like designed incrementer -bit down-counter -bit register 3 Up/Down-Counter Counter with Prllel Lod Cn count either up or down Includes both incrementer nd decrementer Use dir input to select, using 2x: dir=0 mens up Likewise, dir selects pproprite terminl count vlue dir clr clr -bit up/down counter -bit 2 x 0 -bit register + Up-counter tht cn be loded with externl vlue Designed using 2x mux input selects incremented vlue or externl vlue Lod the internl register when loding externl vlue or when counting t c L -bit 2 x 0 -bit register C + 2 x 0 t c C 5 6

Counter with Prllel Lod Useful to crete pulses t specific multiples of clock Not just t N-bit counter s nturl wrp-round of 2 N Exmple: Pulse every 9 clock cycles Use -bit down-counter with prllel lod Set prllel lod input to 8 (000) Use terminl count to relod When count reches 0, next cycle lods 8. Why lod 8 nd not 9? Becuse 0 is included in count sequence: 8, 7, 6, 5,, 3, 2,, 0 9 counts clk 000 L -bit down-counter Counter Exmple: Timer A type of counter used to mesure time If we know the counter s clock frequency nd the count, we know the time tht s been counted Exmple: Compute cr s speed using two sensors First sensor () clers nd strts timer Second sensor (b) stops timer Assuming clock of khz, timer output represents time to trvel between sensors. Knowing the distnce, we cn compute speed 7 8 Multipliers Arry Style Cn bui multiplier tht mimics multipliction by hnd Notice tht multiplying multiplicnd by is sme s ANDing with.7 Multipliers Arry Style Generlized representtion of multipliction by hnd 9 20 5

Multipliers Arry Style Multiplier design rry of AND gtes b0 b 3 2 0 pp In-clss Exercise Design somewht ccurte Celsius to Fhrenheit converter. The conversion circuit receives digitized temperture in Celsius s 6-bit binry number C nd outputs the temperture in Fhrenheit s 6-bit output F using the following pproximtion: F = C*30/6 + 32. pp2 0 0 b2 + (5-bit) b3 pp3 pp 0 0 0 0 0 + (6-bit) A B * P + (7-bit) Block symbol p7..p0 2 22 6