A kind of three-state input detection circuit and its detection method
Technical field
The present invention relates to a kind of circuit checkers, more specifically more particularly to a kind of three-state input detection circuit;This
Invention further relates to a kind of detection method of three-state input detection circuit.
Background technology
The input state of circuit includes that three kinds of high level, low level and high-impedance state (suspended state) are basic under normal circumstances
Logic state.Usually it can determine that input voltage is in high level, low level or height using detection circuit when designing circuit
Resistance state.
As shown in Figure 1, the composition input point in parallel with resistance R1 and resistance R2 of the input signal of traditional tri-state detection circuit
Volt circuit, input signal are also connected with the grid of the grid and transistor M2 of transistor M1, the other end of resistance R1 respectively with crystal
The drain electrode of pipe M1 is connected with the drain electrode of transistor M2, the other end of resistance R2 respectively with the source electrode of transistor M1 and transistor M2
Source electrode connects, and constitutes the different comparator of turn threshold, and when input is high level or low level, Vin is entered signal drawing
Height drags down, and compares the corresponding result of output.When input is high-impedance state, bleeder circuit provides Vin voltages, exports corresponding knot
Fruit.To achieve the purpose that detect input state.Traditional tri-state detection circuit will appear when strong noise, supply voltage are unstable
Mistake is detected, anti-interference ability is poor, while its bleeder circuit current drain is larger.Keep detection accurate it would therefore be highly desirable to invent one kind
The higher three-state input detection circuit of true property.
Invention content
The previous of the present invention is designed to provide a kind of three-state input detection circuit, which passes through input state control
The work of two NMOS and two PMOS transmission gates is made, tri-state input detection is realized, has the characteristics that detection accuracy is high.This hair
Bright latter purpose is to provide a kind of detection method of three-state input detection circuit.
The previous technical solution of the present invention is as follows:
A kind of three-state input detection circuit, wherein including sequentially connected bleeder circuit and partial pressure after detection circuit,
The bleeder circuit connects an input signal Vin, for dividing input signal;
Detection circuit after the partial pressure, the input state for checking input signal.
Preferably, the described partial pressure electricity 1 include resistance R1, resistance R2, resistance R3, resistance R4, resistance R5, PMOS tube PM1,
PMOS tube PM2, PMOS tube PM3, NMOS tube NM1, the input signal Vin by after resistance R5 respectively with PMOS tube PM3's
The source electrode connection of source electrode, NMOS tube NM1, the drain electrode of the NMOS tube NM1 are sequentially connected after resistance R3, resistance R1 and PMOS tube
The source electrode of PM1 connects, the grid of the PMOS tube PM1 be separately connected the drain electrode of PMOS tube PM1, PMOS tube PM2 source electrode and
The grid of the grid of NMOS tube NM1, the PMOS tube PM2 is connect with the grid of the drain electrode of PMOS tube PM2, PMOS tube PM3 respectively,
The drain electrode of the PMOS tube PM2 is connect after being sequentially connected resistance R2, resistance R4 with the drain electrode of PMOS tube PM3, the resistance R2 and
Resistance R4 indirectly, an operating voltage VDD is connected between the resistance R1 and resistance R3.
Preferably, after the partial pressure detection circuit include phase inverter U1, it is phase inverter U2, phase inverter U3, phase inverter U4, anti-
Phase device U5, phase inverter U6, phase inverter U7, PMOS tube PM4, PMOS tube PM5, NMOS tube NM2, NMOS tube NM3, the NMOS tube
The drain electrode of NM1 with the grid of phase inverter U2, the source electrode of PMOS tube PM4, PMOS tube PM5 by connecting respectively after phase inverter U1, institute
The output for stating phase inverter U2 is separately connected the grid of the source electrode of NMOS tube NM2, NMOS tube NM3, and the drain electrode of the PMOS tube PM3 is logical
Cross sources of the phase inverter U3 respectively with the grid of phase inverter U3, the source electrode of NMOS tube NM3, the grid of PMOS tube PM4, PMOS tube PM5
Pole and phase inverter U6 connections, the drain electrode of the NMOS tube NM2 and the drain electrode of NMOS tube NM3, the drain electrode of PMOS tube PM4 and
Connect output end OUT1 after the drain electrode parallel connection of PMOS tube PM5 after phase inverter U4, phase inverter U5 successively, the phase inverter U6's
Output end connects connection output end OUT2 after phase inverter U7.
Latter technique scheme of the present invention is as follows:
A kind of detection method of three-state input detection circuit, includes the following steps:
(1) input signal enters three-state input detection circuit, and detection is exported respectively from output end OUT1 and output end OUT2
Information judges the input state of input signal according to the inspection information of output;
(2) when input signal Vin is high level, PMOS tube PM3 conductings, resistance R4 pressure drops are high, output end OUT2 outputs
" 0 ", NMOS tube NM1 cut-offs, resistance R3 is without pressure drop, NMOS tube NM3 conductings, output end OUT1 outputs " 0 ";
(3) when input signal Vin is low level, PMOS tube PM3 cut-offs, resistance R4 is without pressure drop, output end OUT2 outputs
" 1 ", NMOS tube NM1 conductings, resistance R3 pressure drops are big, NMOS tube NM2 conductings, output end OUT1 outputs " 0 ";
(4) when input signal Vin is high-impedance state, PMOS tube PM3 conductings, resistance R4 pressure drops are small, output end OUT2 outputs
" 1 ", NMOS tube NM1 conductings, resistance R3 pressure drops are small, PMOS tube PM4 conductings, output end OUT1 outputs " 1 ".
Compared with prior art, the device have the advantages that being:
1. a kind of three-state input detection circuit of the present invention, wherein including being examined after sequentially connected bleeder circuit and partial pressure
Slowdown monitoring circuit, the bleeder circuit connects an input signal Vin, for dividing input signal;It is examined after the partial pressure
Slowdown monitoring circuit, the input state for checking input signal.When detecting, input signal Vin current potentials when low and high level is inputted by
Input signal determines, is determined by bleeder circuit in high-impedance state, meanwhile, input state controls the conducting of NM1 and PM3 pipes, determines
The pressure drop of pull-up resistor R3 and pull down resistor R4.NMOS transmits low level, and PMOS transmits high level;The output electricity of pull down resistor R4
Pressure obtains detection signal OUT2 after phase inverter is delayed;The output voltage of pull-up resistor R3 and pull down resistor R4, pass through reverse phase
Device so that only there are one transmission gates to work, and transmits corresponding level, obtains detection signal OUT1;Due in high-impedance state, NM1, PM3
Conducting, but it is much smaller when pull down resistor and pull-up resistor voltage drop value ratio input low and high level so that and output testing result will not weigh
It is multiple, have the characteristics that detection accuracy is high.
2. a kind of detection method of three-state input detection circuit of the present invention detects input state using this detection method
When, the different way of outputs, which is shown, to be realized to three kinds of input states, testing result is more acurrate clear.
Description of the drawings
Fig. 1 is the circuit diagram of traditional tri-state detection circuit;
Fig. 2 is the circuit diagram of the present invention.
Specific implementation mode
With reference to embodiment, technical scheme of the present invention is described in further detail, but do not constituted pair
Any restrictions of the present invention.
With reference to shown in Fig. 2, a kind of three-state input detection circuit of the invention, wherein including sequentially connected bleeder circuit 1
With detection circuit 2 after partial pressure,
The bleeder circuit 1 connects an input signal Vin, for dividing input signal;
Detection circuit 2 after the partial pressure, the input state for checking input signal.
The bleeder circuit 1 includes resistance R1, resistance R2, resistance R3, resistance R4, resistance R5, PMOS tube PM1, PMOS
Pipe PM2, PMOS tube PM3, NMOS tube NM1, the input signal Vin by after resistance R5 respectively with the source electrode of PMOS tube PM3,
The source electrode of NMOS tube NM1 connects, and the drain electrode of the NMOS tube NM1 is sequentially connected the source after resistance R3, resistance R1 with PMOS tube PM1
Pole connects, and the grid of the PMOS tube PM1 is separately connected the drain electrode of PMOS tube PM1, the source electrode of PMOS tube PM2 and NMOS tube
The grid of the grid of NM1, the PMOS tube PM2 is connect with the grid of the drain electrode of PMOS tube PM2, PMOS tube PM3 respectively, described
The drain electrode of PMOS tube PM2 is connect after being sequentially connected resistance R2, resistance R4 with the drain electrode of PMOS tube PM3, the resistance R2 and resistance
R4 indirectly, an operating voltage VDD is connected between the resistance R1 and resistance R3.The current potential of input signal Vin is inputting
Signal is to be determined by input signal when high level inputs or low level inputs, when input signal is high-impedance state, input signal
The current potential of Vin is determined by bleeder circuit 1;Meanwhile the conducting of the input state control NM1 and PM3 pipes of input signal Vin, to
Determine the pressure drop of resistance R3 and resistance R4.
Detection circuit 2 includes phase inverter U1, phase inverter U2, phase inverter U3, phase inverter U4, phase inverter after the partial pressure
U5, phase inverter U6, phase inverter U7, PMOS tube PM4, PMOS tube PM5, NMOS tube NM2, NMOS tube NM3, the NMOS tube NM1's
Drain electrode with the grid of phase inverter U2, the source electrode of PMOS tube PM4, PMOS tube PM5 by connecting respectively after phase inverter U1, the reverse phase
The output of device U2 is separately connected the grid of the source electrode of NMOS tube NM2, NMOS tube NM3, and the drain electrode of the PMOS tube PM3 passes through reverse phase
Device U3 respectively with the grid of NMOS tube NM2, the source electrode of NMOS tube NM3, the grid of PMOS tube PM4, PMOS tube PM5 source electrode and
Phase inverter U6 connections, the drain electrode of the NMOS tube NM2 and the drain electrode of NMOS tube NM3, the drain electrode of PMOS tube PM4 and PMOS tube
Connect output end OUT1, the output end of the phase inverter U6 after the drain electrode parallel connection of PM5 after phase inverter U4, phase inverter U5 successively
Output end OUT2 is connected after connecting phase inverter U7.4 metal-oxide-semiconductors transmit low electricity as transmission gate, NMOS tube NM2 and NMOS tube NM3
Flat, PMOS tube PM4 and PMOS tube PM5 transmit high level;It is defeated that the output voltage of resistance R4 obtains connection after phase inverter is delayed
Outlet OUT2;The output voltage of resistance R3 and resistance R4, by phase inverter so that only there are one transmission gates to work, transmission is corresponding
Level obtains connection output end OUT1;Since in high-impedance state, NMOS tube NM1 and PMOS tube PM3 are connected, but resistance R3 and electricity
It is much smaller when resistance R4 voltage drop values are inputted than input signal for high level or low level inputs so that output testing result will not weigh
It is multiple, have the characteristics that detection accuracy is high.
A kind of detection method of three-state input detection circuit, includes the following steps:
(1) input signal enters three-state input detection circuit, and detection is exported respectively from output end OUT1 and output end OUT2
Information judges the input state of input signal according to the detection information of output;
(2) when input signal Vin is high level, PMOS tube PM3 conductings, resistance R4 pressure drops are high, output end OUT2 outputs
" 0 ", NMOS tube NM1 cut-offs, resistance R3 is without pressure drop, NMOS tube NM3 conductings, output end OUT1 outputs " 0 ";
(3) when input signal Vin is low level, PMOS tube PM3 cut-offs, resistance R4 is without pressure drop, output end OUT2 outputs
" 1 ", NMOS tube NM1 conductings, resistance R3 pressure drops are big, NMOS tube NM2 conductings, output end OUT1 outputs " 0 ";
(4) when input signal Vin is high-impedance state, PMOS tube PM3 conductings, resistance R4 pressure drops are small, output end OUT2 outputs
" 1 ", NMOS tube NM1 conductings, resistance R3 pressure drops are small, PMOS tube PM4 conductings, output end OUT1 outputs " 1 ".
The results are shown in Table 1 for a kind of three-state input detection circuit of the present invention:
1 three-state input detection circuit of table exports result
Input state |
Output end OUT1 |
Output end OUT2 |
High level |
0 |
0 |
Low level |
0 |
1 |
High-impedance state |
1 |
1 |
As can be seen from Table 1, a kind of three-state input detection circuit of the invention, set bleeder circuit can be realized not
Transmission gate working condition when being inputted with low and high level, the characteristic of high-impedance state high resistant, when control is different and low and high level inputs
Transmission gate works, and realizes the output of three kinds of results, testing result accuracy higher.
The foregoing is merely presently preferred embodiments of the present invention, it is all within the scope of the spirit and principles in the present invention made by it is any
Modifications, equivalent substitutions and improvements etc., should all be included in the protection scope of the present invention.