此代码将产生多少人字拖? [英] How many Flip Flops will this code produce?

查看:32
本文介绍了此代码将产生多少人字拖?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我要考试了,我正在解题.其中一个问题非常基本,但我认为我没有确切的逻辑.它只是给了我一小段代码,并询问这将产生多少人字拖.你能帮我理解如何找到这个吗?谢谢!

so I have an exam coming up and I am solving tutes. One of the questions is very basic but I don't think I have the exact logic down for it. It simply gives me a small bit of the code and asks how many Flip Flops will this produce. Could you help me understand how I can find this out? Thanks!

Architecture rtl of ex is
    signal a,b,q, int: bit_vector(3 downto 0);
begin
    process(clk)
    begin
        If  clk = '1' and clk'event then 
            int <= int +1;     
            q <=int;
            a <= b xor q;
        end if;
    end process; 
    b <= int
end;

推荐答案

好的,这是正确但很尖刻的答案,但需要注意的是,这几乎肯定不是问题所要求的.

OK, here's the correct - but snarky - answer, with the caveat that it is almost certainly not what the question calls for.

鉴于上面的架构声明,很明显,除了内部信号之外没有任何分配.我们没有显示实体声明,但从架构中我们可以假设至少有一个名为 clkInput 端口.可能有也可能没有输出;我们不能说,但是它们无关紧要,因为没有分配给它们.

Given the above Architecture declaration, it is clear that there are no assignments to anything other than internal signals. We are not shown the Entity declaration, but from the Architecture we can assume at least an Input port named clk. There may or may not be outputs; we cannot tell, however they are irrelevant as there are no assignments to them.

因此上述架构不会影响任何输出,因此在综合的逻辑最小化阶段将被完全修剪,并且不会产生任何触发器.

Therefore the above architecture cannot affect any outputs, so it will be entirely trimmed during the Logic Minimisation phase of synthesis, and generate no Flipflops whatsoever.

这篇关于此代码将产生多少人字拖?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆