On not designing circuits with evolutionary algorithms

[Henrik] has been working on a program to design electronic circuits using evolutionary algorithms. It’s still very much a work in progress, but he’s gotten to the point of generating a decent BJT inverter after 78 generations (9 minutes of compute time), as shown in the .gif above.

To evolve these circuits, [Henrik] told a SPICE simulation to generate an inverter with a 5V power supply, 2N3904 and 2N3906 transistors, and whatever resistors were needed. The first dozen or so generations didn’t actually do anything, but after 2000 generations the algorithm produced a circuit nearly identical to the description of a CMOS inverter you’d find in a circuit textbook.

Using evolution to guide electronic design is nothing new; an evolutionary algorithm and a a few bits of Verilog can turn an FPGA into a chip that can tell the difference between a 1kHz and 10kHz tone with extremely minimal hardware requirements. There’s also some very, very strange stuff that happened in this experiment; the evolutionary algorithm utilized things that are impossible for a human to program and relies on magnetic flux and quantum weirdness inside the FPGA.

[Henrik] says his algorithm didn’t test for how much current goes through the transistors, so implementing this circuit outside of a simulation will destroy the transistors and emit a puff of blue smoke. If you’d like design your own circuits using evolution, [Henrik] put all the code in a git for your perusal. It’s damn cool as it stands now, and once [Henrik] includes checking current and voltage in each component his project may actually be useful.

Comments

  1. xaio says:

    actually it would be pretty easy to build more limitations like currenttesting etc. into the evolutionary programm and many times it would get faster.

    • Dax says:

      Then the next problem you run into is setting the fitness criteria for the device.

      It’s impossible to develop a complete fitness test for something as simple as an amplifier because you have to exhaust all possible inputs, or at least all possible inputs that are relevant to you, and all the other cases such as rejection of EMI.

      And if you don’t, then evolution will pick any shortcut possible and answer to your criteria, but only your criteria. For example, if you want a stable oscillator, you’ll get a phase locked loop radio reciever tuned to 60 Hz, because the line hum all around you stays constant regardless of temperature etc.

      • Soham says:

        Sir

        I am a student of VLSI Design. My thesis subject is ” Fibonacci Codes for Crosstalk Avoidance” , here I particularly working on Complementary Redundant Fibonacci coding .

        Here I need the circuit design of the coding .

        Sir could you kindly help me in this work.

        I will be very much grateful if you kindly provide me the circuit design for above coding .

        Regards

        Soham

    • WILLAIM says:

      well wouldn’t it just need to have real world limits added to it and the bad designs would just die off?

  2. Author here, since writing this post I’ve added the current measurements and multithreading. I have also tried to simulate a new bandgap reference. This time measurements are input current(60C)(rload=100k), output voltage(27C)(rload=100k), output voltage(60C)(rload=100k), output voltage(50C)(rload=10k). Results seem good in simulation and it should work when built with real components. I bought some transistors today to actually build this circuit and make some real measurements. I think I’m going to write a post about the results later this week.

    Animations and the final circuit here: http://imgur.com/a/ur5V1

    Also if you use Windows and have motivation to code, please add Windows support. Github issue here: https://github.com/Ttl/evolutionary-circuits/issues/1

  3. David Rysdam says:

    Why is the word “not” in the title of this post?

    • Geancarlo says:

      “[Henrik] says his algorithm didn’t test for how much current goes through the transistors, so implementing this circuit outside of a simulation will destroy the transistors and emit a puff of blue smoke.”

    • Colecoman1982 says:

      I think it’s a joke because you’re not designing the circuit, the computer is designing it for you.

  4. Chris C. says:

    Interesting read about the tone detector.

  5. zuul says:

    Cool

  6. thatcherc says:

    Wait… quantum activities go on inside FPGA’s?? Might that mess things up a bit?

    • Leonard says:

      It is probable it might mess up a bit xD

    • Dax says:

      It’s more like slight crosstalk between the logic cells, because the circuit they evolved works in analog mode.

      It’s tricky, because just changing the room temperature by 1 degrees throws it off. There was never any consideration for different operating temperature while they were evolving the circuit, so evolution ignored robustness to temperature changes alltogether and made use of very fragile quirks of the hardware.

  7. etuiretuireut says:

    If you are interested in this sort of thing, check out Koza’s books on Genetic Programming — particularly the 2nd one, which mostly focuses on giving examples of circuits evolved using GP.

  8. K0HAX says:

    Here’s an idea, give an evolutionary circuit simulator the only requirement of self-preservation, then run it and see what happens. :) inb4skynet.

    • PocketBrain says:

      It’ll just put 10Mohm resistors everywhere, LOL!

    • charles says:

      Depends on how you define self preservation. If you go the homeostasis route without any additional requirements it would effectively kill itself. It would return the least functional design.

      It would fulfill robustness and homeostasis perfectly.

  9. NateOcean says:

    How could an evolved circuit based on Bipolar transistors “produced a circuit nearly identical to the description of a CMOS inverter you’d find in a circuit textbook”?

    • philwatcher says:

      Advanced magicks.

      Well, you would never have the “infinite input impedance”, and the output would never quite reach the rails, and static current consumption would be higher…I see what you mean.

  10. David says:

    Brian,

    Can you provide a reference or explanation for the comment pertaining to “quantum weirdness.” Thompson’s paper titled “An evolved circuit, intrinsic in silicon, entwined in physics” makes reference to electromagnetic coupling or power line coupling explaining the unusual circuit design but does not mention quantum mechanics.

    Thanks,
    David

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 92,407 other followers