Many embedded microcontrollers store ADC results in a packed format where a 12-bit ADC value and channel number are stored together in a 16-bit register.
You are given a 16-bit ADC register where:
Your task is to:
Example-1
Input: 0xC3F5 Output: Channel: 12 ADC Value: 1013
Example-2
Input: 0x10FF Output: Channel: 1 ADC Value: 255
Test Cases
Test Results
Input
0xC3F5
Expected Output
Channel: 12 ADC Value: 1013