The requirements for smoke/CO detectors in homes vary by state. In general, every state requires all residential dwellings to be equipped with smoke detectors. Some states require that detectors be interconnected or hardwired with a battery backup.
Many state and local municipalities have also adopted the NFPA 72 code, which requires smoke detectors to be installed on every level of a home (including basements), inside every bedroom, and outside every sleeping area (larger homes require additional smoke detectors).