In-memory Multibit Multiplication and Accumulation Based on an Automatic Pulse Generation Circuit