T
TigerJade
Guest
Hi,
I'm thinking about to write a N-input AND gate like this:
signal A : std_logic_vector(N-1 downto 0)
process (A)
variable result: std_logic;
begin
result := '1';
for i in N-1 downto 0 loop
result := result and A(i);
end loop;
Y <= result;
end process;
But this type of implementation has propagation delay of N AND gates. I
believe a tree type of AND gates will have only propagation delay of
log2(N), which is a significant reduction if N is large, although the
number of AND gates is the same.
Is it possible using some loop or generate statements to produce a
tree-type N-input AND gate, which is suitable for for all values of N,
or even just N = any power of 2.
Regards,
TJ
I'm thinking about to write a N-input AND gate like this:
signal A : std_logic_vector(N-1 downto 0)
process (A)
variable result: std_logic;
begin
result := '1';
for i in N-1 downto 0 loop
result := result and A(i);
end loop;
Y <= result;
end process;
But this type of implementation has propagation delay of N AND gates. I
believe a tree type of AND gates will have only propagation delay of
log2(N), which is a significant reduction if N is large, although the
number of AND gates is the same.
Is it possible using some loop or generate statements to produce a
tree-type N-input AND gate, which is suitable for for all values of N,
or even just N = any power of 2.
Regards,
TJ