Use Quartus to realize 2-4 line, 3-8 line, 4-16 line decoder and control seven-segment digital tube

The basic steps

1. Create project and files (top-level BDF, and a virlog HDL file)

Remember that the project name is the same as the top-level file name, otherwise you will get can't find design entitle and you will get an error when compiling.

2. Create components:

(1) Create two new files in the new project, change the file name and file address in File/save as, and enter the following code in the virlog HDL file. This code contains a 2-4 line decoder.

(2). In the project navigator on the left, "create symbol files for current file" for use in BDF can be used by default. If there is no default, remember to check it.

3. Use components and draw BDF diagrams

Then add input and output pins and rename them (output pins can be named in a group, note the naming format as shown above)

Input the net mark boundary line, pay attention to the content as shown in the figure:

 

 

Assign pins according to important reference diagrams

4. Compile

Before compiling, don't forget to set idle pin tri-state output in assignments/setting/device.

5. Download and run.

 

Supplementary steps and codes for three specific items:

1.       Place two 2-4 decoder modules, there are 2 groups of SW in total, 2 in each group ; 2 groups of LEDs , 4 in each group, each group of SW controls its corresponding LED group respectively.

(1) The corresponding BDF is shown in the figure: (see above for the corresponding code)

(2) The corresponding pin assignment is shown in the figure:

2.       Design 3-8 decoder, pay attention to signal width

(1) The code of the 3-8 line decoder is as follows:

(2) The generated symbol tools are as follows:

(3) The BDF diagram is as follows:

(3) The corresponding pin assignments are as follows:

 

 3.       Check the correspondence between the pins of the 7-segment decoder in the manual, and use four DIP switches to control the numbers of a 7 -segment decoder, from 0-9-AF , a total of 16 numbers and letters.



(I'm lazy trying to do it once and for all...)

(1) The component code is as follows:

(2) The generated components are as follows:

(3) The BDF diagram is as follows:

(4) The pin assignments are as follows:

Effect picture:

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325789171&siteId=291194637