Presentation is loading. Please wait.

Presentation is loading. Please wait.

T,JK-flip-flop, Midterm 1 Revision Decoders and Multiplexers Prof. Sin-Min Lee Department of Computer Science San Jose State University.

Similar presentations


Presentation on theme: "T,JK-flip-flop, Midterm 1 Revision Decoders and Multiplexers Prof. Sin-Min Lee Department of Computer Science San Jose State University."— Presentation transcript:

1 T,JK-flip-flop, Midterm 1 Revision Decoders and Multiplexers Prof. Sin-Min Lee Department of Computer Science San Jose State University

2 2

3 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 4

5 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 6 Characteristic Equation of FFs

7 7

8 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.JPLJune 131968Hughes 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 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 10

11 11 Implement D Flip-flop by T Flip-flop 0 1 0 1 0 1 1 0 DT Q Q 0101 0101 T = D Q’ + D’ Q D D’ T

12 12 Implement JK Flip-flop by D Flip-flop 0 1 0 1 0 1 J K Q 0 0 1 1 1 0 D = J Q’ + K’ Q D 0 1 J K Q 0 0 1 1 1 0 0 1 0 1 0 1 DQ+Q+ 0101 0101 J K Q Q’

13 13 Implement JK Flip-flop by T Flip-flop 0 1 0 1 0 1 J K Q 0 0 1 1 1 0 T = J Q’ + K Q T 0 1 J K 0 0 1 1 1 0 0 0 1 1 1 0 TQ+Q+ 0101 Q Q’ J K Q Q Q+Q+ J KQ+Q+ 0 0 1 1 0 1 Q 0 1 Q’

14 14 Implement T Flip-flop by JK Flip-flop 0 X 1 X X 1 X 0 J K 0 0 1 1 0 1 T Q 0101 0 1 1 0 Q Q+ 0 1 T Q 0101 0 X 1 X 0 1 T Q 0101 X 0 X 1 0 1 J = T K = T

15 15

16 16

17 17

18 18

19 19

20 20

21 21

22 22

23 23

24 24

25 25

26 26

27 27

28 28

29 29

30 30

31 31

32 32 XYF 000 010 100 111 F = ΣmF = Π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 33

34 34

35 35

36 36

37 37

38 38

39 39

40 40

41 41

42 42

43 43

44 44

45 45 Example F(X,Y,Z) = X’Y’Z + X’YZ’ + XYZ’ + XYZ = Σm(1,2,6,7) 2 2 -to-1 MUXThere are n=3 inputs, thus we need a 2 2 -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 46 ZYXF 0000 F=0 0010 0101 F=1 0111 1001 F= X´ 1010 1100 F= X 1111 0 1 X´ X F Z Y

47 47 YXZF 0000 F= Z 0011 0100 F=0 0110 1001 F= Z´ 1010 1101 F= 1 1111 Z 0 Z´ 1 F Y X

48 48 YXZF 000 X.Y ´=0 001 X ⊕ Y=0 010 X.Y ´=0 011 X ⊕ Y=1 100 X.Y ´=1 101 X ⊕ Y=1 110 X.Y ´=0 111 X ⊕ Y=0

49 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 S 1 and S 0 selection inputs of the MUX (A is most sig, S 1 is most sig.) Enumerate function in a truth table.

50 50 MUX Example (cont.) ABCF 0000 0011 0100 0111 1000 1011 1101 1110 When A=B=0, F=C When A=0, B=1, F=C When A=1, B=0, F=C When A=B=1, F=C’

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

52 52 Or Simply…. F A B C C C C 11 1001 00

53 53 A larger Example

54 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. OR NOTAND z = x 1 + x 1 ’x 0 = x 1 x 0 ’ + x 1 x 0 + x 1 ’x 0 = x 1 + x 0 = x 1 x 0 ’ + x 1 x 0 + x 1 ’x 0 = x 1 + x 0 z = 0x + 1x’ = x’ z = x 1 x 0 + 0x 0 ’ = x 1 x 0 1 x1x1x1x1

55 55 Implementation using decoders: Now we implement the output f 1 using an decoder and 3-input OR gates.

56 56

57 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 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 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 60 Decoders Selects one of 2**n inputs Each AND gate implements one Boolean expression ABC etc.

61 61 Comparators 4 address words, A, B compared. Output (A =B) Users XOR gates: 1 iff both inputs are same

62 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 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 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 65 Similarly, a function having three inputs, has the minterms that are shown in this diagram. 3A.2 Description of Kmaps and Terminology

66 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 82 3A.6 Don’t Care Conditions In one grouping in the Kmap below, we have the function:

83 83 3A.6 Don’t Care Conditions A different grouping gives us the function:

84 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 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 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


Download ppt "T,JK-flip-flop, Midterm 1 Revision Decoders and Multiplexers Prof. Sin-Min Lee Department of Computer Science San Jose State University."

Similar presentations


Ads by Google