uint8_t bits_that_are_zero(uint8_t num)
{
return low_bits_that_are_zero(num)
+ low_bits_that_are_zero(num>>4);
}
uint8_t low_bits_that_are_zero(uint8_t num)
{
uint8_t zeros;
num &= 0xF;
zeros = (~num)&0x3;
if(zeros < 2)
zeros += 1;
if(num < 4)
zeros += 1;
else if(num >=12)
zeros -= 1;
return zeros;
}
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
Is this code allowed in MySQL language? | Programming & Languages | 1 | ||
test bench code | Homework Help | 1 | ||
S | Programm on MKICROC | General Electronics Chat | 13 | |
S | Please explain me what is error in my programm ? | Programming & Languages | 5 | |
only one programm | Programming & Languages | 3 |
by Jake Hertz
by Jake Hertz
by Jake Hertz