Let's say I have this design for example:
library ieee;
use ieee.std_logic_1164.all;
entity adder is
port(x : in std_logic_vector(3 downto 0);
y : in std_logic_vector(3 downto 0);
z : out std_logic_vector(4 downto 0));
end entity adder;
architecture rtl of adder is
signal c : std_logic_vector(3 downto 0);
begin
adder_gen : for i in 0 to 4 generate
half_adder_gen : if i = 0 generate
z(i) <= x(i) xor y(i);
c(i) <= (x(i) and y(i));
end generate half_adder_gen;
full_adder_gen : if 0 < i and i < 4 generate
z(i) <= x(i) xor y(i) xor c(i-1);
c(i) <= (x(i) and y(i)) or ((x(i) or y(i)) and c(i-1));
end generate full_adder_gen;
overflow_gen : if i = 4 generate
z(i) <= c(i-1);
end generate overflow_gen;
end generate;
end architecture rtl;
Usually if I run a design like this what I see in the waveform is that ALL the bits of the output changes instantaneously as soon as the input bits change as well. However this behaviour is not what I expect in this case, I would expect that the output bits y(4) ... y(0)
changes when the value of c(i)
is known, but such bit depends on the c(i-1)
and so on... Is there something I'm miss understanding?