I tried a 3 combinator setup (plus a 4th to make the input generic). There's an arithmetic combinator acting as the memory cell to hold the minimum. There's an arithmetic combinator subtracting the stored minimum from the input. And there's a decider combinator which, if the difference is negative, injects this difference into the memory cell. First I initialize the memory cell to some arbitrary high value using a constant combinator before I connect it to the rest of the circuit.
I thought that would be all I need, but in practice it over-corrects and drives itself down to negative values. Maybe it's some kind of propagation delay issue? Any ideas how to solve it?
Blueprint of my prototype:
Code: Select all
0eNq9lkGv2jAMgP9KlMukLSAolD2Qdph24sBpu6EnFFpDvbVJl6S8McR/n5MWKG/wxtDTg0vqxI792bKz48u8gtKgcnyy4ynYxGDpUCs+4Z8Vk85BUTrmNCvkD2CSJWiSCkmSSces0wYsrYEVqLCoCqaXFswGUoaqrBzbSLLfZd/oBJ2scsdkWYI01ps0lWIK1tLhBgQrwWSytCytwG9aXQArjS6lP6AVSyGXW8Gm7wqmNN1dGehywTHRyvLJfMctrpXMfRxKFkABSIMuK8Bh0kl0sUQlyV++Jx2Vwi8+6e8fBQfl0CHUJsLHdqGqYgmGDoiDKX+Jk8q1DQleaos1rB0ne51R3I0F3/LJ4KEb0z2k5YzOF0vI5AZJhc5ZSLyKPV/T3QenBF9h7sA8lzaebCvKhKbLf1YyJ2dJpLQpKHB/X1FKE5yb8E9BUPnM9qPe/pH+5FJJEMEszjP9lVKXS3fMGnTXXeadJx6W6VVItFwDW1arFXiEf6GKxMvUL8AatlGlaGoYfDK8DO5kd0HbKR4prtBYtzhl321L78cGjasClsax+kQHZJL5IiD4ZGZxyGxgrKkIZQPlPWnqyhGP221P+f4q5C9abcAQz5oxlfgaFBhMWGP+AtXB3VTHb0x12kJ6s9LMK7WZd+5gPnuJucyTUNnUVtCXLqiEqhjcE4BqEiFVWjey9NDELmVieG8rGPZfvxX8k8j/dYee/4UGQa3RLnwQK5lbuEZ1qihUMv8bTOjU4MIIICrGoVofZwHtSZbhOmvGwCWu8b0V3nB9uwqfXWwavfMC/vDKBTyDQpstSyDPw8SEAjy3yyP3Ou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