Question: Write a Java class TLogic to implement ternary logic variables , where variable values are 'T' (true), 'F' (false), and 'U' (unknown). The class should
Write a Java class TLogic to implement ternary logic variables, where variable values are 'T' (true), 'F' (false), and 'U' (unknown). The class should include TNOT, TAND, and TOR methods as they are defined for ternary random variables.
Write a program that uses instances of this class to calculate the truth table for the logical expression shown in Part A. Note that with three ternary logic variables as inputs, the truth table will have 27 rows, compared to 8 rows for binary logic variables.
|
| TNOT |
|
| F | T | U |
| T | F | U |
|
|
| TOR |
|
|
| F | T | U |
| F | F | T | U |
| T | T | T | T |
| U | U | T | U |
|
|
| TAND |
|
|
| F | T | U |
| F | F | F | F |
| T | F | T | U |
| U | F | U | U |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
