mdude: Yellow and green ink blot style image. (Default)
Oh hey, someone let me know I ought to consider describing what I made in https://mdude.dreamwidth.org/1762.html in a way that actually makes sense instead being mostly incoherent rambling about my thought process.

So, the the main idea of how the function acts as analog version of the Fredkin/controlled swap gate: It takes some sequence of N values, and swaps them around by X places. If X is a whole number, the values just get moved that many places over, wrapping around. So in such cases, the output for function(X) can equal to Input[N+X]. But when it's not, we need to have some way of producing outputs that lie between the outputs for Input[ceiling(X)] and Input[floor(X)].

So, easiest way to do that would be to make the output for function(X) equal:
(Input[floor(X)]*(1-(fractional part of X)))+(Input[ceiling(x)*(fractional part of X))

The only reason I was relying so much on max and min was because I know those are easy to implement in mechanical analog computers, by just letting either input push or pull the output so that the output pushes/pulls as much as whichever input is doing that the most. While I'm at it, here's a version that ditches the modulo function at the cost of only being accurate over a limited range of input: https://www.desmos.com/calculator/or2gurny0c

Edit: I should probably point out that I later realized I'm still doing this wrong, so I'll need to keep working on it. For some reason it just seems slightly too hard to keep all the parts I'm working with in my head at once while translating it from geometry to code. I think it might work if I take some earlier ideas I was trying and go "something something Viviani's theorem" at it, but that'll wait until I feel like getting back to it.
mdude: Yellow and green ink blot style image. (Default)
To continue writing down ideas I ought to have written: I like the idea of making computer parts from scratch, impracticable as it may be for producing a machine which meets contemporaneous performance expectations. I like the idea of reversible computing. As well, I also enjoy playing with the idea of analog computing. These things entwine together in a series of thoughts that begin with observation the observation that a Fredkin gate, in addition to being reversible, outputs the same number of each value as it receives as input.

This means that even if the two values are represented by a phenomenon which embodies different energy levels, the output can embody the same amount of energy as the input. Further, it can do so without the output using different energy levels for each value than the input! If there were a continuous version of this, I figured it'd be pretty handy for designing analog computers.

The reason I thought this was that I was already looking into ways to make reversible analog computers, as I wanted to see if the reversibility would result in substantially reduced noise in the system and thus a higher precision of results for a given level of quality of components. That in turn just seems generally useful for making computers from scratch.

So, the first thought I had was that what I'm doing would have something to do with affine transformations, as earlier research and discussion called my attention to the fact that affine transformations are both reversible and continuous functions. Specifically, rotation seemed like a good option, since if I'm taking the two inputs to be swapped as the X and Y coordinates, and the controlling input as rotation, then rotating 90 degrees should do something like swap them? More like invert them both, really.

At the moment, I was more interested in getting around the part where I don't want a circular arc, since that clearly wouldn't preserve the part where the sum of the outputs match the sum of the inputs. So I tried looking a thing where, before rotation, perform a transformation where I take the Chebyshev distance of the point and turn it into a point with the same angle from the origin but with Euclidean distance, and reverse the transformation after.

This ended up making the function for the X/Y coordinate inputs over the rotation input equivalent to what I'll call trapezoid waves, since that's what they look like, and a simpler way to implement the result is to just make a triangle wave and then use min and max functions to clip off the distance. However, I notice then that this still doesn't actually conserve the sum-invariance property I wanted! So then I thought, hey, if I rotate it 45 degrees normally first, then just do a the triangle waves without clipping them, I'm now going around the edge of a Manhattan distance circle instead of a Chebyshev distance one!

So that actually worked, but only if I presume the signal values can be negative, which might not be true of whatever computing media I go with. Otherwise I'm stuck in the upper right corner. I guess I could just use a different offset for the triangle waves so the function for any given X/Y input just covers the diagonal line where X+Y is constant. Maybe that actually would work? Something about it just didn't feel right to me, though.

So, I decided to make a function that takes X,Y, and Z inputs and well as the control/rotation, and does a function that for each input is just a triangle wave clipped at the bottom, but for all three of them ends up tracing the perimeter of a triangular wafer cut from a cube. So there we go! Maybe some time I'll try using it for a thing. Also, here it is on a web-based graphing calculator: https://www.desmos.com/calculator/rslh0cvwrk

Edit: Just realized I could generalize this to rotating arbitrary points by having each input other than the control ran through the function alongside its two neighboring inputs. Though also, it seems that I'm wrong about this version of the function doing what I want at all, as actually checking (I1+I2+I3)-(O1+O2+O3) shows that it in fact not produce a function f(r) that only produced an output of zero? So I'll need to keep working on this I guess.

Edit2: Oh, nice, I managed to fix the thing I was making! Working cube slice gate function: https://www.desmos.com/calculator/15wnxj923y

Profile

mdude: Yellow and green ink blot style image. (Default)
Meticulac

March 2019

S M T W T F S
     12
34567 89
10 111213141516
17181920212223
24252627282930
31      

Syndicate

RSS Atom

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 17th, 2025 07:42 pm
Powered by Dreamwidth Studios