nagkiller
Full Member level 4
- Joined
- Jul 9, 2009
- Messages
- 238
- Helped
- 37
- Reputation
- 74
- Reaction score
- 37
- Trophy points
- 1,308
- Location
- Brazil
- Activity points
- 2,706
PIC CCS C Compiler Hexadecimal to Binary Conversion : How to
Hello!!!
I need code in CCS Compiler to convert the value hex 4C48F5 into value 24 bit binary ( like this 101011110001001000110010 ).
Thanks for reply.
- - - Updated - - -
Solved!!!
In my case the code is:
Hello!!!
I need code in CCS Compiler to convert the value hex 4C48F5 into value 24 bit binary ( like this 101011110001001000110010 ).
Thanks for reply.
- - - Updated - - -
Solved!!!
In my case the code is:
Code:
void Convert(int Code1, int Code2, int Code3)
{
int aux;
int bit;
for(aux = 0; aux < 8; aux++)
{
bit=(Code3>>aux)& 0x01;
}
for(aux = 0; aux < 8; aux++)
{
bit=(Code2>>aux)& 0x01;
}
for(aux = 0; aux < 8; aux++)
{
bit=(Code1>>aux)& 0x01;
}
}
void main()
{
Convert(0x4C,0x48,0xF5);
}