Systemverilog shift operator question

In reply to Svlearner:

That’s nice that you want to write this. If I give you the answer, then you would not have written it. I can suggest using a for-loop. It can be done in one statement if you do it in the correct direction.