Home
Prox / RFID
Verichips
Ladder Logic
[interfacing] †
Tube Joints
Key Code From Photo
SolveSpace (3d CAD)
SketchFlat (2d CAD)
Photographs
Miscellany
Resume / Consulting
Contact Me

LDmicro Forum - Convert BIN to DEC

(you are viewing a thread; or go back to list of threads)

Convert BIN to DEC (by Tomas Vanagas)
Hello,
I want to convert binary code (101001) to decimal number (0..9,10...). Is it possible to make this? If you can please help me, it will be very great.

Best Regards
Tomas
Sun Jan 10 2010, 10:52:55
(no subject) (by Jonathan Westhues)
I'm assuming that the binary values are coming in on digital inputs; so that for your six-bit binary value, you have six microprocessor pins.

See the attachment. We just have to sum up the inputs according to their place value. The least significant bit is worth 1, and then 2, 4, 8, 16 and so on. The resulting integer can be used with the math operations, and printed as decimal ASCII using the "formatted string" op.

It's possible to do BCD (or any other place value) input too. In that case, the place value is not 1, 2, 4, 8, 16, ..., but instead would be 1, 2, 4, 8, 10, 20, 40, 80, 100, ....
Mon Jan 11 2010, 02:26:06, download attachment binary-in.ld
(no subject) (by Tomas Vanagas)
Lots of thanks. It's very helpful:)
Thu Jan 14 2010, 10:17:10
8 digital input (by smei)
binary to digital
Fri Oct 20 2017, 03:20:03
FLOTING POINT (by smei)
hi..Jonathan Westhues i need div floting point if possible
iam using absolute encoder 256 how to convert 360......formula
256/360= 0.711 flot... how solve i cant write flot 0.711...
pls example or explain ..thank you
Fri Oct 20 2017, 07:57:48
Post a reply to this comment:
Your Name:
Your Email:
Subject:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):