Disclosure of Invention
In order to improve the operation efficiency of the storage and computation integrated chip technology, the invention provides an analog-to-digital converter with a pooling function, which comprises: the device comprises a pooling circuit and an analog-to-digital conversion circuit, wherein the pooling circuit is connected with the analog-to-digital conversion circuit; the analog-to-digital conversion circuit is of a capacitive SAR ADC universal structure and comprises an SAR comparison control module and a capacitive array DAC; the pooling circuit and the analog-to-digital conversion circuit share a capacitor array DAC; the pooling circuit compares the voltages of input signals and samples and holds the maximum value to realize maximum pooling; and the analog-to-digital conversion circuit is used for converting the kept pooling result into a digital signal to be output.
Optionally, the pooling circuit includes: a comparator Comp, a capacitor array DAC, a sampling switch S1 and a reset switch S2;
the output end of the comparator Comp is connected with the control end of a sampling switch S1, and the output ends of the sampling switches S1 and S2 are connected with the upper plate VP of the DAC capacitor array and the inverting input end of the comparator Comp.
Optionally, the comparator Comp adopts a dynamic latch structure, and when Clkc is at a low level, the sampling signal Sample is reset to 0; when Clkc is at high level, compare the magnitude of the input signal VIN with the holding signal VH, and latch the comparison result Sample out, controlling the sampling switch S1 to be turned on or off.
Optionally, the upper plate VP of the capacitor array DAC holds a maximum value.
Optionally, the sampling switch S1 is configured to control whether to Sample the input signal, and when the Sample signal is high, S1 is turned on; when the Sample signal is low, S1 is turned off.
Optionally, the reset switch S2 is configured to control whether to reset the hold voltage VP of the DAC to 0, and when the Rst signal is high, S2 is turned on; when the Rst signal is low, S2 is off.
Optionally, the analog-to-digital converter further includes a voltage buffer unit Buf.
Optionally, the Buf input terminal is connected to the upper electrode plate VH of the DAC capacitor array, and the output terminal is connected to the inverting input terminal of the comparator Comp. Buf is used for following the buffering with voltage signal VP that DAC kept, and output signal VH connects Comp's inverting input end for the influence of the kickback noise of isolated comparator to keeping signal VP.
The invention has the beneficial effects that:
compared with the prior art, the analog-digital converter with the pooling function has the following advantages: the analog-to-digital converter designed by the invention integrates a pooling function, a pooling circuit and an analog-to-digital conversion circuit share a capacitor array, and a data matrix can be subjected to pooling operation and read out in an analog domain by introducing less power consumption and area, so that the dimension of the data matrix is reduced. The invention effectively reduces the working times of the analog-digital conversion circuit, omits the frequent comparison operation of a digital domain, reduces the consumption of storage space and greatly improves the operation efficiency of the storage and computation integrated chip technology.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
The first embodiment is as follows:
referring to fig. 2, the analog-to-digital converter includes a pooling circuit and an analog-to-digital conversion circuit, wherein the pooling circuit is connected to the analog-to-digital conversion circuit; the analog-to-digital conversion circuit is of a capacitive SAR ADC universal structure and comprises an SAR comparison control module and a capacitive array DAC; the pooling circuit and the analog-to-digital conversion circuit share a capacitor array DAC.
When Clks is high, the analog-to-digital conversion circuit is in a stage to be sampled; when Clks is low, the analog-to-digital conversion circuit is in the conversion phase.
The pooling circuit compares the voltages of input signals and samples and holds the maximum value to realize maximum pooling; and the analog-to-digital conversion circuit is used for converting the kept pooling result into a digital signal to be output.
The pooling circuit comprises a comparator Comp, a capacitive array DAC, a sampling switch S1 and a reset switch S2; the output end of the comparator Comp is connected with the control end of a sampling switch S1, and the output ends of the sampling switches S1 and S2 are connected with the upper plate VP of the DAC capacitor array and the inverting input end of the comparator Comp.
The comparator Comp adopts a dynamic latch structure, and when Clkc is at a low level, the sampling signal Sample is reset to 0; when Clkc is at high level, compare the magnitude of the input signal VIN with the holding signal VH, and latch the comparison result Sample out, controlling the sampling switch S1 to be turned on or off.
The upper plate VP of the capacitor array DAC holds the maximum value.
The sampling switch S1 is used for controlling whether to Sample the input signal, and when the Sample signal is high, S1 is conducted; when the Sample signal is low, S1 is turned off.
The reset switch S2 is used for controlling whether the holding voltage VP of the DAC is reset to 0, and when the Rst signal is high, S2 is conducted; when the Rst signal is low, S2 is off.
Compared with the existing analog-to-digital converter which performs pooling processing in a digital domain, the analog-to-digital converter with the pooling function provided by the invention can perform pooling operation on convolution operation results in an analog domain, so that the dimension can be further reduced, and the calculation amount of the digital domain can be further reduced. The invention integrates the pooling function on the basis of the analog-digital conversion circuit, can perform pooling operation on the data matrix in the analog domain and read out the data matrix, reduces the dimension of the data matrix, effectively reduces the working times of the analog-digital conversion circuit, saves frequent comparison operation of the digital domain, reduces the consumption of storage space and further improves the operation efficiency of the storage-computation-integrated chip technology.
A schematic diagram of a storage-computation-integrated architecture based on an analog-to-digital converter with a pooling function is shown in fig. 3, and compared with the existing storage-computation-integrated architecture based on ADC reading, the existing architecture can realize convolution operation and reading, and then perform pooling operation in a digital domain. Based on the storage and calculation integrated overall architecture of the analog-to-digital converter with the pooling function, the convolution operation result can be pooled before being read out, the working times of the analog-to-digital conversion circuit are reduced, the speed requirement of the analog-to-digital conversion circuit is further reduced, and low-power-consumption design is facilitated. Meanwhile, the output under the framework based on the invention is the result of convolution and pooling, and compared with the existing framework, the pooling operation of a digital domain is omitted, so that a large amount of storage space is saved.
Example two:
referring to fig. 4, the analog-to-digital converter with pooling function of the present embodiment adopts an analog-to-digital converter structure with pooling function with a buffer unit.
In the first embodiment, a voltage buffering unit Buf is introduced on the basis of the structure of the analog-to-digital converter shown in fig. 2, the input terminal of the Buf is connected to the upper plate VH of the DAC capacitor array, and the output terminal of the Buf is connected to the inverting input terminal of the comparator Comp. Buf is used for following the buffering with voltage signal VP that DAC kept, and output signal VH connects Comp's inverting input end for the influence of the kickback noise of isolated comparator to keeping signal VP.
The analog-to-digital converter with pooling function provided by the invention takes a pooling core with the size of 2x2 as an example, and the operation timing chart is shown in fig. 5. There are 4 positive input signals VIN (V1, V2, V3, V4) per cycle, 4 comparisons are made, and the maximum pooling result is digitally quantized and output. The specific working process is as follows:
a reset stage: RST signal is high, reset switch S2 is conducted, and upper plate voltage VP of DAC resets to 0; when the Clks signal is high, the analog-to-digital conversion circuit finishes the last conversion state and enters a state to be sampled.
(II) a pooling stage: RST signal is set to 0, and reset switch S2 is turned off; clkc switches to high level for the first time, the comparator compares the first input signal V1 with VH, and since VH ═ VP ═ 0, the comparator output signal Sample is high level, the sampling switch S1 is turned on, and the DAC samples and holds the input signal V1, that is, VH ═ VP ═ V1. When the second input signal V2 is completely established, Clkc switches to high level for the second time, the comparator compares the input signal V2 with the hold signal V1, if V2> V1, the comparator outputs Sample as high level, the sampling switch S1 is turned on, and the DAC samples and holds the input signal V2, that is, VH ═ VP ═ V2; if V2< V1, the comparator output Sample is low, the sampling switch S1 remains off, and the DAC still keeps the previous signal, i.e., VH ═ VP ═ V1. The comparison of the input signals V3 and V4 is then done in turn on the same principle and the input signal is sampled or held in the previous state.
(III) an analog-to-digital conversion stage: after the circuit finishes the pooling operation, the Clks signal is switched to low level, the analog-to-digital conversion circuit quantizes the pooling result kept by the DAC, and an N-bit digital signal is output.
The analog-to-digital converter with the pooling function provided by the invention is also suitable for pooling cores of other sizes, only needs to correspond the switching times of the input signals to the Clkc signal in the pooling process, has m positive input signals VIN (V1-Vm) in each period, performs m comparisons, and performs digital quantization output on the maximum pooling result.
The analog-to-digital converter designed by the invention integrates a pooling function, a pooling circuit and an analog-to-digital conversion circuit share a capacitor array, and a data matrix can be subjected to pooling operation and read out in an analog domain by introducing less power consumption and area, so that the dimension of the data matrix is reduced. The invention effectively reduces the working times of the analog-digital conversion circuit, omits the frequent comparison operation of a digital domain, reduces the consumption of storage space and greatly improves the operation efficiency of the storage and computation integrated chip technology.
Some steps in the embodiments of the present invention may be implemented by software, and the corresponding software program may be stored in a readable storage medium, such as an optical disc or a hard disk.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.