1. A threshold gate, comprising: a magnetic tunnel junction (MTJ) element switchable from a first resistive state to a second resistive state; and a threshold realization element configured to switch the MTJ element from the first resistive state to the second resistive state in accordance with a threshold function.