Forum Discussion
Altera_Forum
Honored Contributor
9 years agoHow to square a fixed point number?
Assuming I have a 16 bit fixed point number that needs to be squared, how should this be implemented? The number format is Q2.14. Squaring it shall produce a result that is 32 bits instead a...
Altera_Forum
Honored Contributor
9 years ago --- Quote Start --- just multiply 16 bits x 16 bits = 32 bits If you are asked to also scale down then truncate LSBs --- Quote End --- Truncating always floors the values (ie. rounds down). If you need to round to nearest, you add 1 to the highest LSB you are going to discard, then discard the LSBs.