Forum Discussion
Altera_Forum
Honored Contributor
10 years ago --- Quote Start --- Thank you for your prompt reply. I am trying to understand that but I might be missing something... So if x = 150, c = 3 and n = 3 then y = 3*2^3 = 24 -> 150*24 = 3600 and if I shift that n positions then I get 450 when I should get something near 150/3 = 50. What did i get wrong? Edit: the result is nearly correct if I shift 2*n positions. Does it mean anything? --- Quote End --- if you want to divide by 3 then your target is 150/3 = 50 in the design: convert 1/3 to 1/3 *2^n e.g. round(1/3 * 2^14) = 5461 (your n of 3 is too low) 5461 * 150 = 819150 discard n bits i.e. your result becomes 818150/2^14 = 49.996