Jump to content
  • 0

Basic Logic Function Help


Capnfrost

Question

Hello all, 

I am trying to program a Basys3 to perform basic logic functions. It seems like it would be really easy to accomplish but I am still a little unclear how to program the board as well as write for Vivado. For example I think that I should be able to, in theory, program the board to be an AND gate by writing a program that looks at switch 0, switch 1, and LED 0. If switch 0 and switch 1 are both switched on LED 1 comes on. It sounds super easy I just have no idea how to write in vivado. Any help would be super appreciated.

Thanks

Capnfrost

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

Dear Capnfrost,

Programming for Vivado can be frustrating I understand. Let's see if I can help point you in the right direction. We have a couple websites that can help you in your process to learn about the Basys 3. Your best option is going over and looking at our Learn site. Here we have a multitude of projects and guides to help you with just about basic function you can think of. Next would be checking out the project vault in the forums here. People will often post similar projects that can help you learn how you want to accomplish your task. I did find a particularly useful Learn page that has what you're looking for and it will also generate the a file for your Basys 3 towards the bottom of the page. I would recommend trying to accomplish it yourself before you generate the file that way you can try it yourself. I hope this helps.

Best Regards,

Bobby

Link to comment
Share on other sites

This is the only way I could figure out how to reply without making another question. I am still kinda struggling although I am closer. Everytime I look at a tutorial it always seems like they leave a step out or the file is already created. I think I might be missing something about how this works. Like, is it possible to make it so that when sw0 and sw1 are both switched on that led 1 will turn on? it seems simple enough I just can not figure it out. Sorry for the ignorance I just am having trouble wrapping my head around this.

Link to comment
Share on other sites

Here's a brief summary of the whole process - which step are you having problems with?

1.Install the tools (Vivado for Basys3) and license it

2. Create a new project, ensuring you select the correct FPGA that is on the board

3. Create a Verilog of VHDL module, with the input and output signals you need - e.g. switch0, switch1, led0, led1 For the examples I'll assume you are using VHDL.

4. Code the logic you want - e.g.

 

led0 <= switch0 AND switch1;
led1 = switch0 OR switch1;
5. VERY IMPORTANT STEP - add a constraints file to your project, and add the definition of your top level connections. eg:

set_property PACKAGE_PIN V17 [get_ports {switch0}]                    
    set_property IOSTANDARD LVCMOS33 [get_ports {switch0}]
set_property PACKAGE_PIN V16 [get_ports {switch1}]                    
    set_property IOSTANDARD LVCMOS33 [get_ports {switch1}]
set_property PACKAGE_PIN U16 [get_ports {led0}]                    
    set_property IOSTANDARD LVCMOS33 [get_ports {led0}]
set_property PACKAGE_PIN E19 [get_ports {led1}]                    
    set_property IOSTANDARD LVCMOS33 [get_ports {led1}] 

All this information can be found in the board's master constraints file and/or the board's schematic, both available from the FPGA's board's web page. NOTE: You have to amend the signal names to match what you have called them.

6. Generate the bitstream for your design

7. Program the device and test

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...