Hello,
I'm planning to do a hobby project using a Lattice ICE40 UltraPlus FPGA. As I was reading through the documentation, I've noticed some odd logic in the block diagram of the MAC16 hard macro (pls. see attachment). The sum of the intermediate 8x8 products seems wrong when doing a 16 bit multiplication.
In my understanding the DSP cell should implement the following logic:
A[15:0] * B[15:0] =
((A[15:8] * 0x100) + A[7:0]) * ((B[15:8] * 0x100) + B[7:0]) =
(A[15:8] * B[15:8] * 0x10000) + (A[7:0] * B[15:8] * 0x100) + (A[15:8] * B[7:0] * 0x100) + (A[7:0] * B[7:0]) =
(F[15:0] * 0x10000) + (J[15:0] * 0x100) + (K[15:0] * 0x100) + G[15:0] =
(F[15:8] * 0x1000000) + ([F[7:0] + J[15:8] + K[15:8]) * 0x10000) + ((J[7:0] + K[7:0] + G[15:8]) * 0x100) + G[7:0]However the block diagram suggests the following design implementation:
([F[7:0] + J[15:8]) * 0x1000000) + ((J[7:0] + K[15:8]) * 0x10000) + ((K[7:0] + G[15:8]) * 0x100) + G[7:0]
So I'm wondering, whether
- this is a documentation problem
- the design is broken
- my math is wrong
Is there anybody with hand-on experience on ICE40 FPGAs, who can confirm that the MAC16 cells do perform correct 16 bit multiplications?
Thanks,
Dirk