Function with variable input buswidth

In reply to dave_59:

Thanks Dave. This seems like a good option. However, I’m curious why did you decide to use static function?

Also, I’m curious about the other solution you were suggesting in your initial post regarding “creating dynamic array of bits”. Why did you not choose this option as a solution?