Question: All FPGAs include flip - flops that are available for implementing a user's circuit. We will show how to make use of these flip -
All FPGAs include flipflops that are available for implementing a user's circuit. We will show how to make
use of these flipflops in Part IV of this assignment. But first we will show how storage elements can be
created in an FPGA without using its dedicated flipflops. Fig. depicts a gated D latch circuit. Two styles
of Verilog code that can be used to describe this circuit are given in Fig. Part a of the figure specifies the
latch by instantiating logic gates, and part b uses logic expressions to create the same circuit. If this latch
is implemented in an FPGA that has input lookup tables LUTs then only one lookup table is needed.
Fig. a Instantiating logic gates for the D latch.
Fig. b Specifying the D latch by using logic expressions
Although the latch can be correctly realized in one input LUT, this implementation does not allow its
internal signals, such as g and g to be observed, because they are not provided as outputs from the
LUT. To preserve these internal signals in the implemented circuit, it is necessary to include a compile
directive in the code. In Fig. the directive is included to instruct the Quartus II
compiler to use separate logic elements for each of the signals Rg SgQa and Qb Compiling the code
produces the circuit with four LUTs, one for each assign statement.
Fig. shows a circuit with three different storage elements: a gated D latch, a positiveedge triggered D
flipflop, and a negativeedge triggered D flipflop. Implement and simulate the circuit in Fig. by using the Quartus Il software as follows: The project for this part is provided in the starter kit. Open the project named port in the port subdirectory to begin your work Write a Verilog file that instantiates the three storage elements. For this part you should no longer include the synthesis keep directive in your Verilog code, because you will not be describing the exact structure of flipflops. Instead, you should use a style of Verilog code that will allow the Verilog compiler in the Quartus II software to automatically instantiate flipflops that are provided as part of the FPGA logic elements. Such Verilog code is often called behavioral code, because it specifies a desired circuit behavior rather than an exact circuit structure. As an example, Fig. gives a behavioral style of Verilog code that specifies the gated D latch in Fig. This latch can be implemented in one input lookup table. Use a similar style of code to specify the flipflops in Fig. Compile your project You may wish to use the Quartus Technology Map Viewer to examine the compiled circuit, by using the command Tools Netlist Viewer Technology Map Viewer Create a Vector Waveform File vwf which specifies the inputs and outputs of the circuit. You need to show it in the report. Draw the inputs D and Clock as indicated in Fig. Use functional simulation to obtain the three output signals. Observe the different behavior of the three storage elements. Also you can simulate your circuit in Modelsim softwaremodule D latch D Clk Q;input D Clk;output reg Q:always @ D Clkif ClkQD;endmoduleFig. A behavioral style of Verilog code that specifies a gated D latch
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
