P
pasamdivya
Hi everyone,
I need to store an unsigned 16 bit number in the upper (MSB) and
another unsigned 16 bit number in the 16 LSB. Basically, I am trying
to store two unsigned 16 bit numbers into one unsigned 32 bit number.
So far, I have the following:
struct
{
unsigned int num1:16;
unsigned in num2:16;
} twoUnsigned16BitNums;
unsigned int num;
What I am having trouble with is to store the two 16 bit numbers into
the 32 bit number. I know one option is to use bit wise ANDs and ORs.
Any help on your part is greatly appreciated. Best Regards.
I need to store an unsigned 16 bit number in the upper (MSB) and
another unsigned 16 bit number in the 16 LSB. Basically, I am trying
to store two unsigned 16 bit numbers into one unsigned 32 bit number.
So far, I have the following:
struct
{
unsigned int num1:16;
unsigned in num2:16;
} twoUnsigned16BitNums;
unsigned int num;
What I am having trouble with is to store the two 16 bit numbers into
the 32 bit number. I know one option is to use bit wise ANDs and ORs.
Any help on your part is greatly appreciated. Best Regards.