May I share with you the definitions from Oxford Advanced Learner's Dictionary, 8th edition:
carpet / kɑpɪt /
2 [countable] a piece of carpet used as a floor covering, especially when shaped to fit a room
to lay a carpet
a bedroom carpet
(BrE) We have fitted carpets (= carpets from wall to wall) in our house.
rug / rʌɡ /
1 a piece of thick material like a small carpet that is used for covering or decorating part of a floor
a hearth rug (= in front of a fireplace)
an oriental rug
a sheepskin rug
2 (BrE) a piece of thick warm material, like a blanket, that is used for wrapping around your legs to keep warm
a travelling rug
a tartan rug
So I quite agree with the previous answers.