An integrated threshold gate