code
No one writes and give you the ready made code. Instead you write something and check out, refer here if you got doubts. if you dont know the coding better refer to some beginner books,,not here
I am giving hints.try a code yourself and post the MODELSIM outputs.
[label :] [iteration_scheme] loop
{ sequential_statement }
{ next [ label ] [ when condition ] ; }
{ exit [ label ] [ when condition ] ; }
end loop [label];
That is the syntax in loop equatios. try out now
And to view the output in modelsim is pretty simple. I didnt understand where have you got the doubt