Logic circuits · Circuitos lógicos
| English | Español |
|---|---|
| logic circuit/ˈlɒdʒɪk ˈsɜːkɪt/ | circuito lógico |
| Boolean expression/ˈbuːlɪən ekˈspreʃn/ | expresión booleana |
| problem statement/ˈprɒbləm ˈsteɪtmənt/ | enunciado del problema |
| truth table/truːθ ˈteɪbl/ | tabla de verdad |
| sum of products/sʌm ɒv ˈprɒdʌkts/ | suma de productos |
| half adder/hɑːf ˈædə/ | sumador parcial |
Three sensors, two gates, one decision
- A microwave oven heats only when the door is closed and the start button has been pressed and the timer has not reached zero.
- Three sensors give three 0/1 signals. Two AND gates combine them into one signal that switches the magnetron. Open the door and the output drops to 0 at once.
- Every safety interlock, every alarm and every processor instruction is a decision like this, built from the six gates of the last lesson.
- This lesson is about building and reading those circuits, and moving between the four ways of writing the same decision.
Tres sensores, dos compuertas, una decisión
- Un horno microondas se calienta solo cuando la puerta está cerrada y el botón de inicio ha sido presionado y el temporizador no ha llegado a cero.
- Tres sensores dan tres señales 0/1. Dos compuertas AND las combinan en una sola señal que activa el magnetrón. Abrir la puerta hace que la salida caiga a 0 al instante.
- Cada interlock de seguridad, cada alarma y cada instrucción del procesador es una decisión como esta, construida a partir de las seis compuertas de la lección anterior.
- Esta lección trata sobre cómo construir y leer esos circuitos, y cómo transitar entre las cuatro formas de escribir la misma decisión.
Four views of one function
- A logic circuit 逻辑电路 is a network of gates that carries out a Boolean expression 布尔表达式.
- The same function can be written as a problem statement 问题陈述 in English, as an expression, as a circuit diagram, or as a truth table 真值表. The exam asks you to move in every direction between them.
- The paper writes expressions in words,
X = (A AND NOT B) OR (B AND C), and accepts the algebraic form $X = A\overline{B} + BC$, where a dot or nothing is AND, a plus is OR and a bar is NOT. Use whichever the question uses.
Gates wired together to carry out one Boolean expression
Cuatro vistas de una función
- Un circuito lógico 逻辑电路 es una red de compuertas que ejecuta una expresión booleana 布尔表达式.
- La misma función puede escribirse como un enunciado del problema 问题陈述 en inglés, como una expresión, como un diagrama de circuito o como una tabla de verdad 真值表. El examen te pide moverte en todas las direcciones entre ellas.
- El papel escribe expresiones con palabras,
X = (A AND NOT B) OR (B AND C), y acepta la forma algebraica $X = A\overline{B} + BC$, donde un punto o nada significa AND, un más significa OR y una barra significa NOT. Usa la que utilice la pregunta.

Compuertas cableadas juntas para ejecutar una expresión booleana
Expression to circuit
- Draw one gate per operator, starting from the innermost brackets.
- For
X = (A AND B) OR (NOT C): an AND gate on A and B, a NOT gate on the C wire, and an OR gate combining the two results. - Inputs on the left, the single output on the right, every line ending at a gate input or the output, and the output labelled X.
One gate for each operator in the expression
Expresión a circuito
- Dibuja una compuerta por operador, comenzando desde los paréntesis más internos.
- Para
X = (A AND B) OR (NOT C): una compuerta AND en A y B, una compuerta NOT en el cable C, y una compuerta OR que combina ambos resultados. - Entradas a la izquierda, la única salida a la derecha, cada línea termina en una entrada de compuerta o en la salida, y la salida está etiquetada como X.

Una compuerta para cada operador en la expresión
Logic circuits · Circuitos lógicos
gates combine into circuits · las compuertas se combinan en circuitos
Each gate has a fixed rule; chaining them builds every circuit — start with one gate. · Cada compuerta tiene una regla fija; encadenarlas construye cualquier circuito — comienza con una compuerta.
For · A favor $X = (A \cdot B) + \overline{C}$ with $A=1, B=1, C=1$, what is $X$? · Para $X = (A \cdot B) + \overline{C}$ con $A=1, B=1, C=1$, ¿cuál es $X$?
$A \cdot B = 1$, and $\overline{C} = 0$. $X = 1 + 0 = 1$. · $A \cdot B = 1$, y $\overline{C} = 0$. $X = 1 + 0 = 1$.
Worked example: circuit to expression
- Work forwards from the inputs and label every intermediate output.
- In the circuit below, B passes through a NOT gate. A and NOT B feed an AND gate: call its output P, so
P = A AND NOT B. B and C feed a second AND gate:Q = B AND C. - P and Q feed the OR gate, so
X = P OR Q = (A AND NOT B) OR (B AND C). - Labelling P and Q is not decoration. It is what lets you fill the truth table one gate at a time.
Label every intermediate output before you write the expression
Ejemplo resuelto: circuito a expresión
- Trabaja hacia adelante desde las entradas y etiqueta cada salida intermedia.
- En el circuito de abajo, B pasa por una compuerta NOT. A y NOT B alimentan una compuerta AND: llámale su salida P, así
P = A AND NOT B. B y C alimentan una segunda compuerta AND:Q = B AND C. - P y Q alimentan la compuerta OR, así
X = P OR Q = (A AND NOT B) OR (B AND C). - Etiquetar P y Q no es adorno. Es lo que te permite llenar la tabla de verdad una compuerta a la vez.

Etiqueta cada salida intermedia antes de escribir la expresión
In the worked circuit, the second AND gate's output is Q = B AND ____. · En el circuito resuelto, la salida de la segunda compuerta AND es Q = B AND ____.
B and C feed the lower AND gate. Labelling that output Q lets the truth table be filled one gate at a time. · B y C alimentan la compuerta AND inferior. Etiquetar esa salida como Q permite llenar la tabla de verdad una compuerta a la vez.
Circuit to truth table
- For $n$ inputs there are $2^{n}$ rows: two inputs give 4, three give 8, four give 16. List them in binary counting order.
- Give the table a column for each intermediate output as well as the final one, so every row is checked one gate at a time.
- Fill the columns left to right: first the NOT, then each AND, then the OR.
Circuito a tabla de verdad
- Para $n$ entradas hay $2^{n}$ filas: dos entradas dan 4, tres dan 8, cuatro dan 16. Listalas en orden de conteo binario.
- Da a la tabla una columna para cada salida intermedia además de la final, para que cada fila se verifique una compuerta a la vez.
- Llena las columnas de izquierda a derecha: primero la NOT, luego cada AND, luego la OR.
How many rows does a truth table have for a circuit with 3 inputs? · ¿Cuántas filas tiene una tabla de verdad para un circuito con 3 entradas?
$2^n$ rows; for 3 inputs, $2^3 = 8$. · $2^n$ filas; para 3 entradas, $2^3 = 8$.
How many rows for 4 inputs? · ¿Cuántas filas para 4 entradas?
$2^4 = 16$ rows. · $2^4 = 16$ filas.
Worked example: the eight rows
- The circuit from the worked example above, with columns for NOT B, P, Q and X:
| A | B | C | NOT B | P | Q | X |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 | 0 | 0 | 0 |
| 0 | 1 | 0 | 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 | 0 | 1 | 1 |
| 1 | 0 | 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 1 | 1 | 1 | 0 | 1 |
| 1 | 1 | 0 | 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 0 | 0 | 1 | 1 |
- X is 1 in four of the eight rows. Check any one against the expression: row 1 0 0 has A = 1 and NOT B = 1, so P = 1, so X = 1.
Ejemplo resuelto: las ocho filas
- El circuito del ejemplo resuelto anterior, con columnas para NOT B, P, Q y X:
| A | B | C | NOT B | P | Q | X |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 | 0 | 0 | 0 |
| 0 | 1 | 0 | 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 | 0 | 1 | 1 |
| 1 | 0 | 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 1 | 1 | 1 | 0 | 1 |
| 1 | 1 | 0 | 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 0 | 0 | 1 | 1 |
- X es 1 en cuatro de las ocho filas. Verifica cualquier una contra la expresión: la fila 1 0 0 tiene A = 1 y NOT B = 1, así que P = 1, así que X = 1.
For · A favor X = (A AND NOT B) OR (B AND C), which of these input rows give X = 1? Select all · todos that apply. · Para X = (A AND NOT B) OR (B AND C), ¿cuáles de estas filas de entrada dan X = 1? Selecciona todas las que correspondan.
Row 011 makes Q = 1; row 100 makes P = 1. In row 110, B = 1 kills P and C = 0 kills Q; in row 001 both terms are 0. · La fila 011 hace que Q = 1; la fila 100 hace que P = 1. En la fila 110, B = 1 anula P y C = 0 anula Q; en la fila 001 ambos términos son 0.
Truth table to expression: sum of products
- Sum of products 积之和: for each row whose output is 1, write an AND of the inputs, putting NOT on any input that is 0 in that row. Then OR those terms together.
- A table that is 1 only on (A = 0, B = 1) and (A = 1, B = 0) gives
(NOT A AND B) OR (A AND NOT B), which is exactly A XOR B. - Simplify only if the question asks; the unsimplified sum of products earns the marks.
Tabla de verdad a expresión: suma de productos
- Suma de productos 积之和: para cada fila cuya salida sea 1, escribe un AND de las entradas, poniendo NOT en cualquier entrada que sea 0 en esa fila. Luego OR esas términos juntos.
- Una tabla que es 1 solo en (A = 0, B = 1) y (A = 1, B = 0) da
(NOT A AND B) OR (A AND NOT B), que es exactamente A XOR B. - Simplifica solo si la pregunta lo pide; la suma de productos sin simplificar obtiene los puntos.
In the sum-of-products method, for each row whose output is 1 you write: · En el método de suma de productos, para cada fila cuya salida sea 1, escribes:
Each 1-row becomes an AND term (NOT the 0 inputs); you then OR all those terms together. · Cada fila con 1 se convierte en un término AND (NOT-ing los inputs 0); luego ORs todos esos términos juntos.
In sum-of-products, you OR together one AND-term for every row whose output is 1. · En suma de productos, ORs juntos un término AND por cada fila cuya salida sea 1.
Each output-1 row becomes an AND term (NOT-ing the 0 inputs); ORing those terms gives an expression that is 1 on exactly those rows. · Cada fila con salida 1 se convierte en un término AND (NOT-ing los inputs 0); ORing esos términos da una expresión que es 1 exactamente en esas filas.
The half adder
- Adding two bits gives a sum bit and a carry bit: 1 + 1 = 10 in binary.
- The sum column is 0, 1, 1, 0, which is XOR. The carry column is 0, 0, 0, 1, which is AND. Two gates make a half adder 半加器.
- It is the standard example of reading gates straight off a truth table, and the first piece of every processor's arithmetic unit.
Each input pair flows through the gates: XOR gives the sum, AND gives the carry, so 1 + 1 = 10
El sumador medio
- Sumar dos bits da un bit de suma y un bit de acarreo: 1 + 1 = 10 en binario.
- La columna de suma es 0, 1, 1, 0, lo cual es XOR. La columna de acarreo es 0, 0, 0, 1, lo cual es AND. Dos compuertas hacen un sumador medio 半加器.
- Es el ejemplo estándar de leer compuertas directamente de una tabla de verdad, y la primera pieza de la unidad aritmética de todo procesador.
Cada par de entradas fluye a través de las compuertas: XOR da la suma, AND da el acarreo, así que 1 + 1 = 10
Half adder · Sumador parcial
Wire XOR and AND to the same two inputs: XOR gives the sum bit, AND gives the carry. Click A and B. · Conecta XOR y AND a las mismas dos entradas: XOR da el bit de suma, AND da la acarreo. Haz clic en A y B.
In a half adder, which gate produces the carry bit? · En un sumador parcial, ¿qué compuerta produce el bit de acarreo?
The carry is 1 only when both bits are 1, which is AND. The sum is 1 when the bits differ, which is XOR. · El acarreo es 1 solo cuando ambos bits son 1, lo cual es AND. La suma es 1 cuando los bits difieren, lo cual es XOR.
From a problem statement
- Turn the English into Boolean one clause at a time before drawing anything.
- "A and B" is
A AND B. "A or B, or both" isA OR B. "exactly one of A and B" isA XOR B. - "neither A nor B" is
A NOR B. "not both" isA NAND B. "unless" usually means AND NOT.
De un enunciado del problema
- Convierte el inglés a booleano una cláusula a la vez antes de dibujar algo.
- "A y B" es
A AND B. "A o B, o ambos" esA OR B. "exactamente uno de A y B" esA XOR B. - "ni A ni B" es
A NOR B. "no ambos" esA NAND B. "a menos que" usualmente significa AND NOT.
Match each English phrase to the single gate that implements it. · Empareja cada frase en inglés con la única compuerta que la implementa.
both = AND, differ = XOR, neither = NOR, not-both = NAND. · ambos = AND, difieren = XOR, ni uno ni otro = NOR, no-ambos = NAND.
Worked example: a machine alarm
- An alarm X sounds when the guard is open (A = 1) and either the motor is running (B = 1) or the temperature is high (C = 1).
- "Either B or C" is
B OR C. "A and that" isX = A AND (B OR C). The brackets around the OR are essential. - X = 1 needs A = 1 and at least one of B, C equal to 1: the rows (1, 0, 1), (1, 1, 0) and (1, 1, 1). Three rows out of eight, and A = 0 can never sound the alarm.
- The circuit is one OR gate on B and C feeding one AND gate with A.
Ejemplo resuelto: alarma de máquina
- Una alarma X suena cuando el guardabarrera está abierto (A = 1) y ya sea el motor está en marcha (B = 1) o la temperatura está alta (C = 1).
- "Ya sea B o C" es
B OR C. "A y eso" esX = A AND (B OR C). Los paréntesis alrededor de la OR son esenciales. - X = 1 necesita A = 1 y al menos uno de B, C igual a 1: las filas (1, 0, 1), (1, 1, 0) y (1, 1, 1). Tres filas de ocho, y A = 0 nunca puede activar la alarma.
- El circuito es una compuerta OR en B y C alimentando una compuerta AND con A.
For the alarm X = A AND (B OR C), the alarm can sound when A = 0 provided both B and C are 1. · Para la alarma X = A AND (B OR C), la alarma puede sonar cuando A = 0 siempre que tanto B como C sean 1.
The AND with A means A = 1 is required in every row where X = 1. With A = 0 the output is 0 whatever B and C do. · El AND con A significa que A = 1 es requerido en cada fila donde X = 1. Con A = 0, la salida es 0 sin importar lo que hagan B y C.
Marks that slip away
A AND B OR Cwithout brackets is ambiguous, and the examiner reads it as you did not intend. Bracket the OR before ANDing it.- A wire that goes nowhere, or an output with no label, loses the circuit mark even when the gates are right.
- A NOT on an input is a gate on the diagram, not a bar written over the letter.
- Three inputs mean eight rows. A table with fewer rows cannot be marked as complete.
Puntos que se escapan
A AND B OR Csin paréntesis es ambiguo, y el examinador lo lee como si no hubieras tenido intención. Pon paréntesis a la OR antes de hacer el AND con ella.- Un cable que va a ninguna parte, o una salida sin etiqueta, pierde el punto del circuito incluso cuando las compuertas están bien.
- Un NOT en una entrada es una compuerta en el diagrama, no una barra escrita sobre la letra.
- Tres entradas significan ocho filas. Una tabla con menos filas no puede ser calificada como completa.
You've got it
- expression → circuit: one gate per operator, innermost brackets first, inputs left, labelled output right
- circuit → expression: label each intermediate output (P, Q) and combine; circuit → truth table: $2^{n}$ rows with a column per gate
- truth table → expression: sum of products, one AND-term per output-1 row, ORed together; XOR + AND make the half adder
- problem → Boolean: exactly one = XOR, neither = NOR, not both = NAND; bracket the OR inside an AND
Lo has logrado
- expresión → circuito: una compuerta por operador, paréntesis internos primero, entradas a la izquierda, salida etiquetada a la derecha
- circuito → expresión: etiqueta cada salida intermedia (P, Q) y combínalas; circuito → tabla de verdad: $2^{n}$ filas con una columna por compuerta
- tabla de verdad → expresión: suma de productos, un término AND por fila de salida-1, OReados juntos; XOR + AND hacen el sumador medio
- problema → Booleano: exactamente uno = XOR, ni...ni = NOR, no ambos = NAND; pon paréntesis a la OR dentro de un AND