Commonly referred to as propositional logic or sentential logic, examines the logical connections between propositions, or claims, that are stated in terms of logical operators like "and," "or," and "not." Propositions are represented by symbols or letters in propositional calculus, and logical operators are used to connect these symbols to create more complicated statements.
Negation - it alters the proposition's truth value and is denoted by the symbol ¬.
For example, if a proposition is P, its negation is ¬P.
Conjunction - it stands for the logical "and" between two propositions and is denoted by the symbol ∧. For example, if P and Q are propositions, P ∧ Q represents the statement "P and Q are both true".
Disjunction - It represents the logical "or" between two propositions and is denoted by the symbol ∨. For example, the statement "P or Q (or both) are true" is represented by P ∨ Q if P and Q are propositions.
Implication - If P, then Q is a logical relationship that is represented by the symbol →. If P and Q are propositions. For example, P → Q denotes the proposition "if P is true, then Q is true."
Equivalence - The concept of logical equivalence between two assertions is represented by the symbol ↔. P ↔ Q, for example, denotes the proposition "P is true if and only if Q is true," if P and Q are propositions.
TRUTH TABLE - This is a chart where the truth values of logical expressions are shown for all possible input combinations. It is often used in mathematics and logic to evaluate the strength of arguments, judge the veracity of claims, and simplify difficult formulas.
Ludwig Wittgenstein initially discussed truth tables in his book "Tractatus Logico-Philosophicus," published in 1921. Truth tables have now developed into a crucial instrument in the study of logic, computer science, and other fields. A typical truth table contains columns for each component of the expression being evaluated and rows for every possible combination of input values. The truth value of the complete expression for each input combination is displayed in the table's last column.
In sentential logic, a statement is constructed from smaller statements using the logical connectives ㄱ , ∧ , ∨ , → , and ↔. A statement constructed using these connectives is either true or false, depending on the truth or falsity of its individual parts.
A truth table demonstrates how the true or false nature of the simple propositions that make up a compound statement affects the truth or falsity of the complex statement. The truth tables for the five logical connectives will therefore be our first step.
P∧Q should be true when both P and Q are true, and false otherwise:
P∨Q is true if either P is true or Q is true (or both --- remember that we're using "or" in the inclusive sense). It's only false if both P and Q are false.
Here's the table for negation:
This table is easy to understand. If P is true, its negation ㄱP is false. If P is false, then ㄱP is true.
Here's the table for logical implication:
If P implies Q and P is true and Q is false, then it is false, and true otherwise.
P↔Q means that P and Q are equivalent. So the double implication is true if P and Q are both true or if P and Q are both false; otherwise, the double implication is false.
The truth tables for the logical connectives should be retained in your memory or be able to be created. These tables will be used to build tables for longer, more complex sentences. Since it is simpler to see something done than to discuss how to do it, the examples will show you how to accomplish it.
You must take into account all possible True (T) and False (F) assignments to the component statements when building a truth table. Consider the case where P, Q, and R are the component statements. There are many ways that each of these claims could be true or untrue.
To prevent repetition or omission when presenting the choices, you should assign truth values to the component assertions in a methodical manner. Using lexicographic ordering is the simplest strategy. Hence, I would present the options as follows for a compound statement with the three components P, Q, and R:
Truth tables can be put up in a variety of ways. For example, you may gradually work your way up to the column for the "primary" connective by placing the truth values "under" the logical connectives of the compound statement.
Lay everything out slowly, creating columns for each "component" of the compound statement, until you reach the compound statement itself. Every style is acceptable as long as you demonstrate enough effort to support your outcomes.
BITWISE OPERATORS
Fundamental operations on binary data at the bit level are called bitwise operations. These operations change the value of a binary value by manipulating its component bits. Binary values can be changed in a variety of ways. You can perform common mathematical operations on binary values, such as addition, subtraction, multiplication, and division, in the same way that you can with decimal numbers.
Bit-by-bit operations are carried out by bitwise operators on either one or two complete binary values. They use boolean logic applied to a collection of binary symbols. These bitwise operators are frequently used in both programming and electronics.
Three main bitwise operations:
Bitwise OR (|): If any of the bits is 1, the OR operation returns 1, otherwise it returns 0.
Example:
Compare all of the bits that share a place after aligning each number's bits. If either or both bits in a bit comparison are 1, the result at that bit position has a value of 1. The result additionally receives a 0 at that place if both values have a 0 there.
Find the 10011010 OR 01000110 by bit-by-bit lining up each digit. The result value also has a 1 if one, both, or neither of the numbers in the column:
Solution:
10011010
OR 01000110
------------- =
11011110
Bitwise AND (&): If both bits are 1, the operation returns 1, otherwise it returns 0.
Example:
Similar to how OR works, AND’ing two binary numbers together does as well. Compare all of the bits that share a position after aligning each number's bits. If one or both of the bits in a bit comparison are 0, the result at that bit position has a value of 0. The result receives a 1 at that place if both values have a 1.
Line up each item to determine the value of 10011010 AND 01000110. The result of each bit-position will only be 1 if both bits in that column are also 1.
Solution:
10011010
AND 01000110
------------- =
00000010
Bitwise XOR (): If the two bits being compared are different, the XOR operation yields 1, else it returns 0.
Example:
The exclusive OR is XOR. While XOR functions similarly to conventional OR, it will only result in a 1 if both of the other integers also have a 1 in that bit-position.
Find the result of 10011010 XOR 01000110:
10011010
XOR 01000110
------------ =
11011100