tsillen
Junior Member level 1
I must be really stupid because I can't seem to find the answer online after a long time searching.
My system consists of ADC -> Decimation filter (matlab) -> DAC
I got the ADC , DAC , clkdiv all working with relative ease but I'm having troubles with a simple step.
The ADC / DAC is 12 bit , 2.048V reference . My filter accepts +-2V fixed point
Input word length 12 bit , input fractional length 10 bit fixed point
Output word length 12 bit , output fractional length 10 bit fixed point
Matlab filter picture:
So what I need to do seems fairly simple , convert the 12 bit binary from the adc to the above mentioned 12b fixed point.
In C/C++ I would have this working in no-time but I'm fairly new to VHDL and need help with this.
Since the reference is 2.048V , the adc 12 bit (4096 steps), each step = 0.0005V
logic says float / real ADCOUTV = 12 bit binary value * 0.0005V and after convert this float / real to the mentioned fixed point format.
I also read that it might not be smart to use floating point / real in VHDL , is there a simpeler way to get this done ?
I'm really struggling with this conversion and would greatly appreciate if anyone can give me tips or help me.
Kind regards,
Ths
My system consists of ADC -> Decimation filter (matlab) -> DAC
I got the ADC , DAC , clkdiv all working with relative ease but I'm having troubles with a simple step.
The ADC / DAC is 12 bit , 2.048V reference . My filter accepts +-2V fixed point
Input word length 12 bit , input fractional length 10 bit fixed point
Output word length 12 bit , output fractional length 10 bit fixed point
Matlab filter picture:
So what I need to do seems fairly simple , convert the 12 bit binary from the adc to the above mentioned 12b fixed point.
In C/C++ I would have this working in no-time but I'm fairly new to VHDL and need help with this.
Since the reference is 2.048V , the adc 12 bit (4096 steps), each step = 0.0005V
logic says float / real ADCOUTV = 12 bit binary value * 0.0005V and after convert this float / real to the mentioned fixed point format.
I also read that it might not be smart to use floating point / real in VHDL , is there a simpeler way to get this done ?
I'm really struggling with this conversion and would greatly appreciate if anyone can give me tips or help me.
Kind regards,
Ths
Last edited: