Forum Discussion
Altera_Forum
Honored Contributor
14 years agoA custom mulacc instruction would have to be a clocked (not combinatorial one) but is otherwise simple.
If you only need/have a 32bit result it can be inconditionally latched as the instruction 'result' - use the writerc bit to stop the write into the register file. To avoid needing a second custom instruction to clear the accumulater, you could detect rA being zero (no point doing a mulacc with a fixed zero!). Or clear readra (and readrb) and use the 5bit rA as an opcode. A similar 'trick' could be used to read the high part of a 64bit result. I've actually wondered how much fpga 'real estate' a full multiplier takes. Having the option of a fast multiply (and/or the high 32bits of the product) on all processor families could be useful. The 64bit result is very useful for fixed point arithmetic and dividing by constants.