EDA_hg81
Advanced Member level 2
two complement
Let me explain the problem first.
In the new design, the high voltage output means signal is low and low voltage output means signal is high.
But in the old design, the situation is reversed. The high voltage output means signal is high and low voltage output means signal is low.
I have to modify VHDL code inside old design.
The output data from ADC is two’s complement format. Output is 16 bit.
The following is the code:
Old code :
New code:
But above modification is not working.
What is the problem?
Thanks.
Let me explain the problem first.
In the new design, the high voltage output means signal is low and low voltage output means signal is high.
But in the old design, the situation is reversed. The high voltage output means signal is high and low voltage output means signal is low.
I have to modify VHDL code inside old design.
The output data from ADC is two’s complement format. Output is 16 bit.
The following is the code:
Old code :
Code:
ad_data_regh <= AD_DAT;
Code:
ad_data_regh <= "0111111111111111" + (not(AD_DAT) + "0000000000000001");
What is the problem?
Thanks.