Multi-valued logics (MVLs) offer higher information density, reduced circuit and interconnect complexity, lower power dissipation, and faster speed over conventional binary logic system. Recent advancement in MVL research, particularly with emerging low-dimensional materials, suggests that breakthroughs may be imminent if multistates transistors can be fabricated controllably for large-scale integration. Here, a concept of source-gating transistors (SGTs) is developed and realized using carbon nanotubes (CNTs). By extending the source electrode into the channel of conventional CNT transistors, a controllable p-n homojunction is formed, allowing CNT-SGTs to reliably switch between three distinct states. Capitalizing on the straightforward fabrication process of CNT-SGTs, ternary inverters, NMIN and NMAX logic gates, ternary SRAM cells, and a ternary neural network achieving 100% image classification accuracy have been successfully implemented. This study represents the most advanced and highest-performing ternary circuits realized with low-dimensional materials to date. This progress highlights the potential of CNT-SGTs in driving the future of MVL architectures.