This document is formatted in Rich Text (html). It contains a couple of images (ascii art). If you read it as plain text you are not able to see the images which require monospaced fonts (terminal).
Top posting because of the long rich text format post.
It *is* safe to assume that no latch is inferred when there's already a = flop that stores the value.
The latches in combinatorial equations are because the LHS or = combinatorial output relies on itself as a combinatorial input in the = RHS. In sequential logic, the new register value depends on the onld = register value and nowhere tries to assign the new value based on the = new value which *would* generate a latch.
Your figure B always holds true always because the implied "q
It *is* safe to assume that no latch is inferred when there's already = a flop that stores the value.
The latches in combinatorial equations are because the LHS or = combinatorial output relies on itself as a combinatorial input in the = RHS. In sequential logic, the new register value depends on the onld = register value and nowhere tries to assign the new value based on the = new value which *would* generate a latch.
Your figure B always holds true always because the implied "q
Thanks for your reply. In any case, avoiding the double branch is what i was looking for. I wanted to omit the "else" and safely hand data to a flip flop.
Actually, most FPGA synthesizers will implement the register and mux as a clock enabled register (which incorporates the mux and the register as you stated, but is a primitive that does not consume a LUT for the mux).
I really wish the advise "don't use an if without an else" in combinatorial logic had never been given. There are a couple of much more effective and verifiable ways to eliminate the possibility of inferring a latch:
First, use clocked processes for everything, and include the logic in the clocked process. No combinatorial processes, no latches. There are lots of ways to avoid using combinatorial processes in virtually any circumstance (except when an entity has a completely combinatorial path from input to output), and using variables helps a lot.
Second, if you HAVE to use a combinatorial process, assign a default value to every signal driven by the process, right up front in the process, before anything else happens. It is MUCH easier to see and verify that every driven signal is in that default list, than it is to verify that every if contains an else AND that anything assigned in the if is also assigned in the else.
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.