zoukankan      html  css  js  c++  java
  • Altera Coding Style 之 比较器

    一、两种情况

    比较器的使用可以归类为2种情况:== 和 <。不等于和大于实际上只是上述的一个反运算。

    … The == comparator is implemented in general logic cells. The < comparator can be implemented using the carry chain or general logic cells.

    ==会综合成组合逻辑,<可能综合成组合逻辑,也可能综合成进位链。

    二、优劣比较

    独立测试时,进位链会比组合逻辑快;但是在大的工程当中,由于约束的关系,进位链的结构有时反而显得慢。

    对于 6-input 的ALUT,每次可以比较3比特;对于 4-input LUT,每次只能比较1比特。

    三、风格引导

    1、综合成组合逻辑

          wire [6:0] a, b;

          wire alb = a < b;

    2、综合成进位链

          wire [6:0] a, b;

          wire [7:0] tmp = a – b;

          wire alb = tmp[7];

          显然,alb 为1时说明a比b小。

           还有这样一段话:

           … If you have any information about the range of the input, you have “don’t care” values that you can use to optimize the design. Bacause this information is not available to the synthesis tool, you can often reduce the device area required to implement the comparator with specific hand implementation of the logic.

    四、一个例子

            确定数值范围的例子:

    T`7EKD(M]K40F%DI9TI5F{S

     

  • 相关阅读:
    360安全浏览器发布
    搬家了
    驾驶员考试科目一通过
    脑海中总有些新念头
    2008汤姆斯杯尤伯杯羽毛球赛事直播时刻表
    操作日期和时间
    数据库设计中的14个技巧
    字段属性(空值、缺省值、标记字段/自增字段)
    SQL触发器
    数据库质疑事件 总结
  • 原文地址:https://www.cnblogs.com/freshair_cnblog/p/2642504.html
Copyright © 2011-2022 走看看