Home    LittleBigPlanet 2 - 3 - Vita - Karting    LittleBigPlanet 2    [LBP2] Help!
#1

analogue addition. maybe SOLVED. input appreciated

Archive: 9 posts


ok, I'm trying to do something and am probably doing it all wrong, so maybe you guys can help.

what I am doing is basically making an analogue adder that adds to itself.

I have it set up where i pass what i want to add into a NOT gate. That goes into the positive input of a direction combiner. from there I go to a direction splitter. where the positive output goes to a second NOT gate, and this feeds into an OR gate.

I'm using the OR as storage, so its output feeds back into the negative input of the direction combiner.

This works ok, and I can capture the overflow through the negative output on the splitter just fine.

The problem I am having is that once the sum is 100% or more it sets the OR gate to a value of 100%, which then sets the adder to a value of 100% and immediately clears my overflow before I have a chance to use it.

What I would like to do is, if the value going to the OR gate is 100% or more, clear the gate and apply the overflow value.

So, if the OR is holding 80%, and I send it a 40% value, I want it to clear itself back to zero then add the 20% from the overflow so that it now reads the proper 20%.

I hope that was clear. Any ideas?
2011-02-17 01:15:00

Author:
tdarb
Posts: 689


Well, I am still beating my head against a wall on this one. Here's a pic if it helps.

http://i135.photobucket.com/albums/q149/tbradt/lbp/LBP2random/UGLY.jpg

It's still a work in progress, so it's a bit messy.

Essentially, all the stuff on the left of the blue components is for testing inputting signals. The adder portion in blue works as expected and shows a 100% value when it hits the max. I've swapped the two inputs at the start, but that's really not the issue right now.

The last combiner is my latest attempt at this. I was hoping that by subtracting the NOTted output from the overflow I could get the proper value stored in the Or gate.

I still think this approach will work, but I just can't seem to figure out the overflow logic. Once the value goes over 100, I would like for it to reset to 0 then add the overflow value to it, but I would be happy with anything that works.
2011-02-18 03:04:00

Author:
tdarb
Posts: 689


That OR in what you have laid out isn't acting as storage. To act as storage, it feeds into itself with an AND to reset... Like in RTM's post on sampling (http://www.lbpcentral.com/forums/entry.php?2325-Analogue-Logic-4-Basics-of-Sampling-amp-Scaling)

Specifically...
http://i600.photobucket.com/albums/tt82/rtm223/APhoto_1-9.jpg

What is the formula for what you're trying to do? From the description, I'm guessing "o = i + i" (Or doubling the input) but on overflow, get the overflow value rather than the value itself. If that's the case it should be simple enough. Feed the overflow from the addition into a sequencer, with a battery covering the entire grid except for 0%. Then take the output from that battery and AND it with the negative output from the splitter (The overflow value). Take the same batter output, run it through a NOT gate and AND that with the output from the adder (After the NOT gate from the positive splitter output). Then OR the results together, and it should be as you described, though may suffer from a delay of one cycle.
2011-02-18 03:27:00

Author:
Tygers
Posts: 114


basically the formula would be o=i1+i2 where i1 is the value stored in the OR gate, and i2 is any arbitrary value from 10%-100% in 10% increments. the Or gate does function as storage since the combiner it feeds into loops back to it, feeding its output value (through the adder) constantly back in.

I'll give it a try. It sounds a lot like what I was trying before this last attempt (you can see the sequencer still in the photo). That tiny delay you mentioned may be where i am having an issue. I've tried something similar with it, and the problem I have is that tiny bit of latency makes the positive output process before i can do anything with the negative. When this happens it resets the storage to 100% immediately, and I lose the overflow in the adder. I know there must be a simple fix for it.
2011-02-18 03:47:00

Author:
tdarb
Posts: 689


That OR gate in your picture is serving as nothing but a wire... The input will always equal the output when only one input is connected to an OR. (I'm talking about the blue one.)

Are you intending to have this be a signal that is constantly incrementing by the input value every cycle? If this is a periodic addition, the sequencer should be good enough, but if you truly want it constantly adding 30 times a second, I would go about it slightly differently.

Specifically, the same thing I said with the sequencer, but use the negative output directly. Then you just need to inject a TRUE signal into the analog stream and use the negative output as a digital signal directly. (Note that this can get hairy trying to do that.)
2011-02-18 04:12:00

Author:
Tygers
Posts: 114


I see what you mean. you're right. At the moment it doesn't do much of anything. I had the OR gate looped back on itself to act as a storage, and just left it there afterwards in case i go back to that later.

The input is just hooked to a button so I can test different values. The time between inputs, and their values, could be anything.

i just tried your suggestion and it has the same issue i have been having. Once the value goes over 100% the positive output triggers that and resets the adder to 100% before there is a chance to process the overflow. When hooked to a probe, the overflow flashes the proper value briefly and goes back to 0 before anything can be done with that value.

As long as the output of an operation loops back into an input, and there is nothing in between to change it, any circuit can act as storage.

thanks for your help. It's good to have fresh eyes on it.
2011-02-18 05:12:00

Author:
tdarb
Posts: 689


Is this perhaps what you are aiming for?

http://ia.lbp.me/img/ft/b8a8256ccc2b1ded5d48501326b7350ca34de041.jpg

The blue part is the adder itself, with the sequencer exactly as I described (Battery for any non-zero value). Then the purple part is an analog sampler. So the way this works, is at any point, you can send it a single pulse (Note the counter set to reset itself) and it will sample the current result. It then feeds that back into the adder. (The counter partly filled on top is just my test input.) Theoretically you can pulse this up to 15 times a second. There is a very slight race condition if the input value causes the result to overflow right as a pulse comes in. If you really want to avoid that, you can do two slightly offset pulses, the first samples the input, then the second samples the result of the addition.
2011-02-18 05:56:00

Author:
Tygers
Posts: 114


Sort of, but I need only one input from an analogue source. Pulsing the sampler doesn't work for me that way.

I think I have solved it...maybe. I'd love if you guys could look it over and see if there's a better way.

http://i135.photobucket.com/albums/q149/tbradt/lbp/LBP2random/overflow.jpg


http://i135.photobucket.com/albums/q149/tbradt/lbp/LBP2random/overflowpulse.jpg

It's a standard adder looped back on itself so it can hold a value and update it.

The overflow is passed into and OR gate that is looped back onto itself so that it holds the overflow value. The chip to the left just passes the value from the OR gate across a circuit node, and provides a way to interrupt the loop and clear the OR value.

The OR gate outputs to a sequencer with a battery stretched across it covering everything but 0%. The combiner gets the difference between 100% and the overflow value. I know that the inputs are backwards, but the sign is stripped anyway, and it looks neater. Then it is passed to an AND gate.

The sequencer is also wired to a very fast pulser to complete the AND for subtracting the value from the 100% value stored in the topmost adder, and breaking the circuit to clear the overflow storage.
2011-02-18 20:57:00

Author:
tdarb
Posts: 689


I got lost in this, my head aches.
Wait, am I wrong or gates do not submit analog and negative signals ?
I mean, if you connect an analog signal to something, as soon as it is over 0% it will activate the device. I red that a 50% signal sent through two not gates in a row (signal-gate-gate-) would make a 100% signal. The first not gate reads "it is over 0%, return 0%. The second gate reads "it is 0%, return 100%.

Either I just saved you a month of crying alone in the dark, either I didn't understand what you are trying to do. And I don't want to understand what you are trying to do, I'm too tired.
2011-03-07 01:33:00

Author:
Unknown User


LBPCentral Archive Statistics
Posts: 1077139    Threads: 69970    Members: 9661    Archive-Date: 2019-01-19

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.