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

     

  • 相关阅读:
    Individual Reading Assignment
    Individual P1: Summary
    Individual P1: Preparation
    M1m2分析报告
    第二次阅读作业--12061161 赵梓皓
    代码互审报告
    结对编程————电梯整理报告
    读书问题之《编程之美》 -----12061161 赵梓皓
    SE Class's Individual Project--12061161 赵梓皓
    博客测试
  • 原文地址:https://www.cnblogs.com/freshair_cnblog/p/2642504.html
Copyright © 2011-2022 走看看