Digital Logic and LogicWorks #1

advertisement
1
Digital Logic and LogicWorks #1
A bit of digital logic and the Karnaugh map
In this laboratory you will experiment with logical principles and software that are useful
in the efficient design of digital Boolean functions on electronic chips. In class we have
studied an effective way of simplifying digital functions using Karnaugh maps. These are
arrays of 0’s and 1’s that correspond to the output (or result) of functions given all
possible inputs of those functions corresponding to the positions within the table. Map a
network drive to your mhc space (not www) and save any circuits you create in a cs100
folder in your classwork folder.
Part 1: Building a circuit
Construct this circuit in Logicworks and record the outputs for all possible inputs
XOR
OR
A
0
0
0
0
1
1
1
1
B
0
0
1
1
0
0
1
1
C
0
1
0
1
0
1
0
1
F
Test the circuit in LogicWorks. Save your circuit as "Karnaugh1.cct."
Have the lab instructor see the circuit and initial here _______________.
2
Part 2: if and only if
1. One of the 16 possible truth tables for two Boolean values A and B is the “if and only
if” operation (abbrev. "iff"). This arises from the statement B is true if and only if A is
true.
A
0
0
1
1
B
0
1
0
1
B iff A
1
0
0
1
This table means that "B iff A" is true (1) when both statements A and B are true or
when both are false. If the values are different, it's false (0).
(Note: A iff B is also A = B)
2. Describe this function (iff) in a logical expression using A’ to represent not A, B’ to
represent not B. Use terms like AB’ to represent A AND B’ and + to indicate the OR
operation. (this description is longer than the formula)
F=
3. Sketch a circuit using AND and OR gates with binary switches for A and B and a
binary probe to measure the value of B iff A. Notice that this can also be viewed as a
circuit that checks if A = B.
4. Test the circuit in LogicWorks. Save your circuit as "Karnaugh2.cct."
Test it, then have the lab instructor initial here _______________.
3
Part 3: three-bit Karnaugh map
1. Consider a digital function F that has 3 binary inputs {a, b, c} and one output that has
value 1 if and only if the binary number n = abc is both odd and greater than 1.
2. Describe this function in a table form, then a Karnaugh Map form:
a
0
0
0
0
1
1
1
1
b
0
0
1
1
0
0
1
1
C
0
1
0
1
0
1
0
1
bc
F
a
00
01
11
0
1
3. Write out the simplified function that you get for the circuit by constructing the
Karnaugh Map, i.e. the terms that have F value of 1 should be included:
F =
4. Draw by hand the simplified circuit showing the inputs and output using logic gates,
AND, OR, and NOT, as appropriate.
5. Construct this circuit with LogicWorks using the appropriate gates and connections.
The input should be a set of three binary switches, and the output should contain a
binary probe, so that you can see the value of F for any inputs.
6. Label your inputs and gates using the text tool from the program.
7. Test your circuit to see that it produces the table outputs from the appropriate inputs.
8. Save this as Karnaugh3.cct. Test it for the lab instructor who will initial here_______
10
4
Part 4: the hex keyboard
Now in place of the three binary switches you have used for inputs, substitute a “hex
keyboard” (one of the library elements at the right of the screen. You will use only the
lower three output pins from the hexadecimal keyboard, and the rule you used to set up
F should work using this keyboard input. See Figure 1.) Save this new circuit as
Karnaugh4.cct.
.
Figure 1 The “a”, “b”, “c” connections to the hex keyboard
for 3-bit output are at the 4’s, 2’s, 1’s bit outputs, respectively
Test and have the lab initialed here ________________
5
Part 5: the Up controller
Recreate the truth table for the UP elevator controller here
floor
a
b
0
0
0
0
0
0
0
0
0
1
0
1
0
1
0
1
1
0
1
0
1
0
1
0
1
1
1
1
1
1
1
1
Create a karnaugh map for this controller:
cd
ab
00
button
c
d
0
0
0
1
1
0
1
1
0
0
0
1
1
0
1
1
0
0
0
1
1
0
1
1
0
0
0
1
1
0
1
1
UP
00
Write the reduced formula for this table:
UP
Create a circuit in LogicWorks using two hex keyboards (only the lowest two outputs of
each) to provide input and a binary probe to show output (1 if the elevator is to rise).
Save the circuit as Karnaugh5.cct. Instructor signoff ____________________
6
Part 6: reprise part 1
Take the truth table you worked out by measuring the circuit in Part 1 and analyze it
using our standard procedure with a Karnaugh Map. This means no XOR gates are used.
a
0
0
0
0
1
1
1
1
b
0
0
1
1
0
0
1
1
C
0
1
0
1
0
1
0
1
F
bc
a
00
01
11
10
0
1
Find the formula F =
Construct and test a circuit built from this formula. Save it as karnaugh6.cct
. Instructor signoff ____________________
Download