Forum Discussion
Altera_Forum
Honored Contributor
12 years ago --- Quote Start --- You can declare (n) as unsigned(7 downto 0) n range is 0~255 so n*n range is 0~65535, while (dis) range is 0~255 so if you divide dis/(n*n) you get (0~255)/(0~65536) and so it is mostly < 1 i.e. zero division result + remainder apart from the small range case when dis > (n*n) --- Quote End --- hi kaz , sorry for late.i were very ill anyway,y are right really the result of division will be always between 0~1. will be some thing like 0.234....etc.so its floating numbers, but i want to know from you how to avoid the floating numbers and the same time know the correct answer because you know that floating numbers in implementation is a big problem. the counter will gave me the result of the data inputs number its only one value (the last value from a stream signal) and the dis is the accumullation of the dis values its only one value and i want to check if the result of the counter is even or odd value then divide the accumulator result on the n*n or (n*n)-1 . i kknow its easy task ,but i new in vhdl and want your help .many thanks