2.4 Boolean Logic Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What are the three logic Gates?

A
  • AND
    Both inputs need to be **TRUE** in order for the output to be **TRUE**.
  • OR
    Only one of the inputs need to be true in order for the output to be true
  • NOT
    This reverses the Input
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What do logic gates look like

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do you combine Boolean operators?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are Logic Gates?

A

Why data is represented in binary form

A computer is basically a collection of transistors and circuits. These components have two states:

  • on - a current is flowing through the component
  • off - a current is not flowing through the component

These two states can easily be represented by using binary:

  • 1 = on (TRUE)
  • 0 = off (FALSE)

State

State refers to the output of a circuit. If a circuit has one input and one output, and the input and output each have two states - on and off - this gives two combinations of state:

  • input off, output off
  • input on, output on

More complex circuits have many inputs, and the output state depends on the various combinations of the inputs and the logic gates they pass into.

Logic gates

In its most basic form, a computer is a collection of powered and unpowered circuits and transistors. A logic gate is a series of transistors connected together to give one or more outputs, each output being based on the input or combination of inputs supplied to it. There are three types of gate to consider:

  • AND gate
  • OR gate
  • NOT gate

Each type of gate can be represented either as a diagram, in algebraic form, or as a truth table.

Boolean algebra

Boolean algebra is a notation used to represent logic. For example:

  • Q = A AND B
  • Q = A OR B
  • Q = NOT A

This notation can also be represented using symbols:

  • Q = A /\ B, or as A.B
  • Q = A \/ B, or as A+B
  • Q = ¬ A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the NOT gate?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the AND gate?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the OR gate?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How can you combine logic gates?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How do you generate random numbers in Python?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do you create a randome integer between 1 and 6 inclusive?

How do you create a random real number between -5.0 and 5.0?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly