# 13 - Past Paper Simulation - Boolean Logic (I) #1

1. Noah wants to know why it is an advantage to use as few gates as possible in a logic circuit. State the answer in a sentence (1 mark)

2. Name the three main gates that are associated with Boolean Logic. (3 marks)

3. If an output of a 'True' is put in through a NOT gate, what comes out? (1 mark)

4. If an OR gate receives two inputs of a 1 and 0, what would the output be? (1 mark)

5. Analyse the following code. It uses the boolean OR operator. What is the result of running this code? (1 mark)
```a=1
b=2
c=3
if a or b or c ==1:
print("Yes")
else:
print("No")```

6. Complete the truth table below for the Boolean statement p = A AND B (1 mark)

7. Complete the truth table below for the Boolean statement p = NOT (A AND B). (1 mark)

8. Fill in the missing blank for the truth table, in reference to the logic circuit shown below (1 mark)

9. One of the coloured boxes with values in them contains the incorrect value. State the colour of the box that contains the error. (1 mark)

10. Write the expression for the following logic circuit. Ensure you get the brackets in the right place, and use the words 'And' 'Or' 'Not' for any gates you use in the expression. (1 mark)

11. Analyse the following truth table. One of the coloured boxes contains the wrong output. State the colour of the box that contains the error (1 mark)

12. Ozan is unsure of how to complete the last row of this 'AND' gate truth table. Can you help him? What are the three values from left to right? (e.g. 0 0 1). Do not use commas in your answer. (3 marks)

13. A single output Q is produced from three inputs A, B and C. Output Q is required to be 1 only if inputs A and B are 1, or input C is 1 and input B is 0. Select the correct boolean equation: Option1, Option2 or Option3. (1 mark)
```Option 1
=========
Q = A.B . C+¬B

Option 2
=========
Q = A+B + C.¬B

Option 3
=========
Q = A.B + C.¬B```

14. Syeda has a terrible headache after a long day's work and needs some help deciding the correct value for output Q (in the red box). It's either 0 or 1 - which one is it? (1 mark)

15. Analyse the following code which uses a boolean operator. What will the output be if the user enters "guest" for username and "dunno" for password? How can you fix the program? (2 marks)
```username=input("Enter username:")