FPGA, SoC, And CPLD Boards And Kits
FPGA Evaluation and Development Kits
6364 Discussions

FPGA extracting wrong value form array

Ansen1
Beginner
593 Views

I'm doing a project where I'm making a Rayleigh-distributed random number generator. I do not understand, but for some reason, my FPGA is incorrectly interpreting a value from an array. 

The array is very long but here is a snippet. 

type lut_type is array (0 to 991) of integer;
--Gradient
constant C1 : lut_type := (18199);

 

This is how I assign a value from the array. 

 

UNR <=std_logic_vector(to_unsigned(C1(counter), 16));

 

Somehow when I send the value of UNR over serial coms it reads some of the values wrong like 18199 as 18198. I know my python script is reading the values correctly. According to Modelsim the value assigned to UNR is 18199. But when I upload it to the FPGA It read/sends the wrong value.

 

What could cause this?

Labels (1)
0 Kudos
4 Replies
sstrell
Honored Contributor III
519 Views

You're creating a memory array but then you're creating a constant with a single value instead of assigning it to an address in the array.  Where are you expecting the 18199 to be stored if you don't reference it like C1(25) or whatever?  Are you trying to create a ROM?

0 Kudos
RichardTanSY_Intel
355 Views

Hi,


May I know is there any update on this case?

Do you able to resolve your issue?


Regards,

Richard Tan


0 Kudos
RichardTanSY_Intel
313 Views

Hi,


Do you need any further assistance from my side?


Regards,

Richard Tan


0 Kudos
RichardTanSY_Intel
260 Views

We noticed that we haven't received a response from you regarding the latest previous question/reply/answer, and will now transitioning your inquiry to our community support. We apologize for any inconvenience this may cause and we appreciate your understanding.


If you have any further questions or concerns, please don't hesitate to reach out. Please login to ‘https://supporttickets.intel.com’, view details of the desire request, and post a feed/response within the next 15 days to allow me to continue to support you. After 15 days, this thread will be transitioned to community support.


The community users will be able to help you on your follow-up questions.


Thank you for reaching out to us!


Best Regards,

Richard Tan


0 Kudos
Reply