This project implements a sequential multiplier and divider using SystemVerilog. The sequential multiplier repeatedly shifts and adds partial products, while the sequential divider performs iterative subtraction and shifting to compute the quotient and remainder.
rtl/
seq_multiply.sv
: Sequential multiplier moduleseq_divide.sv
: Sequential divider moduleseq_top.sv
: Top module that instantiates both multiplier and divider modules
wavedrom/
: Waveform diagramsobj_dir/
: Directory containing object files and executables generated during Verilator simulationtb.cpp
: Testbench top-level fileMakefile
: Makefile script to run the testbenchREADME.md
: Project documentationLICENSE
: License information
The provided testbench is designed for simulation using Verilator. Ensure Verilator is installed before running the testbench. Refer to the Verilator GitHub page for installation instructions.
-
Clone this repository:
git clone https://github.com/shsjung/sequential-multiply-divide.git
-
Navigate to the
sequential-multiply-divide
directory and run the following command:make
Below are example waveforms of the sequential multiplier and the sequential divider.
-
Sequential Multiply
- The multiplier completes its operation in
WidthB
+1 clock cycles, which is 33 in this case.
- The multiplier completes its operation in
-
Sequential Divide
- The divider completes its operation in
WidthB
+2 clock cycles, which is 34 in this case.
- The divider completes its operation in
This project is distributed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Please open an issue or submit a Pull Request if you'd like to contribute to this project.