InícioEletrônica e CircuitosSomador de 8 Bits

➕ Somador de 8 Bits

Somador de acarreio propagado (ripple-carry) de 8 bits interativo. Alterne bits individuais de dois números binários e veja a cadeia de carry se propagar por 8 estágios de somador completo. Mostra resultados em binário, hexadecimal e decimal.

Eletrônica e Circuitos3DFácil60 FPS
8bit-adder ↗ Abrir separadamente

🔢 Somador de 8 Bits com Acarreio Propagado

Uma visualização interativa de um somador de 8 bits com acarreio propagado — o bloco fundamental da unidade lógica e aritmética de qualquer CPU. Alterne bits, observe o carry se propagar e veja os resultados em binário, hexadecimal e decimal atualizando ao vivo.

🔬 O Que Demonstra

Como um somador completo calcula a soma e o carry de saída a partir de dois bits de entrada e um carry de entrada, encadeando oito estágios para que cada carry se propague para o próximo. O caminho crítico pela cadeia de carry determina a velocidade máxima de clock do somador.

🎮 Como Usar

Clique nos bits individuais de A e B para alterná-los entre ligado e desligado. Observe a cadeia de carry piscar pelos 8 estágios. Leia o resultado final em binário, hexadecimal e decimal abaixo do circuito.

💡 Você Sabia?

O somador com acarreio propagado é o projeto de somador binário mais simples, mas sua propagação de carry O(n) limita a velocidade. CPUs modernas usam somadores carry-lookahead ou Kogge–Stone que calculam todos os carries em tempo O(log n).

Sobre o Somador de 8 Bits com Acarreio Propagado

Esta simulação modela um somador de 8 bits com acarreio propagado, o núcleo aritmético da ALU de uma CPU. Ele encadeia oito estágios idênticos de somador completo, um por posição de bit. Cada estágio calcula um bit de soma e um carry de saída a partir de dois bits de entrada e um carry de entrada, usando as equações booleanas S = A ⊕ B ⊕ Cₜₙ e Cₒₕₜ = (A·B) + (B·Cₜₙ) + (A·Cₜₙ). O carry se propaga do bit 0 ao bit 7.

Clique nos botões de bit nos painéis Entrada A e Entrada B para alternar cada bit entre 0 e 1; o valor decimal de cada operando é atualizado ao vivo. O painel Soma mostra o resultado como uma string binária de 9 bits, decimal, hexadecimal e um indicador de overflow (o carry de saída do bit 7). Os botões Reiniciar e Aleatório definem os operandos. Somadores como este sustentam toda soma, subtração e cálculo de endereço que um processador executa.

Perguntas Frequentes

What is a ripple-carry adder?

A ripple-carry adder is a digital circuit that adds two binary numbers by connecting a chain of full adders, one for each bit. The carry produced by each stage feeds into the next, so the carry signal "ripples" along the chain from the least significant bit to the most significant. This simulation uses eight such stages to add two 8-bit numbers.

What is the difference between a half adder and a full adder?

A half adder adds just two input bits and produces a sum and a carry, but it cannot accept an incoming carry. A full adder adds three bits, the two operands plus a carry-in, which is what lets stages be chained together. This adder is built entirely from full adders so carries can propagate.

How does a single full-adder stage work?

Each stage computes the sum bit as S = A ⊕ B ⊕ Cₜₙ, the exclusive-OR of the two input bits and the carry-in. The carry-out is Cₒₕₜ = (A·B) + (B·Cₜₙ) + (A·Cₜₙ), which is 1 whenever at least two of the three inputs are 1. That carry-out becomes the carry-in for the next bit.

What do the controls on this page do?

The Input A and Input B panels each show eight bit buttons running from bit 7 down to bit 0; clicking one toggles it between 0 and 1. The Sum panel displays the result in binary, decimal and hex, plus an overflow indicator. The Reset button clears both numbers to zero, and the Random button fills both with random bits.

Why is the binary result shown with 9 bits?

Adding two 8-bit numbers can produce a value larger than 255, the maximum an 8-bit register holds. The extra ninth bit captures the final carry out of bit 7. Since each operand can reach 255, the largest possible sum is 510, which needs nine bits to represent fully.

What does the overflow flag mean here?

The overflow flag shows the carry out of the most significant bit, labelled C₈. When the unsigned sum exceeds 255 it sets to "Yes (C₈=1)", meaning the answer no longer fits in 8 bits. In a real CPU this carry bit is stored in the status register and used for multi-byte arithmetic and comparisons.

Is this an accurate model of how a CPU adds numbers?

Yes, the logic is faithful: it implements true full-adder Boolean equations and a left-to-right carry chain exactly as a hardware ripple-carry adder would. The main simplification is timing; the animation flashes the carry path for clarity rather than reproducing real gate propagation delays measured in nanoseconds.

Why is the ripple-carry adder considered slow?

Because each stage must wait for the carry from the stage below it, the worst-case delay grows linearly with the number of bits, giving O(n) propagation time. For wide words this critical path through the carry chain limits how fast the circuit can be clocked.

What faster adder designs exist?

Carry-lookahead adders compute carries in parallel from generate and propagate signals, reaching all carries in roughly O(log n) time. Other fast designs include carry-select, carry-save, and parallel-prefix adders such as Kogge-Stone, all of which trade extra logic for shorter delay. Modern processors rely on these instead of plain ripple-carry.

How does this relate to subtraction?

Computers subtract by adding the two's complement of the second operand: invert its bits and add 1. The same adder hardware handles subtraction once the input is negated, which is why a single ripple-carry adder, combined with inverters and a carry-in, can perform both addition and subtraction in an ALU.

⚙ Por trás dos panos

Somador de 8 bits com acarreio propagado com botões interativos de alternância de bits. Visualiza a propagação da cadeia de carry pelos 8 estágios de somador completo. Exibe o resultado em binário, hexadecimal e decimal.

Canvas 2DBinary AdderRipple CarryDigital LogicALU

3D · Renderizador Three.js / WebGL · meta de 60 FPS · roda totalmente no navegador, sem instalação

What did you find?

Add reproduction steps (optional)