Chargement…
Chargement…
Keep two 18-bit vectors, save and carry. For each 18-bit extended operand: save_next = save xor carry xor operand, then carry_next = ((save and carry) or (save and operand) or (carry and operand)) sll 1. After the fourth compression, calculate save_next + carry_next.
Latch all four inputs on i_start while idle. Keep o_busy='1' through the four compression cycles, then pulse o_done for one cycle. Synchronous active-high reset clears all state.
The testbench checks different bit patterns, zero, the maximum sum, and the completion pulse.