Hello,
To change the positin of relay contact, you should apply a constant voltage across the inductor of the relay. Therefore you can connect the FPGA pin directly to one terminal of the coil while the other is grounded. this is pretty simple, why do we need a transistor and a diode?
We need the SL100 Transisto because.
The inductor will draw much current that may cause damage to the FPGA.
Therefore we apply the control signal to a the base(gate) of BJT(MOS) transistor so that the current will be drawn in the collector(drain) of the transistor.
Now, Why do we need a diode such as 1N4007?
When you remove the voltage from the inductor, it need some path to discharge the stored energy in it, so the diode creates that path untill the inductor discharges.
**broken link removed**