looks like a cool verilog/VHDL homework :slightly_...
# general
g
looks like a cool verilog/VHDL homework 🙂 you likely need 1 5-bit adder + 2 5to32 decoders + combining previous output bit value (or earlier in the signal path) with decoded signal with some combinational logic to drive the output bus