Introduction to FPGA Part 3 - Getting Started with Verilog | Digi-Key Electronics

Sdílet
Vložit
  • čas přidán 17. 06. 2024
  • In this tutorial, we demonstrate how to use continuous assignment statements in Verilog to construct digital logic circuits on an FPGA.
    A field-programmable gate array (FPGA) is an integrated circuit (IC) that lets you implement custom digital circuits. You can use an FPGA to create optimized digital logic for things like digital signal processing (DSP), machine learning, and cryptocurrency mining. Because of the FPGA’s flexibility, you can often implement entire processors using its digital logic. You can find FPGAs in consumer electronics, satellites, and in servers used to perform specialized calculations.
    In this series, we will see how an FPGA works and demonstrate how to create custom digital logic using the Verilog hardware description language (HDL).
    Previously, we showed how to install apio and the open-source toolchain required to work with Lattice iCE40 FPGAs ( • Introduction to FPGA P... ). In this episode, we demonstrate how to write simple continuous assignment statements in Verilog to create digital logic circuits.
    Wikipedia article on adders: en.wikipedia.org/wiki/Adder_(...)
    The solution to the challenge at the end of the episode can be found here: www.digikey.com/en/maker/proj...
    All code examples and solutions for this series can be found here: github.com/ShawnHymel/introdu...
    We start by showing how to define pins using a physical constraints file (.pcf), which maps Verilog I/O signal names to physical pin numbers on the FPGA package. Refer to the following documents to see the pinout on the iCE40HX1K and how it’s connected on the iCEstick:
    - iCE40 LP/HX Datasheet
    - iCEstick Evaluation Kit User’s Guide
    From there, we show how lookup tables are used to construct digital circuits inside the FPGA. We design a very simple digital circuit (a simple AND gate with pushbutton inputs) in Verilog, synthesize it, and upload it to the iCEstick.
    Next, we demonstrate how vectors work in Verilog (as a bus of wires) and how to branch wires using the replication operation.
    Verilog Quick Reference Card: www.ee.ic.ac.uk/pcheung/teachi...
    Your challenge is to create a 1-bit full adder as shown in this Wikipedia article.
    Product Links:
    www.digikey.com/en/products/d...
    Related Videos:
    • Cyclone® III FPGA
    • Power Management: Powe...
    • FPGA's: Low-Cost, High...
    Related Project Links:
    www.digikey.com/en/maker/proj...
    Related Articles:
    www.digikey.com/en/pdf/r/rene...
    www.digikey.com/en/videos/d/d...
    Learn more:
    Maker.io - www.digikey.com/en/maker
    Digi-Key’s Blog - TheCircuit www.digikey.com/en/blog
    Connect with Digi-Key on Facebook / digikey.electronics
    And follow us on Twitter / digikey
  • Věda a technologie

Komentáře • 59

  • @NotMarkKnopfler
    @NotMarkKnopfler Před 2 lety +8

    Thank you. This is a nice, gentle introduction to the subject. Perfectly paced. That it uses open-source tools is a bonus. Much appreciated.

  • @citiesinspace4864
    @citiesinspace4864 Před 2 lety +14

    I'm about to take an HDL course at university next semester so this is super helpful! Thank you Digikey and Shawn!

  • @markusbuchholz3518
    @markusbuchholz3518 Před 2 lety +23

    From my humble point of view you Shawn are the most impressive and brilliant educator/innovator I have ever seen. Awesome channel and impressive people who support the content and channel. Have a nice day!

    • @computerchaot9891
      @computerchaot9891 Před 2 lety +2

      I almost completely agree if I hadn't attended courses with Professor Niklaus Wirth (ETHZ). But yes, compliments!

  • @Ivan-iu7xf
    @Ivan-iu7xf Před 2 lety +7

    I love the FPGA tutorials
    Keep making great videos

  • @navalenigma
    @navalenigma Před 2 lety +16

    I've looked at several fpga tutorials, this is by far the best. Absolutely fantastic.

    • @duncanwalduck7715
      @duncanwalduck7715 Před 2 lety +1

      It almost recommends an ICE40hx1K dev board. I hope we're going somewhere special with this, because I'm not massively confident of what can actually be done with such an entry-level part. I think Shawn has really got into this one, though - even to the point of insisting that we should not make 'blink' on episode one or two... or three.. PDM microphone to I2S: - go! (eventually?)
      Part 3 > and only as 'digital' as a Class D amplifier, i.e. not synchronous ("blocking") yet.

  • @MR-fs2pc
    @MR-fs2pc Před 2 lety +3

    Thank you for the clear explanation - Icestick just arrived and managed to get it up and running. Everything works, including my full adder implementation!! Really looking forward to the next part.

  • @CrimsonTide001
    @CrimsonTide001 Před 2 lety +2

    You have a very good presentation style. Clear, concise, articulate. Definitely one of the best presenters I've seen for this material.

  • @squee222
    @squee222 Před rokem

    I'm really enjoying the series. Following along without a FPGA and just using the simulator, at the moment. Thanks again.

  • @viperjoeone4933
    @viperjoeone4933 Před 2 lety +2

    This is so great, thank you very much for this easy to follow jump into the topic. This is exactly the level I needed to get started!

  • @thalanayarmuthukumar5472
    @thalanayarmuthukumar5472 Před 2 lety +1

    Awesome next video of the series. Very well and simply presented. Waiting for the next one

  • @ricardoquesada
    @ricardoquesada Před 2 lety +3

    Very clear, easy to understand! Keep doing these videos please!

  • @_azaad_
    @_azaad_ Před 2 lety +1

    Loving this series. I have the subscriptions with the bell on for this channel just so I know when these are out!

  • @dadominicanstyl
    @dadominicanstyl Před rokem

    Love your videos, the way you explain things....you're amazing! Thanks Shawn for your dedication to education.

  • @eddyfontaineyoutu100
    @eddyfontaineyoutu100 Před 2 lety +2

    Very good tutorial! Perfect tempo and presentation! Keep on the good job 👍👍👍!

  • @sevensolutions77
    @sevensolutions77 Před 2 lety +2

    This is a very excellent course, many thanks 👍

  • @AhmadAsmndr
    @AhmadAsmndr Před 2 lety +1

    Thank you, you are the best.

  • @arunalakmal9031
    @arunalakmal9031 Před 2 lety +2

    Nice work...Thank you so much

  • @briancooper2737
    @briancooper2737 Před 2 lety +1

    I am a bit late to the party, but I'm here now. Very good stuff so far and very beginner friendly. I like the assignments at the end too! I ordered an Alchitry Cu, closest thing I could get to the Icestick. It will be a bit before I get it, but not 21 weeks! I have a cheap Chinese dev board with a Cyclone 4 and a lot of peripherals on it. I am currently using that to follow along till I can get my new board. I will try and catch up as soon as I can. Good job so far.

  • @AgainPsychoX
    @AgainPsychoX Před 2 lety +8

    I wish you could use editor like Visual Studio Code with some extension that styles/colors PCF files syntax. Anyways, great video as always!

    • @TiNredstoner
      @TiNredstoner Před 2 lety

      I just get started with fpga and I use Notepad++. The verilog syntax coloring is great, but I agree with you about pcf file. It's plain color, probably need to define by myself

    • @AhmadAsmndr
      @AhmadAsmndr Před 2 lety

      i am searching too!!

  • @ZedaZ80
    @ZedaZ80 Před 2 lety +2

    I've been looking forward to this video and now I'm looking forward to the next. It occurred to me: I should probably subscribe XD
    I love bitbanging in assembly and this looks like it might be even more fun :O

    • @ShawnHymel
      @ShawnHymel Před 2 lety +2

      Why bitbang in assembly...when you can do it in hardware! :P

  • @RequiemForABuckeye
    @RequiemForABuckeye Před 2 lety

    This is absolute gold

  • @Thangheo12233
    @Thangheo12233 Před rokem

    very helpful bro. thank you!

  • @philipacovington
    @philipacovington Před 2 lety +1

    Interesting overview of verilog! FPGAs are really great for those interesting in retro-computing or learning how a CPU works. I am implementing Ben Eater's 8-bit computer in an FPGA in a series of videos on my channel for anyone interested.

  • @vaniaeli4392
    @vaniaeli4392 Před 3 měsíci

    Muito Obrigado por democratizar esse conhecimento ❤

  • @srengullach1459
    @srengullach1459 Před 2 lety

    Yes its awesome, i have learned alot from this videos, my only problem was that I use iCE40 UltraPlus breakout board, that had a bad FTDI setup, but finaly I managed to change the Descriptor with FT_Prog.

  • @damny0utoobe
    @damny0utoobe Před rokem

    Brilliant

  • @DianelosGeorgoudis
    @DianelosGeorgoudis Před 2 lety +1

    So, I programmed the full-adder. I must say the synthesiser's error messages are not particularly helpful. Also one of my buttons on the breadboard was not working well, and I thought there was a problem with the verilog code. So a good advice is to test one's hardware using a simple programme, for example having each button press light a particular led. Anyway, great stuff.
    Incidentally, the link to the Wikipedia article about full adders is missing in the description of the video.

  • @tinglin6121
    @tinglin6121 Před měsícem

    Note that "apio build" now defaults main as the module name. Use the --top-module option to change.

  • @cl.5974
    @cl.5974 Před rokem +1

    Thank you for making the videos. Your demo is in Windows. Could I work on the project using the Linux system? Thank you.

  • @gacherumburu9958
    @gacherumburu9958 Před 2 lety +1

    👍👍

  • @fredkilner2299
    @fredkilner2299 Před 2 lety +1

    With 3 pins (video data, colorbust, H and V sync) and an external module with a few resistors and transistor you could generate a Black and White(no colorbust) or composite color signal. Apple II schematic has one bipolar transistor and a few resistors and a variable resistor to get the correct voltage. Before HDMI composite video was everywhere. For color it's critical to be able to generate a multiple close to 14.31818 MHz. Colorburst frequency is 3.579545. Artix-7 clock module gets close enough. I tried with Spartan-3e and couldn't get close enough so had drifting colors.

    • @fredkilner2299
      @fredkilner2299 Před 2 lety

      For ICE Stick 4 month factory lead time. Not Good..Factory Lead-Time: 21 weeks

  • @power-max
    @power-max Před 2 lety +2

    It would be amazing if someone could take a digital logic simulator like Logisim and have it be capable of compiling the physical schematic into Verilog or VHDL!

  • @fredkilner2299
    @fredkilner2299 Před 2 lety

    The Special Tuesday digilent FPGA board prices for Arty and Zynq are well worth looking at. For today only. 11/30/2021.

  • @Tristoo
    @Tristoo Před 2 lety +2

    sick. over too quickly, I could watch this for hours.
    one thing I didn't get fully though is the 'wire' part. I'm thinking the 'assign' only works with outputs and if you're trying to take output from a gate to another gate you'd use a wire?
    and also, are wires just implicit when you do multiple operations in one expression? i.e. "~a & ~b"?
    thank you!

    • @ShawnHymel
      @ShawnHymel Před 2 lety +4

      Yes, wires are implicit when you do something like `assign out = ~a & ~b;` A wire is just a way to name an intermediate node (or "wire") that connects other logic. You could accomplish the same thing with:
      wire not_a;
      wire not_b;
      assign not_a = ~a;
      assign not_b = ~b;
      assign out = not_a & not_b;
      As you can see, we're just using wires to name the intermediate connections. Also, the `assign` keyword does not need to be used on outputs--we can use it to make connections between things within the module (e.g. connecting the `not_a` wire to the output of the logic `NOT a`). Hope that helps!

  • @stekarblx
    @stekarblx Před rokem

    Can you perhaps share the Fritzing part for the iCEstick?

  • @bennguyen1313
    @bennguyen1313 Před 2 lety

    What language is the pcf file in?
    And after generating the ini file
    "apio_init -b icestick"
    How does
    "apio build"
    automatically generate the command "yosys -p "synth_ice40 -json harware.json" -q and_gate.v"? for example, if you havd more files, now does it know which is the top one?
    apio upload

  • @AdityaMehendale
    @AdityaMehendale Před 2 lety +1

    I'm curious to know the contents of the "funny" folder at 3:30 :) (Only if it isn't too personal..)

    • @ShawnHymel
      @ShawnHymel Před 2 lety +4

      Mostly just random memes I find and keep :P

  • @cobalt_plated_eyeball
    @cobalt_plated_eyeball Před 2 lety +1

    Has anyone tried following this series using the Alchitry Au?

  • @razvanvlad607
    @razvanvlad607 Před rokem

    Can anybody help me? I'm a beginner and I'm looking for a FPGA board to start with. I don't know which board is the most suitable for me. Nexys A7 is way too expensive. My options for the time being are: Basys 3 artix-7, Arty A7/S7 or Cmod A7/S7 (breadboardable). I need a good price quality ratio. And also I don't know if the breadboardable boards are enough powerful and capable. Are they worth it? Or the extra money for the other boards like Basys and Arty is worth it more? Thank you very much!

  • @mmaranta785
    @mmaranta785 Před 2 lety +1

    Oh and Senator, love the bowtie

  • @vaniaeli4392
    @vaniaeli4392 Před 6 měsíci

    Because I couldn't generate the files: .gtkw and .tb To do the simulation?

  • @timonix2
    @timonix2 Před 2 lety +1

    These videos are great. I just wish that they used vhdl

  • @lightning_sree2531
    @lightning_sree2531 Před 27 dny

    Hey Shawn, I dont known, why! this is happening?
    Im using Icebreaker dev board and i use your code and using yapio to build and upload the code.
    "&" is performing "|" operation and vice versa. can you help me out!

  • @matthewprater7892
    @matthewprater7892 Před 11 měsíci

    i am getting a "Error: module 'click' has no attribute 'get_terminal_size'" when i verify. i am using python 3.8.2 and apio 0.6.7. Anyone else see this?

    • @isamzerouali1916
      @isamzerouali1916 Před 2 měsíci

      had this issue! Try update apio: python -m pip install apio==0.8.4 then use: apio install oss-cad-suite. You should then be able to use APIO verify

  • @rickh6963
    @rickh6963 Před 2 lety +1

    I need to wait until after work to watch these videos, too distracting.

  • @savejeff15
    @savejeff15 Před 2 lety

    the fpga is very IO focused. why are there only so few pins on this board. i would rather have the possibility to use all pins.
    also why does it have male full size USB ?
    I hope they will release a arduino style board soon with about pins at either side and a micro/type c USB connector for easy use on a breadboard.
    The world of FPGA is still not ready I guess ^^

    • @0LoneTech
      @0LoneTech Před 2 lety +2

      There are dozens of different boards. This is like saying the world of microcontrollers isn't ready because there's a plastic casing on the EZ430-F2013. APIO alone supports over 30 different boards; e.g. the IceZUM Alhambra is shaped like an Arduino and the iCE40-HX8K Breakout Board breaks out many IOs to the sides. The first FPGA board I remember imitating the Arduino layout was the Papilio One. The TinyFPGA, iceFUN or OrangeCrab might fit better on a breadboard.

  • @navidmorovati1742
    @navidmorovati1742 Před 2 lety

    hi

  • @PabloRamos-tm9rp
    @PabloRamos-tm9rp Před rokem

    Karnaugh maps are very useful for designing combinatorial logic. en.wikipedia.org/wiki/Karnaugh_map