Professional Documents
Culture Documents
Symbolic Propositions To Sentences & Conversely
Symbolic Propositions To Sentences & Conversely
• a ≤ x ≤ b means a ≤ x AND x ≤ b
p↔q
Translating English Sentences into logical
Expressions: examples
“You can purchase this book if you have Rs.1000 or Rs.500 and a
discount coupon.”
r: You can purchase this book
s: you have Rs.1000
t: you have Rs.500
u: you have a discount coupon
s∨(t ∧ u)→r
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
Logic and Bit Operations
• 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 ∧,
∨, and ⊕. We will also use the
notation OR, AND, and XOR for
the operators ∨, ∧, and ⊕, as is
done in various programming
languages
Logic and Bit Operations
Bit string:-
“A bit string is a sequence of 0’s and 1’s. The length of this string is the number
of bits in the string.”
Example:-
101010011 (bit string of length nine)
Bitwise OR, Bitwise AND & Bitwise XoR
• Example: Find the bitwise OR, bitwise AND, and bitwise XOR of the bit strings 01 1011 0110 and
11 0001 1101. (bit strings will be split into blocks of four bits to make them easier to read)
Bitwise OR, Bitwise AND & Bitwise XoR
• Example
Evaluate the following expression 0 1011
˅1 1011
1 1000 ˄ (0 1011 ˅ 1 1011)
1 1011
Solution: ˄1 1000
1 1000
1 1000 ˄ (0 1011 ˅ 1 1011)
1 1000 ˄1 1011
1 1000
Thanks