digital_electricity: Fix terminals default value being 0
Previously, the gates would work when one of the input terminals out of
the two is connected. For example, if only one terminal is connected to
an OR gate and it is of value 1, the output will be = 1, even though the
other terminal is not connected to any input. This is corrected by
checking whether both of the terminals are connected via some wire and
setting the input accordingly, ie:
output value = (terminal 1 is connected && terminal 2 is connected) ? calculate value : 0
Signed-off-by: Rudra Nil Basu <rudra.nil.basu.1996@gmail.com>