The Wallace tree uses parallel carry-save adders to reduce partial products in logarithmic time. An 8-bit Wallace tree reduces 8 products to 2 in 3–4 levels, then a final fast adder.
module wallace_tree_8bit ( input [7:0] A, B, output [15:0] P ); // Step 1: generate partial products wire [7:0] pp[0:7]; genvar i, j; generate for(i = 0; i < 8; i = i+1) begin assign pp[i] = 8A[i] & B; end endgenerate// Step 2: reduction using full/half adders (not shown in full) // The tree would reduce 8 vectors to 2 vectors (sum and carry) wire [15:0] sum_vec, carry_vec; // Step 3: final addition assign P = sum_vec + (carry_vec << 1);
endmodule
Performance: Fastest for 8-bit (critical path ~log2(8) adder delays).
Area: Larger than sequential but smaller than full array (due to compression).
GitHub search tip: Look for wallace-tree-verilog or compressor-adder. 8bit multiplier verilog code github
├── 8bit_multiplier.v # Combinational multiplier
├── 8bit_multiplier_seq.v # Sequential multiplier
├── tb_8bit_multiplier.v # Testbench
├── Makefile # Simulation commands
└── README.md # This file The Wallace tree uses parallel carry-save adders to
## Usage
How to synthesize: combinational module maps directly to multiplier DSP/logic; sequential maps to small FSM + adder.
License: MIT (or choose preferred)