Mudanças entre as edições de "Circuito Somador Carry Ripple - Pedroni"
Ir para navegação
Ir para pesquisar
Linha 44: | Linha 44: | ||
! colspan="1" style="background: #efefef;" | ALMs | ! colspan="1" style="background: #efefef;" | ALMs | ||
! colspan="1" style="background: #efefef;" | Delay | ! colspan="1" style="background: #efefef;" | Delay | ||
− | ! colspan="1" style="background: #efefef;" | Potência | + | ! colspan="1" style="background: #efefef;" | Potência (mW) |
|- | |- | ||
− | | | + | | 8 || 20 || x || 131.41 |
|- | |- | ||
− | | | + | | 32 || 80 || x || 162.19 |
|- | |- | ||
− | | | + | | 128 || 320 || x || 227.90 |
|- | |- | ||
| x || x || x || x | | x || x || x || x | ||
|- | |- | ||
|} | |} |
Edição das 19h27min de 5 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
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 | Potência (mW) |
---|---|---|---|
8 | 20 | x | 131.41 |
32 | 80 | x | 162.19 |
128 | 320 | x | 227.90 |
x | x | x | x |