1 00:00:00,510 --> 00:00:02,820 The previous sections showed us how 2 00:00:02,820 --> 00:00:04,920 to build a circuit that computes a given 3 00:00:04,920 --> 00:00:06,940 sum-of-products expression. 4 00:00:06,940 --> 00:00:08,820 An interesting question to ask is 5 00:00:08,820 --> 00:00:11,370 if we can implement the same functionality using 6 00:00:11,370 --> 00:00:13,710 fewer gates or smaller gates? 7 00:00:13,710 --> 00:00:16,560 In other words is there an equivalent Boolean expression 8 00:00:16,560 --> 00:00:19,290 that involves fewer operations? 9 00:00:19,290 --> 00:00:21,490 Boolean algebra has many identities 10 00:00:21,490 --> 00:00:24,760 that can be used to transform an expression into an equivalent, 11 00:00:24,760 --> 00:00:27,660 and hopefully smaller, expression. 12 00:00:27,660 --> 00:00:29,770 The reduction identity in particular 13 00:00:29,770 --> 00:00:32,009 offers a transformation that simplifies 14 00:00:32,009 --> 00:00:35,450 an expression involving two variables and four operations 15 00:00:35,450 --> 00:00:38,700 into a single variable and no operations. 16 00:00:38,700 --> 00:00:41,660 Let’s see how we might use that identity to simplify 17 00:00:41,660 --> 00:00:44,770 a sum-of-products expression. 18 00:00:44,770 --> 00:00:47,160 Here’s the equation from the start of this chapter, 19 00:00:47,160 --> 00:00:49,500 involving 4 product terms. 20 00:00:49,500 --> 00:00:52,240 We’ll use a variant of the reduction identity involving 21 00:00:52,240 --> 00:00:56,930 a Boolean expression alpha and a single variable A. 22 00:00:56,930 --> 00:00:59,320 Looking at the product terms, the middle two 23 00:00:59,320 --> 00:01:02,110 offer an opportunity to apply the reduction identity 24 00:01:02,110 --> 00:01:06,150 if we let alpha be the expression (C AND B). 25 00:01:06,150 --> 00:01:08,190 So we simplify the middle two product terms 26 00:01:08,190 --> 00:01:13,580 to just alpha, i.e., (C AND B), eliminating the variable A 27 00:01:13,580 --> 00:01:15,730 from this part of the expression. 28 00:01:15,730 --> 00:01:17,620 Considering the now three product terms, 29 00:01:17,620 --> 00:01:19,930 we see that the first and last terms can also 30 00:01:19,930 --> 00:01:22,300 be reduced, this time letting alpha be 31 00:01:22,300 --> 00:01:25,890 the expression (NOT C and A). 32 00:01:25,890 --> 00:01:29,970 Wow, this equivalent equation is much smaller! 33 00:01:29,970 --> 00:01:32,440 Counting inversions and pair-wise operations, 34 00:01:32,440 --> 00:01:35,170 the original equation has 14 operations, 35 00:01:35,170 --> 00:01:39,067 while the simplified equation has 4 operations. 36 00:01:39,067 --> 00:01:40,900 The simplified circuit would be much cheaper 37 00:01:40,900 --> 00:01:45,560 to build and have a smaller tPD in the bargain! 38 00:01:45,560 --> 00:01:48,070 Doing this sort of Boolean simplification by hand 39 00:01:48,070 --> 00:01:50,290 is tedious and error-prone. 40 00:01:50,290 --> 00:01:53,990 Just the sort of task a computer program could help with. 41 00:01:53,990 --> 00:01:56,990 Such programs are in common use, but the computation 42 00:01:56,990 --> 00:02:00,910 needed to discover the smallest possible form for an expression 43 00:02:00,910 --> 00:02:03,400 grows faster than exponentially as the number 44 00:02:03,400 --> 00:02:05,410 of inputs increases. 45 00:02:05,410 --> 00:02:07,470 So for larger equations, the programs 46 00:02:07,470 --> 00:02:12,330 use various heuristics to choose which simplifications to apply. 47 00:02:12,330 --> 00:02:16,040 The results are quite good, but not necessarily optimal. 48 00:02:16,040 --> 00:02:19,870 But it sure beats doing the simplification by hand! 49 00:02:19,870 --> 00:02:22,440 Another way to think about simplification is by searching 50 00:02:22,440 --> 00:02:25,280 the truth table for “don’t-care” situations. 51 00:02:25,280 --> 00:02:27,940 For example, look at the first and third rows 52 00:02:27,940 --> 00:02:30,740 of the original truth table on the left. 53 00:02:30,740 --> 00:02:35,420 In both cases A is 0, C is 0, and the output Y is 0. 54 00:02:35,420 --> 00:02:39,660 The only difference is the value of B, which we can then tell 55 00:02:39,660 --> 00:02:42,810 is irrelevant when both A and C are 0. 56 00:02:42,810 --> 00:02:45,760 This gives us the first row of the truth table on the right, 57 00:02:45,760 --> 00:02:49,500 where we use X to indicate that the value of B doesn’t matter 58 00:02:49,500 --> 00:02:52,690 when A and C are both 0. 59 00:02:52,690 --> 00:02:55,440 By comparing rows with the same value for Y, 60 00:02:55,440 --> 00:02:59,080 we can find other don’t-care situations. 61 00:02:59,080 --> 00:03:02,370 The truth table with don’t-cares has only three rows where 62 00:03:02,370 --> 00:03:04,230 the output is 1. 63 00:03:04,230 --> 00:03:06,690 And, in fact, the last row is redundant in the sense that 64 00:03:06,690 --> 00:03:11,370 the input combinations it matches (011 and 111) are 65 00:03:11,370 --> 00:03:15,210 covered by the second and fourth rows. 66 00:03:15,210 --> 00:03:17,770 The product terms derived from rows two and four 67 00:03:17,770 --> 00:03:21,010 are exactly the product terms we found by applying the reduction 68 00:03:21,010 --> 00:03:23,180 identity. 69 00:03:23,180 --> 00:03:26,360 Do we always want to use the simplest possible equation 70 00:03:26,360 --> 00:03:28,830 as the template for our circuits? 71 00:03:28,830 --> 00:03:31,320 Seems like that would minimize the circuit cost 72 00:03:31,320 --> 00:03:34,630 and maximize performance, a good thing. 73 00:03:34,630 --> 00:03:37,280 The simplified circuit is shown here. 74 00:03:37,280 --> 00:03:40,830 Let’s look at how it performs when A is 1, B is 1, 75 00:03:40,830 --> 00:03:44,020 and C makes a transition from 1 to 0. 76 00:03:44,020 --> 00:03:46,460 Before the transition, C is 1 and we can see from 77 00:03:46,460 --> 00:03:49,970 the annotated node values that it’s the bottom AND gate that’s 78 00:03:49,970 --> 00:03:51,510 causing the Y output to be 1. 79 00:03:51,510 --> 00:03:57,400 When C transitions to 0, the bottom AND gate turns off 80 00:03:57,400 --> 00:04:01,880 and the top AND gate turns on, and, eventually the Y output 81 00:04:01,880 --> 00:04:04,060 becomes 1 again. 82 00:04:04,060 --> 00:04:07,530 But the turning on of the top AND is delayed by the tPD 83 00:04:07,530 --> 00:04:10,920 of the inverter, so there’s a brief period of time where 84 00:04:10,920 --> 00:04:16,019 neither AND gate is on, and the output momentarily becomes 0. 85 00:04:16,019 --> 00:04:18,779 This short blip in Y’s value is called a glitch and it may 86 00:04:18,779 --> 00:04:22,019 result in short-lived changes on many node values as it 87 00:04:22,019 --> 00:04:25,610 propagates through other parts of the circuit. 88 00:04:25,610 --> 00:04:27,720 All those changes consume power, so it 89 00:04:27,720 --> 00:04:31,890 would be good to avoid these sorts of glitches if we can. 90 00:04:31,890 --> 00:04:35,580 If we include the third product term BA in our implementation, 91 00:04:35,580 --> 00:04:38,650 the circuit still computes the same long-term answer 92 00:04:38,650 --> 00:04:40,120 as before. 93 00:04:40,120 --> 00:04:42,380 But now when A and B are both high, 94 00:04:42,380 --> 00:04:45,340 the output Y will be 1 independently 95 00:04:45,340 --> 00:04:47,730 of the value of the C input. 96 00:04:47,730 --> 00:04:51,480 So the 1-to-0 transition on the C input doesn’t cause a glitch 97 00:04:51,480 --> 00:04:52,990 on the Y output. 98 00:04:52,990 --> 00:04:55,900 If you recall the last section of the previous chapter, 99 00:04:55,900 --> 00:05:00,280 the phrase we used to describe such circuits is “lenient”.