Calculate No of Fragment in file

Dear Experts,
Thanks for your time. I have got stuck on following problem. I have one file with five column name Chr, Pos Qial GT1 and GT2. In file Column 4 Gt1 is with 01 value only. I like to do comparision between col GT1 and col GT2. I like It has to check col 4 and 5 and print in output If 01 is followed by 00 as starting point and in another situation 00 followed by 01 as End point. For example In following sample, It has to print row (2) as starting point because it is followed by 00 in Col GT2. and row (4) as end point. Another cases would mentioned in expected outcome details. In few cases like row (10) and (13) where 01 situation is pre and followed by 00. So it first write this position as end point and same position as start point in next row.

This can easily be done by going through your data a line at a time. Since it's only the last number that is changing there is no need comparing it with the pervious figure before it.
Just take the number you wanted and check the condition you specify, if that is met, raise a flag, but if not take off the flag; like a flip-flop switch.