A VHDL/FPGA implementation of the 3k+1 (Collatz) sequence generator, built in two RTL styles and verified through simulation + synthesis.
This project finds the smallest positive integer k whose 3k+1 sequence has at least 9 terms, using hardware-oriented RTL design.
Two implementations are included:
- Single clocked process (
part1.vhd) - ASM-style datapath + control unit (
part2.vhd)
Both produce the same functional outcome and were carried through simulation and FPGA implementation flow.
- Smallest
kwith sequence length ≥ 9: 6
| Path | Description |
|---|---|
part1.vhd |
Single-process RTL implementation |
part2.vhd |
ASM datapath/control RTL implementation |
3k.xdc |
Nexys A7 constraints |
part1.do |
ModelSim script for part 1 |
part2.do |
ModelSim script for part 2 |
part1_wave.pdf |
Waveform output for part 1 |
part2_wave.pdf |
Waveform output for part 2 |
docs/architecture.md |
Architecture notes + diagram sources |
docs/results.md |
Validation summary |
process.bit, asm.bit |
FPGA bitstreams |
process.vdi, asm.vdi |
Implementation/synthesis logs |
- VHDL (
numeric_std, synthesizable RTL) - ModelSim for simulation
- Vivado for synthesis/implementation
- Nexys A7 FPGA target board
do part1.dodo part2.do
- Open project in Vivado.
- Add either
part1.vhdorpart2.vhd. - Apply
3k.xdc. - Run synthesis, implementation, and bitstream generation.
- Clean arithmetic with
numeric_std - Explicit width handling (
resize) for safe synthesis behavior - FSM-based control flow (no non-synthesizable
whileloop dependence) - Two architecture styles demonstrating design trade-offs:
- compact single-process RTL
- modular control/datapath partitioning
This repo demonstrates practical digital design skills:
- RTL state-machine design
- Datapath/control decomposition
- Cycle-accurate hardware reasoning
- Simulation-based verification
- FPGA build flow to bitstream artifacts