elx304_part 1_lesson 2.pptx

38
Last Updated: Saturday, May 14, 2022 © LMS SEGi education group 1 ELX 304 – Electronic System Design Part 1 – Lesson 2 Design With Inputs PowerPoint ® Slides by Dr. Chow Li Sze

Upload: zacboy11

Post on 01-Feb-2016

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ELX304_Part 1_Lesson 2.pptx

Last Updated:April 22, 2023 © LMS SEGi education group 1

ELX 304 – Electronic System Design

Part 1 – Lesson 2

Design With Inputs

PowerPoint® Slidesby Dr. Chow Li Sze

Page 2: ELX304_Part 1_Lesson 2.pptx

Aims

• Designed several synchronous circuits with input(s).

• Gained expertise in constructing state diagrams.

Last Updated:April 22, 2023 © LMS SEGi education group 2

Page 3: ELX304_Part 1_Lesson 2.pptx

Flip-Flop – State Diagram

• D Flip-Flop

• J-K Flip Flop

Last Updated:April 22, 2023 © LMS SEGi education group 3

q* denote next state.

Page 4: ELX304_Part 1_Lesson 2.pptx

Flip-Flop – State Diagram

• S-R Flip Flop

• T Flip Flop

Last Updated:April 22, 2023 © LMS SEGi education group 4

Page 5: ELX304_Part 1_Lesson 2.pptx

General Design with a single input

Step 1: Problem statement: Pattern Generator• The problem is to generate a pattern as shown below. • If the input, X is a logic ‘0’, then the pattern to be generated is in 6

steps. • If X=1, then a shortened pattern is produced, but the change can

only be initiated starting from the state whose output is 000.

Last Updated:April 22, 2023 © LMS SEGi education group 5

A B C D E F

A B C D E F

A B E F

A B E F

6 steps

4 steps

Page 6: ELX304_Part 1_Lesson 2.pptx

Step 2: State diagram

Last Updated:April 22, 2023 © LMS SEGi education group 6

x =

input

Page 7: ELX304_Part 1_Lesson 2.pptx

Step 2: State diagram

• In this example, there is one input (X), there will be 2 arrows leaving each state.

• In general, if there are n inputs, there will be 2n arrows leaving each state.

Question:

If a state does not have any arrows leading to it, what is that mean?

Last Updated:April 22, 2023 © LMS SEGi education group 7

Answer:That state represents an initial condition.

Page 8: ELX304_Part 1_Lesson 2.pptx

Step 3: State table

There are 2 “next state” for each “present state”

Notes: The State Table from Slide 8-13 doesn’t match the corrected State diagram in Slide 6 as in the UOS lecture notes. But they were used for demonstration of the method.

Last Updated:April 22, 2023 © LMS SEGi education group 8

Page 9: ELX304_Part 1_Lesson 2.pptx

Step 4: Flip-flops Step 5: State Assignment

• There are 6 states, so we need 3 flip-flops.• Let’s choose J-K flip-flops.• We cannot make the state assignments the same as the

outputs, because the outputs of different states are the same!• We can choose the following state assignment:

• A = 000 • B = 001• C = 010 • D = 011 • E = 100 • F = 101

Last Updated:April 22, 2023 © LMS SEGi education group 9

Page 10: ELX304_Part 1_Lesson 2.pptx

Step 6: Excitation table

Last Updated:April 22, 2023 © LMS SEGi education group 10

Page 11: ELX304_Part 1_Lesson 2.pptx

Step 6: Excitation table

Use the Change Table to fill up the Excitation Table:

Last Updated:April 22, 2023 © LMS SEGi education group 11

Change Table

Page 12: ELX304_Part 1_Lesson 2.pptx

Step 7: Karnaugh Maps

Last Updated:April 22, 2023 © LMS SEGi education group 12

Jc = Kc = 1

input

Page 13: ELX304_Part 1_Lesson 2.pptx

Step 7: Karnaugh Maps

We require output maps for Z1Z2Z3 which depends only on the PRESENT STATE.

Last Updated:April 22, 2023 © LMS SEGi education group 13

Page 14: ELX304_Part 1_Lesson 2.pptx

Practice

Try it yourself for the Step 8: Circuit Diagram

Last Updated:April 22, 2023 © LMS SEGi education group 14

Page 15: ELX304_Part 1_Lesson 2.pptx

Example 2: Pattern Detector

• Problem Statement:• Design a synchronous circuit which will give a logic 1 for one

clock period when the following pattern is detected in a series data stream ….0 1 1 0…

• The final 0 can be the first 0 in the next pattern. • Use JK Flip-flops.• Typical sequence:

Last Updated:April 22, 2023 © LMS SEGi education group 15

Page 16: ELX304_Part 1_Lesson 2.pptx

State Diagram

Last Updated:April 22, 2023 © LMS SEGi education group 16

Start at some known situation: the input is 0 and so is the output(State A). If the input stays at 0, then there is no reason not to stay at state A. But if the input changes to 1, then we want to remember this, so we go to state B, and the output is still 0.

If we now get a second 1, then we go to state C. C effectively is a memory that we have detected 0 1 1. If we now get a 0 input, this is the sequence we want so we go to state D which has an output 1.

Page 17: ELX304_Part 1_Lesson 2.pptx

State Diagram

Last Updated:April 22, 2023 © LMS SEGi education group 17

We now have to decide what happens if the inputs don’t follow the pattern we want to detect.

In state B if we get a logic 0, we should go back to A.

In state C if we get a logic 1, we have to go to a new state E, because we have now detected 3 logic ‘1’s. We then stay there until a logic 0 is detected, when we go back to A, which can be the start of a new sequence.

Page 18: ELX304_Part 1_Lesson 2.pptx

State Assignment

Last Updated:April 22, 2023 © LMS SEGi education group 18

Finally, when we are in state D, a logic 0 should take us back to A, but a logic 1 will take us to state B (because B is remembering 01).

There are 5 states, so 3 Flip-flops and a 3-bit state assignment is needed.

We will choose A = 000, B = 001, C = 010, D = 011 and E = 100,labelling the Flip-flop outputs as Q1Q2Q3 respectively.

Page 19: ELX304_Part 1_Lesson 2.pptx

Practice

Try it yourself to develop the:• State Table• Excitation Table• K-maps

Answer:

Last Updated:April 22, 2023 © LMS SEGi education group 19

Page 20: ELX304_Part 1_Lesson 2.pptx

Example 3: Multiple Input

• For a problem with 2 inputs, there will be 4 arrows leaving each state!

• Problem Statement:• A circuit has two inputs: X and Y.• The system must detect if both inputs are 0 or both inputs are 1

for three or more consecutive clock pulses.• The output must stay as logic ‘1’ for as long as the sequence of

‘1’s or ‘0’ s is detected.• Use D Type Flip-flops.• Typical Sequence:

Last Updated:April 22, 2023 © LMS SEGi education group 20

Page 21: ELX304_Part 1_Lesson 2.pptx

State Diagram

Last Updated:April 22, 2023 © LMS SEGi education group 21

Page 22: ELX304_Part 1_Lesson 2.pptx

State Table

• There are 7 states so we need 3 Flip-flops.• Since we have two inputs we shall need 5 variable K-maps!

Last Updated:April 22, 2023 © LMS SEGi education group 22

Page 23: ELX304_Part 1_Lesson 2.pptx

State Assignment

• There is clearly some symmetry between states BCD and EFG, so

we should make their state assignments follow a similar pattern.

• We shall try the following:

A = 000, B = 001, C = 010, D = 011,

E = 101, F = 110, G = 111

• State 100 is not used, because we want to match the above pattern.

• D type Flip-flops were chosen because that will make the Excitation

Table simpler (although the resulting logic is likely to be more

complex overall).

Last Updated:April 22, 2023 © LMS SEGi education group 23

Page 24: ELX304_Part 1_Lesson 2.pptx

Excitation Table

Last Updated:April 22, 2023 © LMS SEGi education group 24

A

B

C

D

E

F

G

BAEACAEADAEADAEABAFABAGABAGA

Page 25: ELX304_Part 1_Lesson 2.pptx

K-maps

• The following 5 variable maps are each basically two 4-variable, differing in the Q1 bit – the left hand map is where Q1 = 0.

Last Updated:April 22, 2023 © LMS SEGi education group 25

2 inputs

State 100 is not usedFollow the order for input

XY

Page 26: ELX304_Part 1_Lesson 2.pptx

K-maps

• Note that the “don’t care” entries have been chosen to generate symmetrical functions.

Last Updated:April 22, 2023 © LMS SEGi education group 26

Page 27: ELX304_Part 1_Lesson 2.pptx

K-maps

Last Updated:April 22, 2023 © LMS SEGi education group 27

symmetrical functions

Page 28: ELX304_Part 1_Lesson 2.pptx

K-maps

• The output, Z, depends only on the states:

Last Updated:April 22, 2023 © LMS SEGi education group 28

State 100 is not used

Page 29: ELX304_Part 1_Lesson 2.pptx

Circuit Diagram

Last Updated:April 22, 2023 © LMS SEGi education group 29

Page 30: ELX304_Part 1_Lesson 2.pptx

Unwanted State

• In every case, we go back to an appropriate state.

Last Updated:April 22, 2023 © LMS SEGi education group 30

Page 31: ELX304_Part 1_Lesson 2.pptx

Summary

In this lesson, we have learned:• Synchronous design for one or two inputs for a range of

problems.• Developing state diagrams from a word specification.• There is no definitive solution, but there is an optimum State

Diagram.

Notes: The choices we make may not be wrong, but they may not

be optimum. The optimum may not in fact be achievable in any

sensible time.

Last Updated:April 22, 2023 © LMS SEGi education group 31

Page 32: ELX304_Part 1_Lesson 2.pptx

Tutorial

Last Updated:April 22, 2023 © LMS SEGi education group 32

Page 33: ELX304_Part 1_Lesson 2.pptx

Tutorial Q.3

Design a circuit which will produce the following repeated three output pattern under the control of two inputs X and Y as defined below:

Last Updated:April 22, 2023 © LMS SEGi education group 33

Page 34: ELX304_Part 1_Lesson 2.pptx

Answer Q.3

Last Updated:April 22, 2023 © LMS SEGi education group 34

Page 35: ELX304_Part 1_Lesson 2.pptx

Tutorial Q.4

Design a circuit which will detect the pattern ….1011… in a serial input. The final logic ‘1’ in a detected pattern may form the first 1 in the next pattern. When a pattern is detected the output must stay at logic ‘1’ for 2 clock periods.

Last Updated:April 22, 2023 © LMS SEGi education group 35

Page 36: ELX304_Part 1_Lesson 2.pptx

Answer Q.4

Last Updated:April 22, 2023 © LMS SEGi education group 36

Page 37: ELX304_Part 1_Lesson 2.pptx

Tutorial Q.5

Design a circuit which will give an output if a 3 bit serial word contains an odd number of logic ‘1’s. The output is only ‘1’ at the end of the word. Assume that the words have been synchronised externally, so that we start with the first bit of the word and not halfway though a word.

Last Updated:April 22, 2023 © LMS SEGi education group 37

Page 38: ELX304_Part 1_Lesson 2.pptx

Answer Q.5

Last Updated:April 22, 2023 © LMS SEGi education group 38