Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualParadigm Shifter

Posted 27 December 2012 - 12:54 PM

Yeah, that's what we did back in PS1 days. Every time you multiply a 12 fractional bit number by another, you need to shift down 12 bits afterwards to get the right answer. You can keep the accuracy high by storing the result & 4095 (just getting the fractional part) before shifting down, and accumulating it in another int. When it overflows to 4096, subtract 4096 from the remainder accumulator and add 1 << 12 to the fixed point value.

EDIT: This new forum update has knackered the post formatting hasn't it? I meant result logical anded with 4095

#2Paradigm Shifter

Posted 27 December 2012 - 12:54 PM

Yeah, that's what we did back in PS1 days. Every time you multiply a 12 fractional bit number by another, you need to shift down 12 bits afterwards to get the right answer. You can keep the accuracy high by storing the result & 4095 (just getting the fractional part) before shifting down, and accumulating it in another int. When it overflows to 4096, subtract 4096 from the remainder accumulator and add 1 << 12 to the fixed point value.

EDIT: This new forum update has knackered the post formatting hasn't it? I meant result logical anded with 4095

#1Paradigm Shifter

Posted 27 December 2012 - 12:53 PM

Yeah, that's what we did back in PS1 days. Every time you multiply a 12 fractional bit number by another, you need to shift down 12 bits afterwards to get the right answer. You can keep the accuracy high by storing the result &amp; 4095 (just getting the fractional part) before shifting down, and accumulating it in another int. When it overflows to 4096, subtract 4096 from the remainder accumulator and add 1 &lt;&lt; 12 to the fixed point value.

PARTNERS