Logic
Logic
DISCRETE MATHEMATICS
LOGIC
November 5, 2021
FACILITATOR AJohn
vertex of Hawa
Francis and degree zero [email protected]
Mofi Email is called isolated
INSTITUTE OF and A CYU
CODE: vertex
ACCOUNTANCY 07102 is DISCRETE MATHE
ARUSHA
PROGRAM: BCS
Logic and Bit Operations
Computers represent information using bits. A bit is a symbol
with two possible values, namely, 0 (zero) and 1 (one).
This meaning of the word bit comes from binary digit,
because zeros and ones are the digits used in binary
representations of numbers.
The well-known statistician John Tukey introduced this
terminology in 1946. A bit can be used to represent a truth
value, because there are two truth values, namely, true and
false.
As is customarily done, we will use a 1 bit to represent true
and a 0 bit to represent false. That is, 1 represents T (true),
0 represents F (false).
Computer bit operations correspond to the logical
connectives. By replacing true by a one and false by a zero in
the truth tables for the operators
[(p → q) ∧ ¬q] → ¬p
¬ [(p → q) ∧ ¬q] ∨ ¬p
[¬(¬p ∨ q) ∨ q] ∨ ¬p
[(p ∧ ¬q) ∨ q] ∨ ¬p
[(p ∨ q) ∧ (¬q ∨ q)] ∨ ¬p
[(p ∨ q) ∧ T ] ∨ ¬p
(p ∨ q) ∨ ¬p
(q ∨ p) ∨ ¬p
q ∨ (p ∨ ¬p)
q∨T
T.
∴ [(p → q) ∧ ¬q] → ¬p = T
FACILITATOR John Francis and Hawa Mofi Email [email protected]
INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
Application of propositional logic
Logic has many important applications to mathematics and
computer science. Statements in mathematics and the
sciences and in natural language often are ambiguous.
To make such statements precise, they can be translated into
the language of logic.
Propositional logic and its rules can be used to design
computer circuits, to construct computer programs, to verify
the correctness of programs.
Definition;
A list of propositions is consistent if it is possible to assign
truth values to the propositional variable so that each
proposition is true.
Logic Circuits
Propositional logic can be applied to the design of computer
hardware.
A logic circuit (or digital circuit) receives input signals
p1 , p2 , .., pn , each a bit [either 0 (off) or 1 (on)], and
produces output signals s1 , s2 , .., sn , each a bit.
Here we will restrict our attention to logic circuits with a
single output signal; in general, digital circuits may have
multiple outputs
The Basic logic gates are shown below.
¬∀x¬∃y ¬(xy = 1)
∴ ∃x∀y (xy 6= 1)
s1
s2
..
.
sn
∴C