library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity sipo is
port(rst,din,clk:in std_logic;
dout:out std_logic_vector(1 downto 0));
end sipo;
architecture behav of sipo is
signal q:std_logic_vector(1 downto 0);
begin
process(clk,q,din,rst)
variable t:integer range 1 to 3;
begin
if rst='1' then dout<="00";
else if (t=3)then
t:=1;
dout<=q;
elsif(clk'event and clk='1')then
t:=t+1;
q(0)<=din;
q(1)<=q(0);
end if;
end if;
end process;
end behav;
uj5u.com熱心網友回復:
t帖子內容是?轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/45686.html
標籤:硬件設計
