In: Computer Science
create an expression using appropriate logical operators (AND,OR or NOT)
1. You can have only one meal
a. pizza
b. spaghetti
2. You need one of the following as proof of identity
to get driver's license
a. passport
b. two of the following
(a) birth certificate
(b) ID CARD
(c) Bill statement with your name and address
Q1 You can have only one meal.
It is solve by using not gate if out put of not gate is
Output = 0 it means you have pizza
Output = 1 it means you have spaghetti
Input | Output | Meal |
0 | 1 | Spaghetti |
1 | 0 | Pizza |
Q2 You need one of the following as proof of identity to get driver's license.
It is solve by using AND & OR gate.
AND gate is use for check
Two of the following
(a) birth certificate.
(b) ID CARD.
(c) Bill statement with your name and address.
OR gate is use for check
one of the following as proof of identity
1. passport.
2. Two of the following.
Two of the following.
Birth certificate | ID Card | Bill |
Birth certificate AND ID Card |
Birth certificate AND Bill |
ID Card AND Bill |
Output (OR of all AND) |
0 | 0 | 0 | 0 | 0 | 0 | 0 |
0 | 0 | 1 | 0 | 0 | 0 | 0 |
0 | 1 | 0 | 0 | 0 | 0 | 0 |
0 | 1 | 1 | 0 | 0 | 1 | 1 |
1 | 0 | 0 | 0 | 0 | 0 | 0 |
1 | 0 | 1 | 0 | 1 | 0 | 1 |
1 | 1 | 0 | 1 | 0 | 0 | 1 |
1 | 1 | 1 | 1 | 1 | 1 | 1 |
one of the following as proof of identity
Passport | Two of the following | Output (OR) |
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 1 |
Here in output
0 - Not valid proof
1 - Proof is valid
I hope this solution will help you.
If you have any doubts about this, then do comment below.
Do you feel it is helpful to you?
Then please up vote me.
Thank You :)