Mask the bits out you want, right shift down so that the result is in the lower bits.
So to get the 0x6 from 0x156A you'd first mask it out, and it is covered by 0xF0.
Then, because it is the second group of 4 bits shift that down by 4 bits.
Something like this might help you;
#include <iostream>
using namespace std;
int main() {
const int source = 0x156A;
const int first_4 = (source & 0xF) >> 0;
const int second_4 = (source & 0xF0) >> 4;
const int third_4 = (source & 0xF00) >> 8;
const int fourth_4 = (source & 0xF000) >> 12;
cout << hex;
cout << "Source = 0x" << source << endl;
cout << "First four bits = 0x" << first_4 << endl;
cout << "Second four bits = 0x" << second_4 << endl;
cout << "Third four bits = 0x" << third_4 << endl;
cout << "Fourth four bits = 0x" << fourth_4 << endl;
return 0;
}
Hope this helps,
Fredrik