Sex w/ your kid in the room?

When does it become inappropriate to have sex with your child in the room? I have a friend who says that it's totally normal and the kid doesn't know what's going on. What are y'all's thoughts?  When do they start registering what's going on?