LOGIC, CIRCUITS, AND TRUTH TABLES 1 CS 147 Dr. Sin-Min Lee Presented by Kristina Miguel INTRODUCTION The CPU is constructed from logic gates. The basic activity of the control unit is decoding instructions. Decoder circuits use an input binary number to select an output line, or several lines. Logic circuits can be implemented directly from truth table information. 2 REVIEW: BASIC LOGIC GATES WITH TRUTH TABLES 3 TRAFFIC LIGHT CONTROLLERS – IMPOSSIBLE TO AVOID! Traffic controllers are an example of decoder circuits. Integrated urban traffic management schemes depend on communication links between the traffic light controllers and a central control computer. 4 EXAMPLE SYSTEM Traffic light controllers found at British road junctions have the sequence Red, Red/Amber, Green, Amber, and then Red again. We will analyze the corresponding truth tables. 5 CIRCUIT IMPLEMENTATION FROM TRUTH TABLES – SOME PRACTICAL TIPS 6 TIP #1: IDENTICAL COLUMNS The input is directly connected to the output if an output column is identical to an input column. No logic is required. The level crossing Amber output and Y input are identical and can be expressed as 7 TIP #2: NEARLY IDENTICAL COLUMNS An output can be generated by a simple logic function from only some of the inputs. The level crossing Red is the inverse of input X. 8 TIP #3: SOLO ROW Use an AND gate to detect the input row if an output column only has a single ‘1’. The level crossing Green can be expressed as 9 TIP #3: SOLO ROW (CONT.) The crossroads Green can be expressed as 10 TIP #4: INVERTED SOLO ROW Use an AND gate to detect the input row pattern, and then a NOT inverter when an output column only has a single ‘0’. Crossroads Red can be expressed as 11 TIP #5: STANDARD PATTERNS Sometimes it is possible to utilize an existing logic circuit, with minimum modification. Let us consider a simple washing machine controller. XOR can be used as a ‘difference detector’ as seen in the motor control output from the following washing machine example. 12 TIP #5: STANDARD PATTERNS (CONT.) Motor can be expressed as Motor = (X XOR Y) AND Z 13 TIP #6: ELIMINATION A shortcut can be taken when considering the Crossroads truth table. There are two rows where both X and Z contains ‘1’ and the value of Y has no effect in determining the output. Crossroads Amber can be expressed as 14 TIP #7: SUM-OF-PRODUCTS When these short cuts do not work out, the brute force method remains: Run down each output column and mark every row which contributes a ‘1’. Next set up an AND gate pattern detector for each marked row, using NOT gates on inputs if ‘0’ is detected. Then allocate an OR gate to each output column. 15 DECODER LOGIC – ESSENTIAL FOR CONTROL UNITS AND MEMORIES The essential purpose of a decoder is to recognize a code number and invoke the corresponding action. The schematic diagram for a decoder is a box with more output than input lines. ‘Proper’ decoders select a single output line at a time. Example: 74F138 Decoder 3 to 8 line decoder Accepts three binary weighted inputs. The output selected depends on the input number. Ideal for memory chip select decoding. 16 EXAMPLE: 74F138 DECODER 17 ANOTHER EXAMPLE: SEVEN-SEGMENT CONVERTER The seven-segment decoder has three inputs and eight outputs and could be modified to implement a binary to seven-segment display converter. The unit is constructed from seven LEDs (Light-Emitting Diodes). 18 APPLYING THE BRUTE FORCE METHOD Using logic expressions you can design a sevensegment display converter driver circuit. The truth table logic terms for each output column can be directly implemented by the brute force method. 19 APPLYING THE BRUTE FORCE METHOD (CONT.) 20 APPLYING THE BRUTE FORCE METHOD (CONT.) 21 USING LOGIC EXPRESSIONS TO DESIGN A LOGIC CIRCUIT Logic circuit for the ‘a’ segment of a sevensegment LED driver. ‘a’ can be derived by taking the complement of ‘inverse a’ 22 SUMMARY Truth tables can clearly express logic circuit functionality by displaying input-output relationships. Some short cuts can be used to speed up the process of deriving logic circuits from truth tables. Logic minimization may not be the priority when building circuits. 23