Boolean Algebra document

BOOLEAN ALGEBRA INVESTIGATIONS
NAMES:
Adapted from http://educ.queensu.ca/~compsci/resources/BoolLogic/assocdistrib.html
A
1
A
0
A
1.
If one of the inputs is always 1 (true), what is the output? 1
Therefore, A + 1 = 1
2.
If one of the inputs is always 0 (false), what is the output? A
What variable is the output dependent upon? A
Therefore, A + 0 = A
3.
If A = 0, then the output is 0
If A = 1, then the output is 1
How does the output compare with the input? It is the input
Therefore, A + A = A
4.
If A = 1, then the output is 1
If A = 0, then the output is 1
How does the output compare with the input? Always True
̅ = 1
Therefore, A + A
5.
If one of the inputs is always 1 (true), what is the output? A
What variable is the output dependent upon? Depends on A
Therefore, A * 1 = A
6.
If one of the inputs is always 0 (false), what is the output? 0
Therefore, A * 0 = 0
7.
If A = 0, then the output is 0
If A = 1, then the output is 1
How does the output compare with the input?
Therefore, A * A = A
8.
If A = 1, then the output is 0
If A = 0, then the output is 0
̅ = 0
Therefore, A * A
A
A
1
A
0
A
A
List the EIGHT basic rules of Boolean Algebra you gained from exercises 1-8:
i.
ii.
iii.
iv.
v.
vi.
vii.
viii.
A+1 =1
A+0=A
A+A=A
A*A=A
̅=0
A*A
A*0= 0
̅ =0
A+A
A*1 =1
9. How do
A
B
and
B
A
compare?
Therefore, A+B = _B+A_____________
How do
A
B
and
B
A
What arithmetic law is this? ___Commutative_____________
Therefore, A*B = ____B*A_________________
compare?
10. Consider the boolean expression A + B + C. Does it matter which OR you evaluate first :
(A+B or B+C)? Verify that (A + B) + C = A + (B + C) by writing out truth tables for each expression.
Make an intermediate column for (A+B) and (B+C) in each truth table. Here is a table to get you
started:
A
1
1
1
1
0
0
0
0
B
0
1
1
0
0
1
1
0
C
0
0
1
1
1
1
0
0
(A+B)
1
1
1
1
0
1
1
0
(A+B)+C
1
1
1
1
1
1
1
0
(B+C)
0
1
1
1
1
1
1
0
A+(B+C)
1
1
1
1
1
1
1
0
11. Now consider the boolean expression A * B * C. Does it matter which AND you evaluate first :
(A*B or B*C)? Verify that (A * B) * C = A * (B * C) by writing out truth tables for each expression.
Make intermediate columns for (A*B) and (B*C) in each truth table.
A
1
1
1
1
0
0
0
0
B
0
1
1
0
0
1
1
0
C
0
0
1
1
1
1
0
0
(A*B)
0
1
1
0
0
0
0
0
(A*B)*C
0
0
1
0
0
0
0
0
Which arithmetic law is this? _______Associative_______
(B*C)
0
0
1
0
0
1
0
0
A*(B*C)
0
0
1
0
0
0
0
0
Applying boolean algebra:
12. To get into a physics program in a university, Samantha needs to have high school Physics, and
either Algebra or Calculus. Assign boolean variables to the conditions and write a boolean
expression for the program requirements.
>>
A = Algebra
C = Calculus
P = Physics
Equation: P * (A + C)
13. Another way of stating the conditions for the physics program is that Samantha needs high school
Physics and Algebra, or high school Physics and Calculus. Using the same boolean variables as
above, write a boolean expression for the program requirements.
>>
Same variables as earlier
(P*A) + (P*C)
14. Since both expressions refer to the same situation, the boolean expressions must be equal. Verify
this by writing a truth table that includes both expressions and comparing those columns. (Model
the table after the 2 input tables you used above.
P
1
1
1
1
0
0
0
0
A
0
1
1
0
0
1
1
0
C
0
0
1
1
1
1
0
0
(P*A)
0
1
1
0
0
0
0
0
(P*A)+(P*C)
0
1
1
1
0
0
0
0
(P*C)
0
0
1
1
0
0
0
0
15. John wants to go Go-Karting at KartWorld. They have conditions on who can drive their Go-Karts.
You must either be over sixteen or be over twelve and have parental supervision. Using boolean
variables create an expression for the Go-Karting requirements.
>>
P = Parental Supervision
S = Age over 16
T = Age over 12
Equation: S + (P*T)
16. Another way to state the requirements, (although you wouldn’t usually say it this way) is you must
be over sixteen or over twelve, and, you must be over sixteen or have parental supervision. Using
the same boolean variables as above, write a boolean expression for the Go-Karting requirements.
>>
Same variables as ealier
(S+T)*(P+S)
17. Verify that the two expressions above are equal by writing a truth table that includes a column for
each expression and comparing the results.
P
S
T
(S+T)
(S+T)*(P+S) (P+S)
1
0
0
0
0
1
1
1
0
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
0
0
1
1
0
0
0
1
1
1
1
1
0
1
0
1
1
1
0
0
0
0
0
0
What arithmetic law does this demonstrate for boolean algebra? Distributive
18. Given the laws you proved in problems 12-18, what can you say about (A+B)*(C+D)?
[HINT: what algebra method can be used?] Draw a truth table to prove your hypothesis.
>> (A+B)*(C+D) = AC + AD + BC + BD
A
B
C
D
(A*D)
(A*C)
(B*C)
(B*D)
1
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
1
1
1
0
0
1
1
0
1
0
1
0
0
1
0
0
0
0
1
0
0
0
0
0
0
1
1
0
0
0
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
1
0
0
0
1
1
0
1
1
0
0
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
0
0
0
0
1
1
0
0
0
0
0
1
1
1
0
0
1
1
0
1
0
1
0
0
0
1
0
0
0
1
0
0
0
0
Distributive property: Makes it so (A+B)*(C+D) expands to what is listed above.
19. Consider the NOT gate
1 0
0 1
. Construct a truth table.
AD +
AC +
BC +
BD
0
0
1
1
0
1
0
0
1
1
1
1
0
1
1
0
20. Construct a truth table for the following:
1 1
0 0
21. What conclusions can you draw from looking at the two truth tables?
>> Not Not is the same as just printing it out. Not makes it the opposite
22. Construct truth tables for each of the following:
A
A
B
B
A
A
B
B
Add more columns if you need to complete any of the tables.
A
1
1
0
0
B
0
1
1
0
0
0
0
1
A
1
1
0
0
B
0
1
1
0
1
0
1
1
A
1
1
0
0
B
0
1
1
0
1
0
1
1
A
1
1
0
0
B
0
1
1
0
0
0
0
1
23. Compare the four truth tables. What conclusions can you draw? Use boolean expression to express
your findings.
>> With the ands only 1 scenario evaluates to true, whereas with the or all but 1 evaluate to true
These expressions are known as DeMorgan’s Law.
24. Consider the following diagram. If A=0, what is the output? ___0,0_______.
If A=1, what is the output? __1,_Depends on B_. Therefore, A*(A + B) = ___A+A*B_______.
A
B
A
B
Write a truth table for the above diagram.
A
1
0
1
0
B
0
1
1
0
(A+B)
1
1
1
0
A
1
0
1
0
B
0
1
1
0
̅
A
0
1
0
1
A*(A+B)
1
0
1
0
(A+B)
1
1
1
0
̅ *(A+B)
A
0
1
0
0
Does it look familiar? What conclusions can you draw? A sends through to the and automatically at
the top and the second part is 1 no matter what if A is 1. If A is 0 the expression will be 0 no matter what
because that will make the and evaluate to false.
25. Now consider the XOR gate
Create a truth table.
A
1
1
0
0
B
0
1
1
0
1
0
1
0
26. Now write a boolean expression for the following diagram (A’*B)+(A*B’)
A
B
Construct a truth table. Add more columns if you need them.
A
1
1
0
0
B
0
1
1
0
1
0
1
0
Compare the truth tables for 25 and 26. What is your conclusion? Same thing. The more
complicated version is likely for programs that aren’t able to utilize the xor function. In the end the
second example is just a more complex way to state the xor function
27. Compare the following three diagrams, by writing out the boolean expressions and then
constructing corresponding truth tables.
A
A
B
B
A
B
What are your conclusions? (A’⊕B) , (A⊕B’) , (A⊕B)’
(A’⊕B)
A
1
1
0
0
B
0
1
1
0
0
1
0
1
B
0
1
1
0
0
1
0
1
B
0
1
1
0
0
1
0
1
(A⊕B’)
A
1
1
0
0
(A⊕B)’
A
1
1
0
0
There are 2 trues in each example. In the end all
three examples are the exact same thing. Within
a xor it doesn’t seem to matter where the not is
placed, before (Example 1 and 2) or after
(Example 3).