Focusing on the upper 4 high bits of these 5 constant terms, if K is even, these will always sum to zeroes and a carry out bit, have no effect on the result, and can be replaced with zeroes. If K is odd, these will always sum to 1's, inverting the upper 4 bits of the output sum. Therefore, those can be replaced with zeroes and inverting the upper 4 bits of P (`P[11:8]`) after summation.
The column of bits at `(1 << (M-1))` can be summed together prior to compilation into one constant value of `(K << (M-1))`. Therefore, the final MAC output can be shown by: