To create the framework of a Verilog Design File for the hvalues
block, follow these steps:
Select the hvalues
block.
Choose Create Design File from Selected Block (right button pop-up menu). The Create Design File from Selected Block dialog box appears.
Under File type, select Verilog HDL.
Make sure Add the new design file to the current project is turned on.
Make sure the File name box shows the hvalues.v file in the fir_filter project directory.
Click OK. The Quartus II software confirms that the file has been generated successfully and automatically opens a Text Editor window that contains the new file. The Quartus II software generates the file shown below, which includes a template for a module declaration containing port declarations that correspond to the data you entered in the block:
You may notice a few pairs of Quartus II-generated comments that start with "ALTERA " and end with "DO NOT REMOVE THIS LINE! " The Quartus II software updates the information between these pairs of comments, so you must not enter text between them. However, you can enter other Verilog HDL statements outside these commented sections. |
Add the following lines to the hvalues.v file to implement the design. Insert these lines just before the endmodule
statement:
reg [2:0]h; always @(sel) case (sel) 2'b 00 : h = 3'b 111; 2'b 01 : h = 3'b 101; 2'b 10 : h = 3'b 011; 2'b 11 : h = 3'b 001; endcase
Choose Save (File menu).
To close the Text Editor, choose Close (File menu).
|