Verilog: Using a counter module to switch outputs
Then why would you use 2 bits for Y. If you only need two possible outcomes just use a single bit Y = counter [24];, Also you need to have a reset in the counter module so that you can initialize the counter to zero or else it's value will remain XX.