czh306

导航

<2006年10月>
24252627282930
1234567
891011121314
15161718192021
22232425262728
2930311234

统计

常用链接

留言簿(2)

随笔分类

随笔档案

搜索

最新评论

阅读排行榜

评论排行榜

二进制码与格雷码的转换(Verilog实现)

module Bin2Grad(BinCode, GradCode);
parameter Code_Width = 8;
input [Code_Width - 1 : 0] BinCode;
output [Code_Width - 1 : 0] GradCode;

integer i;
reg [Code_Width - 1 : 0] GradCode;
always @(BinCode)
    begin
        for (i = 0; i < Code_Width - 1; i = i +1)
            begin
                GradCode[i] = BinCode[i] + BinCode[i + 1];
            end
        GradCode[Code_Width - 1] = BinCode[Code_Width - 1];
    end

endmodule

posted on 2008-10-14 14:42 czh306 阅读(1200) 评论(0)  编辑 收藏 引用 所属分类: Verilog


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理