## Teaching binary to decimal conversion

Sometimes we have data in binary and we want to convert it to decimal to lookup some constant in a header file, for example. I used to do it previously via calc.exe. Now I use **.formats** WinDbg command and **0y** binary prefix:

`0:000> .formats 0y111010`

Evaluate expression:

Hex: 0000003a

Decimal: 58

Octal: 00000000072

Binary: 00000000 00000000 00000000 00111010

Chars: ...:

Time: Thu Jan 01 00:00:58 1970

Float: low 8.12753e-044 high 0

Double: 2.86558e-322

Some months ago I was flying SWISS and found this binary watch in their duty-free catalog which I use now to guess time

It has 6 binary digits for minutes. There are desktop binary clocks and other binary watches available if you google them but they don’t have 6 binary digits for minutes. They approximate them by using 2 rows or columns: tenths of minutes and minutes (2 + 4 binary digits) and we are all good in handling 4 binary digits because of our work with hexadecimal nibbles but not good in handling more binary digits like 5 or 6 when we see them in one row.

- Dmitry Vostokov @ DumpAnalysis.org -