The present invention is related to a flip-flop circuit, and more particularly to a scan flip-flop circuit with extra hold time margin.
Please refer to
The slave latch 20 comprises n-transistors Mn4, Mn5, and Mn6, p-transistors Mp4, Mp5, and Mp6, and a NOT gate 22. The Mn4 and Mp4 are connected to each other to form a transmission gate 24. The input terminal of the transmission gate 24 is connected to the output terminal of the master latch 10; the clock signal (CLK) and the complementary clock signal (CLKb) are connected respectively to gates of Mp4 and Mn4. A source of Mp6 is connected to the voltage source (Vdd). A drain of Mp6 is connected to a source of Mp5. A drain of Mp5 is connected to a drain of Mn5. A source of Mn5 is connected to a drain of Mn6. A source of Mn6 is connected to the Ground (Gnd). A gate of Mp6 is connected to a gate of Mn6. The clock signal (CLK) and the complementary clock signal (CLKb) are connected respectively to the gates of Mn5 and Mp5. An output terminal of the transmission gate 24 and an input terminal of the NOT gate 22 are connected to the drain of Mp5. An output terminal of the NOT gate 22 is connected to the gate of Mp6 and also is an output terminal (Q) of the D master-slave flip-flop.
In the D-flip-flop shown in
Please refer to
The slave latch 40 comprises a pair of cross-connected NAND gates 42 and 44. One input terminal of the NAND gate 42 is connected to the Set terminal (Sb) of the master latch 30. One input terminal of the NAND gate 44 is connected to the Reset terminal (Rb) of the master latch 30. Output terminals of the NAND gates 42 and 44 in the slave latch 40 are an output terminal (Q) and a complementary output terminal (Qb) of the D master-slave flip-flop. When the Set terminal (Sb) outputs the high-level and the Reset terminal (Rb) outputs the low-level, the output terminal (Q) would output the low-level and the complementary output terminal (Qb) would output the high-level; when the Set terminal (Sb) outputs the low-level and the Reset terminal (Rb) outputs the high-level, the output terminal (Q) would output the high-level and the complementary output terminal (Qb) would output low-level; and, when the Set terminal (Sb) and the Reset terminal (Rb) output high-levels, the output terminal (Q) and the complementary output terminal (Qb) maintain at the prior-levels. Furthermore, the Set terminal (Sb) and the Reset terminal (Rb) are not allowed to output the low-levels at the same time.
When the clock signal (CLK) is at the high-level and the input terminal of the D master-slave flip-flop receives the high-level, Mn7, Mn9, Mn11 and Mn12 are “On”, Mn8 and Mn10 are “Off”, Mp9 is “On” and Mp7, Mp8 and Mp10 are “Off”. Thus, the Set terminal (Sb) outputs the low-level and the Reset terminal (Rb) outputs the high-level causing the output terminal (Q) to output the high-level and the complementary output terminal (Qb) to output the low-level. Furthermore, when the clock signal is at high-level and the input terminal of the D master-slave flip-flop receives the low-level, the Mn8, Mn10, Mn11, Mn12 are “On”, Mn7 and Mn9 are “Off”, Mp8 is “On” and Mp7, Mp9, Mp10 are “Off”. Thus, the Set terminal (Sb) outputs the high-level and the Reset terminal (Rb) outputs the low-level causing the output terminal (Q) to output the low-level and the complementary output terminal (Qb) to output the high-level. Furthermore, when the clock signal (CLK) is at low-level, regardless of the input terminal (D) of the D master-slave flip-flop, Mp7 and Mp10 in the Master Latch 30 would be “On”, hence the Set terminal (Sb) and the Reset terminal (Rb) output high-levels causing the output terminal (Q) and the complementary output terminal to maintain at the prior-levels.
As shown in
Please refer to
Generally speaking, there are lots of ways to realize master latch 50, such as master latches in
The slave latch 60 comprises NOT gates 62 and 64, storage circuit 65, n-transistors Mn13 and Mn14 and p-transistors Mp11 and Mp12. In which, a gate of Mp11 is connected to the Set terminal (Sb) of the master latch 50. A source of Mp11 is connected to the voltage source (Vdd). An input terminal of the NOT gate 62 is connected to the Reset terminal (Rb) of master latch 50. A gate of Mn13 is connected to an output terminal of the NOT gate 62. A drain of Mn13 is connected to a drain of Mn11 and forms the output terminal (Q). A source of Mn13 is connected to the Ground (Gnd). A gate of Mp12 is connected to the Reset terminal (Rb) of the master latch 50. A source of Mp12 is connected to the voltage source (Vdd). An input terminal of the NOT gate 64 is connected to the Set terminal (Sb) of the master latch 50. A gate of Mn14 is connected to an output terminal of the NOT gate 64. A drain of Mn14 is connected to a drain of Mp12 and forms the complementary output terminal (Qb). A source of Mn14 is connected to the ground (Gnd). Further, the storage circuit 65 comprises NOT gates 66 and 68. The output terminal (Q) is connected to an input terminal of the NOT gate 68 and an output terminal of the NOT gate 66. The complementary output terminal (Qb) is connected to an output terminal of the NOT gate 68 and an input terminal of the NOT gate 66.
Therefore, when the Set terminal (Sb) of the master latch 50 outputs the low-level and the Reset terminal (Rb) outputs the high-level, the output terminal (Q) and the complementary output terminal (Qb) rapidly output the high-level and the low-level respectively. When the Set terminal (Sb) of the master latch 50 outputs the high-level and the Reset terminal (Rb) outputs the low-level, the output terminal (Q) and the complementary output terminal (Qb) rapidly output the low-level and the high-level respectively. Further, when the Set terminal (Sb) and the Reset terminal (Rb) of the master latch 50 output the high-levels, the output terminal (Q) and the complementary output terminal (Qb) maintain at the prior levels. That is, there is no NAND gate delay time for D master-slave flip-flop as in
The slave latch 60 of D master-slave flip-flop in
In the IC design field, in addition to designing the path for transmitting general data, one needs to design another path for testing the circuit. That is to say, when the designed circuit is under test mode, the input terminal of the circuit has to receive test data for test. When the designed circuit is under operation mode, the input terminal of the circuit has to receive general data. In order to achieve the above functions, a multiplexer 70 is added in the stage before the input terminal of the flip-flop to form a scan flip-flop. Please refer to
Generally speaking, transmitting speed of test data from the test data input terminal (TD) is slower when the scan flip-flop is under the test mode. Thus, operation of the D flip-flop 80, such as the D master-slave flip-flop in
Therefore, how to improve the layout area of the conventional D master-slave flip-flop and providing a scan flip-flop with extra hold time margin are the main purposes of the present invention.
The object of the present invention is to improve the layout area of the D master-slave flip-flop and providing a scan flip-flop with extra hold time margin.
The present invention provides a scan flip-flop circuit comprising: a flip-flop; and a multiplexer including: a data transmitting circuit having at least 2 p-transistors and 2 n-transistors cascaded between a voltage source and a ground in sequence, a connecting point of one p-transistor and one n-transistor being an output terminal of the data transmitting circuit coupled to an input terminal of the flip-flop, gates of one p-transistor and one n-transistor being respectively connected to a select terminal and a complementary select terminal of the multiplexer, gates of the other p-transistor and the other n-transistor being connected to a first data input terminal of the multiplexer; and, a test data transmitting circuit having at least 2 p-transistors and 2+N n-transistors cascaded between the voltage source and the ground in sequence, a connecting point of one p-transistor and one n-transistor being an output terminal of the test data transmitting circuit coupled to an input terminal of the flip-flop, gates of one n-transistor and one p-transistor being connected to the select terminal and the complementary select terminal respectively; wherein, when the select terminal receives a first level, the first data input terminal of the data transmitting circuit transmits a data signal to the output terminal of the data transmitting circuit and when the select terminal receives a second level, the second data input terminal of the test data transmitting circuit transmits a test data signal to the output terminal of the test data transmitting circuit and N is greater than 1.
Furthermore, the present invention provides a master-slave flip-flop circuit comprising: a sense amplifier generating a first signal and a second signal in response to an input signal and a clock signal, wherein when the clock signal is at a first-level and the input terminal receives the first-level, the first signal is an activated signal and the second signal is a non-activated signal indicating a first state of the sense amplifier; when the clock signal is at a first-level and the input terminal receives a second-level, the first signal is the non-activated signal and the second signal is the activated signal indicating a second state of the sense amplifier; and when the clock signal is at the second-level, the first signal and the second signal are the non-activated signals indicating a third state of the sense amplifier; and, a latch comprising a generation unit receiving the first signal and the second signal for generating an output signal of the master-slave flip-flop and a storage circuit receiving the output signal and the second signal for maintaining the output signal during the third state of the sense amplifier; wherein, the generating unit comprises a first p-transistor having a gate receiving the first signal and a source connected to a voltage source, a NOT gate having an input terminal receiving the second signal, and a n-transistor having a gate connected to a output terminal of the NOT gate, a drain connected to a drain of the p-transistor and being the output terminal of the master-slave flip-flop, and a source connected to a ground, and the output signal generated by the generating unit during the first state of the sense amplifier and the output signal generated by the generating unit during the second state of the sense amplifier are complementary.
Furthermore, the present invention provides a SR latch circuit comprising: a generation unit receiving a first signal and a second signal for generating an output signal of the SR latch, wherein three states are determined in response to the first signal and the second signal including a first state with a activated first signal and a non-activated second signal, a second state with a non-activated first signal and a activated second signal, and a third state with the non-activated first signal and the non-activated second signal; and, a storage circuit receiving the output signal and the second signal for maintaining the output signal during the third state; wherein, the generating unit comprises a first p-transistor having a gate receiving the first signal and a source connected to a voltage source, a NOT gate having an input terminal receiving the second signal, and a n-transistor having a gate connected to a output terminal of the NOT gate, a drain connected to a drain of the p-transistor and being the output terminal of the master-slave flip-flop, and a source connected to a ground, and the output signal generated by the generating unit during the first state and the output signal generated by the generating unit during the second state are complementary.
The above contents of the present invention will become more readily apparent to those ordinarily skilled in the art after reviewing the following detailed description and accompanying drawings, in which:
Please refer to
The slave latch 100, also called a SR latch, comprises a generation unit 101 and a storage circuit 105. The generation unit 101 comprises a NOT gate 102, n-transistors Mn15 and P-transistors Mp13. In the generation unit 101, a gate of Mp13 is connected to the Set terminal (Sb) of the master latch 90. A source of Mp13 is connected to the voltage source (Vdd). An input terminal of the NOT gate 102 is connected to the Reset terminal (Rb) of the master latch 90. A gate of Mn15 is connected to an output terminal of NOT gate 102. A drain of Mn15 is connected to a drain of Mp13 and forms output terminal (Q) of the D master-slave flip-flop. A source of Mn15 is connected to the ground (Gnd). The storage circuit 105 comprises a NOT gate 104 and a NAND gate 106, in which, one input terminal of the NAND gate 106 is connected to the output terminal (Q), the other input terminal of the NAND gate 106 is connected to the Reset terminal (Rb) of the master latch 90. An output terminal of the NAND gate 106 is connected to an input terminal of the NOT gate 104. An output terminal of the NOT gate 104 is connected to the output terminal (Q) of the D master-slave flip-flop.
Therefore, when the Set terminal (Sb) of the master latch 90 outputs the low-level and the Reset terminal (Rb) outputs the high-level, the output terminal (Q) of the slave latch 100 can rapidly output the high-level, and the NAND gate 106 of storage circuit 105 outputs low-level and the NOT gate 104 outputs the high-level. When the Set terminal (Sb) of the master latch 90 changes to the high-level and the Reset terminal (Rb) remains at the high-level, the storage circuit 105 of slave latch 100 can maintain the prior level (high-level) at the output terminal (Q).
Furthermore, when the Set terminal (Sb) of the master latch 90 outputs the high-level and the Reset terminal (Rb) outputs the low-level, the output terminal (Q) of the slave latch 100 can rapidly output the low-level, and the NAND gate 106 of storage circuit 105 outputs high-level and the NOT gate 104 outputs the low-level. When the Set terminal (Sb) of the master latch 90 remains at the high-level and the Reset terminal (Rb) changes to the high-level, the storage circuit 105 of slave latch 100 can maintain the prior level (low-level) at the output terminal (Q).
That is to say, when the Set terminal (Sb) and the Reset terminal (Rb) respectively output an activated signal and a non-activated signal, the output terminal (Q) of the slave latch 100 can output the high-level. Conversely, when the Set terminal (Sb) and the Reset terminal (Rb) respectively output the non-activated signal and the activated signal, the output terminal (Q) of the slave latch 100 can output the low-level. Further, when both the Set terminal (Sb) and the Reset terminal (Rb) output the non-activated signals, the output terminal (Q) of the slave latch 100 can maintain at the prior level.
Please refer to
Please refer to
The test data transmitting circuit 112 comprises two P-transistors Mp16 and Mp17, and three n-transistors Mn18, Mn19 and Mn20 that are cascaded between the voltage source (Vdd) and the ground (GND) in sequence. The connecting point of Mp17 and Mn18 is the output terminal of the test data transmitting circuit 112, which is connected to the output terminal of the multiplexer 110. Gates of Mn18 and Mp17 are connected to the select terminal (SEL) and the complementary select terminal (SELB) respectively. Gates of Mp16, Mn19 and Mn20 are connected to the test data input terminal (TD) of the multiplexer 110. According to embodiment of the present invention, the test data transmitting circuit 112 comprises two P-transistors and three n-transistors that are cascaded between the voltage source (Vdd) and the ground (GND). In practical application, more P-transistors and n-transistors cascaded between the voltage source (Vdd) and the ground (GND) are allowed for achieving the same function of the test data transmitting circuit 112.
According to embodiment of the present invention, transmitting speed of the test data from the test data input terminal (TD) is slower when the scan flip-flop is under the test mode (SEL is high-level). Thus, the present invention increases the number of cascaded n-transistors Mn19 and Mn20, to achieve the purpose of increasing the hold time margin, and to enable scan flip-flop to work normally under test mode. The number of cascaded n-transistors can be increased or reduced according to the need for maintaining hold time margin in practice. The presented invention is not constrained to the number of cascaded n-transistors in the test data transmitting circuit 112.
The present invention of the scan flip-flop is not constrained to the combination of the invented multiplexer 110 and the invented D master-slave flip-flop. Other scan flip-flop combined with the invented multiplexer 110 and other flip-flop can also realize the effect of increasing hold time margin of the presented invention.
While the invention has been described in terms of what is presently considered to be the most practical and preferred embodiments, it is to be understood that the invention needs not be limited to the disclosed embodiment. On the contrary, it is intended to cover various modifications and similar arrangements included within the spirit and scope of the appended claims which are to be accorded with the broadest interpretation so as to encompass all such modifications and similar structures.
Number | Date | Country | Kind |
---|---|---|---|
096110245 | Mar 2007 | TW | national |