czh306

导航

<2008年10月>
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

统计

常用链接

留言簿(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 阅读(1195) 评论(0)  编辑 收藏 引用 所属分类: Verilog


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