3/10/2015 3:42 PM | |
Posts: 2 Rating:
|
Hi guys! Does someone can explain to me how to make a decimal to binary conversion in logo comfort? I trying to make this: example: 157 to binary :2 78 -> 1 (2^7) (lsb) :2 39 -> 0 (2^6) :2 19 -> 1 (2^5) :2 9 -> 1 (2^4) :2 4 -> 1 (2^3) :2 2 -> 0 (2^2) :2 1 -> 0 (2^1) :2 0 -> 1 (2^0) (msb) I use 'mathematic instruction' to make division by 2, but i have not found a way to get the remainder! If someone has already create a such a 'udf', it would be very usefull to tell me. Thank's a lot, best regards AttachmentLOGO dec to bin converter.zip (200 Downloads) |
3/10/2015 4:08 PM | |
Joined: 12/18/2014 Last visit: 12/11/2023 Posts: 31595 Rating:
|
Here is a possible solution. The counter is only playing through all values between 0 and 255. AttachmentDecimal_to_binary_(0...255).zip (570 Downloads) |
Last edited by: ixo65 at: 3/10/2015 4:13:08 PM |
|
3/11/2015 9:22 AM | |
Posts: 2 Rating:
|
Hi, Thank you very much! It is exactly what i was tryng to do. Bye |
Follow us on