[My Logic-blocks v2 r1.2] : Change function, keep data

    NeonSturm

    StormMaker
    Joined
    Dec 31, 2013
    Messages
    5,110
    Reaction score
    617
    • Wired for Logic
    • Thinking Positive
    • Legacy Citizen 5
    I also have a shorter suggestion :
    [My Logic-blocks v2 r1.1] : Different Block-Block Interactions
    http://starmadedock.net/threads/my-logic-blocks-v2-r1-1-different-block-block-interactions.3425/

    Nonvolatile “AND said:
    Electronic devices or circuits that can implement both logic and memory functions are regarded as the building blocks for future massive parallel computing beyond von Neumann architecture. Here we proposed phase-change memory (PCM)-based nonvolatile logic gates capable of AND, OR, and NOT Boolean logic operations verified in SPICE simulations and circuit experiments. The logic operations are parallel computing and results can be stored directly in the states of the logic gates, facilitating the combination of computing and memory in the same circuit. These results are encouraging for ultralow-power and high-speed nonvolatile logic circuit design based on novel memory devices.
    Read more : http://scitation.aip.org/content/aip/journal/jap/114/23/10.1063/1.4852995
    Phase change materials can switch between two forms depending on how quickly they're cooled. Cool them quickly and you get an amorphous form, which provides significant resistance to the flow of electrons. Cool them slowly and they will allow electrons to flow more readily. Once cooled, these two forms remain stable, locking the differences in conduction in place.

    This difference has been exploited to create a type of storage called phase change memory that's as fast as standard RAM but retains its contents between power cycles. So far, phase change memory hasn't been a commercial success. But some researchers are now experimenting with the idea of building processors out of the technology.

    The efforts started out with a simple arrangement of resistors and phase change bits that operated like a logic gate, allowing AND, OR, and NOT operations. But a new paper shows that by carefully controlling how the phase change bits are set in the first place, it's possible to have a single bit perform different logic operations, acting as a NOT, NOR, or NAND gate. Regardless of the operation's output, it's stored even if power is shut down.
    Read more : http://arstechnica.com/science/2014...ts-a-single-bit-act-as-different-logic-gates/

    How works in StarMade?

    Keep links during bit-flip
    Keep output, except the block is forced to change it dependent on inputs.
    Only flip last 4 ID-bits (some blocks (like hull) may allow ID-flip thus I included a block for this here)


    Flippers.
    Flippers should change their value dependent on from which they received input:
    1. output = last received input
    2. output = Button
    3. output = from OR | own output
    4. output = from AND & own output
    5. flipped value( orientation or id ) =
      1. // Java : bitwise^XOR, bitwise&AND, bitwise|OR
      2. flipper = flipperOrientation & flipable // only flip bits which are allowed to be flipped
      3. value = (value & flipper) | (flipper & flipperInput*1111b)
    They should not affect metal-meshes or some other basic element (helps building with them with break-off enabled)

    Now imagine an element that flips a linked or nearby Block's ID between …0b <> …1b => (Not X) <> X
    1. NAND <> AND
    2. NOR <> OR
    3. NXOR <> XOR (output 0 if 0<value<N || output 1 if 0<value<N)
    4. NButton(=NOT) <> Button (=Activation Module)
    5. ODD-parity <> Even-parity (1,3,5,... || 0,2,4 )
    6. Orientation <> ID Flipper
    7. NExclusive <> PExclusive (true if sum(positve inputs) == inputs-1 || true if sum(positive inputs) == 1 )
    8. Not repeating <> Repeating Delay
    OR ( …0000b <> …0010b => 0<>2 — 1<>3 —…— 3<>5 — 4<>6 —… )
    1. NAND <> NOR || AND <> OR
    2. NXOR <> NButton || XOR <> Button
    3. ODD-Parity <> Orientation-Flipper || Even-parity <> ID-Flipper
    4. NExclusive <> Not repeating Delay || Exclusive <> Repeating Delay
    OR ( …0000b <>… 0010b => 0<>4 — 1<>5 — 2<>6 — 3<>7 —…— 8<>12 —… )
    1. NAND <> NXOR || AND <> XOR
    2. NOR <> NButton || OR <> Button
    3. ODD-Parity <> NExclusive || EVEN-Parity <> Exclusive
    4. Orientation-Flipper <> Not repating Delay || ID-Flipper <> Repeating Delay
    OR 1+( …0000b <> …0010b => 0<>8 — 1<>9 —…— 16<>24 —… )
    1. NAND <> ODD-Parity || AND <> EVEN-Parity
    2. NOR <> Orientation-Flipper || OR <> ID-Flipper
    3. NXOR <> NExclusive || XOR <> Exclusive
    4. NButton <> NotRepeating Delay || Button <> Repeating Delay
    That above is only the theoretical limit!!! Not what is allowed :p


    4 ID bits allow 16 different blocks. I took time to sort it for us:
    (sorted to makes most sense after flipping, (0=not, 1=normal), first simple -> later advanced):
    0000 -00- NAND
    0001 -01- AND
    0010 -02- NOR
    0011 -03- OR
    0100 -04- NXOR (all or none inputs)
    0101 -05- XOR (not all, not none inputs)
    0110 -06- NButton (copies inverted output of last changed input) == Not
    0111 -07- Button (copies output of last changed input) == Activation Module
    1000 -08- Odd-Parity
    1001 -09- Even-Parity
    1010 -10- Orientation-Flipper
    1011 -11- ID-Flipper
    1000 -12- NExclusive (all but one input)
    1001 -13- Exclusive (only one input)
    1110 -14- NDelay - None Repeating
    1111 -15- Delay
    2 IDs {0 = orientation, 1 = ID}
    Flippers themselves can have any combination of 4 Orientations-Bits {0001, 0010, 0100, 1000} which affects how they flip values.

    JavaScript:
    local MASK = 11''1111''1110b // first for orientation-based
    local FLIPPER = (id of some inverter) &MASK // calculated at compile time -not runtime-, replaces occurances
    
    if ( <inverter id> &MASK == FLIPPER ){ // check if it is a Flipper
            if ( <inverter id> &(1b) == 1 ) <affectedBlock id> = affect( <affectedBlock id>, <affectedBlock flipables>, <flipper orientation>, <flipper active> )
            else <affectedBlock orientation> = affect( <affectedBlock orientation>, <affectedBlock flipables>, <flipper orientation>, <flipper active> )
    }
    // else it is not an inverter
    
    // flipable : 1111b == ALL
    int affect( int value, int flipables, int flipperOrientation, boolean flipperActive ){
            flipper &= flipables
            value &= ~flipper
            flipper &= flipperActive // true evaluates to 1111''1111b[/INDENT]
            value |= flipper
    }

    Inverter only work on blocks which allow this
    permissions are stored as fast-calculating bitmasks in the block definition (= once per block type)​
    Use cases:
    1. Change Light color between Red, Green, Blue, White
      1. Change Light colour between Black, Orange, Yellow, Purple/Pink
      2. change between 0..3 and 4..7 light colors with a third-bit Inverter
    2. Change Logic Behaviour
      1. add+sub with less blocks
      2. RAM FlipFlops with less blocks
      3. Adds a challenge for advanced builders because it is mindblowing and few can use it beyond 95% of it's full potential.
      4. ... to be continued ...
    3. Change Gravity direction
    4. ... to be continued ...
    Orientation : Only works with full blocks​
    Use examples:

    Changing Colours : First-Block's ID +
    0. R - 4. Orange
    1. G - 5. Yellow
    2. B - 6. Purple
    3. W - 7. Black​
     
    Last edited:
    Joined
    Jun 15, 2014
    Messages
    914
    Reaction score
    77
    • Legacy Citizen
    I do want doors that can only be activated by logic and password blocks
     

    NeonSturm

    StormMaker
    Joined
    Dec 31, 2013
    Messages
    5,110
    Reaction score
    617
    • Wired for Logic
    • Thinking Positive
    • Legacy Citizen 5
    Block Texture.jpe Click to make it big

    The universal logic block.
    Left= face without something plugged in
    Right= with something plugged in on all sides​

    These plugins increase the size of a circuit thus they should have some use, but they should also increase the through space which a player can walk on his ship and have decorative use.

    They should be counted, but not added to mass (or subtracted) like other non-physical grass blocks should not count to mass (or be subtracted).

    Example Plugins : Which Plugin is used is dependent on orientation of the inverter (32 are possible)
    on-off = plug-in / plug-out

    Not-Out : makes a NOR | NAND out of a OR | AND
    Not-In : switches between (OR <> AND)
    One-Out : outputs 1 if input-bits =/= 0
    None-Out : outputs 1 if input-bits == 0 (== One-out with already plugged in Not-Out)

    You can stick up to 6 into one block.​

    Additional memory-sticks could make a logic block use one orientation bit for logic :
    Logic blocks should have their 1 logic + 5 orientation bit used for this - a full block does not require orientation.

    Blocks which don't have this mem-stick on the same side don't have the same logic bit set and an output of 0.​



    True, but you know how a RAM could look and why not giving the button or storage node such a look in another orientation than it's default? (or some a bit more futuristic variant)

    Yesterday I confirmed for myself that you can store 1 bit information thanks to the button only reacting to the last received input.
    Basically you reset all buttons to 0 and set the ones which you want to be 0 you separately activate to make them 1 - or vice versa.
    That allows a single button and a single and to store 1 bit of information.
    Reading is done by resetting everything and look which buttons give a different output. After a read you need to refresh the storage.

    other TODOs:
    I will update the 4x4 bit ram with a 8x8 version (in 2z), but I think I have to increase the size for a bank from 9x9x2 to 9x10x2 or use a double "9x9x4" because the logic is more advanced and I don't wanna spend more than 10% on controll-blocks :)
    It will also require a special 9x9x2 or even 9x10x2 controller because it should redo the value automatically to be useful for beginners.

    It will also have the connections on top where possible thus you can build a computer room and walk through the banks to see which bits are set / repair damage without walking through cables.

    I will post more details when I upload the final version.


    View attachment 4869That is what I was talking about (click to make it big)

    A block has an X-shaped connection texture with a radial description of connection points.

    If peoples set logic blocks to be sprites (allow you to see/walk through), they can stick logic blocks onto some storage node or mainboard or processor block.

    This would be useful for logic + decoration.
     
    Last edited: