entity TestRun01 is
Port ( Clk : in STD_LOGIC;
Din : in STD_LOGIC;
Dout : out STD_LOGIC_vector(11 downto 0));
end TestRun01;
architecture Behavioral of TestRun01 is
signal regr : std_logic_vector(11 downto 0) :="000000000010";
signal reg : std_logic;
begin
process(Clk,reg)
begin
if falling_edge(CLK) then
if Din ='1' then
reg <='1';
elsif Din='0' then
reg <='0';
else
reg <= reg;
end if;
regr(0)<=reg;
regr<=regr(10 downto 0) & '0';
end if;
end process;
Dout<=regr;
end Behavioral;
¿porquésolocambia'0'alregistrodedesplazamiento?
sicambioelcódigode
regr(0)<=reg;regr<=regr(10downto0)&'0';
a
regr<=regr(10downto0)&'0';regr(0)<=reg;
elpuntodereferenciamuestra