欢迎来到天天文库
浏览记录
ID:45099869
大小:78.51 KB
页数:3页
时间:2019-11-09
《vhdl巴克码发生和检测“01110010”》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、巴克码发生器“01110010”libraryieee;useieee.std_logic_1164.all;useieee.std_logic_unsigned.all;entitybak1isport(clk,reset:instd_logic;dout:outstd_logic);endbak1;architectureaofbak1issignalcount:std_logic_vector(2downto0);signaltmp1:std_logic;begindout<=tmp1;process(clk,reset)be
2、ginifreset='0'thencount<=(others=>'0');elsifrising_edge(clk)thencount<=count+1;casecountiswhen"000"=>tmp1<='0';when"001"=>tmp1<='1';when"010"=>tmp1<='1';when"011"=>tmp1<='1';when"100"=>tmp1<='0';when"101"=>tmp1<='0';when"110"=>tmp1<='1';when"111"=>tmp1<='0';whenothers=
3、>tmp1<='0';endcase;endif;endprocess;enda;巴克码检测器“01110010”libraryieee;useieee.std_logic_1164.all;entityJianMaQiisport(data,clk,reset:instd_logic;dout:outstd_logic);end;architectureaofJianMaQiissignalq0,q1,q2,q3,q4,q5,q6,q7:std_logic;beginprocess(clk,data,reset)beginif(c
4、lk'eventandclk='1')thenq0<=data;q1<=q0;q2<=q1;q3<=q2;q4<=q3;q5<=q4;q6<=q5;q7<=q6;endif;endprocess;process(clk)variableq:std_logic;beginq:=(notq7)andq6andq5andq4and(notq3)and(notq2)andq1and(notq0);dout<=qandreset;endprocess;end;
此文档下载收益归作者所有