LittleBigForum Archive
LittleBigForum
LittleBigPlanet 3
Discussion

(lbp logic) An easy way to do division?

Archive: 4 posts
2016-06-01 22:46:59 / Author: krokkoguy
LBP3 added multiplication (in form of multiplying fractions together) as a secondary option to the And gate, But is there a way to do division? I tried to make an inversion chip using a look-up table, it was very precise and could inverse down to 0,0103125, where 0.1 was the inversion point. However it is so resource intensive you could blow the thermometer with a couple of these chips, so its no good as a meta chip. I also made a less fine tuned version of the inversion chip where it could inverse down to 0.01, but still very resource intensive.

What i did was put a sequencer put to positional, and on that sequencer put more sequencers also set to positional, and then fill it with predefined values for x=1/x. For example the inverse of 0.475 was  a counter set to 4/19~=0,21. Though it was still not precise enough to take the inverse of an inverse to get what i started with.

TL;DR: I tried to make a precise division chip but it took up too much thermometer.

Anybody know a way to do division without using a look-up table?
2016-06-01 22:46:59
Author:
krokkoguy
Posts: 40

2016-06-02 10:28:55 / Author: Hanfi1311
You need a feedback loop, made an example for the german forum a while ago, there, we wanted to have the percentage, but it is similar with division:

http://ie.lbp.me/img/ft/03e862bd09f47737d0b09ec459baf97c0d3c6f9c.jpg

When I remember correctly, the AND gate was set to multiply, the timer is set on speed and is 0,1 sec...
2016-06-02 10:28:55
Author:
Hanfi1311
Posts: 210

2016-06-07 02:44:58 / Author: krokkoguy
Yeah... It technically works. The problem is that it is delayed, after all its a recursive function.
f(n)=0.4-(0.8*f(n-1))+f(n-1) where f(1)=0, is sort of accurate after 10 iterations.
But for changing values, its no good. It is only ever truly accurate at the limit of the function.

I've been looking at how computers do it, and it doesn't bode well for any sort of instant division made in LBP

Shame Sumo made a multiplication tool but no division tool... Same goes for the angle-ifyer, there is no default de-angle-ifyer (although, apparently thats way easier to do than division, sine function chips FTW)
2016-06-07 02:44:58
Author:
krokkoguy
Posts: 40

2016-06-10 23:06:32 / Author: krokkoguy
So i did some tinkering with the design you posted and came to a solution. The problem i faced was that low input values would take a very long time to reach an answer, i tried to counter it by tenfolding the input of the timer, which solved the issue, but at higher values the tenfolding of the timer input would cause pulsating.

What i did was that i took the signal from the subtraction module, multiplied it by the timer, and then multiply it by a houndred. 
This way it would be very sensitive at high values, and very quick at low values.
https://scontent-amt2-1.xx.fbcdn.net/v/t1.0-9/13346446_1271616606200622_529387563345710819_n.jpg?oh=8fd4e849383623ea090c3d59bde60d68&oe=57FF1445
The whole process gives an excact result at most one second for any value.
2016-06-10 23:06:32
Author:
krokkoguy
Posts: 40
LittleBigForum Archive Statistics
Posts: 37945 • Threads: 4847 • Members: 3878  • Archive-Date: 2019-04-15

Datenschutz

Aus dem Archiv wurden alle persönlichen Daten wie Name, Anschrift, Email etc. - aber auch sämtliche Inhalte wie z.B. persönliche Nachrichten - entfernt.
Die Nutzung dieser Webseite erfolgt ohne Speicherung personenbezogener Daten. Es werden keinerlei Cookies, Logs, 3rd-Party-Plugins etc. verwendet.