In-memory
computing featuring a radical departure from the von
Neumann architecture is promising to substantially reduce the energy
and time consumption for data-intensive computation. With the increasing
challenges facing silicon complementary metal-oxide-semiconductor
(CMOS) technology, developing in-memory computing hardware would require
a different platform to deliver significantly enhanced functionalities
at the material and device level. Here, we explore a dual-gate two-dimensional
ferroelectric field-effect transistor (2D FeFET) as a basic device
to form both nonvolatile logic gates and artificial synapses, addressing
in-memory computing simultaneously in digital and analog spaces. Through
diversifying the electrostatic behaviors in 2D transistors with the
dual-ferroelectric-coupling effect, rich logic functionalities including
linear (AND, OR) and nonlinear (XNOR) gates were obtained in unipolar
(MoS2) and ambipolar (MoTe2) FeFETs. Combining
both types of 2D FeFETs in a heterogeneous platform, an important
computation circuit, i.e., a half-adder, was successfully constructed
with an area-efficient two-transistor structure. Furthermore, with
the same device structure, several key synaptic functions are shown
at the device level, and an artificial neural network is simulated
at the system level, manifesting its potential for neuromorphic computing.
These findings highlight the prospects of dual-gate 2D FeFETs for
the development of multifunctional in-memory computing hardware capable
of both digital and analog computation.