![]() ![]() The value is frozen, or latched, until we set E to ‘1’ again. When we assign ‘0’ to the E input, the Q output will stop reacting to changes on D. That’s why the D latch is often called a transparent latch. ![]() Synthesis tools look for specific types of patterns in Verilog code to infer sequential logic. We can say that the latch is transparent as long as the enable input is active. A reg only infers a flip-flop when the always block describes sequential logic elements may be simple wires or delay elements) Synchronous sequential logic state changes occur in lock step across all storage elements (using a periodic waveform to trigger. In this case, defining a reg type does not result in a flip-flop. Winter 2015 CSE390C - VI - Sequential Verilog 20 Forms of sequential logic Asynchronous sequential logic state changes occur whenever state inputs change (seq. There is no such requirement for continuous assignments. In (a), the o signal must be a reg type since it is assigned inside a procedural logic block. However, if your combinational logic were more complicated, the procedural approach might be easier to understand. We’ll see that a memory element can be unintentionally inferred from either an incomplete if statement or incomplete signal assignments within an if. This article will focus on incomplete if statements. For such simple logic, it is preferable to use (b) because it uses less code and it is easier to understand. In my previous article, Sequential VHDL: If and Case Statements, we looked at some examples of the if statement. In this simple case, there is no "correct" way they are 2 different styles to achieve the same functionality. They use 2 different styles of modeling: (a) uses a procedural assignment because it uses an always block, whereas (b) uses a continuous assignment because there is no always block and it uses the assign keyword. This means that they will simulate the same way and they will infer the same logic when synthesized. Your (a) and (b) codes are functionally equivalent. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |