1 / 37

K-map: Product-of-Sums Minimization

Lecture. Digital Systems. K-map: Product-of-Sums Minimization. A K-map can also be used for Product-of-Sums minimization (instead of Sum-of-Products). In this case, we group the 0s and get the minimized form of the maxterms , and then take the multiplication of them. (A + B’). BC. (B’ + C).

koch
Download Presentation

K-map: Product-of-Sums Minimization

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


  1. Lecture Digital Systems K-map: Product-of-Sums Minimization • A K-map can also be used for Product-of-Sums minimization (instead of Sum-of-Products). • In this case, we group the 0s and get the minimized form of the maxterms, and then take the multiplication of them. (A+B’) BC (B’+C) 00 01 11 10 A 0 • 1 • 1 • 0 • 0 B’ AC 1 • 1 • 1 • 1 • 0 F = πM(2,3,6) F = (A + B’)(B’ + C) F = B’ + AC

  2. Lecture Digital Systems Exercise: PoS Minimization YZ 00 01 11 10 (W + X) WX (W+Z) • 0 • 0 • 0 • 0 00 01 • 0 • 1 • 1 • 0 (W’+X’+Y’+Z’) 11 • 1 • 1 • 0 • 1 10 • 1 • 1 • 1 • 1 FPoS = (W + X)(W+Z)(W’+X’ + Y’ + Z’) ? • Find FSoP for the K-map above. • Compare the costs between FPoS and FSoP.

  3. Lecture Digital Systems Exercise: SoP and PoS Minimization Examine the following K-maps. Which one is cheaper? The minimization result using SoP or PoS? BC BC 00 00 01 01 11 11 10 10 A A 0 0 • 1 • 1 • 1 • 0 • 1 • 0 • 1 • 1 1 1 • 0 • 1 • 0 • 0 • 1 • 0 • 1 • 1

  4. Lecture Digital Systems Exercise: PoS Minimization Compare between the cost of SoP and PoS minimization for the function: F(A,B,C) = Σm(2,3,6). Cost = Σ gates + Σ gate inputs A • F = A’B + BC’ Cost = 5 + 8 = 13 (SoP Minimization) • F = B(A’+C’) Cost = 4 + 6 = 10 (PoS Minimization)

  5. Lecture Digital Systems Exercise: SoP and PoS Minimization (1) YZ YZ 00 00 01 01 11 11 10 10 AB AB • 0 • 0 • 1 • 1 • X • X • 0 • 0 00 00 01 01 • 0 • 0 • 1 • 1 • X • X • 0 • 0 11 11 • 0 • 0 • 0 • 0 • X • X • 0 • 0 10 10 • 1 • 1 • 1 • 1 • X • X • 1 • 1 • SoP Minimization • PoS Minimization FSoP = A’Z + AB’ FPoS = (A+Z)(A’+B’) Cost = 5 gates + 8 inputs = 13 Cost = 5 gates + 8 inputs = 13

  6. Lecture Digital Systems Exercise: SoP and PoS Minimization (2) YZ YZ 00 00 01 01 11 11 10 10 AB AB • 0 • 0 • 1 • 1 • X • X • 0 • 0 00 00 01 01 • 0 • 0 • 1 • 1 • 0 • 0 • 0 • 0 11 11 • 0 • 0 • 0 • 0 • X • X • 0 • 0 10 10 • 1 • 1 • 1 • 1 • X • X • 1 • 1 • SoP Minimization • PoS Minimization FSoP = A’Y’Z + AB’ FPoS = (A+Z)(A’+B’)(A+Y’) Cost = 6 gates + 10 inputs = 16 Cost = 7 gates + 12 inputs = 19

  7. Lecture Digital Systems Exercise: PoS Minimization Perform the PoS minimization for the following function by using K-map: F(A,B,C,D) = Σm(0,2,7,8,14,15) + d(3,6,9,12,13).

  8. Lecture Digital Systems Cin FullAdder S A B Cout Application of K-map: Full Adder • A full adder is a circuit that adds three single binary digits A, B, and Cin. A and B are the operands, Cin is a bit carried in from the previous less significant stage. • It has two outputs, sum (S) and carry (Cout). • The carry signal represents an overflow into the next digit of a multi-digit addition. • The truth table of one-bit adder is as follows:

  9. Lecture Digital Systems Cin FullAdder S A B Cout Application of K-map: Full Adder • Using sum of product, • Cout = A’·B·Cin + A·B’·Cin + A·B·Cin’ + A·B·Cin • S = A’·B’·Cin + A’·B·Cin’ + A·B’·Cin’ + A·B·Cin • This function for Cout requires 8 AND Gates and 3 OR Gates (all with 2-inputs). • How to simplify the circuit?

  10. Lecture Digital Systems Cin FullAdder S A B Cout Application of K-map: Full Adder • K-map for Cout Cout = AB + ACin +BCin • Reduction to 3 AND Gates and 2 OR Gates • K-map for S S = A’B’Cin + A’BCin’ + AB’Cin’ + ABCin • No possible reduction

  11. Lecture Digital Systems D B A C Application of K-map: Two-bit Comparator • A two-bit comparator compares 2 binary numbers, AB and CD. • If AB < CD, then LT = 1If AB = CD, then EQ = 1If AB > CD, then GT = 1 • We will need three 4-variable K-maps to implement this digital circuit. One map for each output. Two-bitComparator LT EQ GT

  12. Lecture Digital Systems Application of K-map: Two-bit Comparator • K-map for LT • K-map for EQ • K-map for GT CD CD CD 00 00 00 01 01 01 11 11 11 10 10 10 AB AB AB • 0 • 1 • 0 • 1 • 0 • 0 • 1 • 0 • 0 • 0 • 0 • 1 00 00 00 01 01 01 • 0 • 1 • 0 • 0 • 1 • 0 • 0 • 1 • 0 • 0 • 0 • 1 11 11 11 • 0 • 1 • 0 • 1 • 0 • 0 • 0 • 1 • 0 • 1 • 0 • 0 10 10 10 • 0 • 1 • 0 • 0 • 1 • 0 • 1 • 0 • 0 • 0 • 1 • 0 LT = A’B’D + B’CD + A’C EQ = A’B’C’D’ + A’BC’D + ABCD + AB’CD’ GT = BC’D’ + ABD’ + AC’

  13. Lecture Digital Systems I4 I3 I2 I1 Design Exercise: BCD+5 BCD + 5 Design a digital circuit with BCD as input, and BCD+5 as the output. O1 O2 O3 O4

  14. Lecture Digital Systems Design Exercise: BCD+5 • K-map for O1 • K-map for O2 • I3I4 • I3I4 • I3I4 • I3I4 00 00 00 00 01 01 01 01 11 11 11 11 10 10 10 10 • I1I2 • I1I2 • I1I2 I1I2 • 0 • 1 • 1 • 0 • 1 • 1 • 0 • 0 • 0 • 1 • 0 • 0 • 1 • 0 • 1 • 1 00 00 00 00 01 01 01 01 • 1 • 0 • 1 • 0 • 0 • 0 • 0 • 0 • 0 • 0 • 0 • 1 • 1 • 0 • 0 • 0 11 11 11 11 • X • X • X • X • X • X • X • X • X • X • X • X • X • X • X • X • K-map for O3 • K-map for O4 10 10 10 10 • 0 • 0 • 1 • 1 • 1 • 0 • 0 • 0 • X • X • X • X • X • X • X • X O1 = … O2 = … O3 = … O4 = …

  15. Lecture Digital Systems I4 I3 I2 I1 Design Exercise: BCD×3 BCD × 3 Design a digital circuit that will multiply a BCD input by 3, and deliver the multiplication result as the output. O1 O2 O3 O4 • Fill out by yourself

  16. Lecture Digital Systems Design Exercise: BCD×3 • K-map for O1 • K-map for O2 • I3I4 • I3I4 • I3I4 • I3I4 00 00 00 00 01 01 01 01 11 11 11 11 10 10 10 10 • I1I2 • I1I2 I1I2 • I1I2 00 00 00 00 01 01 01 01 11 11 11 11 10 10 10 10 • K-map for O3 • K-map for O4 • Fill out by yourself O1 = … O2 = … O3 = … O4 = …

  17. Digital Systems Section 7 Parity Method for Error Detection

  18. Lecture Digital Systems Parity Method for Error Detection • The movement of binary data and codes from one location to another is the most frequent operation in digital systems. • Whenever information is transmitted from one device (the transmitter) to another device (the receiver), there is a possibility that errors can occur such that the receiver does not receive the identical information as sent by the transmitter. • The transmitter send a noise-free serial digital signal over a signal line to a receiver. However, by the time the signal reaches the receiver, it contains a certain degree of noise superimposed on the original signal.

  19. Lecture Digital Systems Parity Method for Error Detection • If the noise is large enough in amplitude, it may alter the logic level of the signal. When this occurs, the receiver may incorrectly interpret a logic 0 as a logic 1. • One of the simplest and most widely used schemes for error detection is the parity method.

  20. Lecture Digital Systems Parity Bit • A parity bit is an extra bit that is attached to a code group that is being transferred from one location to another. • The parity bit is made either 0 or 1, depending on the number of 1s that are contained in the code group. • Even-parity method: the value of the parity bit is chosen so that the total number of 1s in the code group (including the parity bit) is an even number. • Odd-parity method: the value of the parity bit is chosen so that the total number of 1s in the code group (including the parity bit) is an odd number.

  21. Lecture Digital Systems Using Even-Parity Method • Suppose that the code group is 1 0 0 0 0 1 1 (ASCII code for character “C”). We apply even-parity method. The code has three 1s. Therefore, we will add a parity bit of 1 to make to total number of 1s become an even number. • The new code group, including the parity bit becomes: • 1 1 0 0 0 0 1 1 Added parity bit • If the code group is 1 0 0 0 0 0 1 (ASCII code for character “A”). The code has two 1s. Therefore, we will add a parity bit of 0 to keep to total number of 1s be an even number. • The new code group, including the parity bit becomes: • 0 1 0 0 0 0 0 1 Added parity bit

  22. Lecture Digital Systems Parity Bit • A transmitter and a receiver agree to use odd-parity. A word of 1 0011 0101 is sent by the transmitter and a word of 1 1010 0101 is received by the receiver. Can the receiver detect the double error? • No. Two errors would not change the oddness or evenness of the number of 1s in the data. A ? • Attach an even-parity bit to the BCD code for decimal 69. • 0 0110 1001

  23. Lecture Digital Systems Parity Generator and Parity Checker • Below, one type of logic circuitry that is used for parity generation and parity checking is introduced (4 bits of data, even-parity bit). ? • How do odd-parity generator & checker look like?

  24. Digital Systems Section 8 Hazards

  25. Lecture Digital Systems Hazards • Logic gates have inherent delay. They are made of electronic components which require time to process the inputs to become the output. • This delay is very small (in the order of ns) and we have been ignoring this. 1 1 1 1 1 0 0 0 0 0 X F Y One gate delay, One gate delay A X A A’ A’ Y F

  26. Lecture Digital Systems Hazards • A hazard is an unwanted alternating value at the output of a combinational circuit. • Hazard depend on the input patterns. A circuit can be free from hazard if the input pattern that would cause the glitch never occur. • We must be aware of the possible sources of hazard and ensure that the transition in a circuit will be hazard free. • The oscillating value at the output of a combinational circuit, before it settles to a certain value is referred to as glitches. • We must reduce hazard because: • Hazard wastes power  power consumption is proportional to number of signal transitions/switching activity. • Hazard may create incorrect circuit operation  dangerous if a decision is made while output is not stable • Hazard causes circuit noise  may affect other parts of the circuit.

  27. Lecture Digital Systems Types of Hazards • Static hazard: when an input variable changes its value, a signal is supposed to remain at a certain logic value, but instead the signal undergoes a momentary change. • Dynamic hazard: when an input variable changes its value, a signal is supposed to change to a new logic value, but such change involves a short oscillation (glitches) before the signal settles into its new value.

  28. Lecture Digital Systems Static Hazard • The equation for the following circuit is: F = AB + B’C. One gate delay A 1 1 1 1 B BC A 0 0 0 0 00 01 11 10 A B C • Minimum cost, contain hazard 0 • 0 • 1 • 0 • 0 F F 1 • 0 • 1 • 1 • 1 • An input change from [111] to [101] results in a static hazard. • Output F will change from 101 • This is due to delay of the inverter gate. • Hazard happens when moving from one implicant to the other. C

  29. Lecture Digital Systems Static Hazard: In Detail One gate delay A B 1 1 1 1 1 1 1 Y A 0 0 0 0 0 0 0 C B F X X Y C Z Z F

  30. Lecture Digital Systems Static Hazard • When hazard occurs because two adjacent 1’s are not covered by a single implicant, then the solution is to add an extra implicant to provide the required coverage. BC 00 01 11 10 A 0 • 0 • 1 • 0 • 0 • Now, F = AB + B’C + AC. • The circuit is no longer in minimum form with lowest cost. But now, we face no hazard anymore. 1 • 0 • 1 • 1 • 1 A B F C • No longer minimum cost, but hazard-free

  31. Lecture Digital Systems Example: Removal of Static Hazard Given F(A,B,C,D) = Σm(6,7,8,9,12,13,14,15). Find out situation where static hazard may occur. Find the solution.

  32. Lecture Digital Systems Dynamic Hazard • Dynamic hazard occurs only in multi-level combinational circuits. This hazard is due to paths with different length in the circuits. • If the output signal changes its value three times, 0101, the there must be at least three paths from the input to the output. • A circuit that has a dynamic hazard must also have a static hazard in some part of it, where an intermediate signal changes from 010 or 101. • Dynamic hazard in multi-level circuits is due to the use of factoring or decomposition techniques. • We can avoid dynamic hazards simply by using two-level circuits and ensuring no static hazards.

  33. Lecture Digital Systems Dynamic Hazard • An example of dynamic hazard is below. Three paths with different lengths can be found. (Name them!) • The circuit contains static hazard at b (see the timing diagram). A • Find the truth table of the above circuit

  34. Lecture Digital Systems Summary • A properly designed two-level Sum-of-Product circuit has no static-0 hazards. It may have static-1 hazards. • A properly designed two-level Product-of-Sum circuit has no static-1 hazards. It may have static-0 hazards. • Dynamic hazards do not occur in a properly designed two-level SoP or PoS circuit. It may occur in multilevel circuits. • A brute-force method of obtaining a hazard-free realization is to use the canonical SoP or canonical PoS. • Hazard analysis and elimination are typically needed in the design of asynchronous sequential circuits.

  35. Lecture Digital Systems Homework 6 (1/2) Encode the following code using even-parity method (Hint: the place for parity bit is the first bit):(i) 1011110 (ii) 110110 The following codes are received after transmission using odd-parity method. Determine whether each code is correct or error.(i) 101011011 (ii) 001110011 A multiplier circuit must deliver the multiplication result of the inputs. The inputs are two 2-bit binary numbers, x1x0 and y1y0. The output is a 4-bit binary number z3z2z1z0. Design the multiplier circuit. See next slide.

  36. Lecture Digital Systems Homework 6 (2/2) Find a hazard-free minimum-cost PoS implementation of the function: F(A,B,C,D) = πM(0,2,3,7,10) + d(5,13,15). • Please write your Class number after your Student ID. • Deadline: 1 day before class. • Monday, 16 October 2017 (Class 2). • Tuesday, 17 October 2017 (Class 1).

More Related