1 00:00:01,069 --> 00:00:06,809 Boolean logic can be used to simplify logic equations into their simplest form. 2 00:00:06,809 --> 00:00:12,639 This simplest form is known as the function's minimal sum of products representation. 3 00:00:12,639 --> 00:00:17,369 Having a simplified equation allows us to implement the function using the fewest number 4 00:00:17,369 --> 00:00:21,670 of gates. One commonly used method for taking any boolean 5 00:00:21,670 --> 00:00:27,480 expression and converting it to its minimal sum-of-products equivalent is the use of Karnaugh 6 00:00:27,480 --> 00:00:31,570 maps. The way Karnaugh maps work is as follows. 7 00:00:31,570 --> 00:00:35,899 You start with the original truth table specification of a function. 8 00:00:35,899 --> 00:00:40,780 You then express each set of inputs, that makes the function equal to 1, as a basic 9 00:00:40,780 --> 00:00:45,399 product term. ORing all of these product terms together 10 00:00:45,399 --> 00:00:49,050 produces a sum of products representation for the function. 11 00:00:49,050 --> 00:00:56,300 Note that this representation is not yet minimal. For our example, the sum of products is F 12 00:00:56,300 --> 00:01:12,119 = NOT(A) NOT(B) NOT(C) + NOT(A) B C + A NOT(B) NOT(C) + A NOT(B) C + A B C. 13 00:01:12,119 --> 00:01:18,350 We then create the Karnaugh map for the function by making a 2D grid representing all possible 14 00:01:18,350 --> 00:01:23,900 input combinations, and ensuring that from one column or row to the next in the grid, 15 00:01:23,900 --> 00:01:29,240 only one single input can be changed. This is known as Gray code. 16 00:01:29,240 --> 00:01:33,979 Once we label the Karnaugh map, we can fill it with 1's for each combination that produces 17 00:01:33,979 --> 00:01:39,470 a 1 output and 0 for each combination that produces a 0 output. 18 00:01:39,470 --> 00:01:45,130 Next, we try to merge as many adjacent ones as possible into groups that are of size that 19 00:01:45,130 --> 00:01:49,930 is a power of 2. Note that adjacent ones can be merged across 20 00:01:49,930 --> 00:01:55,170 rows, along columns, and across the edges of the Karnaugh map like a taurus. 21 00:01:55,170 --> 00:02:00,759 Every largest grouping of 1's that is required in order to cover all of the one's becomes 22 00:02:00,759 --> 00:02:05,740 one term in the minimal sum of products representation of the function. 23 00:02:05,740 --> 00:02:10,440 To figure out what the term is, look at the labels of all the columns and rows that are 24 00:02:10,440 --> 00:02:17,720 covered by the grouping of 1's and eliminate all inputs that appear as both a 1 and 0 input. 25 00:02:17,720 --> 00:02:23,160 Because these inputs are represented in both their 0 and 1 form, it means that that input 26 00:02:23,160 --> 00:02:27,780 is not affecting the result of that term and can thus be eliminated. 27 00:02:27,780 --> 00:02:32,980 By doing this for all groupings of 1's and then ORing the results together, one produces 28 00:02:32,980 --> 00:02:37,190 a minimal sum of products representation for the function. 29 00:02:37,190 --> 00:02:42,329 Note that having overlapping ones in your groupings is allowed and desired if it will 30 00:02:42,329 --> 00:02:48,340 result in a simpler product term. In our example, we circle the bottom two middle 31 00:02:48,340 --> 00:02:54,210 1's which represent the term BC because A appears in both its low and high form in the 32 00:02:54,210 --> 00:02:58,510 grouping. The next set of ones are the two in the rightmost 33 00:02:58,510 --> 00:03:02,620 column. These ones represent the term A NOT(B). 34 00:03:02,620 --> 00:03:09,760 Finally, our last grouping wraps around the first row to create the term NOT(B) NOT(C). 35 00:03:09,760 --> 00:03:13,750 This is a minimal sum of products representation of our function. 36 00:03:13,750 --> 00:03:18,720 Note, however, that instead of grouping the two one's in the rightmost column, we could 37 00:03:18,720 --> 00:03:22,870 have instead grouped the two rightmost ones in the bottom row. 38 00:03:22,870 --> 00:03:27,730 That would have produced the term AC instead of A NOT(B). 39 00:03:27,730 --> 00:03:32,720 Either combination of terms is a valid minimal sum of products representation for this function.