You are given a control register represented using nested struct bitfields. The register is 8-bit wide and divided into the following layout:
Your task is to:
Return 1 if valid, else return 0.
Example-1
Input: 0x05 → 00000101 Output: 1
(enable=1, mode=0, priority=1, reserved=0)
Example-2
Input: 0x0F → 00001111 Output: 0
(priority=3, reserved=0)
Example-3
Input: 0x95 → 10010101 Output: 0
(reserved ≠ 0)
Test Cases
Test Results
Input
05
Expected Output
1