Alina310199
New Contributor
4 years agoMAX 10 ADC
Hello, guys! I really need your help. I have a FPGA MAX10 10M50DAF484C6G Development Kit and I want to write a code in VERILOG or VHDL so that when I move the potentiometer to light different LEDs. For example, if my potentiometer is at 0.5V, my LED 1 will light up, if it is between 0.56-1 V, my LED 2 will light up and so on. In total I have 5 LEDs. The max value is 2.5V. I read a lot about ADC. I know that there is a formula that calculates the conversion from analog to digital, more precisely Digital Code = (Vin / VREF) × 2 ^ 12 where Vin is the voltage from the potentiometer and VREF is 2.5 V, but I don't know how to implement it in VERILOG or VHDL. Can someone help me?