Download presentation
Presentation is loading. Please wait.
Published byBryan Armstrong Modified over 9 years ago
1
CSCI N301: Fundamental Computer Science Concepts Copyright ©2004 Department of Computer & Information Science Designing Circuits
2
N301: Fundamental Computer Science Concepts Copyright ©2004 Department of Computer & Information Science Goals By the end of this lecture, you should understand … How to use the Sum-Of-Products to construct circuits.How to use the Sum-Of-Products to construct circuits. How to construct a basic, binary input circuit.How to construct a basic, binary input circuit. How to construct more complex circuits, using three or more inputs.How to construct more complex circuits, using three or more inputs.
3
N301: Fundamental Computer Science Concepts Copyright ©2004 Department of Computer & Information Science Where We’ve Been We are developing an increasingly complex model of computer operation.We are developing an increasingly complex model of computer operation. We began with the switch and saw how we can use it encode information in digitized form.We began with the switch and saw how we can use it encode information in digitized form. We combined switches into gates and saw how we can use Boolean logic process binary information.We combined switches into gates and saw how we can use Boolean logic process binary information.
4
N301: Fundamental Computer Science Concepts Copyright ©2004 Department of Computer & Information Science Where We’re Going We will learn how to combine gates to form circuits.We will learn how to combine gates to form circuits. We are looking at a special kind of circuit – a combinational circuit – although from here on out we simply refer to circuit.We are looking at a special kind of circuit – a combinational circuit – although from here on out we simply refer to circuit.
5
N301: Fundamental Computer Science Concepts Copyright ©2004 Department of Computer & Information Science What is a Circuit? A circuit is a combination of logic gates that changes a set of binary inputs into a set of binary outputs in which the values of the outputs depend only on the electrical current (high/low voltage) values of the inputs.A circuit is a combination of logic gates that changes a set of binary inputs into a set of binary outputs in which the values of the outputs depend only on the electrical current (high/low voltage) values of the inputs. By the way, there are also circuits that depend also on the previous values of the inputs, but we won’t consider them in this class.By the way, there are also circuits that depend also on the previous values of the inputs, but we won’t consider them in this class.
6
N301: Fundamental Computer Science Concepts Copyright ©2004 Department of Computer & Information Science Circuit Analysis Circuits depend on Boolean logic, which we introduced last lecture.Circuits depend on Boolean logic, which we introduced last lecture. Boolean notation allows us to create logical expressions using Boolean operators.Boolean notation allows us to create logical expressions using Boolean operators. For example:For example: Examples of Boolean Expressions Using Operator Names Using Symbols Q = (A OR B) Q = (A + B) Q = NOT ((A OR B) AND (NOT B)) Q = ~ ((A + B) (~B))
7
N301: Fundamental Computer Science Concepts Copyright ©2004 Department of Computer & Information Science Circuits & Boolean Expressions You can express every Boolean expression using a circuit diagram.You can express every Boolean expression using a circuit diagram. Conversely, you can represent every circuit diagram as a Boolean expression.Conversely, you can represent every circuit diagram as a Boolean expression. Of course, we aren’t going after just any circuits here…. we want to develop the skills to construct and analyze circuits that can perform the logic and arithmetic calculations that a computer requires to operate.Of course, we aren’t going after just any circuits here…. we want to develop the skills to construct and analyze circuits that can perform the logic and arithmetic calculations that a computer requires to operate.
8
N301: Fundamental Computer Science Concepts Copyright ©2004 Department of Computer & Information Science Constructing Circuits We can use any one of several algorithms for constructing circuits, just like there were several different algorithms for modeling gates.We can use any one of several algorithms for constructing circuits, just like there were several different algorithms for modeling gates. We will use an algorithm called the sum-of- products algorithm to design our circuits. When using the sum-of-products algorithm, we move in a step-by-step process to build a circuit.We will use an algorithm called the sum-of- products algorithm to design our circuits. When using the sum-of-products algorithm, we move in a step-by-step process to build a circuit.
9
N301: Fundamental Computer Science Concepts Copyright ©2004 Department of Computer & Information Science The Four Steps for the Sum-Of-Products Algorithm 1.From a problem statement, construct a truth table that describes what the voltage output should be under each possible combination of voltage inputs. 2.From the truth table, identify those gate combinations that produce positive voltage output, and write sub expressions for those conditions. 3.Combine the sub expressions (a.k.a. “Boolean terms”) into a single Boolean expression. 4.Draw a circuit diagram that corresponds to the Boolean expression.
10
N301: Fundamental Computer Science Concepts Copyright ©2004 Department of Computer & Information Science Sub-of-Products Example Problem Statement: “Design a circuit that has two inputs (A, B) and one output, Q. Q = 1 iff* both a and b are the same voltage.” * - iff = “If and only if”Problem Statement: “Design a circuit that has two inputs (A, B) and one output, Q. Q = 1 iff* both a and b are the same voltage.” * - iff = “If and only if”
11
N301: Fundamental Computer Science Concepts Copyright ©2004 Department of Computer & Information Science Sub-of-Products Example How to read the problem:How to read the problem: –We two input lines coming into a circuit. One input line is labeled A and the other input line is labeled B. –There is one output line, labeled Q. –The output voltage on Q is high if and only if both B and B have high voltage, or both A and B have low voltage (A and B have the same voltage). –By inference, when A is high and B is low, or when A is low and B is high, the output line Q is low.
12
N301: Fundamental Computer Science Concepts Copyright ©2004 Department of Computer & Information Science Sub-of-Products Example: Step 1 STEP 1: Construct a truth table to illustrate the problem statement:STEP 1: Construct a truth table to illustrate the problem statement: INPUTSOUTPUT ABQ 00 01 10 11
13
N301: Fundamental Computer Science Concepts Copyright ©2004 Department of Computer & Information Science Sub-of-Products Example: Step 2a STEP 2a: Scan the table to determine when the Output column is TRUE. Identify those instances:STEP 2a: Scan the table to determine when the Output column is TRUE. Identify those instances: INPUTSOUTPUT ABQ 001 010 100 111
14
N301: Fundamental Computer Science Concepts Copyright ©2004 Department of Computer & Information Science Sum-of-Products Example: Step 2b From the table we can identify 2 instances of high output:From the table we can identify 2 instances of high output: –Where both A and B were 0 –Where both A and B were 1 Now let’s create Boolean sub expressions for each instance (STEP 2b):Now let’s create Boolean sub expressions for each instance (STEP 2b): –~A ~B (NOT A AND NOT B) – A B (A AND B)
15
N301: Fundamental Computer Science Concepts Copyright ©2004 Department of Computer & Information Science Sum-of-Products Example: Step 3 STEP THREE: Combine the Boolean sub-expressions (or terms) into an overall expression.STEP THREE: Combine the Boolean sub-expressions (or terms) into an overall expression. In our example, we are building an OR statement. We are saying Q can be high with one set of input conditions (~A ~B), or using a second set of input conditions (A B).In our example, we are building an OR statement. We are saying Q can be high with one set of input conditions (~A ~B), or using a second set of input conditions (A B). Therefore, our expression will be connected with the OR operator. There are two terms – one for each high voltage output.Therefore, our expression will be connected with the OR operator. There are two terms – one for each high voltage output. Our single Boolean Expression is: Q = (~A ~B) + (A B)Our single Boolean Expression is: Q = (~A ~B) + (A B)
16
N301: Fundamental Computer Science Concepts Copyright ©2004 Department of Computer & Information Science Sum-of-Products Example: Step 4 STEP FOUR: Build the circuit to represent our Boolean Expression.STEP FOUR: Build the circuit to represent our Boolean Expression. QAABB
17
N301: Fundamental Computer Science Concepts Copyright ©2004 Department of Computer & Information Science Where We Were Limited The example we looked at took 2 inputs. But, of course, circuits are not limited to just two inputs.The example we looked at took 2 inputs. But, of course, circuits are not limited to just two inputs. We can extend our process to include n inputs.We can extend our process to include n inputs. Consider the following overall remarks regarding how we extend our model to build more complex circuits …Consider the following overall remarks regarding how we extend our model to build more complex circuits …
18
N301: Fundamental Computer Science Concepts Copyright ©2004 Department of Computer & Information Science General Rules/Guidelines When you add additional input lines, it becomes possible to see some general patterns…When you add additional input lines, it becomes possible to see some general patterns… In the step from problem statement to truth table, remember this:In the step from problem statement to truth table, remember this: –A problem with n input lines will produce a truth table with 2 n elements (or rows)… for example, 2 inputs lines result in 4 possible voltage combinations, while 3 input lines result in 8 possible combinations. In the step from truth table to circuit drawing, remember this:In the step from truth table to circuit drawing, remember this: –We can combine various high sub-conditions joined by an OR using an AND gate. To better manage the spacing required to include the or gates and input lines, experienced students sometimes draw their circuits from right to left.
19
N301: Fundamental Computer Science Concepts Copyright ©2004 Department of Computer & Information Science Let’s Do One! Consider the following problem statement. Analyze it using the 4 step, Sum of Products Algorithm to produce a circuit.Consider the following problem statement. Analyze it using the 4 step, Sum of Products Algorithm to produce a circuit. Problem Statement: “Design a circuit that takes 3 inputs, and outputs a high value IFF exactly two of the inputs are high.”Problem Statement: “Design a circuit that takes 3 inputs, and outputs a high value IFF exactly two of the inputs are high.”
20
N301: Fundamental Computer Science Concepts Copyright ©2004 Department of Computer & Information Science Problem Solution Step One: Create truth tableStep One: Create truth table INPUTSOUTPUTS ABCQ 000 001 010 011 100 101 110 111
21
N301: Fundamental Computer Science Concepts Copyright ©2004 Department of Computer & Information Science Problem Solution Step One: Create truth tableStep One: Create truth table INPUTSOUTPUTS ABCQ 000 001 010 011 100 101 110 111
22
N301: Fundamental Computer Science Concepts Copyright ©2004 Department of Computer & Information Science Problem Solution Step Two: Scan the table to determine when the Output column is TRUE. Identify those instances:Step Two: Scan the table to determine when the Output column is TRUE. Identify those instances: INPUTSOUTPUTS ABCQ 0000 0010 0100 0111 1000 1011 1101 1110
23
N301: Fundamental Computer Science Concepts Copyright ©2004 Department of Computer & Information Science Problem Solution Step Three: Create Boolean expressionStep Three: Create Boolean expression Q = (~A * B * C) + (A * ~B * C) + (A * ~B * C) + (A * B * ~C) (A * B * ~C)
24
N301: Fundamental Computer Science Concepts Copyright ©2004 Department of Computer & Information Science Problem Solution: Step 4 STEP FOUR: Build the circuit to represent our Boolean Expression.STEP FOUR: Build the circuit to represent our Boolean Expression. Click Button for the xLogicCircuits Applet
25
N301: Fundamental Computer Science Concepts Copyright ©2004 Department of Computer & Information Science Simplifying Boolean Expressions When you look at complicated input combinations which result in Boolean expressions with many terms, you can save a lot of time by using some simplification rules. These rules allow you to reduce and combine terms.When you look at complicated input combinations which result in Boolean expressions with many terms, you can save a lot of time by using some simplification rules. These rules allow you to reduce and combine terms. You can find a summary of these simple Boolean rules on the next slide …You can find a summary of these simple Boolean rules on the next slide …
26
N301: Fundamental Computer Science Concepts Copyright ©2004 Department of Computer & Information Science Boolean Axioms TRUE * P = PTRUE * P = P FALSE * P = FALSEFALSE * P = FALSE FALSE + P = PFALSE + P = P TRUE + P = TRUETRUE + P = TRUE P + Q = Q + PP + Q = Q + P P * Q = Q * PP * Q = Q * P (P + Q) +R = P + (Q + R)(P + Q) +R = P + (Q + R) (P * R) * Q = P * (R * Q)(P * R) * Q = P * (R * Q) P * ~P = FALSEP * ~P = FALSE P + P = PP + P = P P * P = PP * P = P
27
N301: Fundamental Computer Science Concepts Copyright ©2004 Department of Computer & Information Science De Morgan’s Laws In addition to the preceding axioms, a mathematician named de Morgan first provided proof of the following laws:In addition to the preceding axioms, a mathematician named de Morgan first provided proof of the following laws: –~(P * Q) = ~P + ~Q –~(P + Q)= ~P * ~Q In your next lab assignment, you will confirm de Morgan’s Laws. You can easily do the lab by constructing a truth table with inputs for P, Q, P*Q, ~(P*Q), ~P, ~Q, and ~P+~Q.In your next lab assignment, you will confirm de Morgan’s Laws. You can easily do the lab by constructing a truth table with inputs for P, Q, P*Q, ~(P*Q), ~P, ~Q, and ~P+~Q.
28
N301: Fundamental Computer Science Concepts Copyright ©2004 Department of Computer & Information Science Where We Are Going Now that you have some understanding of how to build a general circuit, we will look at some specific ones.Now that you have some understanding of how to build a general circuit, we will look at some specific ones. Next time, we’ll consider circuits that play particularly important roles in computer operation: adders and Arithmetic Logic Unit processing.Next time, we’ll consider circuits that play particularly important roles in computer operation: adders and Arithmetic Logic Unit processing.
29
N301: Fundamental Computer Science Concepts Copyright ©2004 Department of Computer & Information Science Questions?
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.