Propositional Logic and Hardware2023-1
Propositional Logic and Hardware2023-1
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.
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.
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:
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)
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.
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
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
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
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
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
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.
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.