bzrk89
bzrk89

Reputation: 55

How many Flip Flops will this code produce?

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;

Upvotes: 2

Views: 4681

Answers (1)

user1818839
user1818839

Reputation:

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

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.

Upvotes: 2

Related Questions