1 ENGG 1203 Tutorial Combinational Logic (II) and Sequential Logic (I) 8 Feb Learning Objectives  Apply Karnaugh map for logic simplification  Design.

Slides:



Advertisements
Similar presentations
ENGIN112 L23: Finite State Machine Design Procedure October 27, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 23 Finite State Machine.
Advertisements

1 ENGG 1203 Tutorial Sequential Logic (II) and Electrical Circuit (I) 22 Feb Learning Objectives  Design a finite state machine  Analysis circuits through.
Finite State Machines (FSMs)
CS1Q Computer Systems Lecture 12 Simon Gay. Lecture 12CS1Q Computer Systems - Simon Gay 2 Design of Sequential Circuits The systematic design of sequential.
التصميم المنطقي Second Course
Circuits require memory to store intermediate data
Sequential Circuit Design
08/07/041 CSE-221 Digital Logic Design (DLD) Lecture-8:
ECE C03 Lecture 101 Lecture 10 Finite State Machine Design Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
Sequential Circuits and Finite State Machines Prof. Sin-Min Lee
Give qualifications of instructors: DAP
Contemporary Logic Design Finite State Machine Design © R.H. Katz Transparency No Chapter #8: Finite State Machine Design Finite State.
Sequential Circuit Design
Part 2: DESIGN CIRCUIT. LOGIC CIRCUIT DESIGN x y z F F = x + y’z x y z F Truth Table Boolean Function.
ENGG 1203 Tutorial Combinational Logic (I) 1 Feb Learning Objectives
Chapter 12 Digital Logic Circuit Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Digital Computer Design Fundamental
Introduction to Digital Logic Design Appendix A of CO&A Dr. Farag
Boolean Algebra and Digital Logic
Elevator Controller We’re hired to design a digital elevator controller for a four-floor building st try: Design a counter that counts up.
Chap 4. Sequential Circuits
Rabie A. Ramadan Lecture 3
Finite-State Machines with Output
ECE2030 Introduction to Computer Engineering Lecture 16: Finite State Machines Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering.
1 © 2015 B. Wilkinson Modification date: January 1, 2015 Designing combinational circuits Logic circuits whose outputs are dependent upon the values placed.
Chapter 2Basic Digital Logic1 Chapter 2. Basic Digital Logic2 Outlines  Basic Digital Logic Gates  Two types of digital logic circuits Combinational.
Module 9.  Digital logic circuits can be categorized based on the nature of their inputs either: Combinational logic circuit It consists of logic gates.
Introduction to Sequential Logic Design Finite State-Machine Design.
1 Lecture #12 EGR 277 – Digital Logic Synchronous Logic Circuits versus Combinational Logic Circuits A) Combinational Logic Circuits Recall that there.
1 Lecture 22 Sequential Circuits Analysis. 2 Combinational vs. Sequential  Combinational Logic Circuit  Output is a function only of the present inputs.
Important Components, Blocks and Methodologies. To remember 1.EXORS 2.Counters and Generalized Counters 3.State Machines (Moore, Mealy, Rabin-Scott) 4.Controllers.
Logic Gates Logic gates are electronic digital circuit perform logic functions. Commonly expected logic functions are already having the corresponding.
1 © 2014 B. Wilkinson Modification date: Dec Sequential Logic Circuits Previously, we described the basic building blocks of sequential circuits,
1 Inputs: q (quarter), d (dime) and n (nickel) Input can be two bit coded input or three bit not coded input –Two bit coded: 00 no coin, 01 nickel, 10.
Introduction to State Machine
4. Computer Maths and Logic 4.2 Boolean Logic Logic Circuits.
Department of Computer and IT Engineering University of Kurdistan Computer Architecture (Review of Digital Design) By: Dr. Alireza Abdollahpouri.
1 ENGG 1015 Tutorial Digital Logic (II) (70 pages) 15 Oct Learning Objectives  Learn about Boolean Algebra (SoP/PoS, DrMorgan's Theorem, simplification),
DLD Lecture 26 Finite State Machine Design Procedure.
1 Finite State Machines (FSMs) Now that we understand sequential circuits, we can use them to build: Synchronous (Clocked) Finite State Machines Finite.
Computer Architecture and Organization Unit -1. Digital Logic Circuits – Logic Gates – Boolean Algebra – Map Simplification – Combinational Circuits –
1 A counter counts Number of elements in counter determines how many different states we need For example, an eight-state counter can count eight steps.
Registers; State Machines Analysis Section 7-1 Section 5-4.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
Chapter 3 Digital Logic Structures. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 3-2 Transistor: Building.
1 ENGG 1015 Tutorial Three Examples of Finite State Machines Supplementary notes Learning Objectives  Learn about Design of Finite State Machines Ack.:
Karnaugh Maps (K-Maps)

Digital Electronics Tutorial: Number System & Arithmetic Circuits Solutions.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
1 State machine by nature are ideally suited to track state and detect specific sequence of events For example, we may design specific machines to track.
Instructor: Alexander Stoytchev CprE 281: Digital Logic.
1 Lecture 24 Transistors A look ahead Course summary.
K-maps and Decoders Prof. Sin-Min Lee Department of Computer Science.
Finite Automata (FA) with Output FA discussed so far, is just associated with R.Es or language. Is there exist an FA which generates an output string corresponding.

DIGITAL LOGIC CIRCUITS
Computer Architecture CST 250
DIGITAL LOGIC CIRCUITS
Reading: Hambley Chapters
Karnaugh Maps (K-Maps)
Lecture 17 Logistics Last lecture Today HW5 due on Wednesday
Logic Gates.
13 Digital Logic Circuits.
ECB2212-Digital Electronics K-Map
Guest Lecture by David Johnston
Chapter 10.3 and 10.4: Combinatorial Circuits
Lecture 17 Logistics Last lecture Today HW5 due on Wednesday
EGR 2131 Unit 12 Synchronous Sequential Circuits
Finite State Machine Continued
Presentation transcript:

1 ENGG 1203 Tutorial Combinational Logic (II) and Sequential Logic (I) 8 Feb Learning Objectives  Apply Karnaugh map for logic simplification  Design a finite state machine News  HW1 (Feb 22, 2013, 11:55pm) Ack.: HKU ELEC1008, ISU CprE 281x, PSU CMPEN270, Wikipedia

2 Simplify the Boolean expression of the circuit Change each NAND gate in the circuit to a NOR gate, and simplify the Boolean expression of the circuit Simplification using K-map

3 MNQx NQ M From truth table to K-map Solution (a)

4 MNQx NQ M Solution (b)

Finite State Machine (FSM) State transition diagram  Truth table  K-Map  Circuit State  Present state: before the register  Next state: after the register  State transition: during clock  2 n states: n FFs 5

Turnstile – Control access  Depositing a token in a slot on the turnstile unlocks the arms, allowing a single customer to push through.  After the customer passes through, the arms are locked again until another coin is inserted. A simple Finite State Machine (FSM) Current StateInputNext StateOutput Locked coinUnlockedRelease turnstile so customer can push through pushLockedNone Unlocked coinUnlockedNone pushLockedWhen customer has pushed through, lock turnstile 6

A simple FSM 7 State Transition Transition condition Arm: 0 Arm: 1 Current StateInputNext StateOutput Locked coinUnlockedRelease turnstile so customer can push through pushLockedNone Unlocked coinUnlockedNone pushLockedWhen customer has pushed through, lock turnstile Specification  FSM

Steps in designing a state machine Draw a state transition diagram  An initial state  Other states to keep track of various activities  Transitions Generate a state transition table and a output table  Write state transition table and output table in binary State assignment, i.e., the code used for each state Derive canonical sum-of-product expressions Draw the circuit 8

From state transition diagram to truth table Four states  Two-bit state q: Present state q*: Next state z: Output 9 Condition/Output

From truth table to K-map 10 DADA DBDB DADA DBDB AB

From K-map to circuit 11 Logic for state transition State registerLogic for output

A simple FSM design Design a state machine that will repeatedly display in binary values 1 (001), 3 (011), 5 (101), and 7 (111)  How many states we need?  S0, S1, S2, S3  Simplified state transition diagram? 12

Solution Output table L2 = XY'+XY = X L1 = X'Y+XY = Y L0 = X'Y'+X'Y+XY'+XY = 1 State transition table X = X'Y+XY' Y = X'Y+XY' = Y' 13 Current stateOutput S0 (00)1 (001) S1 (01)3 (011) S2 (10)5 (101) S3 (11)7 (111) CurrentOutput XYL2L1L Current stateNext state S0 (00)S1 (01) S2 (10) S3 (11) S0 (00) CurrentNext XYXY

A complicated FSM design Vending Machine  Collect money, deliver product and change Vending machine may get three inputs  Inputs are nickel (5c), dime (10c), and quarter (25c)  Only one coin input at a time  Product cost is 40c  Does not accept more than 50c  Returns 5c or 10c back  Exact change appreciated 14

Solution We are designing a Mealy state machine (i.e., output depends on both current state and inputs). Suppose we ask the machine to directly return the coin if it cannot accept an input coin. Input specification: I 1 I 2  Represent the coin inserted  00 - no coin (0 cent), 01 – nickel (5 cents), 10 – dime (10 cents), 11 – quarter (25 cents) Output specification: C 1 C 2 P  C 1 C 2 represent the coin returned – 00, 01, 10, 11  P indicates whether to deliver product – 0, 1 15

Solution States: S 1 S 2 S 3  Represent the money inside the machine now  3 bits are enough to encode the states S00 (0 cents) – 000 S05 (5 cents) – 001 S10 – 010 S15 – 011 S20 – 100 S25 – 101 S30 – 110 S35 –

Solution 17

Solution 18 S35 11/110  S35 10/011  S00 01/001  S00 11/110 11/000 01/000 10/000 S35: Currently the machine has 35 cents e.g. 11/110 : If we insert a quarter (11), then the machine should return one quarter and zero product (110)  35c (35 cents inside the machine now) + 25c (insert 25 cents) = 35c (35 cents inside the machine in the next state) + 25c (return 25 cents) + 0c (return no product) Input Output Next state 00/000  S35

Solution 19 S35 11/110  S35 10/011  S00 01/001  S00 11/110 11/000 01/000 10/000 e.g. 10/011: If we insert a dime (10), then the machine should return one nickel and one product (011)  35c (35 cents inside the machine now) + 10c (insert 10 cents) = 0c (zero cent inside the machine in the next state) + 5c (return 5 cents) + 40c (return one product) e.g. 01/001: If we insert a nickel (01), then the machine should return zero coin and one product (001)  35c (35 cents inside the machine now) + 5c (insert 5 cents) = 0c (zero cent inside the machine in the next state) + 0c (return zero cent) + 40c (return one product) 00/000  S35

20 (Appendix) Simplification using K-map Simplify the following Boolean expressions using Karnaugh map.

21 Solution A/B A/BC i) ii)

(Appendix) Counter Figure a) shows a complete four-bit parallel adder with registers and b) shows the signals used to add binary numbers from memory and store their sum in the accumulator. Suppose the numbers being added are 1001 and Also assume that C o =0. Describe what happen at t 1, t 2, t 3, t 4 and t 5. 22

Solution 23

24

At time t 2, load is active high  Set A numbers will be loaded into the upper register At time t 3, transfer is active high  Adder process between A 3 A 2 A 1 A 0 = 0000 and B 3 B 2 B 1 B 0 = 1001 The sum S 3 S 2 S 1 S 0 = 1001 are transferred to register A on PGT due to this transfer pulse at t 3 25

At time t 4, the load is active high, the set B numbers will be loaded into register B on PGT of LOAD pulse  B 3 B 2 B 1 B 0 = 0101 At time t 5, A 3 A 2 A 1 A 0 = 1001 and B 3 B 2 B 1 B 0 = 0101, the adder produces S 3 S 2 S 1 S 0 = This sum is transferred into register A when TRANSFER pulse occur at t 5. 26

(Appendix) State changing in FSM Design a 2-bit counter with input x that can be  A down counter when x = 0 (…  11  10  01  00  11  …)  A Johnson counter when x = 1 (…  00  01  11  10  00  …) 27

Solution 28

(Appendix) A typical FSM 29 FSM  Truth table  Circuit Logic for output Logic for state transition State register