I want to give the input in code itself.I dont want to use testbench to give different serial inputs. I n above code i have used for loop but index is not incrementing how to write the code?please suggest me
A test-bench is highly recommended. Your design/logic needs to interact with the outside world. The top-level ports are the path-ways for your design/logic to receive and output data.
How do you feed-in or monitor data of your design?
By using a test-bench. Follow proper-design methodology, get into the habit of writing test-benches.
You are generating multiple always blocks that are assigning different values to the same reg bits. Causes multiple driver error in synthesis and useless simulation code.
The OP looks like they are trying to write a mixture of hardware (always @(posedge clk) begin) and software for loops, it's no wonder they are having problems.
I haven't shown any code for shift or for determining you've shifted 16-bits of data and now have your parallel output. But as you can see this is NOT written like software. For loops are useless for hardware unless your plan is to replicate something and are too lazy (a good thing in this case) to write multiple instances of something that is very repetitive.