曼彻斯特编码器的vhdl实现代码

[plain]  view plain copy print ? 在CODE上查看代码片 派生到我的代码片
  1. library IEEE;  
  2. use IEEE.STD_LOGIC_1164.ALL;  
  3.    
  4. entity manchester_encode is  
  5.     Port ( clk : in  STD_LOGIC;  
  6.            data_in : in  STD_LOGIC;  
  7.            data_out : out  STD_LOGIC);  
  8. end manchester_encode;  
  9. architecture Behavioral of manchester_encode is  
  10. signal count:std_logic_vector(1 downto 0);  
  11. type work_type is (init,working);  
  12. signal work_st : work_type:=init;  
  13. begin  
  14. process (clk)  
  15. begin  
  16.  if clk'event and clk='1' then  
  17.   if data_in='1' then  
  18.    count<="01";  
  19.   else  
  20.    count<="10";  
  21.   end if;  
  22.  end if;  
  23. end process;  
  24. process(clk)  
  25. begin   
  26.    if clk'event and clk='1' then  
  27.       if work_st=working then  
  28.          data_out<=count(1);  
  29.          work_st<=init;  
  30.       else  
  31.          data_out<=count(0);  
  32.          work_st<=working;  
  33.       end if;  
  34.    end if;  
  35.  end process;  
  36.   
  37. end Behavioral;  
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值