# Save the relays !

A project log for SPDT16: 16-bits arithmetic unit with relays

Let's imagine I could get about 200 SPDT relays. Of course I would know what to do with them :-D But will 200 be enough ?

Yann Guidon / YGDES 05/03/2016 at 04:192 Comments

So my last estimate made me realise that 200 relays is barely enough.

Actually these relays are sold by 36 or 72 and the estimate exceeds 192 relays. Which is the number I've already ordered. And I've already ripped one apart to make the cool cover picture. And I can't make a "slice" prototype AND the final unit so I'm in a bad position (and broke, btw). And I can't accept to reduce the width. And time is running out for the submission to the prize in a few weeks. I need money AND time because things are accelerating now. I'm caught in the evil spiral of fun turning into madness (thank you @Adam Fabio ;-P)

But there might be a tiny bit of relief. Because while trying to finally sleep, my mind wandered across the overall design and I realised something. I can save 16 relays ! This won't solve everything and world hunger but it will save my pride.

Remember the slice of ALU: it starts with the rotary switch and the XORs.

The switch's common is tied to +Vcc (this sounds pretty normal and obvious). Then I realised I could "add 0" for the multiplication with a little trick, that is : turn the current off. No current in the relay, no activation, great.

But now I'm going further and I can propagate the XOR function to the switchs' common pin: what if the whole signal/rail was switched from +Vcc to 0V ? That would do the inversion, for all the signals ! (it would probably save 1A as well).

Let's go back to the diagram of the full adder:

Input C is tied to one coil and one out of 2 outputs.

Input A is tied to one coil and one output.

Input B is tied only to one end of a coil so this is the signal that must be connected to the rotary switches. This way, A and C can still work properly even if there is no current. Actually I suppose it could work as well but this choice preserves some design principles/assumptions.

Wait, this doesn't work. First, the TIL311 is harder to drive because when the switch is off, there is voltage that goes through the paralleled coils of the A-B gate. Diodes and transistors do not easily solve this situation.

Worse: when the SUB signal is grounded, the function of the switch does not change the actual logical function.

The XOR relay makes everything simpler...

Looking at the larger picture, though, something else appears.

The other input comes from the accumulator, which is made of a relay.

Notice how the coil is not tied to the output (unlike the classical methods). The output can be anything we want so we could (selectively) swap the Vcc and GND rails, which would end up as inverted values on the A or B signal of the full adder.

It will make reading the output more complex on the TIL311 but the SUB signal would be restored to 'normal' (low) at the end of an operation. The inconvenience could be further reduced by using the "Latch Enable" pin of the TIL311 so the display doesn't change during computations.

(The two SPDT on the left are common to the 16 FF of the accumulator)

I have somewhat factored the original XOR relays into 2 relays (DPDT), but I haven't yet tested everything.

Subtraction is not commutative so my clever trick is not only clumsy but also useless. I should go back to sleep and buy more relays !

Subtraction is not commutative, yet addition is and the order of the 3 inputs A, B and C don't matter. So it shoudln't even matter which input is inverted. I'm confused. I just give up and return to the original XOR design, which has none of the above problems and lets us easily see the values on the TIL311.

Actually I'm even doing a double XOR to provide the complementary value, as explained in Faster ripple.

## Discussions

K.C. Lee wrote 05/03/2016 at 10:34 point

>And time is running out for the submission to the prize in a few weeks.

Actually the project doesn't need to be done to enter.

Are you sure? yes | no

Yann Guidon / YGDES wrote 05/03/2016 at 10:44 point

yup but entering is not enough. Having some stuff sufficiently advanced to show something working on video, that's much better.

Are you sure? yes | no