Some help with code
Hello,
I have two boards, one fpga intel max10 de lite and one microcontroler atmel samd21.
I read some data like the temperature from the microcontroller and i am sending it to the fpga. The fpga then must display the temperature on the seven segment display.
I am struggling a bit because the number that are displayed on the fpga are very different than the actual temperature.
What I am basicaly doing is reading some values for example 24.56 then i make this into a 4 digit number so that would be 2456 then i convert it into a 13 bit binary which i send it as an output from pins D0 to D13.
The fpga now gets a 13 bit input where it seperates each digit, so in that example it would be 2 4 5 6 and then display them in each segment, for example in the first segment from the right sight it will display 6 after that it should display 5 then a 4 with a dot and after that a 2 , but it doesnt!
The values that are displayed are different i have checked many times if the connections are correct from the microcotroller to the fpga.
Just to mention i tried it with a different method aswell. I tried it with seperating the 13 bit into a 6 bit and a 7 bit. It didnt work either, again different values from the correct ones.
This is my SystemVerilog code, please correct me if u see something or if you have a different way to approach it!
Hi,
in principle, there's nothing against designing a pure combinational FPGA, e.g. a binary to seven-segment decoder as shown above.
By design, unregistered combinational logic has output glitches, but that's not necessarily a problem for a seven-segment decoder.
The worst point of the present design is the ineffective way to implement binary to BCD conversion. In an FPGA implementation, look-up table would be the best resource saving solution. Without block RAM, double dabble algorithm can reduce logic cell count.
Apart from ineffective implementation, I don't see a problem with code. It's producing correct output.
If it's intended as HDL learning project, I agree that synchronous design is preferred.