In embedded systems, status registers often represent multiple flags using each bit. You are given an 8-bit status register. Each bit corresponds to a different condition.
Bit-to-Flag Mapping
Bit | Meaning |
0 | Power On |
1 | Error |
2 | Tx Ready |
3 | Rx Ready |
4 | Overheat |
5 | Undervoltage |
6 | Timeout |
7 | Reserved |
You must write a function that:
Example-1
Input: 13
Output:
Power On
Tx Ready
Rx Ready
Example-2
Input: 48
Output:
Overheat
Undervoltage
Example-3
Input: 255
Output:
Power On
Error
Tx Ready
Rx Ready
Overheat
Undervoltage
Timeout
Reserved
Input
13
Expected Output
Power On Tx Ready Rx Ready