What are you trying to do because your question isn't very clear. The cd is just an image that puts the os on. You are basically paying for the key. So in theory you can make your own cd for free but your copy of windows won't be activated and legit to stay updated with protection without a valid key. So, if I am reading your question correctly you can simply reinstall the os and if you reformat the old drive it will basically "clean out" the old data and install everything like it was brand new. You re-use the old key and it's like when you first got it. It doesn't matter then if it recognizes it as an old or a new drive but keep in mind that all of your old data will be lost unless you have it backed up somewhere.
So if I am understanding correctly that's what you mean then simply put, yes, you can use the same cd key and cd.
Think of it this way, if your old hard drive died and the rest of your computer was still working and you bought a brand new drive and installed using the same cd and key it will work. It doesn't care to recognize if it's the same hard drive or a new one. The new hard drive of course will not have any of your old data. When you reformat it's basically making your drive like new. (There are ways to retrieve data after format soon after with certain software if you don't use swiper programs but that's beyond your question in case any one chimes in on that I'm lightly addressing that here). Anyhow, I hope this helps and if any part doesn't make sense please clarify what you actually want to know and I will do my best to help!
Thanks,
Justin S.