Implementing a VHDL binary search on a std_logic_vector [vhdl]
问题 I'm attempting to create synthesizable VHDL (function or procedure) for an ASIC (it must be part of the ASIC) that will look for the first '1' in a standard_logic_vector and output which vector position that '1' was in. For example, I have an 8-bit slv of "10001000" (a '1' in position 3 and 7). If I use this slv, the output should be 4 (the output is 1 based). The actual VHDL will be searching a large slv, up to 512 bits in length. I tried implementing a binary search function but I get