Forum Discussion
Altera_Forum
Honored Contributor
14 years agosfixed to ufixed conversition
Hi all; I have learn about ufixed and sfixed operation. I want to convert -0.129 to sfixed using the code below and its has no problem; signal n1: ufixed (4 downto -4); ... out_A <= ...
Altera_Forum
Honored Contributor
14 years agoyou cant really do that, because ufixed is unsigned fixed, and sfixed is signed fixed.
Therefore, using a ufixed to size an sfixed is not appropriate. and direct conversion from sfixed to ufixed would be innapropriate without an abs function. so, dont put signed numbers into ufixed. Keep them sfixed.