i want to convert the number (5)DEC
to to BITS=(101)BIN
can u help?
Sat Jan 16 2010, 14:09:05
(no subject)(by Jonathan Westhues)
I'm assuming that you have an integer variable, and you want to write it out on multiple digital outputs, in binary format. See the attachment for example; this pulls the top 4 bits out of a 10-bit number, so the places are valued at 512, 256, 128, and 64.
In your case, the places would be valued at 4, 2, and 1. Everything else stays the same.
A similar method can be used for other codes (like BCD, with place values 1 2 4 10 20 ...).
Sat Jan 16 2010, 16:05:59, download attachment binary-out.ld