a) Complete the truth table for this Boolean expression on your worksheet. ... b)
Apply the sum-of-products algorithm to the truth table from part (a) to obtain a ...
Cmpt 101 Lab 5 – Assignment Specifications Out of a possible 90 marks (Weight: 3%)
Question 1 – Using Boolean expressions (4 marks) This is a Boolean expression to describe a circuit: D = (A • ~B • ~C) + (~A • B • ~C) + (~A • ~B • C) + (A • B • C) a) Complete the truth table for this Boolean expression on your worksheet. If necessary (but not required), you may draw the circuit with the simulator and use the circuit to determine the truth table outputs. Question 2 – XOR circuit (8 marks) The XOR circuit (exclusive OR) and the OR circuit produce identical output except when both inputs are 1. In this case, the XOR output is 0. a) Complete the truth table for the OR on your worksheet and then change it into the truth table for the XOR. (2 marks) b) Apply the sum-of-products algorithm to the truth table from part (a) to obtain a Boolean Expression and write it down on your worksheet. (2 marks) c) Either (i) construct the new circuit using the simulator and print out your circuit diagram or (ii) draw it clearly in the space provided on the worksheet instead. Label the switches! (4 marks) Question 3 – XNOR circuit (6 marks) The XNOR (exclusive NOR) circuit is the negation of the XOR. Whenever the output of the XOR gate is a 1, the XNOR would produce a 0 and whenever the output of the XOR is a 0, the XNOR would produce a 1. a) Complete the truth table for the XNOR on your worksheet. (2 marks) b) For this question only, assume that you have access to the XOR circuit you developed in Question 2. The XOR circuit will be represented as a single gate that looks like this: XOR
Without using the sum-of-products method, draw the XNOR circuit using the XOR gate. You may use any other gates that you wish to help you. (3 marks) c) On your worksheet, circle the Boolean expression that is equivalent to that of the XNOR. (1 mark) (A * B) + ~(A * B)
(A * B) + ~(A + B)
-1-
(A + B) * (~A * ~B)
Question 4 – Majority-Rules circuit (14 marks) The majority-rules circuit makes its output equal to the majority of its input values. For example, consider a 3-input circuit. If it has two or more input values that are 1, the output will be 1. If it has two or more input values that are 0, then the output will be 0. So, if the input is A=1, B=0, and C=1, the output value D will be 1 as there are two ones amongst the input values. a) Complete the truth table for the Majority-Rules circuit on your worksheet. (4 marks) b) Apply the sum-of-products algorithm to the truth table from part (a) to obtain a Boolean Expression and write it down on your worksheet. (4 marks) c) Either (i) construct the new circuit using the simulator and print out your circuit diagram or (ii) draw it clearly in the space provided on the worksheet instead. Label the switches! (6 marks) Question 5 – Mystery circuit (8 marks – 4 marks each for (b) and (c)) Below you will find a circuit drawn with a circuit simulator. Your goal is to use this circuit to determine the corresponding truth table and the Boolean expression that was used to construct it. The topmost switch is A, the middle switch is B, and the bottom switch is C. a) Construct the circuit using the circuit simulator. (no marks) b) Use the circuit you’ve constructed in part (a) to help you fill in the truth table values. c) Apply the sum-of-products algorithm to the truth table to obtain Boolean Expressions for our mystery circuit.
-2-
Question 6 – 3-input odd-parity circuit (14 marks) The 3-input odd-parity circuit has three inputs and one output. The circuit outputs a 1 if and only if its inputs currently display an even amount of ones (note that three zeroes counts as an even amount of ones). It will display a 0 if and only if its inputs currently display an odd amount of ones. The purpose of this circuit is to have the number of 1 bits in the input and the output together always be an odd amount. This circuit is used in error checking. a) Complete the truth table for the 3-input odd-parity circuit on your worksheet. (4 marks) b) Apply the sum-of-products algorithm to the truth table from part (a) to obtain a Boolean Expression and write it down on your worksheet. (4 marks) c) Either (i) construct the new circuit using the simulator and print out your circuit diagram or (ii) draw it clearly in the space provided on the worksheet instead. Label the switches! (6 marks) Question 7 – 7 segment decoder (29 marks as outlined below) Digital readouts like those in electronic calculators or digital alarm clocks use light displays. Each digit of the display is formed from seven segments, each consisting of one LED or one crystal that can be illuminated by digital signals. In the picture below, each segment is represented by a letter from a – g. You are going to build part of a circuit that accepts a decimal digit (0 to 7) in binary format and then generates the appropriate outputs to display the correct digit. For example, in the truth table on the worksheet, the decimal digit 1 is represented in binary as 001 (A = 0, B = 0, C = 1). To display a one on the LED, we need to make segments b and c illuminate. So, when the input is A = 0, B = 0, C = 1, only segment b = 1 and c = 1 while the others are zero. Other numbers can be created similarly.
a) Match the decimal numbers in the truth table with the images given to determine which segments of the LCD will be “on” when the corresponding binary input is given. One row of the truth table has been done for you. (7 marks) b) Apply the sum-of-products algorithm to the truth table to obtain Boolean Expressions for each segment as indicated on your worksheet. We will only do the Boolean expressions for four different output segments. (16 marks – 4 marks each) c) Construct a circuit with the simulator showing only the output for segment f. After you have tested the circuit, draw it clearly in the space provided on the worksheet. Label your switches. (6 marks)
-3-
Question 8: Boolean expressions using zeroes (7 marks) When the output of a truth table contains more ones than zeroes, the resulting Boolean expression created using sum-of-products is quite large. Creating a Boolean Expression based on the rows producing a zero would produce a smaller expression; however, it would be the opposite of what is desired. By building a Boolean Expression for the rows producing an output of zero and then negating that result, we would have an alternate (and smaller) expression for the original circuit. The original expression created using sum-of-products and the negated expression created using the zero output rows and negation would be logically equivalent. For example, A 0 0 1 1
B 0 1 0 1
Output C 1 1 0 1
Boolean expressions: (~A * ~B) + Using 1’s: (~A * B) + (A * B) Using 0’s and negation:
~ [ (A * ~B) ]
a) Use the circuit diagram given to complete the truth table for output D in the space provided. Both outputs should be identical so you can use either one. (2 marks) b) Apply the sum-of-products algorithm to the truth table rows on the worksheet producing 0 as output and negate the overall expression to produce one Boolean Expression for D. (3 marks) c) Apply the sum-of-products algorithm to the truth table rows on the worksheet producing 1 as output to product a logically equivalent Boolean expression for D. (2 marks)
-4-