t,jk-flip-flop, midterm 1 revision decoders and multiplexers prof. sin-min lee department of...

Post on 05-Jan-2016

224 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

T,JK-flip-flop, Midterm 1 RevisionDecoders and Multiplexers

Prof. Sin-Min Lee

Department of Computer Science

San Jose State University

2

3

4 Basic types of Flip-Flops• SR, JK, D, and T• JK ff has 2 inputs, J and K need to be asserted

at the same time to change the state• D ff has 1 input D (DATA), which sets the ff

when D = 1 and resets it when D = 0• T ff has1 input T (Toggle), which forces the ff

to change states when T = 1• SR ff has 2 inputs, S (set) and R (reset) that set

or reset the output Q when asserted

4

5

Analysis of Sequential Systems

• Goal:– Decide the timing and functional behavior from the implementation of a

sequential system composed of FFs and logic gates

• Types:– Functional analysis– Timing analysis

6

Characteristic Equation of FFs

7

8

The origin of the name for the JK flip-flop is detailed by P. L. Lindley, a JPL engineer, in a letter to EDN, an electronics newsletter. The letter is dated June 13, 1968, and was published in the August edition of the newsletter. In the letter, Mr. Lindley explains that he heard the story of the JK flip-flop from Dr. Eldred Nelson, who is responsible for coining the term while working at Hughes Aircraft.Flip-flops in use at Hughes at the time were all of the type that came to be known as J-K. In designing a logical system, Dr. Nelson assigned letters to flip-flop inputs as follows: #1: A & B, #2: C & D, #3: E & F, #4: G & H, #5: J & K. Given the size of the system that he was working on, Dr. Nelson realized that he was going to run out of letters, so he decided to use J and K as the set and reset input of each flip-flop in his system (using subscripts or somesuch to distinguish the flip-flops), since J and K were "nice, innocuous letters."

9

Dr. Montgomery Phister, Jr., an engineer under Dr. Nelson at Hughes, picked up the idea that J and K were the set and reset input for a "Hughes type" of flip-flop, which he then termed "J-K flip-flops," a name that he carried with him when he left for Scientific Data Systems in Santa Monica.

10

11

Implement D Flip-flop by T Flip-flop

0 1

0 0

1 1

0 1

0 1

1 0

D T

Q Q

0

1

0

1

T = D Q’ + D’ Q

D

D’

T

12

Implement JK Flip-flop by D Flip-flop

0 1

0 1

0 0

1 0

1 1

J K

Q

0 0

0 1

1 1

1 0

D = J Q’ + K’ Q

D

0 1

J K

Q

0 0

0 1

1 1

1 0

0 1

0 0

1 0

1 1

D Q+

0

1

0

1

J

K

Q

Q’

13

Implement JK Flip-flop by T Flip-flop

0 1

0 1

0 0

1 0

1 1

J K

Q

0 0

0 1

1 1

1 0

T = J Q’ + K Q

T

0 1

J K

0 0

0 1

1 1

1 0

0 0

0 1

1 1

1 0

T Q+

0

1

Q

Q’

J

K

Q

Q’

QQ+

J K Q+

0 0

0 1

1 0

1 1

Q

0

1

Q’

14

Implement T Flip-flop by JK Flip-flop

0 X

1 X

X 1

X 0

J K

0 0

0 1

1 0

1 1

TQ

0

1

0 1

1 0

Q Q+0 1

TQ

0

1

0 X

1 X

0 1 TQ

0

1

X 0

X 1

0 1

J = T K = T

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

 

X Y F

0 0 0

0 1 0

1 0 0

1 1 1

F = Σm F = ΠM

= xy = (x+y)(x+y´)(x´+y)

(x+y)(x+y´)(x´+y)

= (x+(y.y´))(x´+y)

= (x+0) (x´+y)

= x.x´+xy

= 0+xy

= xy

33

34

35

36

37

38

39

40

41

42

43

44

45

Example•F(X,Y,Z) = X’Y’Z + X’YZ’ + XYZ’ + XYZ = Σm(1,2,6,7)•There are n=3 inputs, thus we need a 2222-to-1 MUX-to-1 MUX•The first n-1 (=2) inputs serve as the selection linesThe first n-1 (=2) inputs serve as the selection lines

46

Z Y X F

0 0 0 0 F=0

0 0 1 0

0 1 0 1 F=1

0 1 1 1

1 0 0 1 F= X´

1 0 1 0

1 1 0 0 F= X

1 1 1 1

0

1

X

F

Z Y

47

Y X Z F

0 0 0 0 F=Z

0 0 1 1

0 1 0 0 F=0

0 1 1 0

1 0 0 1 F= Z´

1 0 1 0

1 1 0 1 F= 1

1 1 1 1

Z

0

1

F

Y X

48

Y X Z F

0 0 0 X .Y ´=0

0 0 1 X⊕Y=0

0 1 0 X .Y ´=0

0 1 1 X⊕Y=1

1 0 0 X .Y ´=1

1 0 1 X⊕Y=1

1 1 0 X .Y ´=0

1 1 1 X⊕Y=0

49

Another Example

• Consider F(A,B,C) = m(1,3,5,6). We can implement this function using a 4-to-1 MUX as follows.

• The index is ABC. Apply A and B to the S1 and S0 selection inputs of the MUX (A is most sig, S1 is most sig.)

• Enumerate function in a truth table.

50

MUX Example (cont.)A B C F

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 1

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 0

When A=B=0, F=CWhen A=B=0, F=C

When A=0, B=1, When A=0, B=1, F=CF=CWhen A=1, B=0, When A=1, B=0, F=CF=CWhen A=B=1, When A=B=1, F=C’F=C’

51

MUX implementation of F(A,B,C) = m(1,3,5,6)

AA

BB

CC

CC

CC

C’C’

FF

52

Or Simply….

F

A B

C

C

C

C

11

10

01

00

53

A larger Example

54

MUX as a Universal Gate• We can construct OR, AND, and NOT gates using

2-to-1 MUXs. Thus, 2-to-1 MUX is a universal gate.

ORORNOTNOT ANDAND

z = xz = x11+ x+ x11’x’x0 0

= = xx11xx00’ + ’ + xx11xx00 + + xx11’x’x0 0 = = xx11 + x + x0 0

z = 0x + 1x’ = x’z = 0x + 1x’ = x’ z = xz = x11xx00 + 0x + 0x00’ = x’ = x11xx00

11

xx11

55

Implementation using decoders: Now we implement the output f1

using an          decoder and 3-input OR gates.

56

57

Multiplexers• 2**n data inputs,

n control input, one data output

• Data inputs selected by control are gated are gated to output

• Each AND gate gets 3 control and one data input, selects input based on control

• OR gate adds all selected inputs

58

Majority Function using a Multiplxer

• Each input wired to 1 or 0• If 0 in table ground Else connect to Vcc. Check if it works!

59

Other Users of Multiplexers

• Parallel to Serial Conversion• Put 8 bit data in input lines• Step through 000 to 111 in control lines to select

inputs serially• Used in serializing device inputs such as key

board inputs over telephone lines• Inverse operation: Demultiplexing routes single

serial input into multiple outputs depending on value of control lines

60

Decoders

• Selects one of 2**n inputs

• Each AND gate implements one Boolean expression ABC etc.

61

Comparators• 4 address

words, A, B compared.

• Output (A =B)

• Users XOR gates: 1 iff both inputs are same

62

3A.1 Introduction

• In 1953, Maurice Karnaugh was a telecommunications engineer at Bell Labs.

• While exploring the new field of digital logic and its application to the design of telephone circuits, he invented a graphical way of visualizing and then simplifying Boolean expressions.

• This graphical representation, now known as a Karnaugh map, or Kmap, is named in his honor.

63

3A.2 Description of Kmaps and Terminology

• A Kmap is a matrix consisting of rows and columns that represent the output values of a Boolean function.

• The output values placed in each cell are derived from the minterms of a Boolean function.

• A minterm is a product term that contains all of the function’s variables exactly once, either complemented or not complemented.

64

• For example, the minterms for a function having the inputs x and y are:

• Consider the Boolean function,

• Its minterms are:

3A.2 Description of Kmaps and Terminology

65

• Similarly, a function having three inputs, has the minterms that are shown in this diagram.

3A.2 Description of Kmaps and Terminology

66

3A.2 Description of Kmaps and Terminology

• A Kmap has a cell for each minterm.

• This means that it has a cell for each line for the truth table of a function.

• The truth table for the function F(x,y) = xy is shown at the right along with its corresponding Kmap.

67

3A.3 Kmap Simplification for Two Variables

• The best way of selecting two groups of 1s form our simple Kmap is shown below.

• We see that both groups are powers of two and that the groups overlap.

• The next slide gives guidance for selecting Kmap groups.

68

The rules of Kmap simplification are:

• Groupings can contain only 1s; no 0s.

• Groups can be formed only at right angles; diagonal groups are not allowed.

• The number of 1s in a group must be a power of 2 – even if it contains a single 1.

• The groups must be made as large as possible.

• Groups can overlap and wrap around the sides of the Kmap.

3A.3 Kmap Simplification for Two Variables

69

3A.4 Kmap Simplification for Three Variables

• A Kmap for three variables is constructed as shown in the diagram below.

• We have placed each minterm in the cell that will hold its value.– Notice that the values for the yz combination at the top

of the matrix form a pattern that is not a normal binary sequence.

70

3A.4 Kmap Simplification for Three Variables

• Thus, the first row of the Kmap contains all minterms where x has a value of zero.

• The first column contains all minterms where y and z both have a value of zero.

71

3A.4 Kmap Simplification for Three Variables

• Consider the function:

• Its Kmap is given below.– What is the largest group of 1s that is a power of 2?

72

3A.4 Kmap Simplification for Three Variables

• This grouping tells us that changes in the variables x and y have no influence upon the value of the function: They are irrelevant.

• This means that the function,

reduces to F(x) = z.

You could verify this reduction with identities or a truth table.

73

3A.4 Kmap Simplification for Three Variables

• Now for a more complicated Kmap. Consider the function:

• Its Kmap is shown below. There are (only) two groupings of 1s.– Can you find them?

74

3A.4 Kmap Simplification for Three Variables

• In this Kmap, we see an example of a group that wraps around the sides of a Kmap.

• This group tells us that the values of x and y are not relevant to the term of the function that is encompassed by the group.– What does this tell us about this term of the function?

What about the green group in the top row?

75

3A.4 Kmap Simplification for Three Variables

• The green group in the top row tells us that only the value of x is significant in that group.

• We see that it is complemented in that row, so the other term of the reduced function is .

• Our reduced function is:

Recall that we had six minterms in our original function!

76

3A.5 Kmap Simplification for Four Variables

• Our model can be extended to accommodate the 16 minterms that are produced by a four-input function.

• This is the format for a 16-minterm Kmap.

77

3A.5 Kmap Simplification for Four Variables

• We have populated the Kmap shown below with the nonzero minterms from the function:

– Can you identify (only) three groups in this Kmap?

Recall that groups can overlap.

78

3A.5 Kmap Simplification for Four Variables

• Our three groups consist of:– A purple group entirely within the Kmap at the right.– A pink group that wraps the top and bottom.– A green group that spans the corners.

• Thus we have three terms in our final function:

79

3A.5 Kmap Simplification for Four Variables

• It is possible to have a choice as to how to pick groups within a Kmap, while keeping the groups as large as possible.

• The (different) functions that result from the groupings below are logically equivalent.

80

3A.6 Don’t Care Conditions

• Real circuits don’t always need to have an output defined for every possible input.– For example, some calculator displays consist of 7-

segment LEDs. These LEDs can display 2 7 -1 patterns, but only ten of them are useful.

• If a circuit is designed so that a particular set of inputs can never happen, we call this set of inputs a don’t care condition.

• They are very helpful to us in Kmap circuit simplification.

81

3A.6 Don’t Care Conditions

• In a Kmap, a don’t care condition is identified by an X in the cell of the minterm(s) for the don’t care inputs, as shown below.

• In performing the simplification, we are free to include or ignore the X’s when creating our groups.

82

3A.6 Don’t Care Conditions

• In one grouping in the Kmap below, we have the function:

83

3A.6 Don’t Care Conditions

• A different grouping gives us the function:

84

3A.6 Don’t Care Conditions

• The truth table of:

is different from the truth table of:

• However, the values for which they differ, are the inputs for which we have don’t care conditions.

85

• Kmaps provide an easy graphical method of simplifying Boolean expressions.

• A Kmap is a matrix consisting of the outputs of the minterms of a Boolean function.

• In this section, we have discussed 2- 3- and 4-input Kmaps. This method can be extended to any number of inputs through the use of multiple tables.

3A Conclusion

86

Recapping the rules of Kmap simplification:

• Groupings can contain only 1s; no 0s.• Groups can be formed only at right angles;

diagonal groups are not allowed.• The number of 1s in a group must be a power of

2 – even if it contains a single 1.• The groups must be made as large as possible.• Groups can overlap and wrap around the sides

of the Kmap.• Use don’t care conditions when you can.

3A Conclusion

top related