Forum Discussion
Altera_Forum
Honored Contributor
14 years ago --- Quote Start --- Sir, how do I improve this something like adding a SEVERAL a combination of lighting the bulb? let's say 100 combinations or more? how am I gonna do this in an array form or in CASE? --- Quote End --- You will find it easier if you divide your logic into components, that way you can have multiple instances of each component, eg., multiple 7-segment decoders. I have attached two examples; * hex_display_sv.txt (rename to hex_display.sv) * hex_display_tb_sv.txt (rename to hex_display_tb.sv) The .sv extension stands for SystemVerilog (the new and improved Verilog). Now learn how to use the Modelsim simulator to look at your logic. Download and install Modelsim Altera Starter edition, and start the program. Change to a work folder and then compile the files. You can do this through the GUI, or via the command line, i.e., # cd c:/temp# vlib mwork# vmap work mwork# vlog -sv hex_display.sv# vlog -sv hex_display_tb.sv# vsim -novopt hex_display_tb# add wave *# run -a The '#' is the command prompt, you do not type that in. This sequence of commands compiles the hex display module and then the (very basic) testbench that uses the module. Read and understand the code. Create a testbench for your design. Look at the signals in the testbench and see if things work like you expect, and then test them in hardware. Cheers, Dave