Altera_Forum
Honored Contributor
14 years agoA shift register question ?
Hi, I am required to write the VHDL code for a 4-bit shift register with active-high clock and asynchronous preset. Below is the architecture declaration.
architecture operation of shiftreg is
signal regs : std_logic_vector((n-1) downto 0); -- note: n = 4
begin
process(PRESET, CLK)
begin
if (PRESET = '1') then
regs <= (others => '1');
elsif (CLK = '1' and CLK' event) then
regs <= regs((n-2) downto 0) & SI;
end if;
end process;
PO <= regs;
end architecture operation; Check the .jpg file that I attached. Anybody can explain why the PO output is HIGH even though the input is LOW at the beginning? Thank you in advance. *edit* Never mind, I figured out why, thanks for looking.