0

I'm reading a 32 bit binary value from an FPGA. This is not a number, each bit represents an error flag for a part of the system. This means that it's important that it is displayed in binary format not hex or decimal.

I simply wish to print the value and treat it as binary.

For example:

printf("Error table: /n %x /n", error_table);

will print the value in hex format. What do I need to do to print this in binary format?

I'd like the result displayed onscreen to be more like:

Error table:
00101101001010000010010010110101

Do I need to convert it to a string?

BenAdamson
  • 625
  • 3
  • 10
  • 19

0 Answers0