rotate.vhd
来自「一本老师推荐的经典的VHDL覆盖基础的入门书籍」· VHDL 代码 · 共 26 行
VHD
26 行
library ieee;
use ieee.std_logic_1164.all;
entity rotate is
port (q: buffer std_logic_vector (7 downto 0);
data: in std_logic_vector (7 downto 0);
clk, rst, r_l: in std_logic);
end rotate;
architecture rotate_design of rotate is
-- rotates bits or loads
-- when r_l is high, it rotates; if low, it loads data
begin
process (clk, rst)
begin
if rst = '1' then
q <= X"00";
elsif rising_edge(clk) then
if r_l = '1' then
q <= q ( 6 downto 0 ) & q (7) ;
else
q <= data;
end if;
end if;
end process;
end rotate_design;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?