How to get the most significant bit being one in VHDL?
What you are asking for is called a 'Priority Encoder'. For an example, see this existing question:

https://stackoverflow.com/questions/14113125/short-way-to-write-vhdl-priority-encoder

Looking at that example, you would replace switch with your input, and assign your output using highest_switch.