Computer Engineering Concepts |
Knowledge and Understanding
1. Which of the following sentences are propositions (a statement that is either true or false, but not both)? What are the truth values of these statements?
a. Ontario is a province of Canada. b. 1 + 5 = 6
c. 7 +5 > 9 d. x + y = 76, if x = 17, y = 31
2. Let p and q be the following propositions:
p: I leave home at 8:00 am.
q: I arrive at school on time.
Express the following composite propositions in sentence form using the above individual propositions.
a. NOT (p) b. NOT (q) c. (p) AND (q)
d. (p) AND [NOT(q)] e. [NOT(p)]AND (q) f. (p)OR [NOT(q)]
3. Write the negation (NOT logical operator) of the following propositions, and state the truth value for the proposition and its negation.
a. This year is a leap year. b. It does not rain in the city.
c. Summer is warmer than winter. d. 7 - 5 = 4
4. Create truth tables for the composite propositions in question 2.
5. Let A, B and C be the following propositions:
A: Alex walks to school.
B: Alex runs to school.
C: Alex takes the bus to school.
Express the following composite propositions in sentence form using the above individual propositions.
a. (B)AND (C) b. (A) OR (C)
c. (C) AND [(A)OR(B)] d. (C) OR [(A)OR(B)]]
e. NOT(C) AND [(A)OR(B)] f. [(A)OR(C)] AND [(A)OR(B)]
6. State whether the following conditions are true or false using truth values, if x=3, y=2, and z=4. These types of logical conditions are commonly encountered in computer programming.
a. x < 4 b. x + 1 not= z – 4
c. 4*y = x + y d. x > y and z < 6
e. x + 2 = y and z = 4 f. y not= 2 and x = 3
g. x -y = 1 or x > z h. x*2 - y not= 4 or y*2 = 4
i. (z/y+3) - x > 0 or (z/y-3) < 3 j. x+z = 7 or (y-1)*10 =50
k. (x = 4 or y < 3) and x < 3 l. (y-1 = 1 and x not=1) or z < 5
7. The XOR (exclusive or) logical operator connects two propositions together, and is false when both propositions are false and when both propositions are true. In all other cases it is true.
a. Create a truth table for (p)NOR(q)
b. Using truth tables show that [(p)OR(q)]AND[NOT((p)AND(q))] is the same as (p)XOR(q).
c. Is the sentence “You can go to the park or to the store, but not to both” an example of the XOR logic function?
8. The NOR logical operator connects two propositions together, and is true when both propositions are false. In all other cases it is false.
a. Create a logic map for (p)NOR(q)
b. Use a truth table to show that [NOT(p)]AND[NOT(q)] is equivalent to (p)NOR(q).
9. For what integer values of x are the following propositions true?
a. not(x>2) and (x<0) b. (x>2) or not(x<0)
c. (x>2) and not(x>2) d. [not(x=3) and (x>4)] or (x<4)
e. [not(x<0) and (x>6)] and (x<0) f. not[(x<6) and not(x<6)]
10. Perform the AND, OR, and XOR operations on the following pairs of binary numbers.
a. 1010100, 1011111 b. 101110, 1011011
c. 1010011, 100010 d. 10011, 111100
11. Find the complement (NOT) of the following binary numbers. Assume all numbers are 8 bit in length.
a. 10111101 b. 1011001
c. 10011 d. 11100
12. Given the logical expression [(p)XOR(q)]AND(r) where p, q, and r are logical propositions, create a truth table for the expression by considering all 8 possible combinations for the logical states of p, q, and r.
13. How many possible logical outcomes are there for the following number of propositions?
a. 2 b. 3 c. 5 d. 8
14. Create logic expressions using AND, OR and NOT that are equivalent to the following expressions.
a. (p ↑ q)′ b. p′ ↓ q′ c. p ⊕ q′ d. (p ↑ q) ↑ p′
15. Create a truth table for each of the following two variable logic expressions.
a. (p â‹… q) + q b. (p + q)′ ⊕ p c. (p ⊕ q) + (p â‹…q)
16. Create a truth table for each of the following four variable logic expressions.
a. (p + q) + s b. q′ + (p + s) c. (s ⊕ q) â‹…(s â‹… q)
17. Create a truth table for each of the following four variable logic expressions.
a. (p â‹… q) + (r + s) b. (p + q)′ + (r + s) c. (p ⊕ q) + (r â‹…q) + s
18. Represent the truth tables in question 28 as logic maps.
19. How many possible outcomes will be generated with five logical variables?
20. Encrypt the following using the XOR operator and 110 as the key.
a. 100110100110100 b. 100100010111 c. 101110100101010010
21. Create a logical expression involving three propositions (p, q, r) that will give a truth value of 1 when any two of the three propositions are true. In all other cases it will produce a truth value of 0.
22. Create a logical expression involving three propositions (p, q, r) that will give a truth value of 1 when the three propositions are (1, 1, 0). In all other cases it will produce a truth value of 0.
23. Create a truth table and a logic map for each of the following logical expressions with three logic variables.
a. (pANDq)ORr b. (pORq)ANDr
c. (pXORr)NANDr d. pAND(qXORr)
24. Using truth tables determine if (pANDq)ORr is the same as pAND(qORr)
25. Using truth tables determine if p∙(q + r) is equivalent to (p∙q)+(p∙r)
Inquiry
26. Given logical operation [pANDq]XOR[pNANDq]
a. Create a truth table.
b. What is unique about this complex logical operation? Is it useful?
27. Using truth tables show that the logical operator NAND can be used to achieve the logical operator NOT. [Hint: try pNANDp]
28. Using the idea in question 16 create the XOR pattern using NAND and NOR operators only.
29. Can a truth table with four logic variables be represented in the form of a logic map? If so, create a sample logic map with four logic variables.
30. Create a logic expression using the logical operators AND, OR, and NOT to produce the following truth table results. An operator may be used more than once.
31. How can a bit string be encrypted using XOR encryption if the string is shorter in length than the key?
32. Create a 3 proposition logic expression that will produce a false result when any two of the propositions are true.
Application
33. The XOR logical operator is used in computers to determine if two numbers are equal. Apply the XOR operator on the following four pairs, and using the results explain how the computer might determine if the two numbers are equal using the XOR operator.
a. 10101110, 10111010 b. 10101110, 10101110
c. 11111111, 10111010 d. 10111010, 10111010
34. Convert your name to a bit string using the ASCI code and then apply a XOR encryption on the bit string using 1011 as the key. Take the encrypted bit string and convert it back to a text format by using the ASCI code. Compare the text of the encrypted name with your name. Is the XOR encryption method equivalent to a shift replacement scheme discussed in chapter 2?
Communication
35. Is the algebraic statement 3x+4 =4 a logical proposition? Explain
36. Is it possible to use the concept of the XOR encryption with a different logical operator? Explain why or why not.
37. Research a device that uses fuzzy logic, and summarize your findings.
38. Create language sentences that can be used as examples for the various logic operators.
39. Is it possible to use the concept of the XOR encryption with a different logical operator? Explain why or why not.
40. Is it possible to create a logic expression that remains always true or always false? Explain with an example.