Get Started With FPGAs and Verilog in 13 Minutes!

  Рет қаралды 29,116

Doctor Volt

Doctor Volt

Күн бұрын

FPGAs are not commonly used by makers due to their high cost and complexity. However, low-cost FPGA boards are now available on the market. This video provides a brief introduction to the Tang Nano 9K board and demonstrates how to program it using Verilog.
Thank you to PCBWay for sponsoring this video. Get PCBs, 3D printing and sheet metal works: www.pcbway.com/?from=Doctor%2...
Consider supporting this channel on Patreon and get updates about ongoing projects and ad-free preview videos!
/ docvolt
Tools:
Gowin EDA: www.gowinsemi.com/en/support/...
Items used in this video:
Tang Nano 9K: amzn.to/3PJiPHA
Please use these links for your order to support the channel. It's the same price for you, but I'll get a small commission.
00:00 - Intro
00:38 - How do FPGAs function?
03:55 - Introduction into Verilog
06:06 - Verilog constraints
09:55 - Sequential logic
10:29 - always @ Blocks
12:57 - Verilog examples

Пікірлер: 88
@rieduciumaratonas
@rieduciumaratonas Ай бұрын
At last after so many years and unused modules I managed to do something with FPGA. Thank you for this breakthrough!
@ClintTheriault
@ClintTheriault 12 күн бұрын
This dev board looks like a cool board to use as a base to make a ISA CGA 2 HDMI graphics card for old 1980's era PCs. I've been looking at something like this for my final Electronics Engineering project.
@VorpalForceField
@VorpalForceField Ай бұрын
I have wanted for years to dive into FPGA's ... Excellent demo ..!! Thank You for sharing ... Cheers :)
@pkraveendranath4081
@pkraveendranath4081 7 күн бұрын
Very helpful video for a beginner! Thank you very much. Please continue and let us have more practical examples that use the GPIO pins too!!
@ukwebb
@ukwebb 21 күн бұрын
Love your little nod to the awesome BBC micro with its schematic :)
@float32
@float32 Ай бұрын
I started as a software person and went to verilog. The first thing I learned is that abstraction uses up all the LUTs and routing. My friend works for an FPGA company and said they never use abstractions, for the core IP stuffs. Makes sense.
@goodn1051
@goodn1051 Ай бұрын
just curious, what example of a company is an "FPGA company"
@float32
@float32 Ай бұрын
@@goodn1051 Altera, Xilinx, etc.
@vitalyl1327
@vitalyl1327 Ай бұрын
Abstraction can be zero-cost. I generate pipeline register chains and FSMs from a high level code all the time, and the result is usually better than what I'd write manually. Same goes for things like AXI bus handling, arithmetic ops scheduling on a long pipeline, etc.
@vitalyl1327
@vitalyl1327 Ай бұрын
​​@@goodn1051e.g., quite a few HFT shops are FPGA-first..Though now there are some ASIC firsr ones as well.
@stickyfox
@stickyfox Ай бұрын
Everything in industry is licensed, and you're lucky if you ever get a peek inside the code. Most designers never do any actual coding.
@svofski
@svofski Ай бұрын
neat, I have this exact board waiting to get used
@treideme
@treideme Ай бұрын
Really good video. Thanks.
@ProfessorLinux
@ProfessorLinux Ай бұрын
Very informative. Thank you.
@alicewyan
@alicewyan Ай бұрын
This is exactly the video I needed, at the exact moment I needed it, as I have the smaller 1k version on its way from China :)
@lutfijd
@lutfijd Ай бұрын
Just got my tang nano 9k yesterday, perfect timing for this video!! it does suck how they connect lines to low instead of high.
@enginerdy
@enginerdy Ай бұрын
It’s common for digital outputs to have more ground drive current capability than high drive current. This is because the low side N FET in the IO pin is easier to drive.
@conorstewart2214
@conorstewart2214 Ай бұрын
How does it suck? What difference does it actually make in practice? Very little, once you know about it and you can figure it out just from looking at the schematic. Active low vs active high is a very easy concept to understand.
@lutfijd
@lutfijd Ай бұрын
@@conorstewart2214 yes it is a simple concept and as enginerdy pointed it makes sense to make it so. I guess what i was trying to convey is that its annoying to have to set a pin to 0 for something to turn on and 1 to turn off, conventionally its the other way around. as you said, not a biggy.
@JoaoCarlos-df1zw
@JoaoCarlos-df1zw Ай бұрын
The explanation of FPGA was great! Still find they are pure magic though
@OneMilian
@OneMilian Ай бұрын
Same here, maybe houses are full of fpgas who build all the hardware you own in the future, like you bought a sound system, bahm its build right into your house
@poisonouspotato1
@poisonouspotato1 Ай бұрын
​@@OneMilianI had a stroke trying to read this
@poisonouspotato1
@poisonouspotato1 Ай бұрын
You are contradicting yourself. He explained FPGAs like he expected us to already know how they work.
@OneMilian
@OneMilian Ай бұрын
@@poisonouspotato1 get well & healthy soon!!
@poisonouspotato1
@poisonouspotato1 Ай бұрын
@@OneMilian it took me a day to figure out what you meant. Also, no, you can't make speaker membranes from fpga chips without some sci-fi tech magic ooze. Fix your grammar.
@theforthdoctor7872
@theforthdoctor7872 Ай бұрын
Outstanding
@thanatosor
@thanatosor 6 күн бұрын
Yes FPGA... the Excel of Hardware.
@erichpoly4434
@erichpoly4434 Ай бұрын
I don't know if you have a video about Analog FPGA. However, it would be cool
@DoctorVolt
@DoctorVolt Ай бұрын
I have never heard of Analog FPGAs..
@erichpoly4434
@erichpoly4434 Ай бұрын
@@DoctorVolt I confused it with FPAA. However, the question is whether you are making or have made videos about it.
@conorstewart2214
@conorstewart2214 Ай бұрын
@@erichpoly4434 there are no commonly used or available FPAA. They just don’t really exist yet (in any usable or accessible capacity) so how do you expect him to make a video on it?
@Promilus1984
@Promilus1984 Ай бұрын
Have been wondering about Tang Nano 9k to house FT816 softcore modified to work in Commodore and Atari range of machines in place of original 6502 (and variants) but to use on-board PSRAM as real 16b local memory in 16b mode. Basically trying to do *slightly* improved SuperCPU ... Original device was based on WDC 65C816 processor @ up to 20MHz iirc, but 65C816 uses 8bit data bus anyway (much like 68008 or 8808) and also uses it to get address bits 16 through 23 (kind of like 8051 does multiplex data and address on one port for external memory interface). Which is ok from as close pin compatibility as possible, but is messy. With FPGA I can route all extended memory (24b space save first 64K) to PSRAM exposing only regular 6502 interface to GPIOs (obviously with level translators) and that also means I can get real 16b data interface to provide better performance in 16b mode.
@thanatosor
@thanatosor 6 күн бұрын
have you tried with Tang Nano 20k + NESTang on it ?
@Dudleymiddleton
@Dudleymiddleton Ай бұрын
Field Programmable Gate Array
@davemorphling7432
@davemorphling7432 Ай бұрын
where do you set the clock rate and thus the sensitivity of the button? I mean, what's stopping the counter to be increased by 1000 times after one press? is the logic only triggered on edge transitions?
@DoctorVolt
@DoctorVolt Ай бұрын
Yes, always @(posedge btn1) begin...
@kuro68000
@kuro68000 Ай бұрын
Thanks for this. I'm going to try this FPGA. I've looked at stuff like Quartus but it's just gigabytes of proprietary crap.
@powerHungryMOSFET
@powerHungryMOSFET Ай бұрын
Can you make some projects for beginners?
@DisgruntledPigumon
@DisgruntledPigumon 24 күн бұрын
Can these cheap FPGAs do the same as the expensive ones that are used for emulating old game consoles?
@DoctorVolt
@DoctorVolt 23 күн бұрын
Yes, of course. I am currently working on this.
@johanneswack4017
@johanneswack4017 Ай бұрын
Just watched your video. During watching, made my Aliexpress order... Looks like fun, but what can this device, what an Arduino can't do?
@DoctorVolt
@DoctorVolt Ай бұрын
On an FPGA, everything is done in parallel, like on an actual circuit. On a Microcontroller, the steps are done one after the other. So FPGAs are much faster and there are less timing issues.
@conorstewart2214
@conorstewart2214 Ай бұрын
An arduino is just a microcontroller, it executes code an instruction at a time. An FPGA in comparison can implement digital logic, you can make digital circuits inside of it, you can even make processors like the one found in an arduino within an FPGA. A major advantage of using an FPGA instead of a microcontroller is that you can have multiple things happening at once with precise timing. Each thing you want to do can be implemented as its own block and they can all operate simultaneously since they are all separate circuits. You could have one section driving a motor, another reading from a sensor, another driving a display and they all work at the same time, so latency is minimised (only the latency of that block) and timing can be very precise and no task can interfere with each other since they are separate circuits. Compare that with a microcontroller where it can only do one thing at once and the processing power is split between everything it is trying to do. If you want to control a motor, read a sensor and drive a display, then the arduino can only do one thing at once, so you have to either do each task in sequence or split them up, so you do a bit of each task at a time and keep on switching what task you do. This does work but it does mean that precise timing is difficult and latency is higher. A common way to let microcontrollers do multiple things is by using a Real Time Operating System (RTOS) but this is just organising how the processors time is split up, it can still only do one thing at once. This generally leads to variable latency, since if there are a lot of higher priority tasks needing done then lower priority tasks can be waiting a while until they get done. A related example of advantages of FPGAs is that everything can be done in parallel. In an arduino you can only do one addition at a time. On an FPGA you can set up multiple adders and have them perform many additions at once in parallel, the same applies to any other thing you want to do. So if you had 6 sensors and you needed to calculate something based on the sensor reading, the arduino would have to read each sensor and then calculate it one at a time whereas an FPGA can be set up with an individual circuit for each so that they are all done simultaneously. An important use of FPGAs is that they can implement any digital protocol if the FPGA is fast enough. So if you need to use an uncommon protocol and no common microcontrollers support it in hardware then you can implement it in an FPGA instead. Or if you implement a processor (maybe a RISC-V processor) in an FPGA then the peripherals are very modular, you can design custom peripherals or you can add any you need, so if your application needs 6 uart (serial) but no SPI or I2C then you just attach 6 uart blocks to it, or if you need to control 10 stepper motors then you can just add on 10 individual stepper motor control blocks. You only need to add what you need so you can basically create the ideal microcontroller for your application. Another advantage of most FPGAs is that they have a lot of available pins. You can find FPGAs in things like reconfigurable accelerator cards for computers or networking equipment. They are also used for testing chip designs before they are made. Often it is better to get an Application Specific Integrated Circuit (ASIC) made as they run faster and with lower power and they are cheaper in bulk amounts, like hundreds of thousands if not millions of chips but they are very expensive if you just need a small amount which is why people use FPGAs. FPGAs are often used in robotics. FPGAs are also often used in oscilloscopes or logic analysers as they can handle and process the measurements at high speeds. As another example each channel on an oscilloscope or logic analyser can be handled separately with its own circuit if you wanted. FPGAs do have some disadvantages though. They are generally considerably more expensive than microcontrollers, they aren’t very fast (compared to a classic arduino they are fast, but not compared to most STM32 microcontrollers for example) but their speed is rarely an issue since they can do everything in parallel, also more expensive FPGAs are faster generally. They also tend to use more power than doing the same thing on a microcontroller would use but again that depends on the use case, it is possible to simplify some tasks on an FPGA so they use very little hardware which doesn’t use much power especially if the task doesn’t need a processor in the first place. As a hobbyist the cost of FPGAs isn’t much of an issue, especially if you only need small ones. The cheap FPGA dev boards aren’t much more expensive than microcontrollers. Also as a hobbyist you will only be making a small amount of something (likely only one) so again the cost of FPGAs isn’t much of an issue. They are definitely worth learning and using though and can actually save you money too, instead of buying an expensive microcontroller of SBC just so it can do everything you need you could just use an FPGA instead and make it do everything you need. As for FPGA development boards sipeed are very good, they have everything from tiny ones with ~1000 LUTs and very little else to reasonably sized ones like the 138k with 138k LUTs and can plug into a PCs PCIe connectors and has DDR3 RAM built into the board with a built in processor too. A good middle ground is the 20k and 25k ones, they are big enough to implement decent processors on or a lot of logic and they have memory built in, like DDR3 or SRAM. The 9k is enough to implement processors on too though. For getting started you should start with learning digital logic first and then learn how to use the FPGA.
@timc3600
@timc3600 Ай бұрын
Is it bad that I recognised the BBC Micro Circuit Diagram within a second of it being put on screen.
@DoctorVolt
@DoctorVolt Ай бұрын
Yes, it was the BBC Micro.
@timc3600
@timc3600 Ай бұрын
@@DoctorVolt I spent many days looking at that circuit diagram when I was young. I learned so much from that platform. Nice work on the Dev board.
@lutfijd
@lutfijd Ай бұрын
how did you access the schematic of 9ktang at @6:43? is it in the gowin program?
@DoctorVolt
@DoctorVolt Ай бұрын
With a quick search on Google
@lutfijd
@lutfijd Ай бұрын
@@DoctorVolt lol ok ;(, found them first link on google ;)
@conorstewart2214
@conorstewart2214 Ай бұрын
All schematics, examples and other information are on the sipeed wiki or their GitHub.
@SurvivalSquirrel
@SurvivalSquirrel Ай бұрын
1:33 3 primary modes? I count 5 ;-)
@hval9085
@hval9085 29 күн бұрын
build an oscilloscope based on Tang Nano 9k
@DoctorVolt
@DoctorVolt 28 күн бұрын
That's not possible, because the Tang Nano has no analog inputs.
@Atmatan_Kabbaher
@Atmatan_Kabbaher 25 күн бұрын
Yeahhhhhhh. I'm going to leave this to the people it actually makes sense to. Nice pipe dream but I comprehend very little of this. Thanks though.
@jaapjethee
@jaapjethee Ай бұрын
You asked what you can make, how about making the 1 bit cpu UE-1 that Usagi electric is working on in his channel. It should de simple enough i think... Well not for me.
@MechanicaMenace
@MechanicaMenace Ай бұрын
In HDLs it's not really any harder making a 64 bit processor compared to a 1 bit one. I think something like the SAP-1 (what Ben Eater made on breadboards) would be cool and more capable. And would leave plenty of room to implement peripherals like say sprite based video... Not shitting on what Usagi is doing btw.
@jaapjethee
@jaapjethee Ай бұрын
@@MechanicaMenace true but is it easier to understand. For me i dont even understand how usagi's cpu works but i thought this might help. But why not do both to show the difference;)
@MechanicaMenace
@MechanicaMenace Ай бұрын
@@jaapjethee it's not really easier to understand, just easier to build out of the building blocks (i.e. valves/tubes) Usagi is using. Whereas the SAP-1 was specifically designed to be easy to understand.
@conorstewart2214
@conorstewart2214 Ай бұрын
@@jaapjethee a 1 bit cpu isn’t really easier to understand, it is very easy to understand basic 8 or 32 bit processors once you break it down and look at what the individual sections do.
@conorstewart2214
@conorstewart2214 Ай бұрын
@@MechanicaMenace one of my first FPGA projects was following Ben’s videos and implementing his processor on a lattice FPGA. It was definitely worthwhile and it was good to figure out how you need to implement things differently on an FPGA vs with chips on a breadboard. For example the fact that you can’t use tristate buffers within an FPGA and you need to use multiplexers instead. Similarly “Nand to Tetris” is good although you use their own hdl and only simulate it, but after doing it that way it should be easy to implement it on an FPGA.
@poisonouspotato1
@poisonouspotato1 Ай бұрын
0:20 you say this like its some inherently bad thing. Also people should stop normalizing being forced to create an account to use an IDE without good alternatives
@alexcrouse
@alexcrouse Ай бұрын
And they don't tell you how big the download is, and it's like 200k/s download... Not doing that on my wifi hotspot right now, guess i have to wait till i get home!
@vincanityl
@vincanityl Ай бұрын
MCU do not emulate circuits. MCU are a processor (usually RISC) that have peripherals built into them. They do not emulate circuits. FPGA emulate circuits. They have these gates that based on programming set a logic operator to them. Also based on programming, they chain together. Hence the programmable gate array part. MCU is pure hardware. FPGA is basically hybrid hardware simulator. You can program an MCU on a FPGA but not the other way. Hence why there are SoC designs with both. Typically the FPGA reconfigures the MCU
@thanatosor
@thanatosor 6 күн бұрын
Yeah, this is why FPGA is interesting. People tend to mistake MCU with it because they share the same level of hardware.
DIY 256-Core RISC-V super computer
10:29
bitluni
Рет қаралды 184 М.
FPGA in trading | Ultra low latency trading | HFT System Design
20:55
Coding Interview Prep
Рет қаралды 10 М.
ХОТЯ БЫ КИНОДА 2 - официальный фильм
1:35:34
ХОТЯ БЫ В КИНО
Рет қаралды 1,6 МЛН
How To: DIY Cassette Tape Loops [2024]
6:17
100% BOOTLEG
Рет қаралды 95
You’ve Never Seen WiFi Like This
20:43
Data Slayer
Рет қаралды 453 М.
Analog Chip Design is an Art. Can AI Help?
15:48
Asianometry
Рет қаралды 181 М.
Build a Ham Transmitter with a Raspberry Pi Pico
5:21
101 Things
Рет қаралды 15 М.
I tried the Cheapest Arduino Alternative (that Nobody heard of)
13:31
Building the ENDGAME invisible PC
27:30
DIY Perks
Рет қаралды 310 М.
How FPGAs Replaced My Arduino Boards - From Maker Faire Hannover
8:51
VHDPlus Learning
Рет қаралды 19 М.
HOW TRANSISTORS RUN CODE?
14:28
Core Dumped
Рет қаралды 172 М.
World's Smallest FPGA Super Nintendo
15:21
level1online
Рет қаралды 3,9 М.
📱 SAMSUNG, ЧТО С ЛИЦОМ? 🤡
0:46
Яблочный Маньяк
Рет қаралды 1,4 МЛН
Carregando telefone com carregador cortado
1:01
Andcarli
Рет қаралды 1,4 МЛН
Индуктивность и дроссель.
1:00
Hi Dev! – Электроника
Рет қаралды 1,4 МЛН
Теперь это его телефон
0:21
Хорошие Новости
Рет қаралды 1,6 МЛН
Распаковка айфона в воде😱 #shorts
0:25
Mevaza
Рет қаралды 1,6 МЛН