C# Logic Gates

Logic gates

From the humble logic gate came the CPU. The CPU begat machine code, machine code begat assembler, assembler begat C, C begat the Windows API and finally the Windows API begat the .NET Framework. So to come full circle, I thought I'd implement logic gates on top of the .NET Framework.

I've implemented OR, AND, XOR and NOT gates, along with a switch for setting inputs and a light for seeing outputs. Just place the gates on the VS.NET forms designer and hook them up through their properties.

Download the source and compiled DLL here

To Do

  • Cope with gates whose output leads back to their input. This currently causes a stack overflow...
  • Hide controls that shouldn't be used (Device, OneInputDevice and TwoInputDevice)
  • Repainting in the IDE isn't very good currently.