ZEDA
1.6.18
|
Macros | |
#define | printf_bit(v, w) fprintf_bit( stdout, (v), (w) ) |
output a bit sequence to the standard output. More... | |
Functions | |
ulong | bit_rotate (ulong val, int bitwidth, int d) |
rotate a bit sequence. More... | |
ulong | bit_reverse (ulong val, int bitwidth) |
reverse a bit sequence. More... | |
void | sprintf_bit (char *str, ulong val, int width) |
convert a bit sequence to a string in binary format. More... | |
void | fprintf_bit (FILE *fp, ulong val, int width) |
output a bit sequence to a file in binary format. More... | |
#define printf_bit | ( | v, | |
w | |||
) | fprintf_bit( stdout, (v), (w) ) |
output a bit sequence to the standard output.
rotate a bit sequence.
bit_rotate() rotates a bit sequence of a value val with the bit width bitwidth. d is a rotation displacement.
reverse a bit sequence.
bit_reverse() reverses a bit sequence val with the bit width bitwidth.
void sprintf_bit | ( | char * | str, |
ulong | val, | ||
int | width | ||
) |
convert a bit sequence to a string in binary format.
sprintf_bit() converts a given value val to a string in binary format. The string is stored where a pointer str points. width is the applied bit width. For example, sprintf_bit( str, 0xf, 6 ) makes str "001111".
void fprintf_bit | ( | FILE * | fp, |
ulong | val, | ||
int | width | ||
) |
output a bit sequence to a file in binary format.
fprintf_bit() outputs a given value val to the current position of a file pointed by fp. The output format is the same with that of sprintf_bit().