网站首页
IC库存
IC展台
电子资讯
技术资料
PDF文档
我的博客
IC72论坛
ic72 logo
资料首页最新产品 技术参数 电路图 设计应用 解决方案 代理商查询 IC替换 IC厂商 电子辞典
关键字: 技术文章 PDF资料 IC价格 电路图 代理商查询 IC替换 IC厂商 电子辞典

格雷码计数器用vhdl怎样实现?

variable count:std_logic_vector(3 downto 0);
if clk'event and clk='1' then
case count is
when "0000"=>count:="0001";
when "0001"=>count:="0011";
when "0011"=>count:="0010";
when "0010"=>count:="0110";
when "0110"=>count:="0111";
when "0111"=>count:="0101";
when "0101"=>count:="0100";
when "0100"=>count:="1100";
when "1100"=>count:="1101";
when "1101"=>count:="1111";
when "1111"=>count:="1110";
when "1110"=>count:="1010";
when "1010"=>count:="1011";
when "1011"=>count:="1001";
when "1001"=>count:="1000";
when "1000"=>count:="0000";
when others=>count:="0000";
end case;
end if;

经典做法:
gray code --> general code --> gray code

自然码转格雷码
library IEEE;
use IEEE.std_logic_1164.all;

entity norm2grey is
generic (width: integer := 8);
PORT (
norm: in std_logic_vector(width - 1 downto 0);
grey: out std_logic_vector(width - 1 downto 0)
);
end norm2grey;

architecture behav of norm2grey is
begin
grey <= norm xor ('0' & norm(width - 1 downto 1));
end behav;


热门搜索:2320335 PS120406 2882828 TLP606B PM6NS PS480806 2839240 2320306 PDU1215 2838283 TLM825SA TLP404 PDU1220 2920078 02C1001JF TRAVELER3USB UL17CB-15 BSV52R BTA12-800TWRG UL24CB-15 02M0500JF PS-415-HG-OEM 2839648 PDU2430 02B1001JF
COPYRIGHT:(1998-2010) IC72 达普IC芯片交易网
客户服务:service@IC72.com 库存上载:IC72@IC72.com
(北京)联系方式: 在线QQ咨询:点击这里给我发消息 联系电话:010-82614113 传真:010-82614123
京ICP备06008810号-21 京公网安备 11010802032910 号 企业资质