logic

Converting between hexadecimal, decimal, and binary is a pretty constant activity when you work with a new microchip.

HiZ>=<<<HEX/DEC/BIN converter command
CONVERT (1) >0b1010 <<<convert this value
0x0A <<<HEX equivalent
10<<<DEC equivalent
0b00001010<<<BIN equivalent
HiZ>=<<<HEX/DEC/BIN converter command
CONVERT (1) >0xf
0x0F
15
0b00001111
HiZ>

The latest Bus Pirate nightly firmware compile (v2.1-RC3+) adds a much-needed base conversion command, available in all modes. Press ‘=’ and enter any byte value to see the HEX/DEC/BIN equivalent.

HiZ>=
CONVERT (1) >0
INVALID, TRY AGAIN>

The prompt function sees 0 as an invalid option. Converting zero remains an exercise for the reader. You may also refer to the chart below:

HEX DEC BIN
0x00 0 0b00000000

Just a reminder: The Bus Pirate accepts HEX/DEC/BIN formatted input, and the output display can be toggled between these formats as well (o menu). See the Bus Pirate manual for more info.

Image:

Advertisements