It's relatibvely straight forward, you need to use an If/else statement so that if the user group is unregistered/not logged in then display the adsense code else don't display the code, if your still stuck I'll dig out the exact code as using a similar thing on my own forum