1、巴克码发生器“01110010”library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity bak1 isport(clk,reset: in std_logic;dout:out std_logic);end bak1;architecture a of bak1 issignal count :std_logic_vector(2 downto 0);signal tmp1:std_logic;begindout0);elsif rising_edge(clk) thencounttmp1t
2、mp1tmp1tmp1tmp1tmp1tmp1tmp1tmp1=0;end case;end if;end process;end a;巴克码检测器“01110010”library ieee;use ieee.std_logic_1164.all;entity JianMaQi isport(data,clk,reset:in std_logic;dout:out std_logic);end;architecture a of JianMaQi issignal q0,q1,q2,q3,q4,q5,q6,q7: std_logic;beginprocess(clk,data,reset)beginif(clkevent and clk=1) thenq0=data;q1=q0;q2=q1;q3=q2;q4=q3;q5=q4;q6=q5;q7=q6;end if;end process;process(clk)variable q:std_logic;beginq:=(not q7)and q6 and q5 and q4 and (not q3) and (not q2) and q1 and (not q0);dout=q and reset;end process;end;