Logic gates · Compuertas lógicas
| English | Español |
|---|---|
| logic gate/ˈlɒdʒɪk ɡeɪt/ | puerta lógica |
| truth table/truːθ ˈteɪbl/ | tabla de verdad |
| Boolean/ˈbuːlɪən/ | Boolean |
| logic expression/ˈlɒdʒɪk ekˈspreʃn/ | expresión lógica |
The master's thesis that built the digital world
- In 1937 a 21-year-old student, Claude Shannon, noticed that the on-off relays in telephone exchanges behaved exactly like the true-false algebra George Boole had written a century earlier.
- His thesis showed that any logical statement could be built as a circuit of switches, and any circuit of switches described as a logical statement.
- Every processor made since is a very large number of those switches, arranged into a handful of standard logic gates 逻辑门.
- This lesson is the handful: six gates, their symbols, and their truth tables.
La tesis del maestro que construyó el mundo digital
- En 1937, un estudiante de 21 años, Claude Shannon, observó que los relevadores de encendido y apagado en las centralitas telefónicas se comportaban exactamente como el álgebra verdadero-falso que George Boole había escrito un siglo antes.
- Su tesis demostró que cualquier enunciado lógico podía construirse como un circuito de interruptores, y que cualquier circuito de interruptores podía describirse como un enunciado lógico.
- Cada procesador fabricado desde entonces es un gran número de esos interruptores, organizados en un puñado de puertas lógicas (logic gates) estándar.
- Esta lección trata sobre ese puñado: seis puertas, sus símbolos y sus tablas de verdad.
What a logic gate is
- A logic gate is a small circuit that carries out one Boolean 布尔 operation. Every input and every output is either 0 (false, low voltage) or 1 (true, high voltage).
- For each gate you must know three things: its symbol, its function in words, and its truth table 真值表, which lists the output for every combination of inputs.
- Every gate in this course has two inputs except NOT, which has one.
The six gates: a shape for each, and a bubble where the output is inverted
Qué es una puerta lógica
- Una puerta lógica (logic gate) es un pequeño circuito que realiza una operación Booleana (Boolean operation). Cada entrada y cada salida es ya sea 0 (falso, bajo voltaje) o 1 (verdadero, alto voltaje).
- Para cada puerta debes conocer tres cosas: su símbolo, su función en palabras y su tabla de verdad (truth table), que enumera la salida para cada combinación de entradas.
- Todas las puertas de este curso tienen dos entradas excepto NOT, que tiene una.

Las seis puertas: una forma para cada una, y una burbuja donde la salida está invertida
Logic gates · Compuertas lógicas
output from the truth table · salida de la tabla de verdad
Toggle A and B through a gate and watch the truth table row light up. · Alternar A y B a través de una compuerta y observa cómo se ilumina la fila de la tabla de verdad.
NOT, AND, OR
- NOT inverts its single input: 0 becomes 1 and 1 becomes 0.
- AND outputs 1 only when both inputs are 1.
- OR outputs 1 when at least one input is 1, so it is 0 only when both inputs are 0.
| A | B | A AND B | A OR B |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 1 |
NOT, AND, OR
- NOT invierte su única entrada: 0 se convierte en 1 y 1 se convierte en 0.
- AND produce una salida de 1 solo cuando ambas entradas son 1.
- OR produce una salida de 1 cuando al menos una entrada es 1, por lo que es 0 solo cuando ambas entradas son 0.
| A | B | A AND B | A OR B |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 1 |
A NOT gate outputs 1 when its input is 0. · Una compuerta NOT produce 1 cuando su entrada es 0.
NOT inverts: 0 → 1 and 1 → 0. · NOT invierte: 0 → 1 y 1 → 0.
An AND gate outputs 1 when: · Una compuerta AND produce 1 cuando:
AND outputs 1 only if every input is 1; otherwise 0. · AND produce 1 solo si cada entrada es 1; de lo contrario, 0.
An OR gate outputs 0 only when: · Una compuerta OR produce 0 únicamente cuando:
OR is 1 if at least one input is 1, so it is 0 only when every input is 0. · OR es 1 si al menos una entrada es 1, por lo que es 0 solo cuando todas las entradas son 0.
NAND, NOR, XOR
- NAND is NOT AND: the output is 0 only when both inputs are 1, and 1 otherwise.
- NOR is NOT OR: the output is 1 only when both inputs are 0.
- XOR (exclusive OR, also written EOR) outputs 1 when the inputs are different, and 0 when they are the same.
| A | B | A NAND B | A NOR B | A XOR B |
|---|---|---|---|---|
| 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 0 | 0 | 0 |
NAND, NOR, XOR
- NAND es NOT AND: la salida es 0 solo cuando ambas entradas son 1, y 1 en cualquier otro caso.
- NOR es NOT OR: la salida es 1 solo cuando ambas entradas son 0.
- XOR (OR exclusivo, también escrito EOR) produce una salida de 1 cuando las entradas son diferentes, y 0 cuando son iguales.
| A | B | A NAND B | A NOR B | A XOR B |
|---|---|---|---|---|
| 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 0 | 0 | 0 |
A XOR gate outputs 1 when: · Una compuerta XOR produce 1 cuando:
XOR (exclusive OR) is 1 when the inputs differ (0,1 or 1,0) and 0 when they are the same. · XOR (OR exclusivo) es 1 cuando las entradas difieren (0,1 o 1,0) y 0 cuando son iguales.
A NAND gate outputs 0 only when: · Una compuerta NAND produce 0 únicamente cuando:
NAND = NOT AND, so it is 0 exactly when AND would be 1 (all inputs 1), and 1 otherwise. · NAND = NOT AND, por lo que es 0 exactamente cuando AND sería 1 (todas las entradas 1), y 1 en caso contrario.
A NOR gate with both inputs 0 outputs what value (0 or 1)? · Una compuerta NOR con ambas entradas 0 produce qué valor (0 o 1)?
NOR = NOT OR. OR of (0,0) is 0, so NOR is 1. NOR is 1 only when all inputs are 0. · NOR = NOT OR. La OR de (0,0) es 0, por lo tanto NOR es 1. NOR es 1 solo cuando todas las entradas son 0.
Worked example: building a truth table
- Task: construct the truth table for a NOR gate.
- Write the input columns A and B and list every combination in binary counting order: 00, 01, 10, 11. Four rows, never three, never repeated.
- Apply the rule to each row. NOR is 1 only when both inputs are 0, so the output column reads 1, 0, 0, 0.
- The order matters for the marks: the examiner compares your output column with the scheme row by row.
Ejemplo resuelto: construir una tabla de verdad
- Tarea: construir la tabla de verdad para una puerta NOR.
- Escribe las columnas de entrada A y B y lista todas las combinaciones en orden de conteo binario: 00, 01, 10, 11. Cuatro filas, nunca tres, nunca repetidas.
- Aplica la regla a cada fila. NOR es 1 solo cuando ambas entradas son 0, por lo que la columna de salida se lee 1, 0, 0, 0.
- El orden importa para la puntuación: el examinador compara tu columna de salida con el esquema fila por fila.
Put the rows of a two-input truth table in the order the examiner expects. · Coloca las filas de una tabla de verdad de dos entradas en el orden que espera el examinador.
Binary counting order: 00, 01, 10, 11. The output column is then compared with the mark scheme row by row. · Orden de conteo binario: 00, 01, 10, 11. Luego se compara la columna de salida con la hoja de respuestas fila por fila.
Worked example: defining a gate in words
- Task: define the function of an XOR gate.
- The mark-scheme wording: the output is 1 when the inputs are different, or equivalently when exactly one input is 1; the output is 0 when both inputs are the same.
- For NAND: the output is 0 only when both inputs are 1. For NOR: the output is 1 only when both inputs are 0.
- "Only when" and "at least one" are doing the work in these sentences. Leave them out and the definition also describes another gate.
Ejemplo resuelto: definir una puerta en palabras
- Tarea: definir la función de una puerta XOR.
- Redacción esperada en el criterio de corrección: la salida es 1 cuando las entradas son diferentes, o equivalentemente cuando exactamente una entrada es 1; la salida es 0 cuando ambas entradas son iguales.
- Para NAND: la salida es 0 solo cuando ambas entradas son 1. Para NOR: la salida es 1 solo cuando ambas entradas son 0.
- "Solo cuando" y "al menos uno" están haciendo el trabajo en estas oraciones. Si los omites, la definición también podría describir a otra puerta.
Reading a symbol
- AND has a flat back and a rounded front, like a D. OR has a curved back and a pointed front. XOR is OR with an extra curved line across its inputs.
- A small circle, the bubble, on the output means "invert". AND with a bubble is NAND, OR with a bubble is NOR.
- NOT is a triangle with a bubble: one input, one output.
Flat back for AND, curved back for OR, an extra line for XOR, a bubble for NOT
Leer un símbolo
- AND tiene la parte trasera plana y la delantera redondeada, como una D. OR tiene la parte trasera curva y la delantera puntiaguda. XOR es OR con una línea curva adicional cruzando sus entradas.
- Un pequeño círculo, la burbuja (bubble), en la salida significa "invertir". AND con burbuja es NAND, OR con burbuja es NOR.
- NOT es un triángulo con una burbuja: una entrada, una salida.

Parte trasera plana para AND, parte trasera curva para OR, una línea extra para XOR, una burbuja para NOT
Match each description of a symbol to its gate. · Empareja cada descripción de un símbolo con su compuerta.
The back of the shape says AND or OR; the extra line says exclusive; the bubble says inverted. · La parte trasera de la forma indica AND u OR; la línea adicional indica exclusivo; la burbuja indica invertido.
Recognising a gate from its output column
- Read the output column from the 00 row down to the 11 row.
- 0 0 0 1 is AND. 0 1 1 1 is OR. 0 1 1 0 is XOR.
- 1 1 1 0 is NAND. 1 0 0 0 is NOR. The inverted gates begin with a 1 where their partner begins with a 0.
Reconocer una puerta por su columna de salida
- Lee la columna de salida desde la fila 00 hacia abajo hasta la fila 11.
- 0 0 0 1 es AND. 0 1 1 1 es OR. 0 1 1 0 es XOR.
- 1 1 1 0 es NAND. 1 0 0 0 es NOR. Las puertas invertidas comienzan con un 1 donde su pareja comienza con un 0.
For inputs A = 0 and B = 1, which gates output 1? Select all · todos that apply. · Para las entradas A = 0 y B = 1, ¿cuáles compuertas producen 1? Selecciona todas las que correspondan.
One input is 1, so OR and XOR give 1; both are not 1, so AND gives 0 and NAND gives 1; both are not 0, so NOR gives 0. · Una entrada es 1, por lo que OR y XOR dan 1; no ambas son 1, así que AND da 0 y NAND da 1; no ambas son 0, por lo que NOR da 0.
Writing the logic expression
- A logic expression 逻辑表达式 writes the gate as words:
X = A AND B,X = A OR B,X = NOT A,X = A NAND B,X = A NOR B,X = A XOR B. - Brackets show which operation happens first when gates are joined:
X = (A AND B) OR C. - The expression, the truth table and the circuit are three views of one function. Next lesson joins the gates into circuits and moves between all three.
Escribir la expresión lógica
- Una expresión lógica (logic expression) escribe la puerta en palabras:
X = A AND B,X = A OR B,X = NOT A,X = A NAND B,X = A NOR B,X = A XOR B. - Los paréntesis muestran qué operación ocurre primero cuando las puertas están conectadas:
X = (A AND B) OR C. - La expresión, la tabla de verdad y el circuito son tres vistas de una misma función. La próxima lección unirás las puertas en circuitos y te moverás entre las tres representaciones.
A circuit outputs 1 only when both of its inputs are 1. Which logic expression describes it? · Un circuito produce 1 solo cuando ambas sus entradas son 1. ¿Cuál expresión lógica lo describe?
"Only when both" is the AND definition. NAND is its inverse, OR needs only one input, XOR needs them to differ. · "Solo cuando ambos" es la definición de AND. NAND es su inverso, OR necesita solo una entrada, XOR necesita que difieran.
Marks that slip away
- XOR is not OR. For inputs 1 and 1, OR gives 1 and XOR gives 0.
- NAND is NOT (A AND B), not (NOT A) AND B. The bubble is on the output.
- Truth-table rows go 00, 01, 10, 11. A table in another order is marked as wrong even when every row is right.
- A NOT gate has one input. Every other gate in this course has exactly two.
Puntos que se escapan
- XOR no es OR. Para entradas 1 y 1, OR da 1 y XOR da 0.
- NAND es NOT (A AND B), no (NOT A) AND B. La burbuja está en la salida.
- Las filas de la tabla de verdad van 00, 01, 10, 11. Una tabla en otro orden se marca como incorrecta incluso si cada fila individual es correcta.
- Una puerta NOT tiene una entrada. Cada otra puerta en este curso tiene exactamente dos.
You've got it
- a gate does one Boolean operation on inputs of 0 and 1; know each symbol, function and truth table
- AND = both 1 · OR = at least one 1 · NOT = invert · NAND = 0 only when both 1 · NOR = 1 only when both 0 · XOR = inputs differ
- the bubble on a symbol inverts the output; truth tables run 00, 01, 10, 11
- a logic expression writes the same function in words:
X = A NAND B
Lo has logrado
- una puerta (gate) realiza una operación Booleana sobre entradas de 0 y 1; conoce cada símbolo, función y tabla de verdad
- AND = ambos 1 · OR = al menos uno 1 · NOT = invertir · NAND = 0 solo cuando ambos 1 · NOR = 1 solo cuando ambos 0 · XOR = entradas diferentes
- la burbuja (bubble) en un símbolo invierte la salida; las tablas de verdad siguen el orden 00, 01, 10, 11
- una expresión lógica escribe la misma función en palabras:
X = A NAND B