

Conversely when i_Switch_1 goes low (to binary 0) o_LED_1 will also go low. Now when i_Switch_1 goes high (to a binary 1) o_LED_1 will also go high. Once all of the output signals are assigned to the input signals, we have successfully connected all LED outputs to the Switch inputs. Always blocks are for the a later project, so don't worry about them for now. There are some rules about this keyword, but for now I'll just tell you that it must be used outside an always block. Assign is used to connect two signals together. The last keyword introduced in this first project is assign.

This connection is done later (and is not part of the Verilog code). The inputs and outputs are going to be connected to specific pins on the Go Board. You can think of these inputs and outputs of being either a 0 or 1 in binary. In this case, we are creating four inputs and four outputs. On the module, you must define the interfaces, which consist of inputs and outputs. More complicated designs will create levels of hierarchy by having many modules.
Run synplify pro on virtual machine code#
Modules can contain all of the code you need, such as the code above, or they can instantiate other modules. Modules are the blocks of code that perform some functionality. The first keyword you encounter is module. The answers for both Verilog and VHDL are shown below. How can you design code such that when a button is pushed, an LED is illuminated? Give it some thought, try to write the code on your own. The inputs are your switches, the outputs are your LEDs. Four of the signals are inputs and four others are outputs. As shown in the image above, you have eight signals to deal with. No matter which language you decide to use, you should give the project some thought before you begin. This is a simple FPGA design, but going through the code and the build process will get you comfortable with everything before we get to more complicated designs. When the button SW1 is released, D1 should turn off. When Switch 1 (SW1) is pushed down on the Go Board, we want D1 to light up. The image to the right shows what this looks like. Again, we are going to be creating code that tells the FPGA to light up one of the four LEDs when a particular switch is pushed. The first thing you are going to do is create your VHDL or Verilog code that tells the FPGA what to do. The Go Board tutorials build on eachother, so it's important to do them in order and remember what you learned! Let's get started! Note that this project is 90% the same should you be learning VHDL or Verilog, so I lumped both into the same lesson. From coding the VHDL or Verilog, to building the FPGA bitstream, to programming the Go Board, this tutorial will walk you through everything you need to know. This is a perfect project to do first, because it will take us through the entire build flow. All we are going to do is program the FPGA to perform one task: When a button is pushed, one of the LEDs should light up. Now it's time to get cracking! The first project that we are going to do is going to be as simple as possible.
