In this explainer, we will learn how to determine the input and output of OR gates in logic circuits and complete truth tables for OR gates.

A logic gate is a device that takes one or more binary inputs and has one binary output. Binary signals have two possible values: 0 and 1. All logic gates determine one output value, depending on the type of gate and its input.

We may use other terms to describe a binary value. Besides using 0 and 1, we may also use “off” and “on” or “false” and “true.” Here, 0, “off,” and “false” all represent the same value, as do 1, “on,” and “true.” It does not matter which notation we use to describe the values, but we may see different uses depending on the context that the logic gate is working in. “Off” and “on” are commonly used when describing whether a current is flowing in an electrical component, since logic gates are combined in circuits to perform complex tasks. Devices like computers and smartphones use vast combinations of logic gates to perform calculations using binary values. We will learn how OR gates can be combined later in this explainer; for now, let us explore how an individual OR gate works.

The diagram above shows the symbol representation of an OR gate. Here, the input is shown on the left side and the output is on the right side, which is made evident by the direction that the curved shape “points.” OR gates use two input values, which are represented by the double lines leading into the curved D-shaped symbol, shown here on the left side. Thus, we have two lines representing the input and one line representing the output. In between, the curved symbol shows the direction that information flows through the gate: two inputs become one output.

Since there are two possible values for two different inputs, there are four possible combinations of inputs. These combinations, along with their respective outputs, are shown below. Note that the dotted line extensions imply that the input/output lines continue in either direction and that the four gates are separate.

These diagrams summarize how an OR gate functions: an OR gate outputs a 1 if input A **or** B is set to 1. The only scenario in which an OR gate will output a 0 is if both inputs are set to 0.

This information can be easily presented in a truth table, which is a more formalized way of determining the outputs of a logic gate. The truth table for the OR gate is shown below. We differentiate the two inputs by calling them “A” and “B,” and each input and output channel will have its own column in the truth table. The four possible combinations of inputs correspond to the four rows, and the table shows a respective output value for each combination of input values. Here, colors are used to code the binary values, with red representing 0 and blue representing 1.

Input A | Input B | Output |
---|---|---|

The truth table reiterates the key functionality of the OR gate, which is worth stating formally.

### Rule: OR Gates

An OR gate is a logic gate with two binary inputs and one binary output that outputs a value of 1 if one **or** both inputs are set to 1. An OR gate will only output a 0 if both inputs are set to 0.

Let us explore the function of an OR gate with a couple of examples

### Example 1: Evaluating the Output of OR Gates

The diagram shows an OR gate. If input A is 1 and input B is 0, what will the output be?

### Answer

An OR gate returns a value of 1 if either input A or input B is set to 1, and it only outputs a 0 value if both inputs are set to 0. Here, since we have one input value of 1, we know the output will be 1.

### Example 2: Evaluating the Input of OR Gates

The diagram shows an OR gate. If input A is 0 and the output is 0, what must input B be?

### Answer

Recall that an OR gate will output a value of 1 if either input A or input B is set to 1. Here, we know the output is 0, so neither input can have a value of 1 because an OR gate only outputs a 0 if both inputs are set to 0.

Thus, we know that input B must be set to 0.

We know that logic gates are often used in combination to perform more complex functions. When combined, each individual OR gate behaves the same way we have seen. However, we must take some extra care to keep track of values that are passed along the combinations, as the output of some gates will be passed along as the input values of other subsequent gates. To better explore this concept, let us look at a few examples.

### Example 3: Evaluating the Output of Multiple OR Gates

The diagram shows two OR gates, where the output of the first OR gate is one of the inputs to the second. If input A is 0, input B is 0, and input C is 1, what is the output?

### Answer

Here we have a combination of OR gates, so the output of the gate on the bottom left joins with input A to be passed into the final gate, whose output we want to determine. Let us begin with the first gate that has inputs B and C; we know that input B is 0 and input C is 1. We also know that an OR gate outputs a 1 so long as either one or both of its inputs are set to 1. Since input B is set to 1, this gate will output a value of 1. This value is passed along as one input to the final gate along with input A, whose value is 0.

Thus, the final gate has input values 0 and 1, so we know the output of this combination is 1.

Now that we have seen how OR gates can be combined, let us fill out a truth table for the same configuration of gates as we saw above.

### Example 4: Evaluating the Output of Multiple OR Gates Using Truth Tables

The diagram shows two OR gates connected as part of a logic circuit. The truth table shows the output for the various combinations of inputs.

Input A | Input B | Input C | Output |
---|---|---|---|

0 | 0 | 0 | 0 |

0 | 0 | p | 1 |

0 | 1 | 0 | 1 |

0 | 1 | 1 | q |

r | 0 | 0 | 1 |

1 | 0 | 1 | 1 |

1 | 1 | 0 | s |

1 | 1 | 1 | 1 |

- What is the value of p in the table?
- What is the value of q in the table?
- What is the value of r in the table?
- What is the value of s in the table?

### Answer

**Part 1**

Here we have two OR gates combined in a circuit with three different input values to consider, so the truth table for this combination is much larger than that for a single OR gate. We will work through a single row in the truth table to complete the entries. Let us refer to the OR gate with inputs B and C as the first OR gate. The output of this gate, along with input A, leads into what we will call the second OR gate, as shown in the diagram below.

Let us begin by locating p in the table, where it stands for input C.

Input A | Input B | Input C | Output |
---|---|---|---|

0 | 0 | p | 1 |

Since we know the final output of this combination, we can work backward to determine the value of p. The final output in this row is 1, so we know that at least one of the input values for the second gate must be set to 1. The table tells us that input A is set to 0 here, so the other input to the second gate must be 1. Thus, input values B and C must result in the first gate giving an output of 1, and for this to happen, at least one of the inputs must be set to 1. The table tells us that input B is 0, so we know that input C must be 1.

Thus, the value of p is 1.

**Part 2**

Let us now move on to q, which represents the final output of this combination of OR gates, so we can plug the respective inputs in and examine what they mean for the final output.

Input A | Input B | Input C | Output |
---|---|---|---|

0 | 1 | 1 | q |

The first gate has two input values of 1, so the gate will output a value of 1 as well. This output joins up with input A to be passed into the second gate; input A is 0, but since the first gate passed on a value of 1, the final output will be 1.

Thus, the value of q is 1.

**Part 3**

Now let us look at r, which is passed as an input to the second gate.

Input A | Input B | Input C | Output |
---|---|---|---|

r | 0 | 0 | 1 |

According to the truth table, the second gate outputs a value of 1 here, so at least one of its inputs must have a value of 1. Notice that because inputs B and C are set to 0, the first gate outputs a 0. Since the second gate outputs a 1, and one of its inputs is set to 0, we know that the other input must be 1.

This means that input A, or r, is set to 1.

**Part 4**

Finally, let us examine s in the table, which represents a final output.

Input A | Input B | Input C | Output |
---|---|---|---|

1 | 1 | 0 | s |

We can start by looking at the first gate, which has input values of 1 and 0, so we know it must output a 1. This value of 1 is passed as one input to the second gate, along with input A, which is set to 1 here. Thus, since the second and final gate has two input values of 1, it will output a 1.

Therefore, the value of s is 1.

### Example 5: Evaluating the Input of Multiple OR Gates

The diagram shows a logic circuit consisting of three OR gates. How many of the inputs must have a value of 1 in order for the output to have a value of 1?

### Answer

Here we have a combination of three OR gates, such that the outputs of the first two gates are passed on as the inputs for the final gate. We want to know the minimum number of the four input values that must have a value of 1 so that the final output of the system is 1.

To begin, let us consider what the result would be if all of the inputs were set to 0. Recall that an OR gate only returns a 0 if both of its input are set to 0, so if both of the first two gates had all-zero inputs, they would both output a 0. These two 0 outputs would be passed as two 0 inputs for the final gate, again resulting in a 0 output, as shown in the diagram below.

Now let us imagine if we were to switch any single one of the original inputs, for instance, input A, to 1. We know that an OR gate will output a 1 if either one or both of its inputs are 1; so if input A is 1, the top left gate would output a 1. Thus, even if inputs C and D are still set to 0 so that the bottom left gate outputs a 0, this 0 output would be passed into the final gate along with the output of 1 from the first gate. Then, since the final gate would have inputs of 0 and 1, it would output a final value of 1, as shown in the diagram below.

Notice that it does not matter which of the four original inputs is set to 1—any input of 1 would create the same effect for this combination of OR gates.

Thus, only one input value of 1 is required for the final output to be 1.

Let us finish by summarizing some important concepts.

### Key Points

- An OR gate is a logic gate with two binary inputs and one binary output.
- The symbol diagram for the OR gate is
- An OR gate outputs a value of 1 if either one
**or**both of its inputs are set to 1. An OR gate only outputs a 0 if both of its inputs are set to 0. - OR gates, along with other logic gates, can be combined to perform more complex calculations. Such combinations are commonly used in electronic circuits.