First let me say, my thoughts and prayers are with you during this tough time.
This past year, both of my remaining grandparents died (only 2 I knew, as the others passed before I was born). My 5 year old was 4 at the time. He knew my grandmother very well, and often went down to visit her when he stayed with my mom (once/month or so). I think my son's reaction and feelings would have been different if my own mother had died, but we explained to him that great grandma had died, and that it meant that he would not see her anymore. She had lung cancer, so we explained to James that dieing meant that she was not in pain any longer, and that she went to a better place.
We had to explain death to James several times because whenever we went down to her house to pack up boxes, he would ask where she was. The best approach I found that worked, was to repeat the same explanations over and over so that he would not get confused by multiple explanations.
Once he clearly understood what had happened, and remembered it, he became obsessed with death (but not in a bad way). He loved to tell people that his great grandma had died, he enjoyed seeing bugs die that had been stepped on (what kid doesn't, right?). He mentioned death so much that I had to explain to his teachers, and a few other people that the obsession was because my grandmother had passed, but it was what I think was a very health reaction.
I chose not to tell James before hand that she was going to die because I was afraid that it might give him nightmares or cause extra anxiety. I do not regret my decision. He did know that she was sick, and every time he visited, we made sure he said goodbye to her. At the very end when it was clear that it was time, we did not allow James to see her because we did not want to scare him.
When it was time for my grandfather's memorial (my grandmother's memorial has not happened yet due to life getting in the way) I left James with my boyfriend because I knew it was not going to be an appropriate thing for him, and I knew that it was likely to be long and boring, where he would most definitely become a disruption and not allow myself or others to grieve properly.
I cannot tell you what is best as far as the funeral is concerned, but I would suggest that perhaps your children are a little young for a funeral. Is there someone that you can leave them with during the funeral? My thought is that it would be a good idea to take them to the graveside so they can see the final resting place, but perhaps not during the service. If you feel you need to have a service with your children involved, perhaps you could do one of your own with just you and your kids where you and your son tell the favorite thing about your dad and what you can do to remember him, like putting special pictures up around the house.
One last thought, if you do want to talk to your kids about this before your dad is gone, is that there are a lot of good books, and probably a few kids shows that deal with the death of a family member that would be helpful to them. I am sure you can get them from your local library. If you need help finding them, just ask the librarian.
I hope this has been helpful and not too long winded.