Mudanças entre as edições de "Circuito Somador Carry Ripple - Pedroni"
Ir para navegação
Ir para pesquisar
Linha 49: | Linha 49: | ||
! colspan="1" style="background: #efefef;" | Potência (mW) | ! colspan="1" style="background: #efefef;" | Potência (mW) | ||
|- | |- | ||
− | | 4 || 20 || 8.806 || | + | | 4 || 20 || 8.806 || <math> \downarrow </math> b[0] -> <math> \downarrow </math> cout || 131.41 |
|- | |- | ||
| 8 || 20 || || || 131.41 | | 8 || 20 || || || 131.41 | ||
Linha 58: | Linha 58: | ||
|- | |- | ||
|} | |} | ||
+ | |||
+ | <math> \uparrow </math> |
Edição das 18h24min de 8 de dezembro de 2015
Estrutura
- Unidades de somadores completos (FAs) conectadas em série através do carry out.
- Possui um processo sensível as entradas a, b e carry in. Incrementa as funções de propagação da saída e do carry out através de um for loop.
Código VHDL
--Book: Pedroni/488
--8 bits
library ieee;
use ieee.std_logic_1164.all;
entity carry_ripple_adder is
generic (n: integer := 8); --number of bits
port (a,b : in std_logic_vector (n-1 downto 0);
cin: in std_logic;
s: out std_logic_vector (n-1 downto 0);
cout: out std_logic);
end carry_ripple_adder;
architecture structure of carry_ripple_adder is
begin
process (a,b,cin)
variable carry: std_logic_vector (n downto 0);
begin
carry(0) := cin;
for i in 0 to n-1 loop
s(i) <= a(i) xor b(i) xor carry(i);
carry(i+1) := (a(i) and b(i)) or (a(i) and carry(i)) or (b(i) and carry(i));
end loop;
cout <= carry(n);
end process;
end architecture;
Testbench
- Código
- Resultado (print)
Simulações
Nº Bits | ALMs | Delay | Caminho Critico | Potência (mW) |
---|---|---|---|---|
4 | 20 | 8.806 | b[0] -> cout | 131.41 |
8 | 20 | 131.41 | ||
32 | 80 | 162.19 | ||
128 | 320 | 227.90 |