I'm currently trying to work through some examples in one of Pong Chu's books. There's one thing I'm not quite clear on. In many of his exampleshe uses lots of if .. else statements, but hardly ever for loops. In some of the questions, you're asked to extend some example he has given, e.g.going from say 4bit input to 12bit or something like that.\n\nFor this kind of example, it seems natural to me to use some sort of loop for each of the 12bits. Is this poor practice?\n\nOne example he gives is a priority encoder, where you output the highest bit that is set to 1. If we have 4 bit input and 3 bit output, we would have\n\nin out \n"1XXX" "100" (4)\n"01XX" "011" (3)\n"001X" "010" (2)\n"0001" "001" (1)\n"0000" "000" (0)\n\nIf we had some 32bit input std_logic_vector, would we really have to explicitly code each case or is there some sort of looping we can use? What isthe preferred method to deal with long std_logic_vectors?