Now, give you an input. It is 32 bit width. Ask you give the zero count from the beginning of the data. For example. If the input is 32'b0000_0001xxxxxx, then the
output is 7. If the input is 32'b0000_00001xxxxx, then the output is 8. Please give me some advice. Thank you!
process(data)
variable count_var : std_logic_vector(4 downto 0);
begin
count_var := (others => '0');
for i in 31 downto 0 loop
if(data(i) = '0') then
count_var := count_var + 1
else
exit
end if;
end loop;
count_sig <= count_var;
end process;