私はVHDLの初心者です。VHDL を使用してシリアル イン シリアル アウト 72 ビット シフト レジスタを実装しています。イネーブル信号がハイの場合、イネーブルがハイまたはローのどちらであるかに関係なく、シフト レジスタを 72 回シフトさせたいと考えています。イネーブルが高い場合にのみ機能する次のコードを作成しました。イネーブルが高くなると、データをシフトするためにイネーブルに依存しなくなり、データをシフトするのを手伝ってくれる人はいますか?
library ieee;
use ieee.std_logic_1164.all;
entity SR is
port(clk, din, rst, enable : in std_logic;
sr_out : inout std_logic_vector(71 downto 0));
end SR;
architecture behavioral of SR is
signal shift_reg: std_logic_vector(71 downto 0);
begin
process (clk, rst)
begin
if (rst = '0') then
shift_reg <= (others => '0');
elsif (clk'event and clk = '1') then
if enable= '1' then
shift_reg(70 downto 0) <= shift_reg(71 downto 1);
shift_reg(71) <= din;
end if;
end if;
end process;
sr_out <= shift_reg;
end behavioral;
どうもありがとう!