Close
0%
0%

YGREC8

A byte-wide stripped-down version of the YGREC16 architecture

Similar projects worth following
YGREC can stand for many things, such as "YG's Relay Electric Computer", "Yann's Germanium and Relay Equipped Computers" or "YG's Ridiculous Electronic Contraption". You decide !

#YGREC16 is getting pretty large and moving away from the original #AMBAP inspiration, making it less likely to be implemented within my lifetime. So here is a "back to minimalism" version with
* 256 bytes of Data RAM (plus parity ?)
* 8 registers, 8 bits each (including PC)
* fewer relays/gates than the YGREC16
This core is so simple that I focus now on other issues, such as the debug/test access port, the register set's structure, I/O, power reduction...
Like the others, it's suitable for implementation with relays, transistors, SSI TTL, FPGA, ASIC, you name it (as long it uses boolean logic)!

After the explorations with #YGREC-РЭС15-bis, I reached several limits and I decided to scale it down as much as possible. And this one will be implemented both with relays and VHDL, since the YGREC8 is a great replacement for Microchip's PICs.

A significant reduction of the register set's size is required so I/O must be managed differently, through specific instructions. The register map is now:

  • D1  <= for NOP
  • A1
  • D2
  • A2
  • R1
  • R2
  • R3
  • PC  <= for INV

The instruction word is shrunk down to 16 bits. It is still reminiscent of the YGREC16 older brother but I had to make clear cuts... The YGREC8 is a 1R1W machine (like x86) instead of the RISCy YGREC16, to remove one field. Speed should be decent, with a pretty short critical datapath, and all the instructions execute in one clock cycle (except the LDCx instructions and computed writes to PC).

The fields have evolved with time (I have tried various locations and sizes). For example:

20171116: The latest evolution of the instruction format has added a 9-bits immediate field address for the I/O instructions.
20180112: Imm9 is now removed again...
20181024: changed the names of some fields
20181101: modified the conditions to change Imm3 into Imm4
20180112: Imm9 back again !

There are 18 useful opcodes (plus INV, and the pseudo-opcodes HLT and NOP), and most share two instruction forms : either an IMM8 field, or a source & condition field. The source field can be a register or a short immediate field (4 bits only but essential for conditional short jumps or increments/decrements).

The main opcode field has 4 bits and the following values:

Logic group :

  • OR
  • XOR
  • AND
  • ANDN

Arithmetic group:

  • CMPU
  • CMPS
  • SUB
  • ADD

Beware : There is no point to ADD 0, so ADD with short immediate (Imm4) will skip the value 0 and the range is now from -8 to -1 and +1 to +8. (see 17. Basic assembly programming idioms)

Shift group (optional)

  • SH/SA direction is sign of shift, I/R(bit9) is Logic/Arithmetic flag.
  • RO/RC direction is sign of shift, I/R(bit 9) allows carry to be rotated.

Control group:

The COND field has 3 bits (for Imm4) or 4 bits, more than YGREC16, so we can add more direct binary input signals. CALL is moved to the opcodes so one more code is available. All conditions can be negated so we have :

  • Always
  • Z (Zero, all bits cleared)
  • C (Carry)
  • S (Sign, MSB)
  • B0, B1, B2, B3 (for register-register form, we can select 4 bits to test from user-defined sources)

Instruction code 0000h should map to NOP, and the NEVER condition, hence ALWAYS is coded as 1.

Instruction code FFFFh should map to INV, which traps or reboots the CPU (through the overlay mechanism): condition is implicitly ALWAYS because it's a IMM8 format.

Overall, it's still orthogonal and very simple to decode, despite the added complexity of dealing with 1R1W code.


Logs:
1. Honey, I forgot the MOV
2. Small progress
3. Breakpoints !
4. The YGREC debug system
5. YGREC in VHDL, ALU redesign
6. ALU in VHDL, day 2
7. Programming the YGREC8
8. And a shifter, and a register set...
9. I/O registers
10. Timer(s)
11. Structure update
12. Instruction cycle counter
13. First synthesis
14. Coloration syntaxique pour Nano
15. Assembly language and syntax
16. Inspect and control the core
17. Basic assembly programming idioms
18. Constant tables in program space
19. Trap/Interrupt vector table
20. Automated upload of overlays into program memory
21. Making room for another instruction
22. Opcode map
23. Sequencing the core
24. Synchronous Serial Debugging
25. MUX trees
26. Flags, PC and IO ports
27. Binary translation (updated)
28. Even better register set
29. A better relay-based MUX64
30. Register set again
31. Rename that opcode !
32. Register set again again
33. Yet Another Fork
34. What can it run ?
35. More register set layout
36. More VHDL and more...

Read more »

YGREC8_VHDL.20200119.tgz

Added FSM ALU_2020 is bork, needs debug

x-compressed-tar - 143.02 kB - 01/19/2020 at 04:14

Download

x-compressed-tar - 138.15 kB - 01/05/2020 at 05:34

Download

YGREC8_VHDL.20191231.tgz

Last release of 2019, new start for 2020 with the new, ASIC-friendly, ROP2 unit

x-compressed-tar - 119.74 kB - 12/31/2019 at 02:05

Download

x-dia-diagram - 7.42 kB - 09/29/2019 at 05:07

Download

x-dia-diagram - 4.74 kB - 09/29/2019 at 05:07

Download

View all 36 files

  • Magnetic interferences

    Yann Guidon / YGDES01/30/2020 at 20:35 2 comments

    It strikes me only now that I must have under-estimated the importance of magnetic interferences between relays...

    I remember seeing placement recommendations for miniature Chinese relays but the РЭC-64 has a tubular shield. How do the openings at both ends behave ?

    Having two relays on a well-spaced prototype breadboard can't show the effects of many relays packed densely and switching with weird patterns.

    I'm starting to consider using mu-metal sheets but I wonder if it's practically effective and the right solution, because I still have some freedom to organise the parts in space and optimise the magnetic field...

    Shoud I start playing with, or even build, a flux-meter ?


    Update :

    Here is the seller for the RES-64 :

    https://www.ebay.com/itm/RELAY-RES-64A-726-REED-SWITCH-9-11V-NOS-USSR-LOT-OF-20PCS/232803573730

    It's a SPST reed relay, you have the two contacts going out of the glass tube available at the opposite ends. The glass tube would be surrounded by the electromagnet coil, the whole is inserted in the metallic tube to further direct the magnetic field and shield a bit from outside influence. I still have to examine a non-working piece to confirm. An additional pin connects the "case" to ground (for example).

    In the expected configuration, the relays will be paired and receive the same current, except during a set/reset pulse.

    I'll have to check and measure the magnetic field at the ends of the relays. That's one excellent reason to finally use all those UGN3503 I bought for another project !

    In the end, working in pairs might solve the problems I imagine so far.

    One way to see it is with both relays forming a magnetic loop, to close the static field. I'll just have to find a way to loop the magnetic field, for example by cutting a torus in half. This ensures that the pair of relays is closely coupled, little energy will leak to the closest neighbours.

    However, I suspect that the real problem is not the static field but the pulsed/forced changes when a capacitor discharges. This is what can affect sensitive neighbour relays but there is a catch : one relay is pulsed with the opposite polarity of the twin relay... In ALL cases, the magnetic pulse will go against the static field of one relay, while also reinforcing the field of the other relay. There must be an opposition of fields somewhere, a magnetic "hot spot" that can interfere with the nearby relays.

    Ideally the programming pulse should have the same polarity for both relays. First it would prevent/limit the cases where one relay has a state different from its twin, in particular during power-on. Second : it would allow the magnetic pulse to be "looped" in a closed magnetic circuit, thus removing many causes of magnetic leakage and interference. The problem is that it would easily double the power drawn by the register set, since there would be 6V to be dropped in resistors... The whole register set would dissipate 2W instead of 1W.

    Yes this log needs more drawings...

  • And now, capacitors !

    Yann Guidon / YGDES01/24/2020 at 16:53 0 comments

    The relay-based version of the YGREC-8 was in limbo due to delays in the delivery of required parts. I'm expecting more RES-64 to arrive in a few weeks, after ridiculous back-and-forth between post offices on strike. Meanwhile I was able to progress with #VHDL library for gate-level verification  in amazing ways but... My soldering iron is asking for action !

    Fortunately I received other parts from Russia (thank you eBay !) and I'm listing them to keep track of their intended use.

    Those parts are pretty oversized, compared to today's technology, but the looks/appearance/style is worth it and the whole will be coherent ;-)


    20× PETP K73-16 63V 2.2µF

    These are non-polarised capacitors with medium value.

    They are useful for 2 cases :

    • for CCPBRL: the coupling between stages requires a capacitor but a polarised one forces the use of two shifted power supply domains. Non-polarised capacitors simplify the power supply design, as well as logic design in some corner cases. However, 2.2µF might not cut it for the RES-15...
    • for the high-fanout buffers such as the ones described below:Some simulations with Falstad have shown that a high value would create an oscillation thatcould interfere with the rest of the circuit. A low value however wouldn't transfer enough energy from one side to the other. In both cases, the purpose is to prevent arcing at the contacts of the control relay at the bottom of the drawing. 

    I don't think the YGREC8 needs 20 high-fanout signals but at least I'll be ready. The data memory system requires 5 buffers, the instruction memory might need a few more, but it is a reasonable approximation.

    Of course I'll have to experiment, test, verify, measure... I expect to make another video when it's done :-)

    Verdict : great surprise !
    These capacitors aged very well and maintained excellent isolation as well as precise capacitance : +/- 2% worst case ! I don't know about the inductance but it should work very well.

    20× Inductances Kig 0.1 1000μH

    High-value, low-current inductors

    These parts will "isolate" the various bitplanes from the main power supply.

    Each of the 8 bitplanes contains at least 16 RES-64 to store the values from the register set, but these planes are quite sensitive to external interferences. A "pi" network is used : each bitplane has a local large-value capacitor, added to the large value of the power supply, and the bitplanes can emit and receive pulses that could flip other states...

    The current rating is low but compatible with a single bitplane : each relay uses approx. 2.5ma, a total of 20mA, this gives a 5× margin with this 100mA part.

    Verdict : good !
    8.5-9.1 ohms is a bit much, but the inductance is around 960µH, a few percents of variation.
    It should work well...

    8x Capacitor K50-24 16 V 2200µF

    high-value, medium-voltage power-storage capacitor

    There are 8 of them, just as needed for the 8 bitplanes. Ideally they filter the power to the 16×RES-64. However due to the high capacity and the low current rating for the inductor, there is the risk of blowing up the inductor in the case where the input is (accidentally) shorted. A series germanium diode (or 2 in parallel for higher current capacity and longevity) would prevent the damage.

    Verdict :
    These parts aged but should be "good enough", with a self-resistance around 1M and average capacitance in the 1600-1800µF range. ESR might be high though. They can be for local power supply filtering.

    8× K50-16 25 V 5000µF

    These big babies belong obviously in the power supply.

    Not much more to say. It's going to be quite massive but I want to avoid as much ripple as possible.

    There will be several voltages so at least a couple will be used for each rail, depending on the needed current.

    Verdict :
    something bad happened, probably a breach because there is liquid in the bag. Probably the electrolyte...
    I'll have to get others and/or use my "modern" stock.

    40× K50-20 100 V 10uF

    Those...

    Read more »

  • Core state machine(s)

    Yann Guidon / YGDES01/12/2020 at 21:07 0 comments

    "Meanwhile..."

    I'm considering writing a quick&dirty&short behavioural simulation of the Y8 core to get a refreshed higher level view (as well as an alternate platform that simulates faster to try code out). I've already written one 2 years ago but it left a lot to be desired. Today's core has a more refined ISA and many details have evolved and matured. And I have a cool assembler I can throw at more challenges!

    The core is still simple, anyway, with "most instructions executing in a single cycle", with 2 exceptions :

    1. Write to PC (except SET and CALL that can write directly to PC and bypass the slow ALU path)
    2. LDCL/LDCH that need one more cycle to read the instruction memory.

    and then you realise you haven't thought about LDCx writing to PC, which makes things even more complex but who would do it ? (well, if 512 instructions of the 64K space allow it, there is 1 chance in 128 it gets executed so it's not negligible).

    A proper FSM is clearly required. And soon, it appears that it's not going to be a nice and tidy FSM like you see in tutorials because I need 2 FSMs.

    • One FSM handles the instructions and the special cases : stop/inst/LDCx/WritePC.
    • Another FSM handles the execution state: start/step/stop/(re)set/load

    These can't be completely joined because they are orthogonal. The execution FSM is what is visible from the outside, particularly during debug sessions. It must also handle internal initialisation when the chip goes out of /RESET (like: load data from external memory). The instruction cycle FSM cares for sequencing single and complex instructions.

    So it makes sense to separate the 2 FSM because it untangles the complex combinations that might arise and prevents naughty bugs and race conditions.


    Before going further, let's remind how the Y8 works : there is no real pipeline, yet 2 phases overlap:

    1. A first phase computes the next address (Increment PC) and/or gets a new address from an instruction, then fetches the instruction memory to read the next instruction.
    2. The second phase gets a ready instruction (or immediate word), then decodes/fetches operands/executes/writesback stuff.

    The FSM must ensure that the instruction memory is fetched before starting the execution phase.

    It gets more complex with the LDCx instructions because another round goes through the instruction memory. And if the destination is PC, yet another cycle is added to fetch the instruction instead of using PC+1.


    OTOH, the core state FSM has to receive orders from outside, latch them and send the appropriate commands to the other FSM. Reset is asserted there, since no "general RESET" signal would be propagated through the whole chip, further simplifying the implementation.

    This FSM receives a code from outside and latches it before interpretation. During debug, it deals with the usual start/step/stop commands, though it defaults to start after power-up. A fourth command can be RESET to force a reload of the program memory (if you change the source code to debug or if INV wants to switch to a different code page).

    So we get the following command codes :

    CommandcodeDescription
    Start11Run the system
    Step10execute one instruction then pause the core.
    Stop01pause the core at the end of the instruction.
    Reset00pause the core and reset FSM
    (reload instructions when another
    command is received)

    The default command is Start when the core wakes up, and it can be modified (from input pins or through the debug interface).

    The FSM can have more states to deal with initialisation. It is clocked by (and synchronised to) the core clock. Its value should be read back by the user after every command to ensure the proper value is latched and the FSM is in a coherent state.

    The five steps (so far) are:

    StateDescriptionHow to get there
    ResetJust do nothing.
    Clear PC and some
    eventual SR flags.
    receive the RESET command
    or external signal.
    Loadcopy external data to
    instruction memory,
    increment PC for each
    new word.
    ext. Reset signal is
    de-asserted...
    Read more »

  • New decoder for the ALU

    Yann Guidon / YGDES01/02/2020 at 04:05 0 comments

    The ALU needs a new decoder because I changed the logic of the ROP2 unit... With a working decoder, I can re-implement the fault checker and validate all the opcodes.


    20200103 : I updated files here and there, as well as the main page that contains the "official definitions", because I have changed the order of the boolean opcodes.

    I must make a new lookup table that is more thorough than the one at Bubble-pushing the ROP2 as well as the previous versions. There is a big difference, this time I use OR instead of MUX2 to combine the data so there are fewer degenerate cases.

           Func   NEG  PASS_en AND_en XOR_en OrXor_en  CLA_en CMPS  WB CryWr
    OR     0000     0      0      0      0       1       0     x    1    0
    XOR    0001     0      0      1      1       1       0     x    1    0
    AND    0010     0      0      0      1       0       0     x    1    0
    ANDN   0011     1      0      0      1       0       0     x    1    0
    CMPU   0100     1      0      1      x       0       1     0    0    1
    CMPS   0101     1      0      1      x       0       1     1    0    1
    SUB    0110     1      0      1      x       0       1     0    1    1
    ADD    0111     0      0      1      x       0       1     0    1    1
    SET    1000     x      1      1      x       0 pass  0     x    1    0
    CALL   1001     x      1      1      x       0 pass  0     x    1    0
    SH/SA  1010     x      0      0      0       0 clear 0     x    1    0
    RO/RC  1011     x      0      0      0       0 clear 0     x    1   b11 (RC)
    LDCL/H 1100     x      1      1      x       0 pass  0     x    1    0
    IN     1101     x      0      0      0       0 clear 0     x    1    0
    OUT    1110     x      0      0      0       0 clear 0     x    0    0
    INV    1111     x      0      0      0       0 clear 0     x    0    0
    

    Some equations :

    CLA_en = F2 & /F3
    ROP2 = /F3 & /F2
    F0F1 = F0 | F1
    /F1F0 = /F1 & F0
    /F1F3 = F3 & /F1
    CMPS = CLA_en & /F1F0
    CarryWrite = CLA_en | opcode=RC
    RegisterWriteback = /F2 | /F1F3 | (/F3 & F1)
    OrXor_en = NOR3( F1, F2, F3)
    XOR_en = F0F1 & ROP2
    NEG = ( ROP2 & F1 & F0) | (CLA_en & F1F0)
    Cin = NEG (more or less but also need to decode ADD 0 cond)
    PASS_en = /F1F3 & /(F2 & F0)
    AND_en = PASS_en | (/F3 & /F1F0) | CLA_en
    

    Maybe a 16×9 bits ROM would be better...

  • Pushing more bubbles, now the carry-lookahead adder

    Yann Guidon / YGDES01/01/2020 at 17:48 0 comments

    The ROP2 re-engineering is going well, despite the surprising number of gates, but now it looks ready for an efficient ASIC implementation. So here comes the time for the ASIC-ification of the CLA...

    There is a 5-gates macroblock that appears 6 times in the circuit and it was already NANDified. See gate_CLA3.vhdl. As noted in the log Netlist and structure of the adder, we need to perform the function Y <= (A AND B  AND C) OR (A AND D) OR E; several times and these need to be optimised as a whole. The following circuit:

    becomes:

    but there is a remaining inverter...

    Similarly, there are a few AND3 that would benefit from a switch to NOR3 if only the input was inverted.

    And the AO1 gate ((A and B) or C) can also be turned into a pair of NAND2, if the C input is inverted...

    Do you see where I'm going ?


    So now, I'm adding a couple of new output ports to the ROP2 units that provide the negated version of P & G. The CLA circuit can then select the negated or positive version, which also decreases the fanout :-)


    The ROP2 part has a pretty decent structure, despite the size.

    Fanout:  Count:  .........|.........|.........|.........|.........|
        1 :     48 - ************************************************  
        2 :     32 - ********************************
        3 :     24 - ************************
        4 :      0 -
        5 :      0 -
        6 :      0 -
        7 :      0 -
        8 :      5 - *****
      
     Depth:  Gates:  .........|.........|.........|.........|.........|
        0 :     21 - *********************
        1 :     16 - ****************
        2 :     16 - ****************
        3 :     16 - ****************
        4 :     16 - ****************
        5 :     16 - ****************
        6 :      8 - ********

    It is quite easy to layout, with 2 gates "width" per bit.

    OTOH the carry lookahead is not as nicely regular and nicely behaved:

    Latency of the 9 outputs :
        Output#0 : 2
        Output#1 : 3
        Output#2 : 4
        Output#3 : 5
        Output#4 : 6
        Output#5 : 7
        Output#6 : 5
        Output#7 : 7
        Output#8 : 8
    
    ************ END OF DEPTHLIST ************
    
    Fanout:  Count:  .........|.........|.........|.........|.........|
        1 :     50 - **************************************************
        2 :     13 - *************
        3 :      5 - *****
        4 :      0 -
        5 :      1 - *
      
     Depth:  Gates:  .........|.........|.........|.........|.........|
        0 :     35 - ***********************************
        1 :     12 - ************
        2 :      5 - *****
        3 :      4 - ****
        4 :      5 - *****
        5 :      4 - ****
        6 :      3 - ***
        7 :      1 - *  <- the carry out

    It is clearly not optimal but I wanted to keep the number of gates low. Only 35 this far :

    Several places have their polarity (and gate type) swapped for an inverted version. For example: the signal G2(1) has been negated, so it drives cla2e and cla2f with their inverted input. cla2b is therefore totally swapped as well, made with NOR gates.

    AO1 is usually replaced by AO1B so it can be implemented as a pair of NAND2.

    The combined unit uses 123 gates !

    Latency of the 17 outputs :
    (the ROP2:)
        Output#0 : 7
        Output#1 : 7
        Output#2 : 7
        Output#3 : 7
        Output#4 : 7
        Output#5 : 7
        Output#6 : 7
        Output#7 : 7
    (CLA8:)
        Output#8 : 6
        Output#9 : 6
        Output#10 : 7
        Output#11 : 8
        Output#12 : 9
        Output#13 : 10
        Output#14 : 7
        Output#15 : 10
        Output#16 : 11
      
    Fanout:  Count:  .........|.........|.........|.........|.........|
        1 :     79 - **************************************************
        2 :     31 - ********************
        3 :     25 - ****************
        4 :      4 - ***
        5 :      2 - **
        6 :      0 -
        7 :      0 -
        8 :      5 - ****
     Depth:  Gates:  .........|.........|.........|.........|.........|
        0 :     23 - ***********************
        1 :     16 - ****************
        2 :     16 - ****************
        3 :     20 - ********************
        4 :     25 - *************************
        5 :     22 - **********************
        6 :     12 - ************
        7 :      4 - ****
        8 :      4 - ****
        9 :      3 - ***
       10 :      1 - *

    The circuit uses these gates :
    and2a ao1 ao1b inv nand2 nand3 nor2 nor3 or2 xor2
    There seems to be room for 2 stages of OR between ROP2 and CLA8 output, to multiplex other values (from IN port and SHA/ROT)


    Now I want to replace the output MUX and merge it with the XOR at the end of the CLA....

  • Bubble-pushing the ROP2

    Yann Guidon / YGDES12/28/2019 at 22:43 0 comments

    The experiments with the RES64 are on hold, waiting for the delivery of more/new parts (and the strikes in France make the delivery date even more uncertain) so I'm back to the ASIC side of the projet. There is significant progress with #VHDL library for gate-level verificationand some early results are "interesting" and require more analysis.

    To ease this analysis, I'm forced to split the carry-lookahead adding tree from the ROP2/Pass logic, which I'm going to re-synthesise now. You might remember the log That ALU should be good (03/25/2019) and the following diagram :

    Well, it works nicely with the A3P family's gates/tiles but it doesn't fly as well with full-custom gates. I tried to get the gates complexity down to simple ones (like NAND2 and NAND3), even trying to eliminate the output MUX2, and did some bubble-pushing.

    Remember that this logic unit has deep ties with the adder logic : P and G provide the Propagate and Generate inputs, and the X output is used at the output stage as well. The rest is built around these fundamental, shared functions. I know well it is possible to create a boolean unit with only 4 NAND3 (see http://www.6502.org/users/dieter/a5/a5_2.htm) but that circuit provides only one of these functions at a time, when I need 3.

    Another choice for the ROP2 part is to enable the output only when required. This makes ORing more practical, we can combine more data sources later with lower constraints (the fan-in is higher and the combining gates are less complex).

    Starting from the output, I have made a big OR3 of AND2s, which were reduced to 2 layers of NANDs.

    There are more control signals but this allows the output to be zero if nothing is enabled. More OR3s can be cascaded to inject data in the result bus.

    I could push the bubbles further down the inputs but the P and G signals have a significant fanout so it makes more sense to simply put a buffer :

    The other gates have a fanout of 1 (except the XOR2 at SND) so they can be simple, FO1 gates. The P and G gates can be OR and AND gates with FO4 or more, if needed, because they are a combination of a NAND2 and inverting buffer.

    I have to redesign the control signals but that's not really a problem. There are more gates but they are "simpler". The new system is less adapted to ProASIC3 tiles but that's not the point. The new problem however is that when ADD/SUB is executed, the ROP2 output will contain the XOR value, which should be disabled somehow (if we want to use OR-combining only, not MUXes), unless another parallel NAND2 provides the value to the sink circuit...

    The front-end XOR2 could be a XNOR2 if it's faster. In this case it's just a matter of adding an inverting buffer or something like that after the decoder...


    OK, problem solved.

    The XOR value is output unconditionally on the dedicated port, while the ROP2 output is cleanly enabled by ORXOR_EN, AND_EN and PASS_EN.


    While implementing the unit, I found that there was some undesired redundancy :

    The goal is to 1) reduce the fanout of G 2) avoid having 2 identical gates with one shared output, while there is "room" a bit later in the circuit.

    There would not be a MUX2, but probably a OR gate, which usually requires 2 levels of inverter but it's not in the critical datapth.

    Decoding becomes a bit more complicated as well but... it will be easier for place&route :-)


    Erratum : SRI is the bypassed signal, not SND !

    How did this mistake manage to survive this long ?


    The truth table is pretty nice

           NEG  PASS_en AND_en XOR_en OrXor_en
    OR      0      0      0      0       1
    XOR     0      0      1      1       1
    AND     0      0      0      1       0
    ANDN    1      0      0      1       0
    SUB     1      0      1      x       0
    ADD     0      0      1      x       0
    PASS    x      1      1      x       0
    clear   x      0      0      0       0

    Notice that I changed the order of the boolean operations (again) to make decoding easier.

    I'll have to redesign the equations and decoder very soon.


    ROP2 is 11 gates per bit, or a massive 88 gates for the whole unit. Fortunately it is quite easy to layout...

  • A proper reset for the double-coil latch

    Yann Guidon / YGDES11/09/2019 at 07:35 0 comments

    A DPST relay can be emulated with two SPST relays, with their coils in series (one coil replaces the pull-up resistor so energy efficiency is increased). However there are two problems :

    • the high-side relay gives an inverted value
    • the power-up value of the complementary latch gives a non-complementary value, both relays are left open.

    The first problem is somehow "easy" to solve with the YGREC8 : the inverted value will go to SND because there is a XOR/inverter in the datapath. We just need to invert "in the other case".

    The 2nd problem is solved by a diode, connected to a common /RESET rail that is momentarily connected to 0V during the power-up sequence. This means more diodes, but the power-up sequence can be shorter than some code scanning the register set and writing to each of them...


    I just tested my system with the RES64 and it works well. The only problem is the capacitance of the RS flip-flop, the 47µF capacitor I tried is too large and 5µF would be good (a discharge time of 10ms) though I can't find the appropriate part.

    The discharge time will determine the max. switching frequency (?), I think 10µF would still take a full clock cycle to discharge at 50Hz, and nothing prevents us from aborting the discharge. So I ordered more Russian 10µF tantalum caps.

    This is also interesting because the much higher resistance of the RES64 coils keeps us from having to use large capacitors for timing purposes. For example, the POR (Power-On-Reset) could be controlled by a large capacitor (1000µF ?) discharging in a coil...


    Experiments have shown very interesting results... Such as a 100µF capacitor with an internal 6K Ohms resistance ???

    Because of this leakage current, the sensitive timing relay was still partially energised and wouldn't turn off after the RC time... Check your parts before using them !!!

    No trick, I swear !


    I make a 2-relays POR circuit now... Here is the schematic :

    I botched the manual reset, is should be a SPDT switch so the 470µ capacitor is discharged fast (through 200 ohms or so).

    The output has a weak pull-up resistor to backwards-bias all the diodes and (hopefully) reduce the crosstalk between all the latches.

    3 more diodes help with discharging the capacitor or to prevent reverse-charging.

    The 470µF cap provides a good 1s pulse.

    The output RES64 could be buffered with more and stronger relays (like 3×RES15)

    .........

    The only problem is with the voltage trigger : this voltage changes with time and self-heat... I'll have to find another system.

    Oh and the trigger voltage varies with the ramp-up speed...

    But this system is still more reliable than nothing. And I can select how many Ge diodes are in series to tune the voltage.

    Another challenge : how do I detect that the voltage has dropped below 5.5V ?

  • A new system for the register set

    Yann Guidon / YGDES11/05/2019 at 21:24 0 comments

    With the new RES-64 reed relays, the intended circuit must be adapted. Then with the experience gained with the other circuits, I came up with a different system that has several significant advantages over the prototype I made 2 years ago... But there is one drawback : it takes MORE RES-64 and more room !

    The write section doesn't change : each bitplane requires a MUX8 to steer the bit to the appropriate coil, plus the latching relay+capacitor, that's already 8×RES15 and 8×RES64.

    Reading however is different ! I simply took the large MUXes away, and I decode 3->8 with bipolar signals to select a whole register. I must add one diode per relay to prevent feedback loops but they are pretty small and cheap.

    However there are 2 read ports and each latch must be duplicated because the RES64 are not DPST... that means a total of 144 RES64 !


    Nothing crazy here, it's simply that I moved the MUX8 from the last to the first side, so it can be shared among the 8 bitplanes, which saves a significant number of relays.

    Fewer relays make the system more dependable/reliable. The "sense buffer" (the same RES64 as the latches) needs less than 3mA and the MUX switches less than 3×8=24mA, the contacts are safe.

    Of course it's not so simple : so many switches in parallel make feedback loops so we need diodes, one per switch, or 8 per bitplane, or 64 overall... But they are small and cheap so it's tolerable.

    with the diodes, it might even be possible to use a bipolar system to save some decoding relays (MUX4 instead of MUX8), though it might be tricky...

    It is also possible to latch the read bit, in case we need a pipeline latch or timing isolator.

    But each RES64 is only a single switch and we need 2 of them, so unless I find a DPST reed relay that is similar enough, there are few choices :

    - use/find/buy MORE RES64, which will take a lot of room

    - use/find/buy more SIP reed relays (such as the Chinese ones I have found) because they are small and still cheap, though they break the "all-Russian style"...

    - find a dual-switches reed relay... => unlikely.

    This problem is specific to the register set because it has two read ports.

    I/O and other registers have only one port (usually) so we can still use this method, for example for the scratchpad area.

    Anyway, the huge parallel MUX8s were big annoyances and I'm glad I reduced their quantity. But I find myself with more questions to solve...


    Lacking a proper, cheap, well-behaved DPST relay is not a catastrophe in itself. We can build one from two SPST relays by replacing the resistor with another coil, as in the sketch below:

    The system will be less "clacky" because reading one operand will switch far fewer contacts. Maybe it's for the best for our ears, but it's certainly better for the overall reliability : the fewer energised relays, the fewer power it draws, the fewer points of failure...

    Furthermore : this diode-OR system could be useful to save a few relays here and there, because the SRI operand gets data from a MUX in the datapath. The "read enable" can be disabled if an immediate value (or anything else) is required by the instruction.

  • A "hub" for the instructions

    Yann Guidon / YGDES10/25/2019 at 20:44 0 comments

    In the Y8, instructions come :

    • from the program memory / PROM
    • from the assembly panel
    • from eventual "modern" sources

    Then the instruction bits are amplified, eventually latched, and sent to :

    • the processor's instruction decoder
    • the disassembly panel
    • eventually something else such as a semiconductor device...

    This is a bit more complex than just plugging things together because all the electrical signals must be at the proper levels...

    For now I have built the assembler panel and I start building the disassembler, and I'd love to test them together, but the levels are not compatible :

    • The input is a low-current (2mA), medium voltage (about 6V) signal
    • The output must be able to drive a string of RES15 coils (50 to 60mA max)

    The RES64A is appropriate to buffer the signals and even latch them, if appropriate biasing is enabled.

    The latch feature can be enabled on demand, for example during sensitive phases of the instruction cycle.

    Another row of relays can also (dis)connect the RES64's coil from the input, to freeze the state of the processor while the memory and other circuits are in transient phases. The RES60 would be appropriate because it's small and DPDT so only 8 relays are needed, which uses much less room than the other methods. The 16× RES64 will use quite a lot of room, in comparison...

    For convenience the latch doesn't use an intermediary capacitor because some operations require a direct connection to the core.

    Now I have to find a PCB that can host 16× RES64...


    20191118: I drop the idea of the RES60 latches because there must be a proper "instruction register".  Program memory can also contain data that must be read by LDCL/LDCH and an early latch would make it harder later...

    It also saves some of these precious relays.

    So I started building the hub board on a smaller board, with only 3 connectors and their 48 diodes. More diodes provide the latching for the RES64. The relays will not be placed yet because I need to bin/sort the whole lot and I have not received everything yet. The preliminary data is in the log First plots.

    The relays will be placed on staggered positions on both sides of the board to save space, just like it will be for the register set.

    Hopefully I'll have some room left in the corners for mounting holes...

  • RES64 > RES15 (somewhat)

    Yann Guidon / YGDES10/25/2019 at 03:02 2 comments

    I received 72× RES64A from Moldova and I'm pretty happy and lucky :-)

    @Artem Kashkanov  praised the RES55 he uses : the lower current and the higher hysteresis compared to RES15 would be great and I was eager to test something.

    The log 86. Sensing relays explored the question of the reed relays and found that even cheap 12V relays from China have desired features for certain circuits of the YGREC8 : mainly as sensors/amplifiers because they require much less current for activation.

    I just measured a RES64A and the reference I received is pretty awesome !

    • Von : 4.3V
    • Ion : 2.1mA
    • Voff : 1.7V

    The case is pretty bulky but this adds to the charm. With a suitable price, I'd get more of them and use the high hysteresis to build the register set as well.

    Even at 2.5mA (worst case), the gain is really significant ! It is less than 1/10  the current required by the RES15 and the hysteresis is somewhat higher, which means : much more stability ! And no need to bin the parts !

    Total current : 2.5 × 8 × 8 = 160mA max !

    This considerably relaxes the constraints on the power supply, the ripple (and filtering capacitance) is much less and the whole is less sensitive to interferences...

    However the supply voltage would be 4.3 + 1.7V = 6V and I'll have to find/design the proper power supply and transformer... But 6 × 0.16 = 1W max !

    Now I have to find enough vintage Russian 2K resistors...

    There is another change : the RES64 is SPST so it's only on or off... the RES15 is SPDT and can switch the output from +Vcc to -Vcc so it's pretty convenient for the output levels. A register set made of RES64 will require some sort of buffer (maybe another RES64 per bit, so I'll need 72 of them)

View all 99 project logs

Enjoy this project?

Share

Discussions

salec wrote 10/09/2019 at 09:18 point

YGREC can stand for so many things, but since my wife has been learning French on Duolingo I can't avoid noticing that it is also a wordplay on French spelling of "Y". 

:-)

  Are you sure? yes | no

Yann Guidon / YGDES wrote 10/09/2019 at 10:03 point

oh, of course, yes, too ;-)

  Are you sure? yes | no

salec wrote 10/09/2019 at 12:04 point

always have an opening joke/tease for audience :D

  Are you sure? yes | no

Yann Guidon / YGDES wrote 10/09/2019 at 12:46 point

@salec  always !

  Are you sure? yes | no

castvee8 wrote 04/13/2019 at 22:57 point

I so love your commitment and enthusiasm ! I was playing with vacuum tube calculators a bit since last year an just keep going down the rabbit hole. Your projects seem to at least make purposeful sense.

  Are you sure? yes | no

Yann Guidon / YGDES wrote 04/14/2019 at 08:56 point

That "purposeful sense" may look drowned into the proliferation of projects, angles and ideas but it is still clear to me since it's my main hobby since 1998 at least :-D

I'm glad you enjoy !

  Are you sure? yes | no

Yann Guidon / YGDES wrote 11/04/2018 at 07:11 point

Another note for later :
writing to A1 or A2 starts a fetch from RAM. In theory the latency is the same as instruction memory and one wait state would be introduced. However the processor can also write directly so the wait state would be only on read to the paired data register...

  Are you sure? yes | no

Yann Guidon / YGDES wrote 11/04/2018 at 06:55 point

Note for later : don't forget the transparent latch on the destination register address field, for the (rare) case of LDCx, because the 2nd cycle doesn't preserve the opcode etc.

  Are you sure? yes | no

Yann Guidon / YGDES wrote 11/04/2018 at 07:18 point

OK, not a transparent latch, but a DFF and a mux, plus some logic to control it.

-- DFF, every cycle :

SND_latched <= SND_field;

LDCx_flag <= '1' when (LDCx_flag='0' and opcode=opc_LDC and writeBack_enabled='1')   else '0';

-- MUX2 :

WriteAddress <= SND_latched when LDCx_flag = '1' else SND_field;

______

Note : LDCx into PC must work without wait state because it's connected directly to SRI, as an IMM8, and no extra delay is required. PC wait state is required for ADD/ROP2/SHL and IN.

  Are you sure? yes | no

Frank Buss wrote 10/27/2018 at 12:51 point

Do you really plan 8 byte-wide registers? This would require thousands of relays :-)

  Are you sure? yes | no

Yann Guidon / YGDES wrote 10/27/2018 at 14:26 point

no :-)

8 registers, 8 bits each = 64 storage bits.
1 relay per bit => 64 registers


The trick is to use the hysteretic mode of the relays :-)

  Are you sure? yes | no

Frank Buss wrote 10/27/2018 at 16:17 point

Ok, makes sense. Maybe change the project description, someone might think you are planning a 64 bit architecture.
BTW, could this be parametrized for the address and data size? If you implement it in VHDL, you could use generics for this, would be no additional work to use just the generic names instead of hard coded numbers. Except maybe some work for extending the instruction opcodes.

  Are you sure? yes | no

Yann Guidon / YGDES wrote 10/27/2018 at 17:16 point

Frank : DAMNIT you're right !

I updated the description...

  Are you sure? yes | no

Yann Guidon / YGDES wrote 10/27/2018 at 17:19 point

For the parameterization : it doesn't make sense at this scale. Every fraction of bit counts and must be wisely allocated.

Larger architectures such at #YASEP Yet Another Small Embedded Processor  and #F-CPU  have much more headroom for this.

  Are you sure? yes | no

Bartosz wrote 11/08/2017 at 16:40 point

this will working on epiphany or oHm or other cheap machine?

  Are you sure? yes | no

Yann Guidon / YGDES wrote 11/08/2017 at 18:07 point

I'm preparing a version that would hopefully use less than half of a A3P060 FPGA, which is already the smallest of that family that can reasonably implement a microcontroller.

But it's a lot less fun than making one with hundreds of SPDT relays !

  Are you sure? yes | no

Bartosz wrote 11/14/2017 at 14:13 point

Question is price and posibility to buy

  Are you sure? yes | no

Yann Guidon / YGDES wrote 11/14/2017 at 16:08 point

@Bartosz : what do you want to buy ?

If you can simulate and/or synthesise VHDL, the source code is being developed and available for free, though I can't support all FPGA vendors.

If you want a ready-made FPGA board, that could be made too.

If you want relays, it's a bit more tricky ;-)

I have just enough RES15 to make my project and it might take a long while to succeed. There will be many PCB and other stuff.

However if, in the end, I see strong interest from potential buyers, I might make a cost-reduced version with easily-found minirelays. I don't remember well but the Chinese models I found cost around 1/2$ a piece. Factor in PCB and other costs and you get a very rough price estimate... It's not cheap, it's not power efficient, it's slow and won't compute useful stuff... But it certainly can make a crazy nice interactive display, when coupled with flip dots :-D

So the answer is : "it depends" :-D

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates