Adders and flip-flops · Sumadores y flip-flops
| English | Español |
|---|---|
| carry/ˈkæri/ | acarreo |
| half adder/hɑːf ˈædə/ | sumador parcial |
| full adder/fʊl ˈædə/ | sumador completo |
| flip-flop/flɪp flɒp/ | flip-flop |
| ripple-carry adder/ˈrɪpl ˈkæri ˈædə/ | sumador de propagación de carry |
| bistable/baɪˈsteɪbl/ | biestable |
| counters/ˈkaʊntəz/ | contadores |
| SRAM/ˈesræm/ | SRAM |
| SR flip-flop/ˌes ˈɑː flɪp flɒp/ | Flip-flop SR |
| JK flip-flop/ˌdʒeɪ ˈkeɪ flɪp flɒp/ | Flip-flop JK |
| toggle/ˈtɒɡl/ | interrupción |
How a machine that only knows true and false does arithmetic
- A processor has no adder in the sense of a thing that knows numbers. It has gates that answer true or false, and nothing else.
- Yet $1 + 1 = 10$ falls out of two gates: an XOR gives the sum digit, an AND gives the carry. That is the entire arithmetic unit in miniature, and chaining copies of it adds numbers of any width.
- The other half of a computer is remembering, and one bit of memory is also just gates, wired so that their outputs feed back into their inputs and hold.
- This lesson is the half adder 半加器, the full adder 全加器, and the flip-flop 触发器 that stores a bit.
Cómo una máquina que solo conoce verdadero y falso realiza aritmética
- Un procesador no tiene un sumador en el sentido de un dispositivo que "conozca" números. Tiene compuertas que responden verdadero o falso, y nada más.
- Sin embargo, $1 + 1 = 10$ surge de dos compuertas: una XOR da el dígito de la suma, una AND da el acarreo. Esa es toda la unidad aritmética en miniatura, y encadenar copias de ella permite sumar números de cualquier anchura.
- La otra mitad de una computadora es la memoria, y un bit de memoria también son solo compuertas, cableadas de modo que sus salidas se retroalimenten a sus entradas y se mantengan.
- Esta lección trata sobre el sumador medio (half adder), el sumador completo (full adder) y el flip-flop que almacena un bit.
The half adder
- A half adder adds two single bits, $A$ and $B$, producing a sum $S$ and a carry 进位 $C$.
| A | B | S | C |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
- Read the columns: $S$ is 1 when exactly one input is 1, which is XOR. $C$ is 1 only when both are 1, which is AND. So $S = A \oplus B$ and $C = A \cdot B$.
- It ignores any carry in, which is why it is only "half" an adder and cannot be chained on its own.
Two gates, and binary addition exists
El sumador medio
- Un sumador medio suma dos bits simples, $A$ y $B$, produciendo una suma $S$ y un acarreo $C$.
| A | B | S | C |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
- Lea las columnas: $S$ es 1 cuando exactamente una entrada es 1, lo cual corresponde a una XOR. $C$ es 1 solo cuando ambas son 1, lo cual corresponde a una AND. Por tanto, $S = A \oplus B$ y $C = A \cdot B$.
- Ignora cualquier acarreo entrante, por eso se llama solo "medio" y no puede encadenarse por sí solo.

Dos compuertas, y existe la adición binaria
The gates inside an adder · Las puertas dentro de un sumador
A half-adder's sum bit is an XOR gate and its carry is an AND gate — toggle A and B and watch the truth-table row light up. · El bit de suma de un medio sumador es una puerta XOR y su acarreo es una puerta AND; alterna A y B y observa cómo se ilumina la fila de la tabla de verdad.
In a half adder, the sum output S is produced by which gate? · En un medio sumador, ¿qué puerta produce la salida S de la suma?
$S = A \text{ XOR } B$ (1 when the inputs differ); the carry is $A \text{ AND } B$. · $S = A \text{ XOR } B$ (1 cuando las entradas son diferentes); el acarreo es $A \text{ AND } B$.
In a half adder the carry output C is produced by which single gate? · En un medio sumador, ¿qué puerta simple produce la salida C del acarreo?
C is 1 only when both inputs are 1, which is AND. The sum S is 1 when exactly one input is 1, which is XOR. · C es 1 solo cuando ambas entradas son 1, lo cual es AND. La suma S es 1 cuando exactamente una entrada es 1, lo cual es XOR.
The full adder
- A full adder adds three bits: $A$, $B$ and a carry-in, producing a sum and a carry-out. $S = A \oplus B \oplus C_{\text{in}}$.
- It can be built from two half adders plus an OR gate: the first half adder adds $A$ and $B$, the second adds that sum to the carry-in, and the OR combines the two carries.
- Chain full adders so that each carry-out feeds the next carry-in, and you have a multi-bit ripple-carry adder 行波进位加法器: four of them add two 4-bit numbers.
The carry is what has to travel, which is why it is called ripple
El sumador completo
- Un sumador completo suma tres bits: $A$, $B$ y un acarreo entrante, produciendo una suma y un acarreo saliente. $S = A \oplus B \oplus C_{\text{in}}$.
- Puede construirse con dos sumadores medios más una compuerta OR: el primer sumador medio suma $A$ y $B$, el segundo suma esa suma con el acarreo entrante, y la OR combina los dos acarreos.
- Encadene sumadores completos de modo que cada acarreo saliente alimente al siguiente acarreo entrante, y tendrá un sumador de propagación de acarreo (ripple-carry adder) de múltiples bits: cuatro de ellos suman dos números de 4 bits.

El acarreo es lo que debe viajar, por eso se le llama propagación
Match each building block to what it does. · Asocia cada bloque constructivo con lo que hace.
Adders add bits (chain full adders for multi-bit addition); flip-flops store a bit (the JK fixes the SR forbidden state). · Los sumadores suman bits (encadena sumadores completos para sumas de múltiples bits); los flip-flops almacenan un bit (el JK corrige el estado prohibido del SR).
How does a full adder differ from a half adder? · ¿Cómo difiere un sumador completo de un medio sumador?
A full adder adds A, B and a carry-in (so adders can be chained) — built from two half adders plus an OR gate. · Un sumador completo suma A, B y un acarreo de entrada (para que los sumadores puedan encadenarse) — construido a partir de dos medios sumadores más una puerta OR.
Worked example: why a full adder, not two half adders
- Explain why a 4-bit adder is built from full adders rather than half adders.
- Adding two 4-bit numbers column by column, every column except the rightmost may receive a carry from the column to its right, so it has three inputs to add, not two.
- A half adder has no carry-in, so it cannot take that third input, and the carry would simply be lost.
- Only the least significant column has no carry-in, so a half adder would do there; in practice all four are full adders, with the first carry-in tied to 0.
Ejemplo resuelto: por qué un sumador completo, no dos sumadores medios
- Explique por qué un sumador de 4 bits se construye con sumadores completos en lugar de sumadores medios.
- Al sumar dos números de 4 bits columna por columna, todas las columnas excepto la más a la derecha pueden recibir un acarreo de la columna a su derecha, por lo que tienen tres entradas para sumar, no dos.
- Un sumador medio no tiene acarreo entrante, por lo que no puede tomar esa tercera entrada, y el acarreo simplemente se perdería.
- Solo la columna menos significativa no tiene acarreo entrante, por lo que allí podría usarse un sumador medio; sin embargo, en la práctica se usan todos completos, con el primer acarreo entrante conectado a 0.
Why must a 4-bit adder use full adders rather than half adders? · ¿Por qué un sumador de 4 bits debe usar sumadores completos en lugar de medios sumadores?
A half adder does produce a carry; what it lacks is a carry-in, so it cannot accept the carry arriving from the previous column. · Un medio sumador sí produce un acarreo; lo que le falta es un acarreo de entrada, por lo que no puede aceptar el acarreo que llega de la columna anterior.
Put the construction of a 4-bit ripple-carry adder in order. · Coloca la construcción de un sumador de propagación de acarreo de 4 bits en orden.
Gates make a half adder, half adders make a full adder, full adders chain into a word-width adder. The carry rippling along is what gives it its name. · Las puertas forman un medio sumador, los medios sumadores forman un sumador completo, los sumadores completos se encadenan en un sumador de ancho de palabra. El acarreo que se propaga a lo largo es lo que le da su nombre.
Flip-flops
- A flip-flop is a bistable 双稳态 circuit: it has two stable states, 0 and 1, and it remembers the one it is in. It stores exactly one bit.
- It is the basic element of registers, where $n$ bits means $n$ flip-flops, of counters, and of SRAM 静态RAM cells.
- Unlike an adder, whose output depends only on its inputs now, a flip-flop's output depends on its past inputs. That is what memory means at the circuit level.
Flip-flops
- Un flip-flop es un circuito biestable: tiene dos estados estables, 0 y 1, y recuerda en cuál se encuentra. Almacena exactamente un bit.
- Es el elemento básico de los registros, donde $n$ bits significa $n$ flip-flops, de contadores y de celdas de SRAM.
- A diferencia de un sumador, cuya salida depende únicamente de sus entradas actuales, la salida de un flip-flop depende de sus entradas pasadas. Eso es lo que significa la memoria a nivel de circuitos.
A flip-flop is used to: · Un flip-flop se utiliza para:
A flip-flop has two stable states and holds one bit — the building block of registers and SRAM. · Un flip-flop tiene dos estados estables y mantiene un bit: el bloque constructivo de registros y SRAM.
A flip-flop is bistable — it has two stable states and remembers one bit — which makes it the building block of registers and SRAM. · Un flip-flop es bistable: tiene dos estados estables y recuerda un bit, lo que lo convierte en el bloque constructivo de registros y SRAM.
Chaining flip-flops gives registers and counters; SRAM cache is built from them (no refresh needed, unlike DRAM). · Encadenar flip-flops da registros y contadores; la caché SRAM está construida a partir de ellos (no necesita refresco, a diferencia de DRAM).
SR and JK
- An SR flip-flop SR触发器 has inputs S (set) and R (reset) and outputs $Q$ and $\overline{Q}$, built from two cross-coupled NOR gates.
S=1, R=0sets $Q$ to 1.S=0, R=1resets $Q$ to 0.S=0, R=0holds the current state, which is the memory.S=1, R=1is invalid: it asks for set and reset at once.- A JK flip-flop JK触发器 removes that flaw by giving the
1,1input a meaning: toggle 翻转, so the output flips to its opposite. That makes it ideal for counters 计数器, since a chain of toggling flip-flops counts in binary. - A JK is usually clocked: the inputs act only on a clock edge, which keeps every flip-flop in the machine in step.
The invalid input turned into a useful one
SR y JK
- Un flip-flop SR tiene entradas S (set/establecer) y R (reset/restablecer) y salidas $Q$ y $\overline{Q}$, construido a partir de dos compuertas NOR cruzadas.
S=1, R=0establece $Q$ en 1.S=0, R=1restablece $Q$ a 0.S=0, R=0mantiene el estado actual, que es la memoria.S=1, R=1es inválido: pide establecer y restablecer al mismo tiempo.- Un flip-flop JK elimina ese defecto asignando un significado a la entrada
1,1: toggle/cambio de estado, por lo que la salida cambia a su opuesto. Esto lo hace ideal para contadores, ya que una cadena de flip-flops con cambio de estado cuenta en binario. - Un JK suele estar sincronizado con reloj: las entradas actúan solo en un flanco del reloj, lo que mantiene a todos los flip-flops de la máquina en sincronía.

La entrada inválida convertida en una útil
For an SR flip-flop, which statements are correct? Select all · todos that apply. · Para un flip-flop SR, ¿cuáles afirmaciones son correctas? Selecciona todas las que correspondan.
Toggling on 1,1 is the JK's improvement. On an SR that input asks for set and reset at once and is invalid. · Invertirse en 1,1 es la mejora del JK. En un SR, esa entrada pide establecimiento y reinicio al mismo tiempo y es inválida.
The JK flip-flop's toggle behaviour is what makes it suitable for building counters. · El comportamiento de inversión del flip-flop JK es lo que lo hace adecuado para construir contadores.
A chain of flip-flops each toggling on its input counts in binary. Clocking them keeps every stage in step. · Una cadena de flip-flops que se invierten con su entrada cuenta en binario. Al sincronizarlos con reloj, se mantiene cada etapa en paso.
Worked example: trace an SR flip-flop
- $Q$ is currently 0. Give $Q$ after the inputs S=1 R=0, then S=0 R=0, then S=0 R=1.
- S=1, R=0 sets the output, so $Q$ becomes 1.
- S=0, R=0 holds, so $Q$ stays 1. This is the step that shows it is a memory: the inputs say nothing, and the output persists.
- S=0, R=1 resets, so $Q$ becomes 0. If S=1 and R=1 were applied, the answer is that the input is invalid, not a value.
Ejemplo resuelto: rastrear un flip-flop SR
- $Q$ es actualmente 0. Dé $Q$ después de las entradas S=1 R=0, luego S=0 R=0, luego S=0 R=1.
- S=1, R=0 establece la salida, así que $Q$ se vuelve 1.
- S=0, R=0 mantiene, así que $Q$ permanece en 1. Este paso demuestra que es una memoria: las entradas no dicen nada y la salida persiste.
- S=0, R=1 restablece, así que $Q$ se vuelve 0. Si se aplicaran S=1 y R=1, la respuesta sería que la entrada es inválida, no un valor.
Marks that slip away
- $S = A \oplus B$ and $C = A \cdot B$: XOR for the sum, AND for the carry. Swapping them loses both marks.
- "Half" means no carry-in, not "half the bits".
- A full adder is two half adders plus an OR, and the OR combines the two carries.
- On an SR flip-flop,
0,0holds and1,1is invalid. The JK's improvement is that1,1toggles.
Puntos que se pierden fácilmente
- $S = A \oplus B$ y $C = A \cdot B$: XOR para la suma, AND para el acarreo. Intercambiarlos pierde ambos puntos.
- "Medio" significa sin acarreo entrante, no "la mitad de los bits".
- Un sumador completo es dos sumadores medios más una OR, y la OR combina los dos acarreos.
- En un flip-flop SR,
0,0mantiene y1,1es inválido. La mejora del JK es que1,1cambia de estado.
You've got it
- half adder: two bits in, $S = A \oplus B$ from an XOR and $C = A \cdot B$ from an AND; no carry-in
- full adder: three bits in, built from two half adders plus an OR; chain them, carry-out to carry-in, for a ripple-carry adder
- a flip-flop is bistable and stores one bit; $n$ flip-flops make an $n$-bit register, and they are the cells of SRAM
- SR: set, reset,
0,0holds,1,1invalid · JK:1,1toggles, which is what makes counters, and it is clocked to stay synchronised
Lo has entendido
- Sumador medio: dos bits de entrada, $S = A \oplus B$ desde una XOR y $C = A \cdot B$ desde una AND; sin acarreo entrante.
- Sumador completo: tres bits de entrada, construido a partir de dos sumadores medios más una OR; encadénelos, acarreo saliente a acarreo entrante, para un sumador de propagación de acarreo.
- Un flip-flop es biestable y almacena un bit; $n$ flip-flops forman un registro de $n$ bits, y son las celdas de SRAM.
- SR: set, reset,
0,0mantiene,1,1inválido · JK:1,1cambia de estado, lo cual es lo que hace posibles los contadores, y está sincronizado con reloj para mantenerse coordinado.