Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Assignment 2, CMPT 260

1.   (Marked)

A.   A .csv (comma-separated values”) file can be loaded in a spreadsheet like Excel or Pages with little trouble . Modify your solution to the marked problem from Assignment 1 that reads an input logical expression and outputs a .csv file that contains a complete truth table for an expression, formatted as in the note . Please see the notes for Assignment 2 on Canvas, many pieces of the assignment have been done for you.

The header items contain the names of all variables (once) in ascending alphabetical order, following by each subexpression of the given expression, terminating with the full expression . Each line contains a truth value for each variable, followed by the truth values of each subexpression . The truth values begin with an assignment of True to each variable, and ends with an assignment of False to each variable.

B.   Show that the following expressions are logically equivalent using the table of logical equivalences.

( ~ (p q) ∨ ( ~ p ^ q)) and  ~ p

(The remaining questions are unmarked)

2.   Show that the following are logically equivalent using the table of logical equivalences: ~ ((q ∨ ~ p) ∨ ( ~ p ^ ~ q)) ∨ (q ^ p) andp

3.   Design a logical circuit with the same truth table as  ~ p → ~ (q ^ p).

4.   Design a circuit with four inputs A, B, C, D, each of which can be either 0 or 1. The output of the circuit is 1 if (A = B) ^ CD)