A Wallace multiplier is a digital circuit which multiplies two integers in binary format. It uses half and full adders to sum partial products in stages until two numbers are left. In this project I shall be developing a 3-bit multiplier using Wallace tree reduction. Before you go through this make you have the sky130pdk in this folder and change the current path in "wallace3tree_test.cir" directing to the sky130 pdk.
- NGSpice Software
- eSim
Port | Type | Description |
---|---|---|
a | Input | 3-bit input |
b | Input | 3-bit input |
z | Output | 6-bit output |
| Here "a" and "b" are 3-bit input digits, and the output "z" contains 6-bits.
Component | Total |
---|---|
AND gates | 9 nos |
Half Adders | 3 nos |
Full Adders | 3 nos |
- halfadder
- fulladder
- and_gate
- xor_gate
It has three steps:
- Multiply each bit of one of the arguments, by each bit of the other.
- Reduce the number of partial products to two by layers of full and half adders.
- Group the wires in two numbers, and add them with a conventional adder.
You can view the schematic using esim software, launch esim and
open this folder, the esim automatically detects the .proj
file
and creats a project for "wallace3tree". Then select respective
".sch" file to launch the schematic of the project.
$ git clone https://github.com/Ikarthikmb/wallace-tree.git
Open eSim application and select open project then navigate to folder wallace-tree
to select wallace3tree. The wallace3tree project file is now added in the eSim.
AND gate schematic:
Draw a schematic with eSim Schematic editor for an AND gate logic circuit with cmos logic, perform CRC error check and export the ngspice netlist.
Draw a schematic with eSim Schematic editor for an XOR gate logic circuit with cmos logic, perform CRC error check and export the ngspice netlist.
Draw a schematic with eSim Schematic editor for an Half Adder circuit with AND and XOR gates, then perform CRC error check and export the ngspice netlist.
Draw a schematic with eSim Schematic editor for a Full Adder circuit with AND and XOR gates, then perform CRC error check and export the ngspice netlist.
Draw a schematic with eSim Schematic editor for a 3-bit Wallace Multiplier logic circuit with AND gates, half adders and full adders. Then perform CRC error check and export the ngspice netlist.
After the netlist is generated, select kicad to spice from the eSim window to convert the
kicad schematic to ngspice model. Rename the netlist file wallace3tree.cir.out
to wallace3tree_test.cir
$ cp wallace3tree.cir.out wallace3tree_test.cir
Add the path for the sky130pdk in the wallace3tree.cir.out
file. In the subcircuit .sub
file replace the
model mosfet_n with sky130_fd_pr__nfet_01v8
and mosfet_p with sky130_fd_pr__pfet_01v8
.
Now, lets simulate the circuit with ngspice.
Lets assign the inputs a
and b
with the pulse signals and try to observe the output.
$ ngspice wallace3tree_test.cir
With this the ciruit simluation is verified. If you encounter with errors recheck the circuit and perform the run
again.
Design of a 3-bit Wallace Tree Multiplier in eSim
- Wallace Tree: https://en.wikipedia.org/wiki/Wallace_tree
- eSim EDA tool: https://esim.fossee.in
This is a project submitted to eSim marathon partnered with Free/Libre and Open Source Software for Education(fossee), Indian Institute of Technology, Bombay(IITB), VLSI System Design(VSD) and Ministry of Education, India during May-June of 2021.