This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
labs:seven_segment [2019/07/01 10:20] jgoeders [Exercise #1 - Seven Segment SystemVerilog] |
labs:seven_segment [2020/02/12 17:31] (current) ee220ta [Exercise #1 - Seven Segment SystemVerilog] |
||
---|---|---|---|
Line 27: | Line 27: | ||
In this configuration, all eight LEDs share a common **anode** which enables the display. Each segment has its own **cathode** signal labeled CX where **X** represents the segment letter. For example, signal **CA** corresponds to the cathode signal for segment **a**. | In this configuration, all eight LEDs share a common **anode** which enables the display. Each segment has its own **cathode** signal labeled CX where **X** represents the segment letter. For example, signal **CA** corresponds to the cathode signal for segment **a**. | ||
- | To turn on an LED, there must be a sufficient voltage drop from anode to cathode. Thus, two conditions are needed to turn on a segment. | + | To turn on an LED, there must be a sufficient voltage drop from anode to cathode. That is, the anode needs to have a high voltage ('1') and the cathode has to have a low voltage ('0'). |
- | - The anode needs to have a high voltage. If the anode has a low-voltage, all of the segments will be off. | + | |
- | - The cathode signal corresponding to that segment that is **on** needs to have a low voltage. (This creates the voltage drop necessary to turn on the LED. If the cathode signal has a high voltage, it will have the same voltage as the anode, and there will be no voltage drop. ) | + | |
To display the character **0**, the anode signal will have a high voltage, the cathode signals CA, CB, CC, CD, CE, and CF will have a low voltage, and the cathode signal CG will have a high voltage. | To display the character **0**, the anode signal will have a high voltage, the cathode signals CA, CB, CC, CD, CE, and CF will have a low voltage, and the cathode signal CG will have a high voltage. | ||
Line 71: | Line 69: | ||
On Learning Suite, you will only fill in a few sections of this table. Make sure that your entire table is correct - it will make the rest of this lab much easier. | On Learning Suite, you will only fill in a few sections of this table. Make sure that your entire table is correct - it will make the rest of this lab much easier. | ||
- | === Anode Signals === | + | === The Board's 7 Segments === |
- | + | ||
- | The seven-segment display on the NEXYS 4 board has //eight// unique digits. | + | |
- | Each digit of the eight digit display has its own anode input. In order to turn on any of the segments of a digit, its corresponding anode signal must be asserted to provide current for individual LED segments of the digit. The schematic of this eight-digit, seven-segment display is shown below. | + | |
- | {{ :labs:seven_segment_schematic.png?350&nolink |}} | + | The seven-segment display on the NEXYS 4 board has //eight// unique digits as shown below. |
+ | {{ :labs:7seglab_0.png?600 |}} | ||
+ | /*{{ :labs:seven_segment_schematic.png?350&nolink |}} */ | ||
- | This eight-digit, seven-segment display configuration is known as a **common cathode** arrangement because the cathode signals are shared among all eight digits. If more than one anode signal is asserted, the corresponding digits will have the same segments turn on because they are connected to the same cathode signals. While this significantly reduces the pin count, it makes it difficult to display different values simultaneously. (Different values can be displayed by time-multiplexing the cathode signals. You will be given a time-multiplexing seven segment display controller to use in future laboratory assignments.) | + | Each digit of the eight digit display has its own anode input (A0-A7). |
+ | NOTE, however, that there is a built-in inverter on each anode signal. Thus, to turn on any of the segments of a digit, its corresponding anode and cathode signals must both be //driven LOW//. The schematic of this eight-digit, seven-segment display is shown below. | ||
- | The seven-segment display in this schematic uses a dedicated transistor to drive each of the anode signals. (A transistor is used because it can provide more current than the FPGA input pin.) Eight anode signals (A0-A7) are used for each of the eight digits. The left-most digit is controlled by AN7, the second to the left digit is controlled by AN6, and so on down to the right-most digit which is controlled by AN0. Because of the way the transistor is used to drive the anode input to the seven-segment display, a logic value of **0** must be passed to the anode to turn on a digit. | + | This eight-digit, seven-segment display configuration is known as a **common cathode** arrangement because the cathode signals are shared among all eight digits. If more than one anode signal is asserted low, the corresponding digits will have the same segments turn on because they are connected to the same cathode signals. While this significantly reduces the pin count, it makes it difficult to display different values simultaneously. (Different values can be displayed by quickly switching between the various anode and cathode signals --- the LED's will flash so quickly your eye will see them as all being "on". This is called "time-multiplexing" the digits. You will be given a time-multiplexing seven segment display controller to use in future laboratory assignments.) |
For example, to turn on only the right two digits of the eight digit display, AN1 and AN0 must have a logic value of **0** and the other anode signals must have a logic value of **1**. | For example, to turn on only the right two digits of the eight digit display, AN1 and AN0 must have a logic value of **0** and the other anode signals must have a logic value of **1**. | ||
- | In the following example, two of the digits are turned on by setting their corresponding anode to zero. All of the other digits are off since their anode signals are set to one. In addition, the digit **3** is displayed based on which cathode signals have a logic **1**. The digit point is also on since the cathode signal, DP, associated with the digit point is set to **0**. | + | In the following example, two of the digits are turned on by setting their corresponding anode to zero. All of the other digits are off since their anode signals are set to one. In addition, the digit **3** is displayed based on which cathode signals have a logic **0**. The digit point is also on since the cathode signal, DP, associated with the digit point is set to **0**. |
^ A7 ^ A6 ^ A5 ^ A4 ^ A3 ^ A2 ^ A1 ^ A0 ^ | ^ A7 ^ A6 ^ A5 ^ A4 ^ A3 ^ A2 ^ A1 ^ A0 ^ | ||
Line 108: | Line 106: | ||
==== Exercise #1 - Seven Segment SystemVerilog ==== | ==== Exercise #1 - Seven Segment SystemVerilog ==== | ||
- | In this exercise you will create a seven segment decoder in a SystemVerilog module. Begin by [[tutorials:vivado_project_setup|creating a new Vivado project]] like you did in the previous lab (you will create a new project for each laboratory assignment). | + | In this exercise you will create a seven segment decoder in a SystemVerilog module. Begin by [[tutorials:vivado_project_setup|creating a new Vivado project]] like you did in the previous lab (you will create a new project for each laboratory assignment). Remember to always follow the instructions in red to properly configure the error messages. |
After creating this project, create a new SystemVerilog file with the following module name and ports: | After creating this project, create a new SystemVerilog file with the following module name and ports: | ||
Line 123: | Line 122: | ||
* Structural SV, in non-minimized, sum-of-products. | * Structural SV, in non-minimized, sum-of-products. | ||
* Structural SV, optimized using the theorems in Table 4.1 of the textbook. | * Structural SV, optimized using the theorems in Table 4.1 of the textbook. | ||
- | * Dataflow SV, using an assign statement and the ternary operator. | + | * Dataflow SV, using an assign statement and the ?: (sometimes called the ternary) operator. |
* Dataflow SV, using an assign statement and dataflow operators of your choice (comparison, and, or, etc.) | * Dataflow SV, using an assign statement and dataflow operators of your choice (comparison, and, or, etc.) | ||
* Behavioral SV, using an ''always_comb'' block, and if/else statements. | * Behavioral SV, using an ''always_comb'' block, and if/else statements. | ||
Line 132: | Line 131: | ||
<color red>Include your TCL simulation file in your report.</color> | <color red>Include your TCL simulation file in your report.</color> | ||
- | **Exercise 1 Pass-off:** Show a TA your your SV code, tcl commands and simulation. \\ \\ | + | **Exercise 1 Pass-off:** Show a TA your SV code, tcl commands and simulation. \\ \\ |
Line 144: | Line 143: | ||
<color red>Copy and paste the testbench console output into your report (the console should report no errors).</color> | <color red>Copy and paste the testbench console output into your report (the console should report no errors).</color> | ||
- | |||
- | <color red>Paste the SystemVerilog code for your **seven_segment** module in your laboratory report.</color> | ||
**Exercise 2 Pass-off:** Show a TA that your module passed the testbench without reporting any errors.\\ \\ | **Exercise 2 Pass-off:** Show a TA that your module passed the testbench without reporting any errors.\\ \\ | ||
Line 225: | Line 222: | ||
After completing your top-level design, simulate your top-level design to make sure your digit point (DP) logic and your anode logic is correct. Also, simulate all possible data inputs to verify your top-level circuit is working properly. | After completing your top-level design, simulate your top-level design to make sure your digit point (DP) logic and your anode logic is correct. Also, simulate all possible data inputs to verify your top-level circuit is working properly. | ||
- | |||
- | <color red>Include a copy of your top-level SystemVerilog module in your laboratory report</color> | ||
**Exercise 3 Pass-off:** Show a TA your code for the top-level module and your working simulation.\\ \\ | **Exercise 3 Pass-off:** Show a TA your code for the top-level module and your working simulation.\\ \\ | ||
Line 260: | Line 255: | ||
<color red>Provide any suggestions for improving this lab in the future.</color> | <color red>Provide any suggestions for improving this lab in the future.</color> | ||
- | ===== Personal Exploration ===== | + | <color red>Submit your SystemVerilog modules using the code submission on Learning Suite.</color> (Make sure your SystemVerilog conforms to the lab SystemVerilog coding standards). |
+ | ===== Personal Exploration ===== | ||
+ | There is no personal exploration this week. | ||
+ | /* | ||
Here are some ideas for personal exploration in this laboratory: | Here are some ideas for personal exploration in this laboratory: | ||
* Create a different seven-segment decoder that implements a different font (upside down, letters in the alphabet, your own unique character set, etc.) | * Create a different seven-segment decoder that implements a different font (upside down, letters in the alphabet, your own unique character set, etc.) | ||
Line 271: | Line 269: | ||
<color red>Describe your personal exploration activities</color> | <color red>Describe your personal exploration activities</color> | ||
+ | */ | ||
---- | ---- | ||
[[labs:ta:seven_segment_decoder|TA Notes and Feedback]] | [[labs:ta:seven_segment_decoder|TA Notes and Feedback]] |