Ultrafast analog-to-digital converter using resonant-tunneling ternary quantizers