2. Consider a 3-bit integer a = a2a1a0 and a 2-bit integer b = bībo. Using the bits of a and b as your propositions (so you have 5 atomic propositions: ao, a1, a2, bo, and b1, where 0 indicates false and 1 indicates true), write a propositional logic formula for each of the following claims. Express your answers in either conjunctive or disjunctive normal form. (a) (a + b) is odd (b) a is divisible by 3 (c) a = b
Consider a 3-bit integer a = a2a1a0 and a 2-bit integer b = b1b0. Using the bits of a and b as your propositions (so you have 5 atomic propositions: ao, a₁, a2, bo, and b₁, where 0 indicates false and 1 indicates true), write a propositional logic formula for each of the following claims. Express your answers in either conjunctive or disjunctive normal form.
(a) (a + b) is odd
(b) a is divisible by 3
(c) a = b
Solution: -
(a) (a+b) is odd
There are 3bits integer for adding so we are take c will be final carry
Putting value of Pi, Gi in 3
C3=(A2)+(A1.B1)(A2)+(A0.B0)(A1+B1)(A2) [TAKING C0=0]
C3=A2 +A1A2B1+A1B1+(A0B0)(A1A2+A1+B1A2+B1)
C3=A2+A1A2B1+A1B1+A0A1A2B0+A0A1B0+A0A2B1B0+A0B0B1 ......................1
Assume A0,A1,A2,B0,B1.......... is 1.
then we are put the value of 1 in eq...1
1+1+1+1+1+1+1 => 7
So, (a+b) is odd "True"
(b) a is divisible by 3
a =a0a1a2 = 3
then
if a is divisible by 3 value return is 1 "True".
(c) a = b
a sum is 3 and b sum is 2. so the return value is not equal to "False".
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 6 images