Forum Discussion
Altera_Forum
Honored Contributor
13 years ago --- Quote Start --- @tricky Sorry that was a mistake. You are right. I mean ('0' & data_in(11 downto 0); Sorry for the confusion. Can you tell me why I am not getting correct ADC values? I used the approach that was given to me in the previous comment by @kaz --- Quote End --- you should not put '0' unless it is unsigned but your computation is signed. This will give wrong results. if your data is 12 bits then use less bits(subtractor needs 13 bits, sum needs 18 bits). you are wasting double resource for two cases. You can use one computation section for both switching between them at input to delay section. setting data type to signed at delay stages as Tricky suggested is an option but I believe doesn't make life any easier.