0% found this document useful (0 votes)
58 views

Propositional Logic and Hardware2023-1

Propositional logic uses propositions that are either true or false as the basic units. Propositions can be combined using logical connectives like AND, OR, and NOT to form more complex statements. Truth tables are used to determine the truth values of propositional statements under all combinations of true and false propositions. Propositional logic has limitations in representing relationships but forms the basis for more advanced logics. Inference rules allow conclusions to be logically derived from given premises through deduction. Common inference rules include modus ponens and syllogisms. Logic gates implement basic logical operations in digital circuits.

Uploaded by

Assassin Gaming
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views

Propositional Logic and Hardware2023-1

Propositional logic uses propositions that are either true or false as the basic units. Propositions can be combined using logical connectives like AND, OR, and NOT to form more complex statements. Truth tables are used to determine the truth values of propositional statements under all combinations of true and false propositions. Propositional logic has limitations in representing relationships but forms the basis for more advanced logics. Inference rules allow conclusions to be logically derived from given premises through deduction. Common inference rules include modus ponens and syllogisms. Logic gates implement basic logical operations in digital circuits.

Uploaded by

Assassin Gaming
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Propositional logic.

Propositional logic (PL) is the simplest form of logic where all the statements are made
by propositions.
A proposition is a declarative statement which is either true or false. It is a technique
of knowledge representation in logical and mathematical form.
Example:
a) It is Sunday.
b) The Sun rises from West (False proposition)
c) 3+3= 7(False proposition)
d) 5 is a prime number.
Following are some basic facts about propositional logic:
 Propositional logic is also called Boolean logic as it works on 0 and 1.
 In propositional logic, we use symbolic variables to represent the logic, and we can use any
symbol for representing a proposition, such as A, B, C, P, Q, R, etc.
 Propositions can be either true or false, but it can not be both.
 Propositional logic consists of an object, relations or function, and logical connectives.
 These connectives are also called logical operators.
 The propositions and connectives are the basic elements of the propositional logic.
 Connectives can be said as a logical operator which connects two sentences.
 A proposition formula which is always true is called Tautology, and it is also called a valid
sentence.
 A proposition formula which is always false is called Contradiction.
 A proposition formula which has both true and false values is called Contingencies.
Statements which are questions, commands, or opinions are not propositions such as "Where is
Rohini", "How are you", "What is your name", are not propositions.

Syntax of propositional logic:


The syntax of propositional logic defines the allowable sentences for the knowledge representation.
There are two types of Propositions:
1. Atomic Propositions
2. Compound propositions
o Atomic Proposition: Atomic propositions are the simple propositions. It consists of a single
proposition symbol. These are the sentences which must be either true or false.
Example:
a) 2+2 is 4, it is an atomic proposition as it is a true fact.
b) "The Sun is cold" is also a proposition as it is a false fact.
o Compound proposition: Compound propositions are constructed by combining
simpler or atomic propositions, using parenthesis and logical connectives.
Example:
a) "It is raining today, and street is wet."
b) "Ankit is a doctor, and his clinic is in Mumbai."
Logical Connectives:
Logical connectives are used to connect two simpler propositions or representing a
sentence logically. We can create compound propositions with the help of logical
connectives. There are mainly five connectives, which are given as follows:
1. Negation: A sentence such as ~ P is called negation of P.
2. Conjunction: A sentence which has ∧connective such as, P ∧ Q is called a conjunction.
Example: P=Rohan is intelligent, Q= Rohan is hardworking.
Its conjunction P∧ Q would be: Rohan is intelligent and hardworking.
3. Disjunction: A sentence which has ∨ connective, such as P ∨ Q. is called disjunction,
where P and Q are the propositions.
Example: If P= Ritika is Doctor. Q= Ritika is Engineer, so its P ∨ Q would be:
"Ritika is a doctor or Engineer"
4. Implication/Conditional: A sentence such as P → Q, is called an implication.
Implications are also known as if-then rules. It can be represented as
If it is raining, then the street is wet.
Let P= It is raining, and Q= Street is wet, so it is represented as P → Q
5. Bi-conditional/Equivalence: A sentence such as P⇔Q is a Bi-conditional
sentence. It is read as if and only if… then… for example:
If and only if I am breathing, then I am alive.
Here, P= I am breathing, Q= I am alive, it can be represented as P ⇔ Q.
Following is the summarized table for Propositional Logic Connectives:

Truth Table:
In propositional logic, we need to know the truth values of propositions in all possible
scenarios. We can combine all the possible combination with logical connectives, and the
representation ofthese combinations in a tabular format is called Truth table.

Negation Conjunction Disjunction Implication Bi-conditional


P Q
~P ~Q P^Q PvQ P→Q P⇔Q

false false true true false false true true

false true true false false true true false

true false false true false true false false

true true false false true true true true

Note: true value can be represented with 1 and false can be represented with 0.
Limitations of Propositional logic:
o We cannot represent relations like ALL, some, or none with propositional logic. Example:
a. All the girls are intelligent.
b. Some apples are sweet.
o Propositional logic has limited expressive power.
o In propositional logic, we cannot describe statements in terms of their
properties orlogical relationships.

Inference:
In artificial intelligence, we need intelligent computers which can create new logic from
old logic or by evidence, so generating the conclusions from evidence and facts is
termed as Inference.

Inference rules:
Inference rules are the templates for generating valid arguments. Inference rules are
applied to derive proofs in artificial intelligence, and the proof is a sequence of the
conclusion that leads to the desired goal.
In inference rules, the implication among all the connectives plays an important role.
Followingare some terminologies related to inference rules:

o Implication: It is one of the logical connectives which can be represented as P → Q. Here


P is also known as “Antecedent” and Q is “Consequent”.
o Converse: The converse of conditional can be found by interchanging its antecedent and
consequent. It can be written as Q → P.
o Inverse: The inverse of conditional can be found by taking its antecedent and
consequent in negated form. It can be written as ~P → ~Q.
o Contrapositive: The contrapositive of a conditional can be found by taking its
antecedent as negated consequent and consequent as negated antecedent. It can be
written as ~Q → ~P.

From the above term some of the compound statements are equivalent to each other,
which wecan prove using truth table:
P Q P->Q Q->P ~P ~Q ~Q->~P ~P->~Q
0 0 1 1 1 1 1 1
0 1 1 0 1 0 1 0
1 0 0 1 0 1 0 1
1 1 1 1 0 0 1 1
Hence from the above truth table, we can prove that P → Q is equivalent to ~Q → ~P, and Q→P is equivalent to
~P → ~Q.

Syllogism:
The logical process of drawing conclusion from given propositions is known as Syllogism and the
propositions used to draw conclusion are called Premises.
If P and Q are the propositions and conclusion to be drawn is C.
P
Q
C
then following should be true.
P.Q ->C
Modus Ponens
If P and P->Q are the propositions and conclusion to be drawn is Q.
P
P->Q
Q
then following would be true.
P.(P->Q) ->Q

Chain Rule
If P->Q and Q->R are the propositions and conclusion to be drawn is P->R.
P->Q
Q->R
P->R
then following would be true.
(P->Q).(Q->P) -> (P->R)

S.No. Propositional Law OR-Expression AND-Expression


1 Property of ‘0’ P+0=P P.0=0
2 Property of ‘1’ P+1=1 P.1=P
3 Involution Law (P’)’=P
4 Idempotance Law P+P=P P.P=P
5 De-Morgan’s Law (P+Q)’ = P’.Q’ (P.Q)’ = P’+Q’
6 Distributive Law P+(Q.R)=(P+Q).(P+R) P.(Q+R)=P.Q+P.R
7 Commutative Law P+Q=Q+P P.Q=Q.P
8 Complementarity Law P+P’=1 P.P’=0
9 Absorption Law P+P.Q=P P.(P+Q)=P
10 Associative Law P+(Q+R)=(P+Q)+R P.(Q.R)=(P.Q).R
11 Conditional Elimination P ⇒Q=P’+Q
12 Bi-Conditional Elimination P ⇔Q= (P ⇒Q). (Q ⇒P)
Logic
Gates

Logic gates are the basic building blocks of any digital system. It is an electronic circuit
having one or more than one input and only one output. The relationship between the
input and the output is based on a certain logic. Based on this, logic gates are named
as AND gate, OR gate, NOT gate etc.

Primary/Elementary/Basic Logic Gate


AND Gate
A circuit which performs an AND operation is shown in figure. It has n input (n >= 2)
and oneoutput.

Logic diagram

Truth Table
OR Gate
A circuit which performs an OR operation is shown in figure. It has n input (n >= 2)
and oneoutput.

Logic diagram

Truth Table

NOT Gate
NOT gate is also known as Inverter. It has one input A and one output Y.

Logic diagram

Truth Table

Secondary Logic Gates


NAND Gate
A NOT-AND operation is known as NAND operation. It has n input (n >= 2) and one output.

Logic diagram

Truth Table
NOR Gate
A NOT-OR operation is known as NOR operation. It has n input (n >= 2) and one output.

Logic diagram

Truth Table

XOR Gate
XOR or Ex-OR gate is a special type of gate. It can be used in the half adder, full adder and
subtractor. The exclusive-OR gate is abbreviated as EX-OR gate or sometime as X-OR gate. It has
n input (n >= 2) and one output.

Logic diagram

X-OR Using Basic Gates Truth Table

XNOR Gate
XNOR gate is a special type of gate. It can be used in the half adder, full adder and subtractor.
The exclusive-NOR gate is abbreviated as EX-NOR gate or sometime as X-NOR gate. It has n input
(n >= 2) and one output.
Logic diagram

Truth Table

Realization of Logic Gate Using Universal gates

In Boolean Algebra, the NAND and NOR gates are called universal gates because any
digital circuit can be implemented by using any one of these two i.e. any logic gate can
be created using NAND or NOR gates only.
XOR using NOR

Combinational Circuits

Combinational circuit is a circuit in which we combine the different gates in the circuit, for
example encoder, decoder, multiplexer and demultiplexer. Some of the characteristics of
combinational circuits are following −
 The output of combinational circuit at any instant of time, depends only on the levels present at input
terminals.
 The combinational circuit do not use any memory. The previous state of input does not have any effect
on the present state of the circuit.
A combinational circuit can have an n number of inputs and m number of outputs.

Half Adder
Half adder is a combinational logic circuit with two inputs and two outputs. The half adder circuit
is designed to add two single bit binary number A and B. It is the basic building block for addition
of two single bit numbers. This circuit has two outputs carry and sum.
Block diagram

Truth Table Circuit Diagram

Full Adder
Full adder is developed to overcome the drawback of Half Adder circuit. It can add two one-bit
numbers A and B, and carry c. The full adder is a three input and two output combinational
circuit.

Block diagram

Truth Table Circuit Diagram

Half Subtractors
Half subtractor is a combination circuit with two inputs and two outputs (difference and
borrow). It produces the difference between the two binary bits at the input and also produces
an output (Borrow) to indicate if a 1 has been borrowed. In the subtraction (A-B), A is
called as Minuend bit and B is called as Subtrahend bit.

Truth Table Circuit Diagram

Full Subtractors
The disadvantage of a half subtractor is overcome by full subtractor. The full subtractor
is a combinational circuit with three inputs A,B,C and two output D and C'. A is the
'minuend', B is 'subtrahend', C is the 'borrow' produced by the previous stage, D is the
difference output and C'is the borrow output.

Truth Table Circuit Diagram

You might also like