1 / 66

Lecture 23

leora
Télécharger la présentation

Lecture 23

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


    2. Counter Example 3-bit synchronous binary counter using D FFs Step (1): State Diagram

    3. Step (2): State Assignment Use variables (A,B,C) and 3-bit binary assignment Step (3): State Transition Table

    4. Step (4): Derivation of Next State Equations

    5. Step (5): Logic Diagram

    6. Sequence Detector Design sequence detector (for 1101) using J-K FF Step (1): State Diagram

    7. Steps (2) and (3): State Assignment & State Transition Table

    8. Step (4): Derivation of Next State and Output Equations

    9. Step (5): Logic Diagram

    11. Conversion to NAND-Gate Circuits

    12. Simplification Goals Goal -- minimize the cost of realizing a switching function Cost measures and other considerations Number of gates Number of levels Gate fan in and/or fan out Interconnection complexity Preventing hazards Two-level realizations Minimize the number of gates (terms in switching function) Minimize the fan in (literals in switching function)

    13. Example

    14. Minimization Methods Commonly used techniques Boolean algebra postulates and theorems Karnaugh maps Quine-McCluskey method

    15. Minimum SOP and POS Representations The minimum sum of products (MSOP) of a function, f, is a SOP representation of f that contains the fewest number of product terms and fewest number of literals of any SOP representation of f. Example -- f(a,b,c,d) = ?m(3,7,11,12,13,14,15) = ab + a?cd + acd = ab + cd The minimum product of sums (MPOS) of a function, f, is a POS representation of f that contains the fewest number of sum terms and the fewest number of literals of any POS representation of f. Example -- f(a,b,c,d) = ?M(0,1,2,4,5,6,8,9,10) = (a + c)(a + d)(a? + b + d)(b + c? + d) = (a +c)(a + d)(b + c)(b + d)

    16. Karnaugh Maps Karnaugh maps (K-maps) -- convenient tool for representing switching functions of up to six variables. K-maps form the basis of useful heuristics for finding MSOP and MPOS representations. An n-variable K-map has 2n cells with each cell corresponding to a row of an n-variable truth table. K-map cells are labeled with the corresponding truth-table row. K-map cells are arranged such that adjacent cells correspond to truth rows that differ in only one bit position (logical adjacency). Switching functions are mapped (or plotted) by placing the functions value (0,1,d) in each cell of the map.

    17. Figure Venn diagram and equivalent K-map for two variables

    18. Figure Venn diagram and equivalent K-map for three variables

    20. Plotting (Mapping) Functions in Canonical Form on a K-map Let f be a switching function of n variables where n ? 6. Assume that the cells of the K-map are numbered from 0 to 2n where the numbers correspond to the rows of the truth table of f. If mi is a minterm of f, then place a 1 in cell i of the K-map. Example -- f(A,B,C) = ?m(0,3,5) If Mi is a maxterm of f, then place a 0 in cell i. Example -- f(A,B,C) = ?M(1,2,4,6,7) If di is a dont care of f, then place a d in cell i.

    21. Figure Plotting functions on K-maps

    22. Figure K-maps for f(a,b,Q,G) (a) Minterm form. (b) Maxterm form.

    23. Figure : f(Q,G,b,a).

    24. (a) Venn diagram form. (b) Sum of minterms. (c) Maxterms.

    25. . (a) Maxterms, (b) Minterms, (c) Minterms of f ?.

    26. . (a) K-map of f?, (b) K-map of f.

    27. Simplification of Switching Functions Using K-maps K-map cells that are physically adjacent are also logically adjacent. Also, cells on an edge of a K-map are logically adjacent to cells on the opposite edge of the map. If two logically adjacent cells both contain logical 1s, the two cells can be combined to eliminate the variable that has value 1 in one cells label and value 0 in the other. This is equivalent to the algebraic operation, aP + a?P =P where P is a product term not containing a or a?. Example -- f(A,B,C,D) = ?m(1,2,4,6,9)

    29. Simplification Guidelines for K-maps Each cell of an n-variable K-map has n logically adjacent cells. Cells may be combined in groups of 2,4,8,,2k. A group of cells can be combined only if all cells in the group have the same value for some set of variables. Always combine as many cells in a group as possible. This will result in the fewest number of literals in the term that represents the group. Make as few groupings as possible to cover all minterms. This will result in the fewest product terms. Always begin with the loneliest cells.

    30. Figure 3.11 K-map illustrating implicants

    33. Use a K-MAP to simplify the following function

    34. Four-variable K-Map

    35. Four-variable K-Map

    36. f(A,B,C,D) = ?m(0,5,7,8,10,12,14,15)

    37. f(A,B,C,D) = ?m(1,2,3,6) = A?C + BC?

    38. f(A,B,C,D) = B?D? + B?C? + BCD

    40. Find the minimum POS form of the function f(A,B,C,D) = ?M(0,1,2,3,6,9,14)

    41. Algorithm -- Finding MPOS of f from f? 1. Plot the complement function f? on the K-map. 2. Produce a MSOP of f?. 3. Complement f? and use DeMorgans theorem to produce a MSOP of f.

    42. Find the MPOS of the following function f(A,B,C,D) = ?M(0,1,2,3,6,9,14)

    43. Example 3.19 -- Minimum covers of f(A,B,C,D) = ? M (3,4,6,8,9,11,12,14) and its complement.

    44. Figure Deriving POS and SOP forms of a function.

    45. Example -- Minimizing a Function with Dont Cares. f(A,B,C,D) = ?m(1,3,4,7,11) + d(5,12,13,14,15) = ?M(0,2,6,8,9,10) ? D(5,12,13,14,15)

    46. Example Design a circuit to distinguish BCD digits ? 5 from those ? 5.

    47. Example

    49. WHAT IS A DECODER In older days, the (good) printers used to be like typewriters: To print A, a wheel turned, brought the A key up, which then was struck on the paper. Letters are encoded as 8 bit codes inside the computer. When the particular combination of bits that encodes A is detected, we want to activate the output line corresponding to A (Not actually how the wheels worked) How to do this detection : decoder General idea: given a k bit input, Detect which of the 2^k combinations is represented Produce 2^k outputs, only one of which is 1.

    50. WHAT A DECODER DOES A n-to-2n decoder takes an n-bit input and produces 2n outputs. The n inputs represent a binary number that determines which of the 2n outputs is uniquely true. A 2-to-4 decoder operates according to the following truth table. The 2-bit input is called S1S0, and the four outputs are Q0-Q3. If the input is the binary number i, then output Qi is uniquely true. For instance, if the input S1 S0 = 10 (decimal 2), then output Q2 is true, and Q0, Q1, Q3 are all false. This circuit decodes a binary number into a one-of-four code.

    51. ENABLE INPUTS Many devices have an additional enable input, which is used to activate or deactivate the device. For a decoder, EN=1 activates the decoder, so it behaves as specified earlier. Exactly one of the outputs will be 1. EN=0 deactivates the decoder. By convention, that means all of the decoders outputs are 0. We can include this additional input in the decoders truth table:

    52. BLOCKS AND ABSTRACTION Decoders are common enough that we want to encapsulate them and treat them as an individual entity. Block diagrams for 2-to-4 decoders are shown here. The names of the inputs and outputs, not their order, is what matters. A decoder block provides abstraction: You can use the decoder as long as you know its truth table or equations, without knowing exactly whats inside. It makes diagrams simpler by hiding the internal circuitry. It simplifies hardware reuse. You dont have to keep rebuilding the decoder from scratch every time you need it. These blocks are like functions in programming!

    54. A 3-TO-8 DECODER Larger decoders are similar. Here is a 3-to-8 decoder. The block symbol is on the right. A truth table (without EN) is below. Output equations are at the bottom right. Again, only one output is true for any input combination.

    55. SUMMARY A n-to-2n decoder generates the minterms of an n-variable function. As such, decoders can be used to implement arbitrary functions. Later on well see other uses for decoders too. Some variations of the basic decoder include: Adding an enable input. Using active-low inputs and outputs to generate maxterms. We also talked about: Applying our circuit analysis and design techniques to understand and work with decoders. Using block symbols to encapsulate common circuits like decoders. Building larger decoders from smaller ones.

    56. MULTIPLEXERS A 2n-to-1 multiplexer sends one of 2n input lines to a single output line. A multiplexer has two sets of inputs: 2n data input lines n select lines, to pick one of the 2n data inputs The mux output is a single bit, which is one of the 2n data inputs. The simplest example is a 2-to-1 mux: The select bit S controls which of the data bits D0-D1 is chosen: If S=0, then D0 is the output (Q=D0). If S=1, then D1 is the output (Q=D1).

    57. MORE TRUTH TABLE ABBREVIATIONS Here is a full truth table for this 2-to-1 mux, based on the equation: Here is another kind of abbreviated truth table. Input variables appear in the output column. This table implies that when S=0, the output Q=D0, and when S=1 the output Q=D1. This is a pretty close match to the equation.

    58. A 4-TO-1 MULTIPLEXER Here is a block diagram and abbreviated truth table for a 4-to-1 mux. Be careful! In LogicWorks the multiplexer has an active-low EN input signal. When EN = 1, the mux always outputs 1.

    59. IMPLEMENTING FUNCTIONS WITH MULTIPLEXERS Muxes can be used to implement arbitrary functions. One way to implement a function of n variables is to use an n-to-1 mux: For each minterm mi of the function, connect 1 to mux data input Di. Each data input corresponds to one row of the truth table. Connect the functions input variables to the mux select inputs. These are used to indicate a particular input combination. For example, lets look at f(x,y,z) = ?m(1,2,6,7).

    60. A MORE EFFICIENT WAY We can actually implement f(x,y,z) = ?m(1,2,6,7) with just a 4-to-1 mux, instead of an 8-to-1. Step 1: Find the truth table for the function, and group the rows into pairs. Within each pair of rows, x and y are the same, so f is a function of z only. When xy=00, f=z When xy=01, f=z When xy=10, f=0 When xy=11, f=1 Step 2: Connect the first two input variables of the truth table (here, x and y) to the select bits S1 S0 of the 4-to-1 mux. Step 3: Connect the equations above for f(z) to the data inputs D0-D3.

    61. SUMMARY A 2n-to-1 multiplexer routes one of 2n input lines to a single output line. Just like decoders, Muxes are common enough to be supplied as stand-alone devices for use in modular designs. Muxes can implement arbitrary functions. We saw some variations of the standard multiplexer: Smaller muxes can be combined to produce larger ones. We can add active-low or active-high enable inputs. As always, we use truth tables and Boolean algebra to analyze things. On Monday, we will start discussing how to build circuits to do arithmetic.

    62. SIGNED MAGNITUDE REPRESENTATION Humans use a signed-magnitude system: we add + or - in front of a magnitude to indicate the sign. We could do this in binary as well, by adding an extra sign bit to the front of our numbers. By convention: A 0 sign bit represents a positive number. A 1 sign bit represents a negative number. Examples:

    63. ONES COMPLEMENT REPRESENTATION A different approach, ones complement, negates numbers by complementing each bit of the number. We keep the sign bits: 0 for positive numbers, and 1 for negative. The sign bit is complemented along with the rest of the bits. Examples:

    64. TWOS COMPLEMENT Our final idea is twos complement. To negate a number, complement each bit (just as for ones complement) and then add 1. Examples:

    65. MORE ABOUT TWOS COMPLEMENT Two other equivalent ways to negate twos complement numbers: You can subtract an n-bit twos complement number from 2n. You can complement all of the bits to the left of the rightmost 1. 01101 = +1310 (a positive number in twos complement) 10011 = -1310 (a negative number in twos complement) 00100 = +410 (a positive number in twos complement) 11100 = -410 (a negative number in twos complement) Often, people talk about taking the twos complement of a number. This is a confusing phrase, but it usually means to negate some number thats already in twos complement format.

    66. TWOS COMPLEMENT ADDITION Negating a twos complement number takes a bit of work, but addition is much easier than with the other two systems. To find A + B, you just have to: Do unsigned addition on A and B, including their sign bits. Ignore any carry out. For example, to find 0111 + 1100, or (+7) + (-4): First add 0111 + 1100 as unsigned numbers: Discard the carry out (1). The answer is 0011 (+3).

More Related