ECE 341. Lecture # 3

Similar documents
Sample Test Paper - I

Digital Circuits ECS 371

EECS150 - Digital Design Lecture 18 - Counters

EECS150 - Digital Design Lecture 18 - Counters

LOGIC CIRCUITS. Basic Experiment and Design of Electronics

King Fahd University of Petroleum and Minerals College of Computer Science and Engineering Computer Engineering Department

LOGIC CIRCUITS. Basic Experiment and Design of Electronics. Ho Kyung Kim, Ph.D.

EECS150 - Digital Design Lecture 16 Counters. Announcements

Design at the Register Transfer Level

COEN 312 DIGITAL SYSTEMS DESIGN - LECTURE NOTES Concordia University

CHW 261: Logic Design

COE 202: Digital Logic Design Sequential Circuits Part 4. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

EECS150 - Digital Design Lecture 11 - Shifters & Counters. Register Summary

Lecture 7: Logic design. Combinational logic circuits

EECS150 - Digital Design Lecture 25 Shifters and Counters. Recap

CS221: Digital Design. Dr. A. Sahu. Indian Institute of Technology Guwahati

Counters. We ll look at different kinds of counters and discuss how to build them

Digital Logic: Boolean Algebra and Gates. Textbook Chapter 3

CprE 281: Digital Logic

Digital Fundamentals

EECS150 - Digital Design Lecture 17 - Sequential Circuits 3 (Counters)

Digital Electronics Final Examination. Part A

Design of Sequential Circuits

EECS150 - Digital Design Lecture 23 - FSMs & Counters

Appendix B. Review of Digital Logic. Baback Izadi Division of Engineering Programs

EECS Components and Design Techniques for Digital Systems. FSMs 9/11/2007

Fundamentals of Digital Design

Review: Designing with FSM. EECS Components and Design Techniques for Digital Systems. Lec09 Counters Outline.

Digital Logic Design ENEE x. Lecture 14

課程名稱 : 數位邏輯設計 P-1/ /6/11

Review: Designing with FSM. EECS Components and Design Techniques for Digital Systems. Lec 09 Counters Outline.

Synchronous Sequential Circuit Design. Digital Computer Design

Chapter 5. Digital Design and Computer Architecture, 2 nd Edition. David Money Harris and Sarah L. Harris. Chapter 5 <1>

Digital Electronics Circuits 2017

10/12/2016. An FSM with No Inputs Moves from State to State. ECE 120: Introduction to Computing. Eventually, the States Form a Loop

COE 202: Digital Logic Design Sequential Circuits Part 3. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

CPE100: Digital Logic Design I

Philadelphia University Student Name: Student Number:

Roger L. Tokheim. Chapter 8 Counters Glencoe/McGraw-Hill

SIR C.R.REDDY COLLEGE OF ENGINEERING ELURU DIGITAL INTEGRATED CIRCUITS (DIC) LABORATORY MANUAL III / IV B.E. (ECE) : I - SEMESTER

CPE100: Digital Logic Design I

Sequential logic and design

Chapter 4. Combinational: Circuits with logic gates whose outputs depend on the present combination of the inputs. elements. Dr.

Computers also need devices capable of Storing data and information Performing mathematical operations on such data

Sequential Logic Worksheet

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI

Introduction EE 224: INTRODUCTION TO DIGITAL CIRCUITS & COMPUTER DESIGN. Lecture 6: Sequential Logic 3 Registers & Counters 5/9/2010

6 Synchronous State Machine Design

Lecture 10: Synchronous Sequential Circuits Design

Philadelphia University Student Name: Student Number:

King Fahd University of Petroleum and Minerals College of Computer Science and Engineering Computer Engineering Department

ECE/Comp Sci 352 Digital Systems Fundamentals. Charles R. Kime Section 2 Fall Logic and Computer Design Fundamentals

CprE 281: Digital Logic

COE 202: Digital Logic Design Sequential Circuits Part 3. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:


Sequential Circuits Sequential circuits combinational circuits state gate delay

Digital Fundamentals

CprE 281: Digital Logic

Different encodings generate different circuits

I. Motivation & Examples

DE58/DC58 LOGIC DESIGN DEC 2014

Numbers and Arithmetic

EGR224 F 18 Assignment #4

Digital Logic Design - Chapter 4

ELCT201: DIGITAL LOGIC DESIGN

Chapter 3 Digital Logic Structures

Combinational Logic Design Combinational Functions and Circuits

Topics for Lecture #9. Button input processor

S.Y. Diploma : Sem. III [DE/ED/EI/EJ/EN/ET/EV/EX/IC/IE/IS/IU/MU] Principles of Digital Techniques

CSE140: Components and Design Techniques for Digital Systems. Midterm Information. Instructor: Mohsen Imani. Sources: TSR, Katz, Boriello & Vahid

Dr. Nicola Nicolici COE/EE2DI4 Midterm Test #2 Nov 22, 2006

ELEN Electronique numérique

Unit II Chapter 4:- Digital Logic Contents 4.1 Introduction... 4

Numbers and Arithmetic

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) State any two Boolean laws. (Any 2 laws 1 mark each)

Written exam with solutions IE Digital Design Friday 21/

Digital Logic Design - Chapter 5

Exam for Physics 4051, October 31, 2008

CSE370 HW6 Solutions (Winter 2010)

Show that the dual of the exclusive-or is equal to its compliment. 7

PGT104 Digital Electronics. PGT104 Digital Electronics

ECE 2300 Digital Logic & Computer Organization

Digital Design. Sequential Logic

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING CS6201 DIGITAL PRINCIPLES AND SYSTEM DESIGN

Dr. S. Shirani COE2DI4 Midterm Test #2 Nov. 9, 2010

Chapter 5 Synchronous Sequential Logic

Decoding A Counter. svbitec.wordpress.com 1

Z = F(X) Combinational circuit. A combinational circuit can be specified either by a truth table. Truth Table

Written exam for IE1204/5 Digital Design with solutions Thursday 29/

Digital Logic and Design (Course Code: EE222) Lecture 19: Sequential Circuits Contd..

ELEC Digital Logic Circuits Fall 2014 Sequential Circuits (Chapter 6) Finite State Machines (Ch. 7-10)

Digital Logic Appendix A

Written reexam with solutions for IE1204/5 Digital Design Monday 14/

Combinational Logic. By : Ali Mustafa

Reg. No. Question Paper Code : B.E./B.Tech. DEGREE EXAMINATION, NOVEMBER/DECEMBER Second Semester. Computer Science and Engineering

Boolean Algebra and Digital Logic 2009, University of Colombo School of Computing

Logic Design II (17.342) Spring Lecture Outline

Adders allow computers to add numbers 2-bit ripple-carry adder

University of Toronto Faculty of Applied Science and Engineering Final Examination

ELCT201: DIGITAL LOGIC DESIGN

Transcription:

ECE 341 Lecture # 3 Instructor: Zeshan Chishti zeshan@ece.pdx.edu October 7, 2013 Portland State University

Lecture Topics Counters Finite State Machines Decoders Multiplexers Reference: Appendix A of the textbook, sections A.8 to A.13.

Announcements Next class (Wednesday, Oct. 9) will start at 5:30PM Homework 1 due next class

Counters Counters are arithmetic circuits used for the purpose of counting Can increment or decrement by 1 each cycle Counters often implemented with T flip-flops Toggle feature naturally suited for counting operation Applications of counters Count occurrences of certain events, for example, no. of add instructions Track elapsed time between events Generate control and timing signals, for example, to produce signals whose frequencies are multiples of original clock frequency

A 3-bit Up-counter Consider a 3-bit counter x 2 x 1 x 0 shown in table. The least significant bit x 0 toggles at every increment of counter x 1 toggles on 1->0 transitions of x 0 (half the rate of toggling of x 0 ) x 2 toggles on 1->0 transitions of x 1 (half the rate of toggling of x 1 ) Counter Value x 2 x 1 x 0 0 0 0 0 1 0 0 1 2 0 1 0 3 0 1 1 4 1 0 0 5 1 0 1 6 1 1 0 7 1 1 1

A 3-bit Up-counter

Practice Exercise Design a 3-bit down counter with T flip-flops. How does the down counter circuit differ from the up-counter circuit?

A 3-bit Down-counter The least significant bit x 0 toggles at every decrement of counter x 1 toggles on 0->1 transitions of x 0 x 2 toggles on 0->1 transitions of x 1 Counter Value x 2 x 1 x 0 7 1 1 1 6 1 1 0 5 1 0 1 4 1 0 0 3 0 1 1 2 0 1 0 1 0 0 1 0 0 0 0

Practice Exercise Solution Design a 3-bit down counter with T flip-flops. How does the down counter circuit differ from the upcounter circuit? Solution: Two ways to convert the previous up-counter to a down-counter: 1. Either, replace the +ve edge-triggered T flip-flops with ve edgetriggered T flip-flops 2. Or, connect the Q outputs (instead of NOT(Q) outputs) from previous flip-flops to clock inputs of next flip-flops

Asynchronous Counters The previous counter is an example of asynchronous counters. Also called ripple counters Input clock only connected to one flip flop Clocks for other flip-flops are derived from outputs of previous flip-flops Asynchronous counters are slow because of cascaded clocking The input clock pulse ripples from stage to stage Propagation delay of individual flip-flops limit speed of operation Solution: Synchronous sequential circuits (finite state machines)

Finite State Machines Recall that in a sequential circuit: Outputs depend both on present inputs and the sequence of previous inputs The state of a sequential circuit determines its behavior when various input patterns are applied A finite state machine model formally describes a sequential circuit Inputs Combinational Logic Outputs Present State Next State Delay Elements (Flip-flops)

Synthesis of Finite State Machines Synthesis of FSM involves the following steps: Step 1: Develop a state diagram or state table Depict how state transitions occur in response to input patterns Step 2: Determine # and types of needed flip flops Step 3: Determine state assignment (flip-flop values for each state) Step 4: Determine the state-assigned state table Step 5: Derive the logic expressions for next-state logic and outputs Step 6: Use the derived expressions to implement the circuit

Example: Up/Down Counter with D flip-flops Problem Statement: Design a mod-4 counter which counts up or down depending on an input and has an output of 1 if the count is equal to 2 States: 4 states (S0, S1, S2 and S3) corresponding to 4 count values Input: Variable x. Count up if x=0, down if x=1 Output: Variable z. If present state is S2, then z=1, otherwise z=0;

State Diagram x=0 S0/0 S1/0 x=1 x=0 x=1 x=1 x=0 x=1 S3/0 S2/1 x=0

State Table Present State Next State Output z x = 0 x = 1 S0 S1 S3 0 S1 S2 S0 0 S2 S3 S1 1 S3 S0 S2 0 Need 2 state variables to represent 4 states => use 2 D flip-flops

State-Assigned State Table State variables y 1 and y 2 used to express each state as a 2-bit number y 2 y 1 We choose the following state assignment S0=00, S1=01, S2=10, S3=11 Present State Next State Output z x = 0 x = 1 y 2 y 1 Y 2 Y 1 Y 2 Y 1 00 01 11 0 01 10 00 0 10 11 01 1 11 00 10 0 Logic Expressions Next state Output Y2 y2 y1 x z y2y1 Y1 y1

Logic Circuit Logic Expressions Next state Output Y2 y2 y1 x z y2y1 Y1 y1

Decoder Decoder is used to decode encoded information A decoder has n data inputs and 2 n outputs For any input data combination, a unique output line has logic value 1 and all the other outputs have the value 0 (one-hot encoding) Example: Consider an instruction which performs 8 different functions. A 3-bit field may be used to denote 1 out of the 8 possible functions. A 3- to-8 decoder would decode any instance of the instruction to determine the desired function n inputs n-to-2 n decoder 2 n outputs

2-to-4 Decoder Circuit x 0 y 3 y 2 x 0 x 1 Active Output 0 0 y 0 0 1 y 1 1 0 y 2 1 0 y 3 x 1 y 1 y 0 x y 0 0 y x 1 1 y 2 y 3

BCD to Seven-Segment Display Decoder In typical decoders, only one output line asserted for an input combination There are other special decoders, where multiple lines may be asserted Example: BCD (binary-coded decimal) to seven-segment display decoder Input: a 4-bit BCD digit Output: 7 bits (a through g) corresponding to 7 display segments Any number from 0 to 9 can be displayed by turning some lights on and others off Multiple outputs may be asserted at once E.g., if input is 0100 (digit 4): b, c, f and g are on See Figure A.36 in book for truth table and circuit a f g b e d c

Multiplexer A multiplexer (MUX) circuit has: 2 k data inputs k select inputs One output A MUX passes the signal value on one of its data inputs to the output based on the value of the select signals Can be used for gating of data that may come from many different sources Multiplexer Symbol 2 k data inputs MUX Output k select inputs

A 4-Input Multiplexer x 0 x 1 x 2 x 3 4-input MUX z w 0 w 1 z 0 0 x 0 0 1 x 1 1 0 x 2 1 1 x 3 w 0 w 1 z x0w0w1 x1w 0w1 x2w0w1 x3w0w1 Logic circuit implementation shown in Figure A.37 Example usage: A register can be loaded from one of four distinct sources by using a 4-input MUX

Logic Functions using MUXes MUXes can be used to synthesize logic functions Example: Consider a function f of 3 input variables x 0, x 1 and x 2 defined by following truth table. This function can be synthesized with a 4-input mux x 0 x 1 x 2 f 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 1 0 0 1 1 0 1 1 x 0 x 1 f 0 0 0 0 1 X 2 1 0 1 1 1 NOT(x 2 ) 1 1 0 1 1 1 1 0

Logic Functions using MUXes MUXes can be used to synthesize logic functions Example: Consider a function f of 3 input variables x 0, x 1 and x 2. This function can be synthesized with a 4-input mux x 0 x 1 x 2 f 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 1 0 0 1 0 x 2 1 NOT(x 2 ) MUX f 1 0 1 1 1 1 0 1 x 0 x 1 1 1 1 0

Practice Problem Synthesize the function f 1 in the following truth table by using a 4-input mux with y 1 and y 2 as selector inputs. y 0 y 1 y 2 f 1 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 1 1 0 0 0 1 0 1 1 1 1 0 0 1 1 1 1

Solution Transform the truth table to use y1 and y2 as inputs y 0 y 1 y 2 f 1 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 1 1 0 0 0 1 0 1 1 y 1 y 2 f 1 0 0 0 0 1 1 1 0 NOT(y 0 ) 1 1 1 1 1 0 0 1 1 1 1

Solution 4-input MUX with y 1 and y 2 as selector inputs y 0 y 1 y 2 f 1 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 1 1 0 0 0 0 1 NOT(y 0 ) 1 MUX f 1 1 0 1 1 1 1 0 0 y 1 y 2 1 1 1 1