Forum Discussion
Altera_Forum
Honored Contributor
13 years ago --- Quote Start --- @kaz If I dont put '0', I get the following error. Should I reduce subtractor bits? Error (10344): VHDL expression error at adc_cntrl.vhd(160): expression has 12 elements, but must have 13 elements. --- Quote End --- sub_result <= resize(signed(data_in),13) - signed(stage(31)); if you are not averaging both ADC data in parallel then you can switch between them at signal stage:
if avg_1 then
stage(1) <= adc1;
elsif avg_2 then
stage(1) <= adc2;
end if;