CPC H03M 13/19 (2013.01) [H03M 13/611 (2013.01)] | 21 Claims |
1. A Hamming weight calculation method performed by an operation apparatus, wherein the operation apparatus comprises a controller and a first calculator, the controller is in signal connection with the first calculator, the first calculator comprises a first memory and a first transistor, a drain of the first transistor is connected to a negative electrode of the first memory, and a source of the first transistor is grounded; and
the method is performed by the controller, and the method comprises:
setting an initial resistance state of the first memory to a low resistance state;
determining a first gate voltage of the first transistor based on first bit data in a first binary sequence taken as input, and controlling an on-off state of the first transistor based on the first gate voltage, wherein when the first bit data is 0, the first transistor is in an on state; and when the first bit data is 1, the first transistor is in an off state;
controlling a target resistance state of the first memory based on the on-off state of the first transistor, wherein when the first transistor is in the on state, the target resistance state of the first memory is a high resistance state; and when the first transistor is in the off state, the target resistance state of the first memory is the low resistance state; and
determining a Hamming weight of the first bit data based on a first output current on the source of the first transistor.
|