Normally-off logic based on resistive switches - Part I: Logic gates