In reply to a72:
This is the correct result. You have a text file with numbers formatted in a string of binary radix ASCII characters. The ASCII code for @ is 8’h40, and the ASCII code for 0 is 8’h30. So 16’h4030 is what $fread sees.
You probably want to use $fscanf(fd,"@%d %b", idx, reg1);