JP2013196011A - Clock switching circuit - Google Patents

Clock switching circuit Download PDF

Info

Publication number
JP2013196011A
JP2013196011A JP2012059001A JP2012059001A JP2013196011A JP 2013196011 A JP2013196011 A JP 2013196011A JP 2012059001 A JP2012059001 A JP 2012059001A JP 2012059001 A JP2012059001 A JP 2012059001A JP 2013196011 A JP2013196011 A JP 2013196011A
Authority
JP
Japan
Prior art keywords
signal
mask
circuit
level
clock
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2012059001A
Other languages
Japanese (ja)
Other versions
JP5900053B2 (en
Inventor
Hisakazu Sotozono
久和 外囿
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Semiconductor Ltd
Original Assignee
Fujitsu Semiconductor Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Semiconductor Ltd filed Critical Fujitsu Semiconductor Ltd
Priority to JP2012059001A priority Critical patent/JP5900053B2/en
Publication of JP2013196011A publication Critical patent/JP2013196011A/en
Application granted granted Critical
Publication of JP5900053B2 publication Critical patent/JP5900053B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Electronic Switches (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a clock switching circuit by which an increase of a circuit scale with an increase of input clock signals can be suppressed.SOLUTION: A clock switching circuit 1 has: a synchronization circuit 10 which synchronizes a selection signal SEL based on an output clock signal CLKOUT; a detection circuit 20 which generates a mask start signal MS when a change of a signal level of a selection signal SELa after synchronization is detected; and a release circuit 60 which generates a mask release signal MR when transition of an input clock signal selected by the selection signal SELa to an H level is detected. Further, the clock switching circuit 1 has: a mask signal generation circuit 30 which generates a mask signal MASK based on the mask start signal MS and the mask release signal MR; and a clock selection circuit 40 which outputs input clock signals CLK1,CLK2 or a signal fixed to a predetermined level as the output clock signal CLKOUT based on the selection signal SELa and the mask signal MASK.

Description

本発明は、クロック切替回路に関するものである。   The present invention relates to a clock switching circuit.

近年、LSI(Large Scale Integration)の低消費電力化のためにクロック信号の周波数を動的に切り替えることが行われている。これにより、例えばスタンバイ時などの高速動作が必要ないときには、低周波数のクロック信号により動作させることで、消費電力を低減することができる。また、例えばPLL(Phase Locked Loop)が内蔵されたLSIでは、PLLの出力クロック信号と、その出力クロック信号とは周波数及び位相が異なる別のクロック信号とを動的に切り替えることが行われる。   In recent years, the frequency of a clock signal is dynamically switched in order to reduce power consumption of an LSI (Large Scale Integration). As a result, when high-speed operation is not necessary, for example, during standby, power consumption can be reduced by operating with a low-frequency clock signal. For example, in an LSI incorporating a PLL (Phase Locked Loop), an output clock signal of the PLL and another clock signal having a frequency and a phase different from that of the output clock signal are dynamically switched.

しかし、動作周波数が異なる複数の非同期クロック信号から1つのクロック信号を単純なセレクタにより選択すると、そのセレクタから出力されるクロック信号にハザードやひげと呼ばれる細い幅のパルスが生じる可能性があった。クロック信号にハザードが存在すると、そのクロック信号で動作する回路が誤動作する虞がある。   However, when one clock signal is selected from a plurality of asynchronous clock signals having different operating frequencies by a simple selector, a pulse having a narrow width called a hazard or a whisker may be generated in the clock signal output from the selector. If a hazard exists in the clock signal, a circuit that operates with the clock signal may malfunction.

そこで、クロック切り替え時におけるハザードの発生を抑制したクロック切替回路が提案されている(例えば、特許文献1,2参照)。図16は、従来のクロック切替回路100の一例を示している。   Therefore, a clock switching circuit that suppresses the occurrence of a hazard at the time of clock switching has been proposed (for example, see Patent Documents 1 and 2). FIG. 16 shows an example of a conventional clock switching circuit 100.

クロック切替回路100では、互いに非同期である2つの入力クロック信号CLKA,CLKBが選択信号SELAに応じて切り替えられ、その選択信号SELAに応じて選択された入力クロック信号が出力クロック信号CLKOUTとして出力される。本例の選択信号SELAは、入力クロック信号CLKAの選択時にLレベル、入力クロック信号CLKBの選択時にHレベルに設定される。   In the clock switching circuit 100, two input clock signals CLKA and CLKB that are asynchronous with each other are switched according to the selection signal SELA, and the input clock signal selected according to the selection signal SELA is output as the output clock signal CLKOUT. . The selection signal SELA in this example is set to L level when the input clock signal CLKA is selected, and to H level when the input clock signal CLKB is selected.

クロック切替回路100は、入力クロック信号CLKAの非選択時に、入力クロック信号CLKAの出力を禁止する第1の回路110と、入力クロック信号CLKBの非選択時に、入力クロック信号CLKBの出力を禁止する第2の回路120とを有している。また、クロック切替回路100は、第1の回路110からのクロック信号CKAと第2の回路120からのクロック信号CKBとを入力し、出力クロック信号CLKOUTを出力するAND回路130を有している。   The clock switching circuit 100 inhibits the output of the input clock signal CLKA when the input clock signal CLKA is not selected, and the first circuit 110 prohibits the output of the input clock signal CLKB when the input clock signal CLKB is not selected. 2 circuit 120. The clock switching circuit 100 includes an AND circuit 130 that receives the clock signal CKA from the first circuit 110 and the clock signal CKB from the second circuit 120 and outputs an output clock signal CLKOUT.

第1の回路110は、2段のD−フリップフロップ回路(D−FF)111,112と、インバータ回路113,114と、OR回路115,116とを有している。D−FF111は、選択信号SELAをインバータ回路101により反転させた信号を、入力クロック信号CLKAの立ち上がりエッジに応答して保持する。D−FF112は、入力クロック信号CLKAの立ち上がりエッジに応答してD−FF111の出力信号を保持する。OR回路115は、D−FF111の出力信号をインバータ回路113により論理反転させた信号と、D−FF112の出力信号をインバータ回路114により論理反転させた信号とを論理和演算した結果を持つマスク信号MASKAを出力する。OR回路116は、入力クロック信号CLKAとマスク信号MASKAとを論理和演算した結果を持つクロック信号CKAを出力する。このような第1の回路110では、OR回路115から出力されるHレベルのマスク信号MASKAにより、OR回路116において入力クロック信号CLKAがHレベルに固定されてマスクされる。   The first circuit 110 includes two-stage D-flip flop circuits (D-FF) 111 and 112, inverter circuits 113 and 114, and OR circuits 115 and 116. The D-FF 111 holds a signal obtained by inverting the selection signal SELA by the inverter circuit 101 in response to the rising edge of the input clock signal CLKA. The D-FF 112 holds the output signal of the D-FF 111 in response to the rising edge of the input clock signal CLKA. The OR circuit 115 is a mask signal having a result obtained by performing an OR operation on a signal obtained by logically inverting the output signal of the D-FF 111 by the inverter circuit 113 and a signal obtained by logically inverting the output signal of the D-FF 112 by the inverter circuit 114. Output MASKA. The OR circuit 116 outputs a clock signal CKA having a result obtained by performing an OR operation on the input clock signal CLKA and the mask signal MASKA. In such a first circuit 110, the input clock signal CLKA is fixed to the H level and masked in the OR circuit 116 by the H level mask signal MASKA output from the OR circuit 115.

第2の回路120は、2段のD−FF121,122と、インバータ回路123,124と、OR回路125,126とを有している。D−FF121は、入力クロック信号CLKBの立ち上がりエッジに応答して選択信号SELAを保持する。D−FF122は、入力クロック信号CLKBの立ち上がりエッジに応答してD−FF121の出力信号を保持する。OR回路125は、D−FF121の出力信号をインバータ回路123により反転させた信号と、D−FF122の出力信号を反転させた信号とを論理和演算した結果を持つマスク信号MASKBを出力する。OR回路126は、入力クロック信号CLKBとマスク信号MASKBとを論理和演算した結果を持つクロック信号CKBを出力する。このような第2の回路120では、OR回路125から出力されるHレベルのマスク信号MASKBにより、OR回路126において入力クロック信号CLKBがHレベルに固定されてマスクされる。   The second circuit 120 includes two stages of D-FFs 121 and 122, inverter circuits 123 and 124, and OR circuits 125 and 126. The D-FF 121 holds the selection signal SELA in response to the rising edge of the input clock signal CLKB. The D-FF 122 holds the output signal of the D-FF 121 in response to the rising edge of the input clock signal CLKB. The OR circuit 125 outputs a mask signal MASKB having a result obtained by performing an OR operation on a signal obtained by inverting the output signal of the D-FF 121 by the inverter circuit 123 and a signal obtained by inverting the output signal of the D-FF 122. The OR circuit 126 outputs a clock signal CKB having a result obtained by performing an OR operation on the input clock signal CLKB and the mask signal MASK. In such a second circuit 120, the input clock signal CLKB is fixed to the H level and masked in the OR circuit 126 by the H level mask signal MASKB output from the OR circuit 125.

このように、各回路110,120では、1段目のD−FF111,121の信号出力タイミングに基づいてマスク信号MASKA,MASKBの立ち上がりタイミングが決定され、2段目のD−FF112,122の信号出力タイミングに基づいてマスク信号MASKA,MASKBの立ち上がりタイミングが決定される。このため、入力クロック信号CLKA,CLKBの切り替え時には、双方のマスク信号MASKA,MASKBが共にHレベルとなる期間が生じることになる。したがって、入力クロック信号CLKA,CLKBの切り替え時に、2つの入力クロック信号CLKA,CLKBが競合して出力されることが抑制されるため、ハザードの発生を抑制することができる。   As described above, in each of the circuits 110 and 120, the rising timings of the mask signals MASKA and MASKB are determined based on the signal output timings of the first-stage D-FFs 111 and 121, and the signals of the second-stage D-FFs 112 and 122 are determined. The rising timing of the mask signals MASKA and MASKB is determined based on the output timing. For this reason, when the input clock signals CLKA and CLKB are switched, a period in which both the mask signals MASKA and MASKB are at the H level occurs. Therefore, when the input clock signals CLKA and CLKB are switched, it is suppressed that the two input clock signals CLKA and CLKB are output in competition with each other, so that occurrence of a hazard can be suppressed.

特開平06−268492号公報Japanese Patent Laid-Open No. 06-268492 特開2005−191877号公報JP 2005-191877 A

ところが、上記クロック切替回路100では、選択対象のクロック信号が増加すると、その増加したクロック信号の数の分だけ回路110に相当する回路が増加する。このため、クロック切替回路100では、選択対象の入力クロック信号の増加に伴って回路規模が著しく増大するという問題がある。   However, in the clock switching circuit 100, when the number of clock signals to be selected increases, the number of circuits corresponding to the circuit 110 increases by the number of the increased clock signals. For this reason, the clock switching circuit 100 has a problem that the circuit scale significantly increases as the number of input clock signals to be selected increases.

本発明の一観点によれば、選択信号に応じて、複数の入力クロック信号の中からいずれか1つの入力クロック信号を選択して出力クロック信号として出力するクロック切替回路であって、前記選択信号を前記出力クロック信号に基づいて同期化する同期化回路と、前記同期化後の選択信号の信号レベルの変化を検出したときにマスク開始信号を生成する検出回路と前記マスク開始信号に基づいて、前記複数の入力クロック信号を所定レベルでマスクするマスク信号を生成するマスク信号生成回路と、前記同期化後の選択信号及び前記マスク信号に基づいて、前記複数の入力クロック信号の中から選択される1つの入力クロック信号又は前記所定レベルに固定された信号を前記出力クロック信号として出力するクロック選択回路と、前記同期化後の選択信号により選択される入力クロック信号の前記所定レベルへの遷移を検出したときにマスク解除信号を生成する解除回路と、を有し、
前記マスク信号生成回路は、前記マスク解除信号に基づいて前記マスク信号の生成を停止する。
According to an aspect of the present invention, there is provided a clock switching circuit that selects any one input clock signal from a plurality of input clock signals according to a selection signal and outputs the selected input clock signal as an output clock signal. Based on the output clock signal, a detection circuit that generates a mask start signal when a change in the signal level of the selection signal after synchronization is detected, and the mask start signal, A mask signal generation circuit for generating a mask signal for masking the plurality of input clock signals at a predetermined level, and the selection signal selected from the plurality of input clock signals based on the synchronized selection signal and the mask signal A clock selection circuit for outputting one input clock signal or a signal fixed at the predetermined level as the output clock signal; and the synchronization Anda release circuit for generating a mask release signal when it detects a transition to the predetermined level of the input clock signal selected by the selection signal,
The mask signal generation circuit stops generating the mask signal based on the mask release signal.

本発明の一観点によれば、クロック切替時におけるハザードの発生を抑制しつつも、選択対象の入力クロック信号の増加に伴う回路規模の増大を抑制することができるという効果を奏する。   According to one aspect of the present invention, it is possible to suppress an increase in circuit scale accompanying an increase in an input clock signal to be selected while suppressing occurrence of a hazard at the time of clock switching.

第1実施形態のクロック切替回路を示すブロック図。The block diagram which shows the clock switching circuit of 1st Embodiment. 第1実施形態のクロック切替回路を示す回路図。A circuit diagram showing a clock switching circuit of a 1st embodiment. 第1実施形態のクロック切替回路の動作を示すタイミングチャート。3 is a timing chart illustrating the operation of the clock switching circuit according to the first embodiment. 変形例のクロック切替回路を示す回路図。The circuit diagram which shows the clock switching circuit of a modification. 変形例のクロック切替回路を示す回路図。The circuit diagram which shows the clock switching circuit of a modification. 変形例のクロック切替回路を示す回路図。The circuit diagram which shows the clock switching circuit of a modification. 変形例のクロック切替回路を示す回路図。The circuit diagram which shows the clock switching circuit of a modification. 変形例のクロック切替回路を示す回路図。The circuit diagram which shows the clock switching circuit of a modification. 変形例のクロック切替回路の動作を示すタイミングチャート。The timing chart which shows the operation | movement of the clock switching circuit of a modification. 変形例のクロック切替回路を示す回路図。The circuit diagram which shows the clock switching circuit of a modification. 変形例のクロック切替回路の動作を示すタイミングチャート。The timing chart which shows the operation | movement of the clock switching circuit of a modification. 変形例のクロック切替回路を示す回路図。The circuit diagram which shows the clock switching circuit of a modification. 変形例のクロック切替回路を示す回路図。The circuit diagram which shows the clock switching circuit of a modification. 第2実施形態のクロック切替回路を示す回路図。The circuit diagram which shows the clock switching circuit of 2nd Embodiment. 第2実施形態のクロック切替回路の動作を示すタイミングチャート。The timing chart which shows the operation | movement of the clock switching circuit of 2nd Embodiment. 従来のクロック切替回路を示す回路図。The circuit diagram which shows the conventional clock switching circuit.

(第1実施形態)
以下、第1実施形態を図1〜図3に従って説明する。
図1に示すクロック切替回路1では、互いに非同期で、且つ周波数の異なる2つの入力クロック信号CLK1,CLK2が選択信号SELに応じて切り替えられ、その選択信号SELに応じて選択された入力クロック信号が出力クロック信号CLKOUTとして出力される。本実施形態の選択信号SELは、入力クロック信号CLK1,CLK2に対して非同期信号であり、入力クロック信号CLK1の選択時には論理Lレベルになり、入力クロック信号CLK2の選択時には論理Hレベルになる。
(First embodiment)
Hereinafter, the first embodiment will be described with reference to FIGS.
In the clock switching circuit 1 shown in FIG. 1, two input clock signals CLK1 and CLK2 that are asynchronous with each other and have different frequencies are switched according to the selection signal SEL, and the input clock signal selected according to the selection signal SEL is changed. Output as an output clock signal CLKOUT. The selection signal SEL of the present embodiment is an asynchronous signal with respect to the input clock signals CLK1 and CLK2, and becomes a logic L level when the input clock signal CLK1 is selected, and becomes a logic H level when the input clock signal CLK2 is selected.

このクロック切替回路1は、同期化回路10と、検出回路20と、マスク信号生成回路30と、クロック選択回路40と、解除回路60とを有している。
同期化回路10には、上記選択信号SELと、出力クロック信号CLKOUTと、初期化信号ISとが入力される。同期化回路10は、選択信号SELを出力クロック信号CLKOUTに基づいて同期化し、その同期化後の選択信号SELaを検出回路20及びクロック選択回路40に出力する。この同期化回路10は、初期化信号ISにより初期化(リセット)されると、Lレベルの選択信号SELaを出力する。
The clock switching circuit 1 includes a synchronization circuit 10, a detection circuit 20, a mask signal generation circuit 30, a clock selection circuit 40, and a release circuit 60.
The selection signal SEL, the output clock signal CLKOUT, and the initialization signal IS are input to the synchronization circuit 10. The synchronization circuit 10 synchronizes the selection signal SEL based on the output clock signal CLKOUT, and outputs the synchronized selection signal SELa to the detection circuit 20 and the clock selection circuit 40. When the synchronization circuit 10 is initialized (reset) by the initialization signal IS, it outputs an L level selection signal SELa.

検出回路20は、選択信号SELaの信号レベルの変化(つまり、HレベルからLレベルの変化、及びLレベルからHレベルの変化)を検出したときにマスク開始信号MSを生成する。このマスク開始信号MSは、出力クロック信号CLKOUTをマスクする、具体的には複数の入力クロック信号CLK1,CLK2を所定レベル(ここでは、Hレベル)でマスクするマスク信号MASKの生成開始を指令する信号である。   The detection circuit 20 generates the mask start signal MS when detecting a change in the signal level of the selection signal SELa (that is, a change from the H level to the L level and a change from the L level to the H level). The mask start signal MS is a signal for instructing generation start of a mask signal MASK for masking the output clock signal CLKOUT, specifically, for masking the plurality of input clock signals CLK1 and CLK2 at a predetermined level (here, H level). It is.

マスク信号生成回路30には、マスク開始信号MSと、解除回路60からのマスク解除信号MRと、初期化信号ISとが入力される。マスク信号生成回路30は、マスク開始信号MSに基づいてマスク信号MASKを生成し、マスク解除信号MRに基づいてマスク信号MASKの生成を停止する。なお、マスク信号生成回路30は、初期化信号ISにより初期化されると、Lレベルのマスク信号MASKを出力する。このマスク信号MASKはクロック選択回路40に供給される。   The mask signal generation circuit 30 receives the mask start signal MS, the mask release signal MR from the release circuit 60, and the initialization signal IS. The mask signal generation circuit 30 generates a mask signal MASK based on the mask start signal MS, and stops generating the mask signal MASK based on the mask release signal MR. Note that the mask signal generation circuit 30 outputs an L level mask signal MASK when initialized by the initialization signal IS. The mask signal MASK is supplied to the clock selection circuit 40.

クロック選択回路40には、複数の入力クロック信号CLK1,CLK2と、選択信号SELaと、マスク信号MASKとが入力される。クロック選択回路40は、選択信号SELa及びマスク信号MASKに基づいて、入力クロック信号CLK1,CLK2又は所定レベルに固定された信号を出力クロック信号CLKOUTとして出力する。具体的には、クロック選択回路40は、選択信号SELaに応じて入力クロック信号CLK1,CLK2の中から1つの入力クロック信号を選択し、その選択した信号を選択クロック信号SCLKとして生成する。さらに、クロック選択回路40は、マスク信号MASKに応じて選択クロック信号SCLKをマスクして所定レベル(ここでは、Hレベル)に固定された信号を出力クロック信号CLKOUTとして出力する。換言すると、クロック選択回路40は、マスク信号MASKに応じて、出力クロック信号CLKOUTをHレベルでマスクする。また、クロック選択回路40は、マスク信号MASKの生成停止に応じて選択クロック信号SCLKを出力クロック信号CLKOUTとして出力する。   A plurality of input clock signals CLK1, CLK2, a selection signal SELa, and a mask signal MASK are input to the clock selection circuit 40. Based on the selection signal SELa and the mask signal MASK, the clock selection circuit 40 outputs the input clock signals CLK1, CLK2 or a signal fixed at a predetermined level as the output clock signal CLKOUT. Specifically, the clock selection circuit 40 selects one input clock signal from the input clock signals CLK1 and CLK2 according to the selection signal SELa, and generates the selected signal as the selected clock signal SCLK. Further, the clock selection circuit 40 masks the selected clock signal SCLK according to the mask signal MASK and outputs a signal fixed at a predetermined level (here, H level) as the output clock signal CLKOUT. In other words, the clock selection circuit 40 masks the output clock signal CLKOUT at the H level according to the mask signal MASK. The clock selection circuit 40 outputs the selected clock signal SCLK as the output clock signal CLKOUT in response to the stop of the generation of the mask signal MASK.

解除回路60には、マスク信号生成回路30からのマスク信号MASKと、クロック選択回路40からの選択クロック信号SCLKとが入力される。解除回路60は、マスク信号MASKが生成されているときに、選択クロック信号SCLKの信号レベルが所定レベルに変化したことを検出したときに上記マスク解除信号MRを生成する。このマスク解除信号MRは、上記マスク信号MASKの生成停止を指令する信号である。なお、解除回路60は、マスク信号MASKの生成が停止されているときには、マスク解除信号MRの生成を停止する。   The cancel circuit 60 receives the mask signal MASK from the mask signal generation circuit 30 and the selection clock signal SCLK from the clock selection circuit 40. The cancel circuit 60 generates the mask cancel signal MR when it detects that the signal level of the selected clock signal SCLK has changed to a predetermined level when the mask signal MASK is generated. The mask release signal MR is a signal for instructing the generation stop of the mask signal MASK. The release circuit 60 stops generating the mask release signal MR when the generation of the mask signal MASK is stopped.

次に、上記クロック切替回路1の各回路10〜60の内部構成例を図2に従って説明する。
同期化回路10は、複数段(ここでは、2段)のD−フリップフロップ回路(D−FF)11,12を含むFF群13を有している。FF群13には、2つの入力クロック信号CLK1,CLK2の中から1つの入力クロック信号を選択するために必要な1ビットの選択信号SELが入力される。ここで、同期化回路10内のFF群は、選択対象の入力クロック信号の数をNとしたときに、logN(小数点以下切り上げ)個、ここではlog2=1個設けられている。
Next, an internal configuration example of each of the circuits 10 to 60 of the clock switching circuit 1 will be described with reference to FIG.
The synchronization circuit 10 has a FF group 13 including D-flip-flop circuits (D-FF) 11 and 12 in a plurality of stages (here, two stages). The FF group 13 receives a 1-bit selection signal SEL necessary for selecting one input clock signal from the two input clock signals CLK1 and CLK2. Here, FF groups in the synchronization circuit 10 are provided log 2 N (rounded up after the decimal point), here log 2 2 = 1, where N is the number of input clock signals to be selected. .

初段のD−FF11は、選択信号SELを出力クロック信号CLKOUTの立ち上がりエッジ(LレベルからHレベルへの遷移)に同期して取り込み、その取り込んだ信号を次段のD−FF11に出力する。D−FF12は、D−FF11の出力信号を出力クロック信号CLKOUTの立ち上がりエッジに同期して取り込み、その取り込んだ信号を上記選択信号SELaとして出力する。これらD−FF11,12のクリア端子CLRには初期化信号ISが入力される。これらD−FF11,12は、初期化時に初期化信号ISがLレベルになるとクリアされ、Lレベルを保持する。   The first-stage D-FF 11 captures the selection signal SEL in synchronization with the rising edge (transition from L level to H level) of the output clock signal CLKOUT, and outputs the captured signal to the next-stage D-FF 11. The D-FF 12 captures the output signal of the D-FF 11 in synchronization with the rising edge of the output clock signal CLKOUT, and outputs the captured signal as the selection signal SELa. An initialization signal IS is input to the clear terminals CLR of these D-FFs 11 and 12. These D-FFs 11 and 12 are cleared when the initialization signal IS becomes L level during initialization, and hold the L level.

このように複数段のD−FF11,12を有する同期化回路10は、メタステーブルの発生を回避し、選択信号SELを出力クロック信号CLKOUTに同期させて正しく取り込むための回路である。ここで、メタステーブルとは、データとクロック信号が非同期信号の場合に、受信側レジスタの出力レベルが不安定になる現象をいう。このとき、上記選択信号SELは入力クロック信号CLK1,CLK2及び出力クロック信号CLKOUTに対して非同期の信号であるため、D−FF11の出力信号が不定となる可能性がある。そこで、上記同期化回路10では、適切な段数(ここでは、2段)の同期化用のD−FF11,12が直列に接続され、それらD−FF11,12において出力クロック信号CLKOUTにリタイミングされることにより、入力される選択信号SELの同期化が行われる。これにより、D−FF11の出力信号が不定値になった場合であっても、D−FF12で出力値を確定することができるため、不定値を後段に伝播することを抑制することができる。なお、同期化回路10におけるD−FF11,12の段数は、メタステーブルの発生を回避することの可能な段数であれば特に制限されない。   As described above, the synchronization circuit 10 having a plurality of stages of D-FFs 11 and 12 is a circuit for avoiding the occurrence of metastable and correctly taking in the selection signal SEL in synchronization with the output clock signal CLKOUT. Here, metastable refers to a phenomenon in which the output level of the receiving side register becomes unstable when the data and the clock signal are asynchronous signals. At this time, since the selection signal SEL is an asynchronous signal with respect to the input clock signals CLK1 and CLK2 and the output clock signal CLKOUT, the output signal of the D-FF 11 may become indefinite. Therefore, in the synchronization circuit 10, D-FFs 11 and 12 for synchronization having an appropriate number of stages (here, two stages) are connected in series, and are retimed to the output clock signal CLKOUT in the D-FFs 11 and 12. Thus, the input selection signal SEL is synchronized. As a result, even if the output signal of the D-FF 11 becomes an indefinite value, the output value can be determined by the D-FF 12, so that the indefinite value can be prevented from propagating to the subsequent stage. Note that the number of stages of the D-FFs 11 and 12 in the synchronization circuit 10 is not particularly limited as long as the number of stages can avoid the occurrence of metastable.

検出回路20は、奇数段(ここでは、1段)のインバータ回路21とXOR回路22とを含む検出部23を有している。検出部23には、選択信号SELaが入力される。ここで、検出回路20内の検出部は、選択対象の入力クロック信号の数をNとしたときに、logN(小数点以下切り上げ)個、ここではlog2=1個設けられている。 The detection circuit 20 includes a detection unit 23 including an odd-numbered stage (here, one stage) inverter circuit 21 and an XOR circuit 22. The selection signal SELa is input to the detection unit 23. Here, when the number of input clock signals to be selected is N, the number of detection units in the detection circuit 20 is log 2 N (rounded up after the decimal point), here log 2 2 = 1.

インバータ回路21は、同期化回路10からの選択信号SELaを論理反転した反転信号をXOR回路22に出力する。XOR回路22は、同期化回路10からの選択信号SELaと、インバータ回路21からの反転信号とを排他的論理和演算した結果を持つマスク開始信号MSを生成する。具体的には、例えば選択信号SELaの信号レベルがHレベルからLレベルに遷移すると、インバータ回路21による遅延時間だけXOR回路22の両入力信号がLレベルになるため、上記遅延時間分だけマスク開始信号MSがLレベルになる。同様に、選択信号SELaの信号レベルがLレベルからHレベルに遷移すると、インバータ回路21による遅延時間だけXOR回路22の両入力信号がHレベルになるため、その遅延時間分だけマスク開始信号MSがLレベルになる。   The inverter circuit 21 outputs an inverted signal obtained by logically inverting the selection signal SELa from the synchronization circuit 10 to the XOR circuit 22. The XOR circuit 22 generates a mask start signal MS having a result obtained by performing an exclusive OR operation on the selection signal SELa from the synchronization circuit 10 and the inverted signal from the inverter circuit 21. Specifically, for example, when the signal level of the selection signal SELa transitions from H level to L level, both input signals of the XOR circuit 22 become L level for the delay time of the inverter circuit 21, so masking starts for the delay time. The signal MS becomes L level. Similarly, when the signal level of the selection signal SELa changes from L level to H level, both input signals of the XOR circuit 22 become H level for the delay time of the inverter circuit 21, so that the mask start signal MS is equal to the delay time. Becomes L level.

マスク信号生成回路30は、D−FF31を有している。D−FF31の入力端子Dには、図示しない電源回路により生成された高電位電源電圧VDDが供給される。D−FF31のクロック端子には解除回路60からマスク解除信号MRが入力される。D−FF31のプリセット端子PRには初期化信号ISの反転レベルが入力される。D−FF31のクリア端子CLRにはマスク開始信号MSが入力される。そして、D−FF31の反転出力端子XQから上記マスク信号MASKが出力される。   The mask signal generation circuit 30 has a D-FF 31. A high potential power supply voltage VDD generated by a power supply circuit (not shown) is supplied to the input terminal D of the D-FF 31. The mask release signal MR is input from the release circuit 60 to the clock terminal of the D-FF 31. The inversion level of the initialization signal IS is input to the preset terminal PR of the D-FF 31. The mask start signal MS is input to the clear terminal CLR of the D-FF 31. Then, the mask signal MASK is output from the inverting output terminal XQ of the D-FF 31.

D−FF31は、初期化時に初期化信号ISがLレベルになるとプリセットされ、高電位電源電圧VDDレベル(Hレベル)を保持してLレベルのマスク信号MASKを出力する。D−FF31は、選択信号SELaの信号レベルの変化に応答してマスク開始信号MSがLレベルになるとクリアされ、Hレベルのマスク信号MASKを出力する。また、D−FF31は、マスク解除信号MRの立ち上がりエッジに応答して、入力端子Dに供給されている信号(高電位電源電圧VDD)を保持し、Lレベルのマスク信号MASKを出力する。   The D-FF 31 is preset when the initialization signal IS becomes L level at the time of initialization, holds the high potential power supply voltage VDD level (H level), and outputs the L level mask signal MASK. The D-FF 31 is cleared when the mask start signal MS becomes L level in response to a change in the signal level of the selection signal SELa, and outputs an H level mask signal MASK. In response to the rising edge of the mask release signal MR, the D-FF 31 holds a signal (high potential power supply voltage VDD) supplied to the input terminal D and outputs an L level mask signal MASK.

クロック選択回路40は、セレクタ41と、OR回路42とを有している。セレクタ41は、選択信号SELaに応じて、入力クロック信号CLK1,CLK2のいずれか1つの入力クロック信号を選択し、その選択した入力クロック信号を選択クロック信号SCLKとして出力する。例えばセレクタ41は、Lレベルの選択信号SELaに応答して入力クロック信号CLK1を選択クロック信号SCLKとして出力し、Hレベルの選択信号SELaに応答して入力クロック信号CLK2を選択クロック信号SCLKとして出力する。   The clock selection circuit 40 includes a selector 41 and an OR circuit 42. The selector 41 selects one of the input clock signals CLK1 and CLK2 according to the selection signal SELa, and outputs the selected input clock signal as the selected clock signal SCLK. For example, the selector 41 outputs the input clock signal CLK1 as the selection clock signal SCLK in response to the L level selection signal SELa, and outputs the input clock signal CLK2 as the selection clock signal SCLK in response to the H level selection signal SELa. .

OR回路42は、選択クロック信号SCLKとマスク信号MASKとを論理和演算した結果を持つ出力クロック信号CLKOUTを出力する。具体的には、OR回路42は、マスク信号MASKがLレベルのときに、選択クロック信号SCLKを出力クロック信号CLKOUTとして出力する。これにより、選択信号SELa(選択信号SEL)に応じて選択された入力クロック信号が出力クロック信号CLKOUTとして出力される。一方、OR回路42は、マスク信号MASKがHレベルのときに、選択クロック信号SCLKの信号レベルに関わらずHレベル固定の出力クロック信号CLKOUTを出力する。すなわち、Hレベルのマスク信号MASKにより選択クロック信号SCLKがマスクされ、出力クロック信号CLKOUTがHレベルに固定される。このように、Hレベルのマスク信号MASKは選択クロック信号SCLK(つまり、入力クロック信号CLK1及び入力クロック信号CLK2)を無効にする信号として機能し、OR回路42は選択クロック信号SCLKを無効にする回路として機能する。ここで、Hレベルのマスク信号MASKは、選択信号SELa(選択信号SEL)の信号レベルが変化したとき、つまり入力クロック信号CLK1,CLK2が切り替えられるときに、Lレベルのマスク開始信号MSに応答して生成される。このため、Hレベルのマスク信号MASKは、クロック切替時における入力クロック信号CLK1,CLK2の双方を無効化し、クロック切替時における出力クロック信号CLKOUTをHレベルに固定する信号であると言える。   The OR circuit 42 outputs an output clock signal CLKOUT having a result obtained by performing an OR operation on the selection clock signal SCLK and the mask signal MASK. Specifically, the OR circuit 42 outputs the selected clock signal SCLK as the output clock signal CLKOUT when the mask signal MASK is at L level. Thus, the input clock signal selected according to the selection signal SELa (selection signal SEL) is output as the output clock signal CLKOUT. On the other hand, when the mask signal MASK is at the H level, the OR circuit 42 outputs the output clock signal CLKOUT that is fixed at the H level regardless of the signal level of the selected clock signal SCLK. That is, the selection clock signal SCLK is masked by the H level mask signal MASK, and the output clock signal CLKOUT is fixed at the H level. Thus, the H level mask signal MASK functions as a signal for invalidating the selected clock signal SCLK (that is, the input clock signal CLK1 and the input clock signal CLK2), and the OR circuit 42 is a circuit for invalidating the selected clock signal SCLK. Function as. Here, the H level mask signal MASK responds to the L level mask start signal MS when the signal level of the selection signal SELa (selection signal SEL) changes, that is, when the input clock signals CLK1 and CLK2 are switched. Generated. Therefore, it can be said that the mask signal MASK at the H level is a signal that invalidates both the input clock signals CLK1 and CLK2 when the clock is switched and fixes the output clock signal CLKOUT at the H level when the clock is switched.

解除回路60は、NAND回路61を有している。NAND回路61は、選択クロック信号SCLKの反転レベルとマスク信号MASKとを否定論理積演算した結果を持つマスク解除信号MRを生成し、そのマスク解除信号MRを上記D−FF31のクロック端子に出力する。具体的には、NAND回路61は、マスク信号MASKがLレベルのときに、選択クロック信号SCLKの信号レベルに関わらずLレベル固定のマスク解除信号MRを出力する。すなわち、マスク信号MASKにより選択クロック信号SCLKがマスクされていないときには、Hレベル固定のマスク解除信号MRが出力される。一方、NAND回路61は、マスク信号MASKがHレベルのときに、選択クロック信号SCLKと同じ論理レベルのマスク解除信号MRを出力する。このため、選択クロック信号SCLKに対するマスクが開始された後に、選択クロック信号SCLKがLレベルからHレベルに遷移するとマスク解除信号MRもLレベルからHレベルに立ち上がる。なお、このマスク解除信号MRの立ち上がりエッジに応答して上記D−FF31でマスク信号MASKがLレベルに遷移される。   The release circuit 60 has a NAND circuit 61. The NAND circuit 61 generates a mask release signal MR having a result obtained by performing a NAND operation on the inverted level of the selected clock signal SCLK and the mask signal MASK, and outputs the mask release signal MR to the clock terminal of the D-FF 31. . Specifically, when the mask signal MASK is at the L level, the NAND circuit 61 outputs the mask release signal MR that is fixed at the L level regardless of the signal level of the selected clock signal SCLK. That is, when the selected clock signal SCLK is not masked by the mask signal MASK, the mask release signal MR fixed at the H level is output. On the other hand, when the mask signal MASK is at the H level, the NAND circuit 61 outputs a mask release signal MR having the same logic level as that of the selected clock signal SCLK. Therefore, after the masking of the selected clock signal SCLK is started, when the selected clock signal SCLK transitions from the L level to the H level, the mask release signal MR also rises from the L level to the H level. In response to the rising edge of the mask release signal MR, the mask signal MASK is changed to L level in the D-FF 31.

本実施形態において、XOR回路22は第1論理回路の一例、セレクタ41は第2論理回路の一例、OR回路42は第2論理回路の一例である。
次に、上記クロック切替回路1の動作を図3に従って説明する。まず、クロック切替回路1の初期化動作について説明する。
In the present embodiment, the XOR circuit 22 is an example of a first logic circuit, the selector 41 is an example of a second logic circuit, and the OR circuit 42 is an example of a second logic circuit.
Next, the operation of the clock switching circuit 1 will be described with reference to FIG. First, the initialization operation of the clock switching circuit 1 will be described.

今、時刻t1において、初期化信号ISがLレベルに立ち下がると、D−FF11,12がクリアされてLレベルの選択信号SELaが出力されるとともに、D−FF31がプリセットされてLレベルのマスク信号MASKが出力される。このLレベルのマスク信号MASKに応答してNAND回路61からHレベルのマスク解除信号MRが出力される。なお、クロック切替回路1(同期化回路10)には、Lレベルの選択信号SELが入力される。   At time t1, when the initialization signal IS falls to the L level, the D-FFs 11 and 12 are cleared and the L level selection signal SELa is output, and the D-FF 31 is preset and the L level mask is set. Signal MASK is output. In response to the L level mask signal MASK, the NAND circuit 61 outputs an H level mask release signal MR. Note that the L-level selection signal SEL is input to the clock switching circuit 1 (synchronization circuit 10).

このような初期化後には、上記Lレベルの選択信号SELaに応じて、入力クロック信号CLK1,CLK2のうち入力クロック信号CLK1がセレクタ41で選択され、その入力クロック信号CLK1が選択クロック信号SCLKとして出力される。このとき、上述のようにマスク信号MASKがLレベルであるため、選択クロック信号SCLK、つまり入力クロック信号CLK1が出力クロック信号CLKOUTとして出力される。このため、同期化回路10において、入力クロック信号CLK1(出力クロック信号CLKOUT)により選択信号SELの同期化が行われる。   After such initialization, the input clock signal CLK1 of the input clock signals CLK1 and CLK2 is selected by the selector 41 in accordance with the L level selection signal SELa, and the input clock signal CLK1 is output as the selected clock signal SCLK. Is done. At this time, since the mask signal MASK is at the L level as described above, the selected clock signal SCLK, that is, the input clock signal CLK1 is output as the output clock signal CLKOUT. Therefore, in the synchronization circuit 10, the selection signal SEL is synchronized by the input clock signal CLK1 (output clock signal CLKOUT).

続いて、入力クロック信号CLK1から入力クロック信号CLK2に切り替える動作について説明する。
時刻t2において、入力クロック信号CLK1から入力クロック信号CLK2に切り替えるために選択信号SELがLレベルからHレベルに遷移される。すると、その遷移後に発生する最初の出力クロック信号CLKOUT(ここでは、入力クロック信号CLK1)の立ち上がりエッジに応答して上記Hレベルの選択信号SELがD−FF11に保持される(時刻t3)。続いて、次の出力クロック信号CLKOUTの立ち上がりエッジに応答して、D−FF11から出力されるHレベルの出力信号がD−FF12に保持され、そのD−FF12からHレベルの選択信号SELaが出力される(時刻t4)。すなわち、時刻t4において、D−FF12から出力される選択信号SELaがLレベルからHレベルに遷移される。これにより、上記遷移後のHレベルの選択信号SELが出力クロック信号CLKOUT(つまり、クロック切替前の入力クロック信号CLK1)で同期化されたことになる。なお、このように選択信号SELがLレベルからHレベルに遷移してから、そのHレベルの選択信号SELに対する同期化が完了するまで(選択信号SELaがHレベルに遷移するまで)は、Lレベルの選択信号SELaに応じて入力クロック信号CLK1が選択クロック信号SCLKとして出力されている。
Next, an operation for switching from the input clock signal CLK1 to the input clock signal CLK2 will be described.
At time t2, the selection signal SEL transitions from the L level to the H level in order to switch from the input clock signal CLK1 to the input clock signal CLK2. Then, the H-level selection signal SEL is held in the D-FF 11 in response to the rising edge of the first output clock signal CLKOUT (here, the input clock signal CLK1) generated after the transition (time t3). Subsequently, in response to the rising edge of the next output clock signal CLKOUT, the H-level output signal output from the D-FF 11 is held in the D-FF 12, and the H-level selection signal SELa is output from the D-FF 12. (Time t4). That is, at time t4, the selection signal SELa output from the D-FF 12 is transitioned from the L level to the H level. Thus, the H-level selection signal SEL after the transition is synchronized with the output clock signal CLKOUT (that is, the input clock signal CLK1 before clock switching). It should be noted that until the selection signal SEL transitions from the L level to the H level until the synchronization with the selection signal SEL at the H level is completed (until the selection signal SELa transitions to the H level), the L level. In response to the selection signal SELa, the input clock signal CLK1 is output as the selection clock signal SCLK.

そして、上述のように選択信号SELaがLレベルからHレベルに遷移すると、その遷移(変化)に応答してXOR回路22からLレベルのマスク開始信号MSが所定期間(インバータ回路21の遅延時間分)だけ出力される。このLレベルのマスク開始信号MSに応答してD−FF31からHレベルのマスク信号MASKが出力される。   As described above, when the selection signal SELa transitions from the L level to the H level, the L level mask start signal MS is transmitted from the XOR circuit 22 in response to the transition (change) for a predetermined period (the delay time of the inverter circuit 21). ) Only. In response to the L level mask start signal MS, the D-FF 31 outputs an H level mask signal MASK.

一方、クロック選択回路40では、上記遷移後のHレベルの選択信号SELaに応じて入力クロック信号CLK2がセレクタ41で選択され、その入力クロック信号CLK2が選択クロック信号SCLKとして出力される。すなわち、セレクタ41では、Hレベルの選択信号SELaに応じて、入力クロック信号CLK1から入力クロック信号CLK2への切り替えが行われる。但し、このときのOR回路42には上記Hレベルのマスク信号MASKが入力されるため、そのマスク信号MASKにより選択クロック信号SCLKがマスクされ、出力クロック信号CLKOUTがHレベルに固定される。このように、入力クロック信号CLK1から入力クロック信号CLK2に切り替えられるときにHレベルのマスク信号MASKが生成される。このため、例えばセレクタ41でのクロック切り替え直前の入力クロック信号CLK1がHレベルで、クロック切り替え直後の入力クロック信号CLK2がLレベルである場合の細い幅のHパルスのハザード(選択クロック信号SCLK)が出力クロック信号CLKOUTとして出力されることが抑制される。   On the other hand, in the clock selection circuit 40, the input clock signal CLK2 is selected by the selector 41 in accordance with the selection signal SELa at the H level after the transition, and the input clock signal CLK2 is output as the selection clock signal SCLK. That is, in the selector 41, switching from the input clock signal CLK1 to the input clock signal CLK2 is performed according to the selection signal SELa of the H level. However, since the H level mask signal MASK is input to the OR circuit 42 at this time, the selection clock signal SCLK is masked by the mask signal MASK, and the output clock signal CLKOUT is fixed to the H level. In this way, when the input clock signal CLK1 is switched to the input clock signal CLK2, the H level mask signal MASK is generated. For this reason, for example, when the input clock signal CLK1 immediately before the clock switching in the selector 41 is at the H level and the input clock signal CLK2 immediately after the clock switching is at the L level, a narrow H pulse hazard (selected clock signal SCLK) is generated. Output as the output clock signal CLKOUT is suppressed.

また、解除回路60では、上記遷移後のHレベルのマスク信号MASKに応じて、選択クロック信号SCLK(つまり、クロック切替後の入力クロック信号CLK2)と同じ論理レベルのマスク解除信号MRがNAND回路61から出力される。上記時刻t4における選択クロック信号SCLKがLレベルであるため、その時刻t4においてマスク解除信号MRがLレベルに遷移する。その後、選択クロック信号SCLKがHレベルに遷移すると(時刻t5)、マスク解除信号MRがHレベルに立ち上がる。このマスク解除信号MRの立ち上がりエッジに応答してマスク信号MASKがHレベルからLレベルに遷移する。すると、選択クロック信号SCLKに対するマスクが解除されるため、その選択クロック信号SCLK(ここでは、クロック切替後の入力クロック信号CLK2)が出力クロック信号CLKOUTとして出力される。このようにして、入力クロック信号CLK1から入力クロック信号CLK2への切り替えが完了する。なお、マスク信号MASKがLレベルに遷移すると、NAND回路61からはHレベル固定のマスク解除信号MRが出力されることになる。   In the release circuit 60, the mask release signal MR having the same logic level as that of the selected clock signal SCLK (that is, the input clock signal CLK2 after the clock switching) is generated in accordance with the H level mask signal MASK after the transition. Is output from. Since the selected clock signal SCLK at the time t4 is at the L level, the mask release signal MR transits to the L level at the time t4. Thereafter, when the selected clock signal SCLK transitions to the H level (time t5), the mask release signal MR rises to the H level. In response to the rising edge of the mask release signal MR, the mask signal MASK changes from H level to L level. Then, the mask for the selected clock signal SCLK is released, and the selected clock signal SCLK (here, the input clock signal CLK2 after the clock switching) is output as the output clock signal CLKOUT. In this way, switching from the input clock signal CLK1 to the input clock signal CLK2 is completed. When the mask signal MASK transitions to the L level, the NAND circuit 61 outputs the mask release signal MR fixed at the H level.

続いて、入力クロック信号CLK2から入力クロック信号CLK1に切り替える動作について説明する。
時刻t6において、入力クロック信号CLK2から入力クロック信号CLK1に切り替えるために選択信号SELがHレベルからLレベルに遷移される。すると、そのLレベルの選択信号SELが出力クロック信号CLKOUT(ここでは、入力クロック信号CLK2)で同期化され、出力クロック信号CLKOUTの立ち上がりエッジに同期してLレベルの選択信号SELaが出力される(時刻t7)。なお、このように選択信号SELがHレベルからLレベルに遷移してから、そのLレベルの選択信号SELに対する同期化が完了するまで(選択信号SELaがLレベルに遷移するまで)は、Hレベルの選択信号SELaに応じて入力クロック信号CLK2が選択クロック信号SCLKとして出力される。
Next, an operation for switching from the input clock signal CLK2 to the input clock signal CLK1 will be described.
At time t6, the selection signal SEL transitions from the H level to the L level in order to switch from the input clock signal CLK2 to the input clock signal CLK1. Then, the L level selection signal SEL is synchronized with the output clock signal CLKOUT (here, the input clock signal CLK2), and the L level selection signal SELa is output in synchronization with the rising edge of the output clock signal CLKOUT ( Time t7). It should be noted that after the selection signal SEL transitions from the H level to the L level in this way until the synchronization with the L level selection signal SEL is completed (until the selection signal SELa transitions to the L level), the H level. In response to the selection signal SELa, the input clock signal CLK2 is output as the selection clock signal SCLK.

そして、上述のように選択信号SELaがHレベルからLレベルに遷移すると、その遷移(変化)に応答してXOR回路22からLレベルのマスク開始信号MSが所定期間だけ出力される。このLレベルのマスク開始信号MSに応答してD−FF31からHレベルのマスク信号MASKが出力される。   When the selection signal SELa transitions from the H level to the L level as described above, the LOR mask start signal MS is output from the XOR circuit 22 for a predetermined period in response to the transition (change). In response to the L level mask start signal MS, the D-FF 31 outputs an H level mask signal MASK.

一方、クロック選択回路40では、上記遷移後のLレベルの選択信号SELaに応じて入力クロック信号CLK1がセレクタ41で選択され、その入力クロック信号CLK1が選択クロック信号SCLKとして出力される。すなわち、セレクタ41では、Lレベルの選択信号SELaに応じて、入力クロック信号CLK2から入力クロック信号CLK1への切り替えが行われる。但し、このときのOR回路42には上記Hレベルのマスク信号MASKが入力されるため、そのマスク信号MASKにより選択クロック信号SCLKがマスクされ、出力クロック信号CLKOUTがHレベルに固定される。   On the other hand, in the clock selection circuit 40, the input clock signal CLK1 is selected by the selector 41 in accordance with the L level selection signal SELa after the transition, and the input clock signal CLK1 is output as the selection clock signal SCLK. That is, in the selector 41, switching from the input clock signal CLK2 to the input clock signal CLK1 is performed in accordance with the L level selection signal SELa. However, since the H level mask signal MASK is input to the OR circuit 42 at this time, the selection clock signal SCLK is masked by the mask signal MASK, and the output clock signal CLKOUT is fixed to the H level.

また、上記時刻t7において、上記Hレベルのマスク信号MASK及びLレベルの選択クロック信号SCLKに応じてマスク解除信号MRがLレベルに遷移する。その後、選択クロック信号SCLKがHレベルに遷移すると(時刻t8)、マスク解除信号MRがHレベルに立ち上がる。このマスク解除信号MRの立ち上がりエッジに応答してマスク信号MASKがHレベルからLレベルに遷移する。すると、選択クロック信号SCLKに対するマスクが解除されるため、その選択クロック信号SCLK(ここでは、クロック切替後の入力クロック信号CLK1)が出力クロック信号CLKOUTとして出力される。このようにして、入力クロック信号CLK2から入力クロック信号CLK1への切り替えが完了する。   At the time t7, the mask release signal MR transits to the L level in response to the H level mask signal MASK and the L level selected clock signal SCLK. Thereafter, when the selected clock signal SCLK transitions to the H level (time t8), the mask release signal MR rises to the H level. In response to the rising edge of the mask release signal MR, the mask signal MASK changes from H level to L level. Then, since the mask for the selected clock signal SCLK is released, the selected clock signal SCLK (here, the input clock signal CLK1 after the clock switching) is output as the output clock signal CLKOUT. In this way, switching from the input clock signal CLK2 to the input clock signal CLK1 is completed.

以上説明したように、クロック切替回路1では、選択信号SELaの信号レベルが変化したとき、つまり入力クロック信号CLK1,CLK2の切り替え時にHレベルのマスク信号MASKが生成される。このときの選択信号SELaは出力クロック信号CLKOUTの立ち上がりエッジに同期化されているため、マスク信号MASKも出力クロック信号CLKOUTの立ち上がりエッジに同期化して生成される。このため、出力クロック信号CLKOUTがHレベルに遷移したときにHレベルのマスク信号MASKが生成され、そのマスク信号MASKにより選択クロック信号SCLKがマスクされて出力クロック信号CLKOUTがHレベルに固定される。これにより、クロック切替時に出力クロック信号CLKOUTの信号レベルをHレベルに固定することができる。換言すると、選択信号SELaに応じてセレクタ41で切り替えられた入力クロック信号(選択クロック信号SCLK)がその切り替え直後に出力クロック信号CLKOUTとして出力されることを防止することができる。このため、切り替え直後の選択クロック信号SCLKがLレベルであっても、出力クロック信号CLKOUTがLレベルに遷移することが防止され、クロック切替時におけるハザードの発生を好適に抑制することができる。   As described above, the clock switching circuit 1 generates the H level mask signal MASK when the signal level of the selection signal SELa changes, that is, when the input clock signals CLK1 and CLK2 are switched. Since the selection signal SELa at this time is synchronized with the rising edge of the output clock signal CLKOUT, the mask signal MASK is also generated in synchronization with the rising edge of the output clock signal CLKOUT. Therefore, when the output clock signal CLKOUT transitions to the H level, the H level mask signal MASK is generated, and the selected clock signal SCLK is masked by the mask signal MASK, and the output clock signal CLKOUT is fixed to the H level. Thereby, the signal level of the output clock signal CLKOUT can be fixed to the H level at the time of clock switching. In other words, the input clock signal (selected clock signal SCLK) switched by the selector 41 according to the selection signal SELa can be prevented from being output as the output clock signal CLKOUT immediately after the switching. For this reason, even if the selected clock signal SCLK immediately after switching is at the L level, the output clock signal CLKOUT is prevented from transitioning to the L level, and the occurrence of a hazard at the time of clock switching can be suitably suppressed.

さらに、クロック切替回路1では、選択クロック信号SCLKに対するマスクが開始された後、選択クロック信号SCLKがLレベルからHレベルに遷移したときに、その選択クロック信号SCLKに対するマスクが解除される。このため、選択クロック信号SCLKに対するマスクが開始されてからそのマスクが解除されるまでの期間は出力クロック信号CLKOUTがHレベルに固定され、さらに上記マスクの解除後にHレベルパルスの選択クロック信号SCLKが出力クロック信号CLKOUTとして出力される。したがって、クロック切替時において、入力クロック信号CLK1,CLK2のうちの短い方のパルス幅よりさらに短いパルス幅の信号が出力クロック信号CLKOUTとして出力されることを好適に抑制することができる。なお、このような短いパルス幅が出力クロック信号CLKOUTに現れる場合には、この出力クロック信号CLKOUTにより動作する回路に誤動作が発生する確率が高まるが、長いパルス幅の信号が出力クロック信号CLKOUTに現れる場合には、通常、誤動作が発生することはない。   Further, in the clock switching circuit 1, after the mask for the selected clock signal SCLK is started, the mask for the selected clock signal SCLK is released when the selected clock signal SCLK transitions from the L level to the H level. For this reason, the output clock signal CLKOUT is fixed at the H level during the period from when masking to the selected clock signal SCLK is started until the mask is released, and after the mask is released, the selected clock signal SCLK of the H level pulse is Output as an output clock signal CLKOUT. Therefore, at the time of clock switching, it is possible to suitably suppress the output of the signal having a shorter pulse width than the shorter one of the input clock signals CLK1 and CLK2 as the output clock signal CLKOUT. Note that when such a short pulse width appears in the output clock signal CLKOUT, the probability that a malfunction will occur in a circuit that operates according to the output clock signal CLKOUT increases, but a signal with a long pulse width appears in the output clock signal CLKOUT. In some cases, malfunctions usually do not occur.

以上説明した本実施形態によれば、以下の効果を奏することができる。
(1)選択信号SELを出力クロック信号CLKOUTで同期化し、その同期化後の選択信号SELaの信号レベルが変化したときに、複数の入力クロック信号CLK1,CLK2を所定レベル(ここでは、Hレベル)でマスクするマスク信号MASKを生成するようにした。また、マスク信号MASKが生成された後、選択信号SELaに応じて選択される入力クロック信号、つまり選択クロック信号SCLKの所定レベル(ここでは、Hレベル)への遷移を検出したときに、マスク信号MASKの生成を停止するようにした。これにより、選択クロック信号SCLKに対するマスクが開始されてからそのマスクが解除されるまでの期間は出力クロック信号CLKOUTがHレベルに固定され、さらに上記マスクの解除後にHレベルパルスの選択クロック信号SCLKが出力クロック信号CLKOUTとして出力される。したがって、クロック切替時におけるハザードの発生を好適に抑制することができる。
According to this embodiment described above, the following effects can be obtained.
(1) When the selection signal SEL is synchronized with the output clock signal CLKOUT and the signal level of the synchronized selection signal SELa changes, the plurality of input clock signals CLK1 and CLK2 are set to a predetermined level (here, H level). The mask signal MASK for masking is generated. Further, after the mask signal MASK is generated, the mask signal is detected when a transition of the input clock signal selected according to the selection signal SELa, that is, the selection clock signal SCLK to a predetermined level (here, H level) is detected. The generation of MASK was stopped. As a result, the output clock signal CLKOUT is fixed at the H level during the period from when the masking to the selected clock signal SCLK is started until the masking is released, and after the masking is released, the selected clock signal SCLK of the H level pulse is Output as an output clock signal CLKOUT. Therefore, it is possible to suitably suppress the occurrence of a hazard at the time of clock switching.

(2)同期化回路10では、選択信号SELを1つの出力クロック信号(選択後の入力クロック信号)で同期化を行うようにした。このため、選択信号SELを入力クロック信号CLK1,CLK2毎に同期化を行う場合に比べて、回路規模を縮小することができる。具体的には、同期化回路10内のFF群13は、選択対象の入力クロック信号CLK1,CLK2の個数N(ここでは、2)個分設ける必要はなく、logN(小数点以下切り上げ)個分だけ設ければよい。このため、選択対象の入力クロック信号の個数Nが増加した場合であっても、その個数Nと同数のFF群13を設ける場合に比べて、回路規模の増大を抑制することができる。 (2) The synchronization circuit 10 synchronizes the selection signal SEL with one output clock signal (input clock signal after selection). Therefore, the circuit scale can be reduced as compared with the case where the selection signal SEL is synchronized for each of the input clock signals CLK1 and CLK2. Specifically, the FF group 13 in the synchronization circuit 10 does not have to be provided for the number N (here, 2) of input clock signals CLK1 and CLK2 to be selected, and is log 2 N (rounded up to the nearest decimal place). It is sufficient to provide only minutes. For this reason, even when the number N of input clock signals to be selected increases, an increase in circuit scale can be suppressed as compared with the case where the same number N of FF groups 13 are provided.

さらに、2つの入力クロック信号CLK1,CLK2に対して同期化後の選択信号SELaが1つ使用されるため、その選択信号SELaに応じてマスク信号MASKを生成する検出回路20、マスク信号生成回路30及び解除回路60の回路規模の増大も抑制することができる。   Furthermore, since one synchronized selection signal SELa is used for the two input clock signals CLK1 and CLK2, the detection circuit 20 and the mask signal generation circuit 30 generate the mask signal MASK in accordance with the selection signal SELa. And the increase in the circuit scale of the release circuit 60 can also be suppressed.

(3)上述のようにクロック切替時におけるハザードの発生を抑制できるため、任意のタイミングで選択信号SELの信号レベルを切り替えることができる、つまり任意のタイミングで入力クロック信号CLK1,CLK2を切り替えることができる。また、マスク信号MASKの生成後、選択クロック信号SCLKの最初の立ち上がりエッジに応答して入力クロック信号CLK1,CLK2の切り替えを完了することができる。このため、選択信号SELの同期化が完了した後に短期間で入力クロック信号CLK1,CLK2を切り替えることができ、入力クロック信号CLK1,CLK2をダイナミックに切り替えることができる。さらに、クロック切替後の入力クロック信号の立ち上がりエッジに応答してマスク信号MASKの生成が停止されるため、入力クロック信号CLK1,CLK2の周波数比及び位相に関係なく、上記ハザードの発生を抑制することができる。   (3) Since the occurrence of a hazard at the time of clock switching can be suppressed as described above, the signal level of the selection signal SEL can be switched at an arbitrary timing, that is, the input clock signals CLK1 and CLK2 can be switched at an arbitrary timing. it can. In addition, after the generation of the mask signal MASK, the switching of the input clock signals CLK1 and CLK2 can be completed in response to the first rising edge of the selected clock signal SCLK. Therefore, the input clock signals CLK1 and CLK2 can be switched in a short period after the synchronization of the selection signal SEL is completed, and the input clock signals CLK1 and CLK2 can be switched dynamically. Further, since the generation of the mask signal MASK is stopped in response to the rising edge of the input clock signal after the clock switching, the occurrence of the hazard is suppressed regardless of the frequency ratio and phase of the input clock signals CLK1 and CLK2. Can do.

(4)ところで、クロック切替時にハザードが発生する回路では、シミュレーションを行う際に、実際の回路とシミュレーション回路を部分的に変更する等の処置が必要になり、この変更した部分に起因して全体回路が所望の動作と異なる動作になるといった問題があった。これに対し、クロック切替時におけるハザードの発生を抑制できるクロック切替回路1では、実際の回路とシミュレーション回路とを同一の回路にすることができるため、上記問題の発生を未然に防止することができる。   (4) By the way, in a circuit in which a hazard is generated at the time of clock switching, it is necessary to take measures such as partially changing the actual circuit and the simulation circuit when performing a simulation. There has been a problem that the circuit operates differently from the desired operation. On the other hand, in the clock switching circuit 1 that can suppress the occurrence of a hazard at the time of clock switching, the actual circuit and the simulation circuit can be made the same circuit, so that the above problem can be prevented from occurring. .

(5)選択信号SELaを、出力クロック信号CLKOUTの立ち上がりエッジで同期化するようにした。これにより、出力クロック信号CLKOUTがHレベルに遷移したときにHレベルのマスク信号MASKが生成され、そのマスク信号MASKにより選択クロック信号SCLKがマスクされて出力クロック信号CLKOUTがHレベルに固定される。したがって、クロック切替時に出力クロック信号CLKOUTの信号レベルをHレベルに固定することができる。このため、クロック切替直後の選択クロック信号SCLKがLレベルであっても、出力クロック信号CLKOUTがLレベルに遷移することが防止され、クロック切替時におけるハザードの発生を好適に抑制することができる。   (5) The selection signal SELa is synchronized with the rising edge of the output clock signal CLKOUT. Thus, when the output clock signal CLKOUT transitions to the H level, the H level mask signal MASK is generated, and the selected clock signal SCLK is masked by the mask signal MASK and the output clock signal CLKOUT is fixed to the H level. Therefore, the signal level of output clock signal CLKOUT can be fixed at the H level during clock switching. For this reason, even if the selected clock signal SCLK immediately after the clock switching is at the L level, the output clock signal CLKOUT is prevented from transitioning to the L level, and the occurrence of a hazard at the time of clock switching can be suitably suppressed.

(6)選択信号SELを出力クロック信号で同期化を行うようにしたため、入力クロック信号CLK1,CLK2に対して非同期信号である選択信号SELに応じて入力クロック信号CLK1,CLK2の切り替えを行うことができる。   (6) Since the selection signal SEL is synchronized with the output clock signal, the input clock signals CLK1 and CLK2 can be switched according to the selection signal SEL which is an asynchronous signal with respect to the input clock signals CLK1 and CLK2. it can.

(7)同期化回路10において、複数段のD−FF11,12によって選択信号SELを出力クロック信号CLKOUTに従って取り込むようにした。これにより、メタステーブルの発生を抑制することができ、選択信号SELを正しく取り込むことができる。さらに、上述したように選択対象の入力クロック信号の個数Nが増加した場合に、FF群13の増加が抑制されるため、メタステーブル対策を行った場合の回路規模の増大も抑制することができる。   (7) In the synchronization circuit 10, the selection signal SEL is fetched in accordance with the output clock signal CLKOUT by the plurality of stages of D-FFs 11 and 12. Thereby, generation | occurrence | production of a metastable can be suppressed and the selection signal SEL can be taken in correctly. Furthermore, as described above, when the number N of input clock signals to be selected is increased, the increase in the FF group 13 is suppressed, so that an increase in circuit scale when a metastable measure is taken can also be suppressed. .

(8)検出回路20では、選択信号SELaの信号レベルの変化、つまりHレベルからLレベルへの変化と、LレベルからHレベルへの変化との双方の変化をXOR回路22で検出するようにしたため、回路規模の増大を抑制することができる。   (8) In the detection circuit 20, the XOR circuit 22 detects the change in the signal level of the selection signal SELa, that is, both the change from the H level to the L level and the change from the L level to the H level. Therefore, an increase in circuit scale can be suppressed.

(第1実施形態の変形例)
なお、上記第1実施形態は、これを適宜変更した以下の態様にて実施することもできる。
(Modification of the first embodiment)
In addition, the said 1st Embodiment can also be implemented in the following aspects which changed this suitably.

・上記第1実施形態における同期化回路10の内部構成例は特に限定されない。例えば複数段のD−FF11,12の代わりに、1段のD−FFを設けるようにしてもよい。このような構成であっても、上記第1実施形態の(1)〜(6)、(8)と同様の効果を奏することができる。   The internal configuration example of the synchronization circuit 10 in the first embodiment is not particularly limited. For example, a single stage D-FF may be provided instead of the plurality of stages of D-FFs 11 and 12. Even if it is such a structure, there can exist an effect similar to (1)-(6) of the said 1st Embodiment, and (8).

・上記第1実施形態では、D−FF11,12をクリア端子CLR付きフリップフロップとし、そのクリア端子CLRに初期化信号ISを供給するようにした。これにより、初期化時において、D−FF12からLレベルの選択信号SELaが出力され、セレクタ41から入力クロック信号CLK1が選択クロック信号SCLKとして出力される。これに限らず、例えばD−FF11,12をプリセット端子PR付きフリップフロップに変更し、そのプリセット端子PRに初期化信号ISを供給するようにしてもよい。この場合には、初期化時において、D−FF12からHレベルの選択信号SELaが出力されるため、セレクタ41から入力クロック信号CLK2が選択クロック信号SCLKとして出力されることになる。なお、この場合には、選択信号SELの初期値をHレベルに設定することが好ましい。   In the first embodiment, the D-FFs 11 and 12 are flip-flops with the clear terminal CLR, and the initialization signal IS is supplied to the clear terminal CLR. Thereby, at the time of initialization, the L-level selection signal SELa is output from the D-FF 12, and the input clock signal CLK1 is output from the selector 41 as the selection clock signal SCLK. For example, the D-FFs 11 and 12 may be changed to flip-flops with a preset terminal PR, and the initialization signal IS may be supplied to the preset terminal PR. In this case, since the selection signal SELa of the H level is output from the D-FF 12 at the time of initialization, the input clock signal CLK2 is output from the selector 41 as the selection clock signal SCLK. In this case, it is preferable to set the initial value of the selection signal SEL to the H level.

なお、D−FF11,12としては、クリア端子CLR又はプリセット端子PRを有さないフリップフロップを使用することも可能である。但し、設計段階の論理シミュレーションにおいて、シミュレーション初期のこれらのフリップフロップの不定値がセレクタ41に伝播してしまう。このため、クリア端子CLR又はプリセット端子PRを有するフリップフロップを使用することが好ましい。   As the D-FFs 11 and 12, flip-flops that do not have the clear terminal CLR or the preset terminal PR can be used. However, in the logic simulation at the design stage, the indefinite values of these flip-flops at the initial stage of the simulation are propagated to the selector 41. For this reason, it is preferable to use a flip-flop having a clear terminal CLR or a preset terminal PR.

・上記第1実施形態における検出回路20の内部構成例は特に限定されない。上記第1実施形態の検出回路20では、選択信号SELaの双方の信号レベルの変化(HレベルからLレベルへの変化、及びLレベルからHレベルの変化)をインバータ回路21及びXOR回路22で検出するようにした。これに限らず、例えば検出回路20において、選択信号SELaのHレベルからLレベルへの変化と、選択信号SELaのLレベルからHレベルへの変化とを個別に検出する論理回路を設けるようにしてもよい。このような構成であっても、上記第1実施形態の(1)〜(7)と同様の効果を奏することができる。   The internal configuration example of the detection circuit 20 in the first embodiment is not particularly limited. In the detection circuit 20 of the first embodiment, the inverter circuit 21 and the XOR circuit 22 detect changes in both signal levels of the selection signal SELa (change from H level to L level and change from L level to H level). I tried to do it. For example, the detection circuit 20 may be provided with a logic circuit that individually detects a change in the selection signal SELa from the H level to the L level and a change in the selection signal SELa from the L level to the H level. Also good. Even if it is such a structure, there can exist an effect similar to (1)-(7) of the said 1st Embodiment.

・上記第1実施形態におけるマスク信号生成回路30の内部構成例は特に限定されない。例えば図4に示されるように、上記D−FF31の代わりに、2つのNAND回路32,33により形成されるRS−FF34を設けるようにしてもよい。具体的には、3入力端子を有するNAND回路32には、初期化信号ISと、マスク開始信号MSと、2入力端子を有するNAND回路33の出力信号とが入力される。このNAND回路32の出力信号は上記マスク信号MASKとして出力されるとともに、NAND回路32の出力信号はNAND回路33に入力される。NAND回路33にはマスク解除信号MRが供給される。このようなRS−FF34では、セット端子Sに入力されるLレベルのマスク開始信号MS(セット信号)に応答してセット状態に遷移し、Hレベルのマスク信号MASKを出力する。また、リセット端子Rに入力されるLレベルのマスク解除信号MR(リセット信号)に応答してリセット状態に遷移し、Lレベルのマスク信号MASKを出力する。このような構成であっても、上記第1実施形態と同様の効果を奏することができる。   The internal configuration example of the mask signal generation circuit 30 in the first embodiment is not particularly limited. For example, as shown in FIG. 4, an RS-FF 34 formed by two NAND circuits 32 and 33 may be provided instead of the D-FF 31. Specifically, the initialization signal IS, the mask start signal MS, and the output signal of the NAND circuit 33 having two input terminals are input to the NAND circuit 32 having three input terminals. The output signal of the NAND circuit 32 is output as the mask signal MASK, and the output signal of the NAND circuit 32 is input to the NAND circuit 33. The NAND circuit 33 is supplied with a mask release signal MR. In such an RS-FF 34, in response to an L level mask start signal MS (set signal) input to the set terminal S, the RS-FF 34 transitions to a set state and outputs an H level mask signal MASK. Further, in response to an L level mask release signal MR (reset signal) input to the reset terminal R, a transition is made to the reset state, and an L level mask signal MASK is output. Even with such a configuration, the same effects as those of the first embodiment can be obtained.

・あるいは、上記第1実施形態のD−FF31では、入力端子Dに高電位電源電圧VDDを供給し、反転出力端子XQからマスク信号MASKを出力するようにした。これに限らず、例えばD−FF31の入力端子に低電位電源電圧を供給し、出力端子Qからマスク信号MASKを出力するようにしてもよい。   Alternatively, in the D-FF 31 of the first embodiment, the high potential power supply voltage VDD is supplied to the input terminal D, and the mask signal MASK is output from the inverting output terminal XQ. For example, the low potential power supply voltage may be supplied to the input terminal of the D-FF 31 and the mask signal MASK may be output from the output terminal Q.

・上記第1実施形態における解除回路60の内部構成例は特に限定されない。例えば図5に示されるように、バッファ回路(遅延回路)62とOR回路63とを追加するようにしてもよい。具体的には、OR回路63には、マスク信号MASKが直接供給されるとともに、マスク信号MASKをバッファ回路62により遅延させた遅延信号が供給される。このため、マスク解除信号MRの立ち上がりエッジに応答してマスク信号MASKがLレベルに遷移された場合に、その遷移後もバッファ回路62による遅延時間(具体的には、D−FF31の出力が変化するだけの時間)分だけマスク解除信号MRがHレベルに確実に維持される。これにより、マスク解除信号MRのパルス幅(D−FF31のクロックパルス幅)を確保することができるため、マスク信号MASKを確実にLレベルに遷移させることができる。   -The internal configuration example of the release circuit 60 in the first embodiment is not particularly limited. For example, as shown in FIG. 5, a buffer circuit (delay circuit) 62 and an OR circuit 63 may be added. Specifically, a mask signal MASK is directly supplied to the OR circuit 63 and a delay signal obtained by delaying the mask signal MASK by the buffer circuit 62 is supplied. For this reason, when the mask signal MASK is transitioned to the L level in response to the rising edge of the mask release signal MR, the delay time (specifically, the output of the D-FF 31 is changed by the buffer circuit 62 after the transition). The mask release signal MR is reliably maintained at the H level for an amount of time). As a result, the pulse width of the mask release signal MR (clock pulse width of the D-FF 31) can be secured, so that the mask signal MASK can be reliably shifted to the L level.

・あるいは、図6に示されるように、解除回路60の内部構成を変更するようにしてもよい。具体的には、図6に示した解除回路60は、3入力端子を有するNAND回路64,65を有している。NAND回路64には、選択クロック信号SCLKの反転レベルと、マスク信号MASKと、NAND回路65の出力信号とが入力される。NAND回路65には、選択クロック信号SCLKの反転レベルと、マスク信号MASKの反転レベルと、NAND回路64の出力信号とが入力される。そして、NAND回路64の出力信号がマスク解除信号MRとして出力される。このような回路では、初期化動作によりLレベルのマスク信号MASKが入力されると、NAND回路64からHレベルのマスク解除信号MRが出力される。その後、マスク信号MASKがHレベルに遷移すると、その時の選択クロック信号SCLKと同じ論理レベルのマスク解除信号MRが出力される。そして、マスク信号MASKがHレベルであるときに、選択クロック信号SCLKがLレベルからHレベルに遷移すると、マスク解除信号MRもLレベルからHレベルに遷移する。すると、そのマスク解除信号MRの立ち上がりエッジに応答してマスク信号MASKがLレベルに遷移する。すなわち、このような構成であっても、Hレベルのマスク信号MASKが生成された後、選択クロック信号SCLKの立ち上がりエッジに応答してマスク信号MASKをLレベルに遷移させることができる。   Alternatively, as shown in FIG. 6, the internal configuration of the release circuit 60 may be changed. Specifically, the release circuit 60 shown in FIG. 6 includes NAND circuits 64 and 65 having three input terminals. The NAND circuit 64 receives the inverted level of the selected clock signal SCLK, the mask signal MASK, and the output signal of the NAND circuit 65. The NAND circuit 65 receives the inverted level of the selected clock signal SCLK, the inverted level of the mask signal MASK, and the output signal of the NAND circuit 64. Then, the output signal of the NAND circuit 64 is output as the mask release signal MR. In such a circuit, when the L level mask signal MASK is input by the initialization operation, the NAND circuit 64 outputs the H level mask release signal MR. Thereafter, when the mask signal MASK transitions to the H level, the mask release signal MR having the same logic level as the selected clock signal SCLK at that time is output. When the mask signal MASK is at the H level and the selected clock signal SCLK transitions from the L level to the H level, the mask release signal MR also transitions from the L level to the H level. Then, in response to the rising edge of the mask release signal MR, the mask signal MASK transitions to the L level. That is, even with such a configuration, after the H level mask signal MASK is generated, the mask signal MASK can be shifted to the L level in response to the rising edge of the selected clock signal SCLK.

・上記第1実施形態におけるクロック選択回路40及び解除回路60の内部構成例は特に限定されない。例えば図7に示されるように、クロック選択回路40及び解除回路60の内部構成を変更するようにしてもよい。具体的には、クロック選択回路40は、インバータ回路43と、AND回路44,45と、3入力端子を有するOR回路46とを有している。AND回路44には、入力クロック信号CLK1と、選択信号SELaがインバータ回路43により論理反転された信号とが入力される。また、AND回路45には、入力クロック信号CLK2と、選択信号SELaとが入力される。OR回路46には、AND回路44,45の出力信号と、マスク信号MASKとが入力される。このOR回路46から上記出力クロック信号CLKOUTが出力される。このようなクロック選択回路40では、Lレベルの選択信号SELaに応じて、AND回路44から入力クロック信号CLK1が出力され、AND回路45からLレベル固定の出力信号が出力される。そして、マスク信号MASKがLレベルであるときには、AND回路44から出力される入力クロック信号CLK1が出力クロック信号CLKOUTとして出力される。一方、クロック選択回路40では、Hレベルの選択信号SELaに応じて、AND回路44からLレベル固定の出力信号が出力され、AND回路45から入力クロック信号CLK2が出力される。そして、マスク信号MASKがLレベルであるときには、AND回路45から出力される入力クロック信号CLK2が出力クロック信号CLKOUTとして出力される。なお、マスク信号MASKがHレベルであるときには、AND回路44,45の出力信号(つまり、入力クロック信号CLK1,CLK2)の信号レベルに関わらずに、Hレベル固定の出力クロック信号CLKOUTが出力される。   The internal configuration examples of the clock selection circuit 40 and the release circuit 60 in the first embodiment are not particularly limited. For example, as shown in FIG. 7, the internal configurations of the clock selection circuit 40 and the release circuit 60 may be changed. Specifically, the clock selection circuit 40 includes an inverter circuit 43, AND circuits 44 and 45, and an OR circuit 46 having three input terminals. The AND circuit 44 receives the input clock signal CLK1 and a signal obtained by logically inverting the selection signal SELa by the inverter circuit 43. The AND circuit 45 receives the input clock signal CLK2 and the selection signal SELa. The output signal of the AND circuits 44 and 45 and the mask signal MASK are input to the OR circuit 46. The OR circuit 46 outputs the output clock signal CLKOUT. In such a clock selection circuit 40, the input clock signal CLK1 is output from the AND circuit 44 and the output signal fixed at the L level is output from the AND circuit 45 in response to the selection signal SELa at the L level. When the mask signal MASK is at the L level, the input clock signal CLK1 output from the AND circuit 44 is output as the output clock signal CLKOUT. On the other hand, in the clock selection circuit 40, an output signal fixed at the L level is output from the AND circuit 44 and the input clock signal CLK2 is output from the AND circuit 45 in response to the selection signal SELa at the H level. When mask signal MASK is at the L level, input clock signal CLK2 output from AND circuit 45 is output as output clock signal CLKOUT. When mask signal MASK is at the H level, output clock signal CLKOUT having a fixed H level is output regardless of the signal level of output signals of AND circuits 44 and 45 (that is, input clock signals CLK1 and CLK2). .

一方、解除回路60は、インバータ回路66と、3入力端子を有するOR回路67とを有している。OR回路67には、マスク信号MASKがインバータ回路66により論理反転された信号と、AND回路44,45の出力信号とが入力される。このOR回路67から上記マスク解除信号MRが出力される。このような解除回路60では、Lレベルの選択信号SELaに応じてAND回路44から入力クロック信号CLK1が出力され、且つHレベルのマスク信号MASKが出力されている場合には、入力クロック信号CLK1と同じ論理レベルのマスク解除信号MRが出力される。また、Hレベルの選択信号SELaに応じてAND回路45から入力クロック信号CLK2が出力され、且つHレベルのマスク信号MASKが出力されている場合には、入力クロック信号CLK2と同じ論理レベルのマスク解除信号MRが出力される。なお、Lレベルのマスク信号MASKが出力されている場合には、AND回路44,45の出力信号の信号レベルに関わらずに、Hレベル固定の出力クロック信号CLKOUTが出力される。このような構成であっても、上記第1実施形態と同様の効果を奏することができる。   On the other hand, the release circuit 60 includes an inverter circuit 66 and an OR circuit 67 having three input terminals. The OR circuit 67 receives a signal obtained by logically inverting the mask signal MASK by the inverter circuit 66 and the output signals of the AND circuits 44 and 45. The OR circuit 67 outputs the mask release signal MR. In such a release circuit 60, when the input clock signal CLK1 is output from the AND circuit 44 in response to the selection signal SELa at the L level and the mask signal MASK at the H level is output, The mask release signal MR having the same logic level is output. When the input clock signal CLK2 is output from the AND circuit 45 in response to the selection signal SELa at the H level and the mask signal MASK at the H level is output, the mask release at the same logic level as the input clock signal CLK2 is performed. A signal MR is output. When the L level mask signal MASK is output, the H level fixed output clock signal CLKOUT is output regardless of the signal levels of the output signals of the AND circuits 44 and 45. Even with such a configuration, the same effects as those of the first embodiment can be obtained.

・上記第1実施形態では、選択信号SELを出力クロック信号CLKOUTの立ち上がりエッジで同期化し、選択クロック信号SCLK(入力クロック信号CLK1,CLK2)をHレベルでマスクするようにした。これに限らず、例えば選択信号SELを出力クロック信号CLKOUTの立ち下がりエッジで同期化し、選択クロック信号SCLK(入力クロック信号CLK1,CLK2)をLレベルでマスクするようにしてもよい。   In the first embodiment, the selection signal SEL is synchronized with the rising edge of the output clock signal CLKOUT, and the selection clock signal SCLK (input clock signals CLK1 and CLK2) is masked at the H level. For example, the selection signal SEL may be synchronized with the falling edge of the output clock signal CLKOUT, and the selection clock signal SCLK (input clock signals CLK1, CLK2) may be masked at the L level.

・上記第1実施形態では、選択信号SELを出力クロック信号CLKOUTの立ち上がりエッジで同期化するようにした。また、選択クロック信号SCLKがマスク信号MASKによりマスクされているときに、選択クロック信号SCLKの立ち上がりエッジに応答してマスク信号MASKによるマスクを解除するようにした。これに限らず、例えば選択信号SELを出力クロック信号CLKOUTの立ち下がりエッジで同期化するようにしてもよい。また、選択クロック信号SCLKがマスク信号MASKによりマスクされているときに、選択クロック信号SCLKの立ち下がりエッジに応答してマスク信号MASKによるマスクを解除するようにしてもよい。   In the first embodiment, the selection signal SEL is synchronized with the rising edge of the output clock signal CLKOUT. Further, when the selected clock signal SCLK is masked by the mask signal MASK, the mask by the mask signal MASK is released in response to the rising edge of the selected clock signal SCLK. For example, the selection signal SEL may be synchronized with the falling edge of the output clock signal CLKOUT. Further, when the selected clock signal SCLK is masked by the mask signal MASK, the masking by the mask signal MASK may be canceled in response to the falling edge of the selected clock signal SCLK.

・上記第1実施形態では、マスク信号生成回路30内のD−FF31の初期化を初期化信号ISにより行うようにした。これに限らず、例えばD−FF31の初期化を、初期化信号IS及びマスク開始信号MSにより行うようにしてもよい。具体的には、図8に示されるように、検出回路20に、初期化信号ISとXOR回路22の出力信号とが供給されるAND回路24を追加し、そのAND回路24の出力信号をマスク開始信号MSとしてD−FF31のクリア端子CLRに供給するようにしてもよい。この場合には、D−FF31のプリセット端子への初期化信号ISの供給が省略されている。   In the first embodiment, the D-FF 31 in the mask signal generation circuit 30 is initialized by the initialization signal IS. For example, the initialization of the D-FF 31 may be performed by the initialization signal IS and the mask start signal MS. Specifically, as shown in FIG. 8, an AND circuit 24 to which the initialization signal IS and the output signal of the XOR circuit 22 are supplied is added to the detection circuit 20, and the output signal of the AND circuit 24 is masked. The start signal MS may be supplied to the clear terminal CLR of the D-FF 31. In this case, the supply of the initialization signal IS to the preset terminal of the D-FF 31 is omitted.

このような回路では、図9に示す時刻t9において、初期化信号ISがLレベルに立ち下がると、D−FF11,12がクリアされてLレベルの選択信号SELaが出力される一方で、AND回路24からLレベルのマスク開始信号MSが出力される。すると、Lレベルのマスク開始信号MSに応答してHレベルのマスク信号MASKが出力される。すなわち、Lレベルの初期化信号ISがマスク開始信号MSとしてD−FF31に入力されると、D−FF31でHレベルのマスク信号MASKが生成される。そのHレベルのマスク信号MASKにより選択クロック信号SCLKがマスクされてHレベル固定の出力クロック信号CLKOUTが出力される。一方、解除回路60では、上記Lレベルのマスク信号MASKに応じて、選択クロック信号SCLKと同じ論理レベル(時刻t9ではLレベル)のマスク解除信号MRが出力される。その後、選択クロック信号SCLKがHレベルに遷移すると(時刻t10)、マスク解除信号MRがLレベルからHレベルに遷移し、そのマスク解除信号MRの立ち上がりエッジに応答してマスク信号MASKがLレベルに遷移する。これにより、クロック切替回路1の初期化が完了し、選択信号SELaに応じて選択される入力クロック信号CLK1が出力クロック信号CLKOUTとして出力される。このように、図8に示したクロック切替回路1では、選択クロック信号SCLKの立ち上がりエッジに同期して初期化が完了する。   In such a circuit, when the initialization signal IS falls to the L level at time t9 shown in FIG. 9, the D-FFs 11 and 12 are cleared and the L level selection signal SELa is output, while the AND circuit 24 outputs an L level mask start signal MS. Then, an H level mask signal MASK is output in response to the L level mask start signal MS. That is, when the L-level initialization signal IS is input to the D-FF 31 as the mask start signal MS, the D-FF 31 generates an H-level mask signal MASK. The selected clock signal SCLK is masked by the H level mask signal MASK, and the H level fixed output clock signal CLKOUT is output. On the other hand, the cancel circuit 60 outputs a mask cancel signal MR having the same logic level as the selected clock signal SCLK (L level at time t9) in response to the L level mask signal MASK. Thereafter, when the selected clock signal SCLK transits to the H level (time t10), the mask release signal MR transits from the L level to the H level, and the mask signal MASK goes to the L level in response to the rising edge of the mask release signal MR. Transition. Thereby, initialization of the clock switching circuit 1 is completed, and the input clock signal CLK1 selected according to the selection signal SELa is output as the output clock signal CLKOUT. Thus, in the clock switching circuit 1 shown in FIG. 8, the initialization is completed in synchronization with the rising edge of the selected clock signal SCLK.

・あるいは、図10に示されるように、同期化回路10及び解除回路60の内部構成を変更するようにしてもよい。具体的には、図10に示した同期化回路10は、D−FF11,12と、AND回路14,15とを有している。AND回路14は、選択信号SELと初期化信号ISとを論理積演算した結果を持つ信号をD−FF11の入力端子Dに出力する。D−FF11は、AND回路14の出力信号を出力クロック信号CLKOUTの立ち上がりエッジに同期して取り込み、その取り込んだ信号をAND回路15に出力する。AND回路15は、D−FF11の出力信号と初期化信号ISとを論理積演算した結果を持つ信号D−FF12の入力端子Dに出力する。D−FF12は、AND回路15の出力信号を出力クロック信号CLKOUTの立ち上がりエッジに同期して取り込み、その取り込んだ信号を上記選択信号SELaとして出力する。   Alternatively, as shown in FIG. 10, the internal configurations of the synchronization circuit 10 and the release circuit 60 may be changed. Specifically, the synchronization circuit 10 illustrated in FIG. 10 includes D-FFs 11 and 12 and AND circuits 14 and 15. The AND circuit 14 outputs a signal having a result obtained by ANDing the selection signal SEL and the initialization signal IS to the input terminal D of the D-FF 11. The D-FF 11 captures the output signal of the AND circuit 14 in synchronization with the rising edge of the output clock signal CLKOUT, and outputs the captured signal to the AND circuit 15. The AND circuit 15 outputs the output signal of the D-FF 11 and the initialization signal IS to the input terminal D of the signal D-FF 12 having a result of the logical product operation. The D-FF 12 captures the output signal of the AND circuit 15 in synchronization with the rising edge of the output clock signal CLKOUT, and outputs the captured signal as the selection signal SELa.

また、図10に示した解除回路60は、2入力端子を有するAND回路68と、3入力端子を有するOR回路69と、2入力端子を有するOR回路70と、2入力端子を有するAND回路71とを有している。AND回路68には、選択クロック信号SCLKと、マスク信号MASKとが入力される。OR回路69には、マスク信号MASKの反転レベルと、初期化信号ISの反転レベルと、AND回路68の出力信号とが入力される。OR回路70には、初期化信号ISと、選択クロック信号SCLKとが入力される。AND回路71には、OR回路69の出力信号と、OR回路70の出力信号とが入力される。そして、AND回路71からマスク解除信号MRが出力される。   10 includes an AND circuit 68 having two input terminals, an OR circuit 69 having three input terminals, an OR circuit 70 having two input terminals, and an AND circuit 71 having two input terminals. And have. A selection clock signal SCLK and a mask signal MASK are input to the AND circuit 68. The OR circuit 69 receives the inversion level of the mask signal MASK, the inversion level of the initialization signal IS, and the output signal of the AND circuit 68. The OR circuit 70 receives the initialization signal IS and the selected clock signal SCLK. The output signal from the OR circuit 69 and the output signal from the OR circuit 70 are input to the AND circuit 71. Then, a mask release signal MR is output from the AND circuit 71.

次に、図10に示したクロック切替回路1の動作を説明する。なお、ここでは、電源投入時において、D−FF11,12の出力端子Qから出力される信号がLレベル、D−FF31の反転出力端子XQから出力される信号(マスク信号MASK)がLレベルになる場合の動作について説明する。   Next, the operation of the clock switching circuit 1 shown in FIG. 10 will be described. Here, when the power is turned on, the signal output from the output terminal Q of the D-FFs 11 and 12 is L level, and the signal (mask signal MASK) output from the inverted output terminal XQ of the D-FF 31 is L level. The operation in this case will be described.

図11に示す時刻t11の直前、つまり電源投入時においては、D−FF12からLレベルの選択信号SELaが出力され、D−FF31からLレベルのマスク信号MASKが出力されているため、入力クロック信号CLK1が選択クロック信号SCLKとして出力され、入力クロック信号CLK1が出力クロック信号CLKOUTとして出力されている。続いて、時刻t11において初期化信号ISがLレベルに立ち下がると、OR回路69からHレベル固定の出力信号が出力され、OR回路70から選択クロック信号SCLK(ここでは、入力クロック信号CLK1)が出力信号として出力される。このため、AND回路71から入力クロック信号CLK1と同じ論理レベル(時刻t11ではLレベル)のマスク解除信号MRが出力される。その後、出力クロック信号CLKOUT(ここでは、入力クロック信号CLK1)がHレベルに遷移すると(時刻t12)、AND回路14,15から出力されるLレベルの出力信号(Lレベルの初期化信号IS)がD−FF11,12に取り込まれ、D−FF11,12からLレベルの出力信号が出力される。このようにして、Lレベルの初期化信号ISによって選択信号SELaの論理レベルがLレベルに確定される。すなわち、同期化回路10では、Lレベルの初期化信号ISに基づいて選択信号SELaがLレベルに設定される(初期化される)。   Immediately before time t11 shown in FIG. 11, that is, when the power is turned on, the L-level selection signal SELa is output from the D-FF 12, and the L-level mask signal MASK is output from the D-FF 31, so that the input clock signal CLK1 is output as the selected clock signal SCLK, and the input clock signal CLK1 is output as the output clock signal CLKOUT. Subsequently, when the initialization signal IS falls to L level at time t11, an output signal fixed at H level is output from the OR circuit 69, and the selected clock signal SCLK (here, the input clock signal CLK1) is output from the OR circuit 70. Output as an output signal. Therefore, the AND circuit 71 outputs a mask release signal MR having the same logic level as the input clock signal CLK1 (L level at time t11). Thereafter, when the output clock signal CLKOUT (here, the input clock signal CLK1) transitions to the H level (time t12), the L level output signal (L level initialization signal IS) output from the AND circuits 14 and 15 is generated. The signals are taken into the D-FFs 11 and 12 and L-level output signals are output from the D-FFs 11 and 12. In this manner, the logic level of the selection signal SELa is determined to be L level by the L level initialization signal IS. That is, in the synchronization circuit 10, the selection signal SELa is set to L level (initialized) based on the L level initialization signal IS.

また、上述のように入力クロック信号CLK1がHレベルに遷移すると、マスク解除信号MRがLレベルからHレベルに遷移し、そのマスク解除信号MRの立ち上がりエッジに応答して、マスク信号MASKがLレベルに確定される。すなわち、解除回路60では、上記初期化されたLレベルの選択信号SELaに応じて選択された入力クロック信号CLK1のLレベルからHレベルの遷移に応答してマスク解除信号MRが生成される。そして、マスク信号生成回路30では、上記マスク解除信号MRに基づいてマスク信号MASKの生成が停止される。これにより、クロック切替回路1の初期化が完了し、選択信号SELaに応じて選択される入力クロック信号CLK1が出力クロック信号CLKOUTとして出力される。   Further, as described above, when the input clock signal CLK1 transits to the H level, the mask release signal MR transits from the L level to the H level, and in response to the rising edge of the mask release signal MR, the mask signal MASK becomes the L level. To be confirmed. That is, in the release circuit 60, the mask release signal MR is generated in response to the transition from the L level to the H level of the input clock signal CLK1 selected according to the initialized L level selection signal SELa. The mask signal generation circuit 30 stops generating the mask signal MASK based on the mask release signal MR. Thereby, initialization of the clock switching circuit 1 is completed, and the input clock signal CLK1 selected according to the selection signal SELa is output as the output clock signal CLKOUT.

このように、図10に示したクロック切替回路1では、出力クロック信号CLKOUTの立ち上がりエッジに同期して初期化が完了する。したがって、この変形例における初期化信号ISは、Lレベルに立ち下がった後、出力クロック信号CLKOUTがLレベルからHレベルに遷移するまではLレベルを維持する必要がある。このため、例えば入力クロック信号CLK1,CLK2のいずれか一方の信号が出力クロック信号CLKOUTとして出力されている定常動作状態において、ノイズ等に起因して初期化信号ISがLレベルに短時間だけ遷移しても、そのLレベルの初期化信号ISに応じてD−FF11,12,31がクリアされることを抑制することができる。具体的には、例えば時刻t13において、初期化信号ISがノイズ等に起因してLレベルに遷移した場合であっても、初期化信号ISがLレベルの期間に出力クロック信号CLKOUTのHレベルへの遷移が発生しない限り、選択信号SELaの論理レベルが意図せずに遷移することはない。このため、マスク開始信号MSがLレベルに立ち下がることを抑制でき、D−FF31がクリアされることを抑制することができる。すなわち、意図せずにHレベルのマスク信号MASKが生成されることを抑制することができる。このように、図10に示したクロック切替回路1ではノイズ耐性を高めることができる。   Thus, in the clock switching circuit 1 shown in FIG. 10, the initialization is completed in synchronization with the rising edge of the output clock signal CLKOUT. Therefore, after the initialization signal IS in this modification falls to the L level, it is necessary to maintain the L level until the output clock signal CLKOUT changes from the L level to the H level. Therefore, for example, in a steady operation state in which one of the input clock signals CLK1 and CLK2 is output as the output clock signal CLKOUT, the initialization signal IS transits to the L level for a short time due to noise or the like. However, it is possible to prevent the D-FFs 11, 12, and 31 from being cleared according to the L level initialization signal IS. Specifically, for example, at time t13, even when the initialization signal IS transitions to the L level due to noise or the like, the output clock signal CLKOUT is set to the H level during the period when the initialization signal IS is at the L level. As long as this transition does not occur, the logic level of the selection signal SELa does not transition unintentionally. For this reason, it can suppress that the mask start signal MS falls to L level, and can suppress that D-FF31 is cleared. That is, unintentional generation of an H level mask signal MASK can be suppressed. As described above, the clock switching circuit 1 shown in FIG. 10 can improve noise tolerance.

なお、初期化信号ISがLレベルの期間は選択クロック信号SCLKと同じ論理レベルのマスク解除信号MRが出力され、初期化信号ISがHレベルの期間はOR回路70からHレベル固定の出力信号が出力される。   Note that the mask release signal MR having the same logic level as that of the selected clock signal SCLK is output while the initialization signal IS is at the L level. Is output.

・上記第1実施形態のクロック選択回路40では、選択信号SELaに応じて入力クロック信号CLK1,CLK2のいずれか一方の信号を選択した後に、その選択後の選択クロック信号SCLKに対してマスク信号MASKでマスクするようにした。これに限らず、例えば入力クロック信号CLK1,CLK2の各々に対してマスク信号MASKでマスクした後に、選択信号SELaに応じて1つのクロック信号を選択するようにしてもよい。この場合のクロック切替回路1の回路例を図12に示している。クロック選択回路40は、OR回路47,48とセレクタ49とを有している。OR回路47には入力クロック信号CLK1とマスク信号MASKとが入力され、OR回路48には入力クロック信号CLK2とマスク信号MASKとが入力される。これらOR回路47,48は、マスク信号MASKがLレベルのときに、入力クロック信号CLK1,CLK2をそれぞれ出力信号としてセレクタ49に出力する。また、OR回路47,48は、マスク信号MASKがHレベルのときに、Hレベル固定の出力信号をそれぞれセレクタ49に出力する。セレクタ49は、Lレベルの選択信号SELaに応じてOR回路47の出力信号を出力クロック信号CLKOUTとして出力し、Hレベルの選択信号SELaに応じてOR回路48の出力信号を出力クロック信号CLKOUTとして出力する。このように、クロック選択回路40は、マスク信号MASK及び選択信号SELaに応じて、入力クロック信号CLK1,CLK2又は所定レベル(Hレベル)に固定された信号を出力クロック信号CLKOUTとして出力する。   In the clock selection circuit 40 according to the first embodiment, after selecting either one of the input clock signals CLK1 and CLK2 according to the selection signal SELa, the mask signal MASK with respect to the selected clock signal SCLK after the selection. It was made to mask with. For example, after masking each of the input clock signals CLK1 and CLK2 with the mask signal MASK, one clock signal may be selected according to the selection signal SELa. A circuit example of the clock switching circuit 1 in this case is shown in FIG. The clock selection circuit 40 includes OR circuits 47 and 48 and a selector 49. The OR circuit 47 receives the input clock signal CLK1 and the mask signal MASK, and the OR circuit 48 receives the input clock signal CLK2 and the mask signal MASK. These OR circuits 47 and 48 output the input clock signals CLK1 and CLK2 to the selector 49 as output signals, respectively, when the mask signal MASK is at L level. Further, the OR circuits 47 and 48 each output an output signal fixed at H level to the selector 49 when the mask signal MASK is at H level. The selector 49 outputs the output signal of the OR circuit 47 as the output clock signal CLKOUT according to the L level selection signal SELa, and outputs the output signal of the OR circuit 48 as the output clock signal CLKOUT according to the H level selection signal SELa. To do. As described above, the clock selection circuit 40 outputs the input clock signals CLK1 and CLK2 or a signal fixed to a predetermined level (H level) as the output clock signal CLKOUT in accordance with the mask signal MASK and the selection signal SELa.

また、この場合の解除回路60は、NAND回路72,73とセレクタ74とを有している。NAND回路72にはマスク信号MASKと入力クロック信号CLK1の反転レベルとが入力され、NAND回路73にはマスク信号MASKと入力クロック信号CLK2の反転レベルとが入力される。これらNAND回路72,73は、マスク信号MASKがLレベルのときに、Hレベル固定の出力信号をそれぞれセレクタ74に出力する。また、NAND回路72,73は、マスク信号MASKがHレベルのときに、入力クロック信号CLK1,CLK2をそれぞれ出力信号としてセレクタ74に出力する。セレクタ74は、Lレベルの選択信号SELaに応じてNAND回路72の出力信号をマスク解除信号MRとして出力し、Hレベルの選択信号SELaに応じてNAND回路73の出力信号をマスク解除信号MRとして出力する。このような解除回路60では、マスク信号MASKがHレベルであって選択信号SELaがLレベルであるときに、その選択信号SELaに応じて選択される入力クロック信号CLK1がLレベルからHレベルに遷移すると、セレクタ74から出力されるマスク解除信号MRがLレベルからHレベルに遷移する。すると、そのマスク解除信号MRの立ち上がりエッジに応答してマスク信号MASKがLレベルに遷移する。このように、解除回路60では、マスク信号MASKがHレベルであるときに、選択信号SELaにより選択される入力クロック信号のLレベルからHレベルへの遷移に応答して、マスク信号MASKの生成を停止するマスク解除信号MRが生成される。   In this case, the release circuit 60 includes NAND circuits 72 and 73 and a selector 74. The NAND circuit 72 receives the mask signal MASK and the inverted level of the input clock signal CLK1, and the NAND circuit 73 receives the mask signal MASK and the inverted level of the input clock signal CLK2. These NAND circuits 72 and 73 output an H level fixed output signal to the selector 74 when the mask signal MASK is at the L level. The NAND circuits 72 and 73 output the input clock signals CLK1 and CLK2 as output signals to the selector 74 when the mask signal MASK is at the H level. The selector 74 outputs the output signal of the NAND circuit 72 as a mask release signal MR according to the L level selection signal SELa, and outputs the output signal of the NAND circuit 73 as a mask release signal MR according to the H level selection signal SELa. To do. In such a release circuit 60, when the mask signal MASK is at the H level and the selection signal SELa is at the L level, the input clock signal CLK1 selected according to the selection signal SELa changes from the L level to the H level. Then, the mask release signal MR output from the selector 74 changes from L level to H level. Then, in response to the rising edge of the mask release signal MR, the mask signal MASK transitions to the L level. As described above, the cancel circuit 60 generates the mask signal MASK in response to the transition from the L level to the H level of the input clock signal selected by the selection signal SELa when the mask signal MASK is at the H level. A mask release signal MR to be stopped is generated.

・上記第1実施形態のクロック選択回路40では、選択信号SELaに応じて入力クロック信号CLK1,CLK2のいずれか一方の信号を選択した後に、その選択後の選択クロック信号SCLKに対してマスク信号MASKでマスクするようにした。これに限らず、例えば選択信号SELaによる選択とマスク信号MASKによるマスクとを共通の回路で行うようにしてもよい。この場合のクロック切替回路1の回路例を図13に示している。クロック選択回路40は、インバータ回路50と、3入力端子を有するOR回路51,52と、AND回路53とを有している。OR回路51には、入力クロック信号CLK1と、選択信号SELaと、マスク信号MASKとが入力される。OR回路52には、入力クロック信号CLK2と、選択信号SELaがインバータ回路50により論理反転された信号と、マスク信号MASKとが入力される。AND回路53は、OR回路51の出力信号とOR回路52の出力信号とを論理積演算した結果を持つ信号を上記出力クロック信号CLKOUTとして出力する。このようなクロック選択回路40では、例えばマスク信号MASKがLレベルであって選択信号SELaがLレベルである場合に、OR回路51から入力クロック信号CLK1が出力され、OR回路52からHレベル固定の出力信号が出力される。このため、この場合のAND回路53は、OR回路51の出力信号、つまり入力クロック信号CLK1を出力クロック信号CLKOUTとして出力する。一方、例えばマスク信号MASKがHレベルである場合には、OR回路51,52の双方からHレベル固定の出力信号が出力されるため、AND回路53からはHレベル固定の出力クロック信号CLKOUTが出力される。このように、クロック選択回路40は、マスク信号MASK及び選択信号SELaに応じて、入力クロック信号CLK1,CLK2又はHレベルに固定された信号を出力クロック信号CLKOUTとして出力する。   In the clock selection circuit 40 according to the first embodiment, after selecting either one of the input clock signals CLK1 and CLK2 according to the selection signal SELa, the mask signal MASK with respect to the selected clock signal SCLK after the selection. It was made to mask with. For example, the selection by the selection signal SELa and the masking by the mask signal MASK may be performed by a common circuit. A circuit example of the clock switching circuit 1 in this case is shown in FIG. The clock selection circuit 40 includes an inverter circuit 50, OR circuits 51 and 52 having three input terminals, and an AND circuit 53. An input clock signal CLK1, a selection signal SELa, and a mask signal MASK are input to the OR circuit 51. An input clock signal CLK2, a signal obtained by logically inverting the selection signal SELa by the inverter circuit 50, and a mask signal MASK are input to the OR circuit 52. The AND circuit 53 outputs a signal having a result obtained by performing an AND operation on the output signal of the OR circuit 51 and the output signal of the OR circuit 52 as the output clock signal CLKOUT. In such a clock selection circuit 40, for example, when the mask signal MASK is at the L level and the selection signal SELa is at the L level, the input clock signal CLK1 is output from the OR circuit 51, and the OR circuit 52 is fixed at the H level. An output signal is output. Therefore, the AND circuit 53 in this case outputs the output signal of the OR circuit 51, that is, the input clock signal CLK1 as the output clock signal CLKOUT. On the other hand, for example, when the mask signal MASK is at the H level, both the OR circuits 51 and 52 output the H level fixed output signal, so that the AND circuit 53 outputs the H level fixed output clock signal CLKOUT. Is done. As described above, the clock selection circuit 40 outputs the input clock signal CLK1, CLK2 or a signal fixed to the H level as the output clock signal CLKOUT in accordance with the mask signal MASK and the selection signal SELa.

また、この場合の解除回路60は、インバータ回路75,76,77と、3入力端子を有するOR回路78,79と、AND回路80とを有している。OR回路78には、入力クロック信号CLK1と、選択信号SELaと、マスク信号MASKがインバータ回路75により論理反転された信号とが入力される。OR回路79には、入力クロック信号CLK2と、選択信号SELaがインバータ回路76により論理反転された信号と、マスク信号MASKがインバータ回路77により論理反転された信号とが入力される。AND回路80は、OR回路78の出力信号とOR回路79の出力信号とを論理積演算した結果を持つ上記マスク解除信号MRを出力する。このような解除回路60では、例えばマスク信号MASKがHレベルであって選択信号SELaがLレベルである場合に、OR回路78から入力クロック信号CLK1が出力され、OR回路79からHレベル固定の出力信号が出力される。このため、この場合のAND回路80は、OR回路78の出力信号、つまり入力クロック信号CLK1をマスク解除信号MRとして出力する。したがって、入力クロック信号CLK1がLレベルからHレベルに遷移すると、マスク解除信号MRもLレベルからHレベルに遷移する。すると、そのマスク解除信号MRの立ち上がりエッジに応答してマスク信号MASKの生成が停止される。一方、例えばマスク信号MASKがLレベルである場合には、OR回路78,79の双方からHレベル固定の出力信号が出力されるため、AND回路80からはHレベル固定のマスク解除信号MRが出力される。   The release circuit 60 in this case includes inverter circuits 75, 76, 77, OR circuits 78, 79 having three input terminals, and an AND circuit 80. The OR circuit 78 receives the input clock signal CLK1, the selection signal SELa, and a signal obtained by logically inverting the mask signal MASK by the inverter circuit 75. The OR circuit 79 receives an input clock signal CLK2, a signal obtained by logically inverting the selection signal SELa by the inverter circuit 76, and a signal obtained by logically inverting the mask signal MASK by the inverter circuit 77. The AND circuit 80 outputs the mask release signal MR having a result obtained by performing an AND operation on the output signal of the OR circuit 78 and the output signal of the OR circuit 79. In such a release circuit 60, for example, when the mask signal MASK is at the H level and the selection signal SELa is at the L level, the input clock signal CLK1 is output from the OR circuit 78, and the OR circuit 79 outputs a fixed H level. A signal is output. Therefore, the AND circuit 80 in this case outputs the output signal of the OR circuit 78, that is, the input clock signal CLK1 as the mask release signal MR. Therefore, when the input clock signal CLK1 transits from L level to H level, the mask release signal MR also transits from L level to H level. Then, the generation of the mask signal MASK is stopped in response to the rising edge of the mask release signal MR. On the other hand, for example, when the mask signal MASK is at the L level, an output signal fixed at the H level is output from both the OR circuits 78 and 79, so that the AND circuit 80 outputs a mask release signal MR at the H level fixed. Is done.

・上記第1実施形態及び上記各変形例を適宜組み合わせるようにしてもよい。例えば図8に示したクロック切替回路1において、その図8に示したクロック選択回路40及び解除回路60を、図12に示したクロック選択回路40及び解除回路60に変更するようにしてもよい。   -You may make it combine the said 1st Embodiment and each said modification suitably. For example, in the clock switching circuit 1 shown in FIG. 8, the clock selection circuit 40 and the release circuit 60 shown in FIG. 8 may be changed to the clock selection circuit 40 and the release circuit 60 shown in FIG.

(第2実施形態)
以下、第2実施形態を図14及び図15に従って説明する。この実施形態のクロック切替回路1Aは、選択対象の入力クロック信号が2個から8個に増加している点が上記第1実施形態と異なっている。以下、第1実施形態との相違点を中心に説明する。
(Second Embodiment)
Hereinafter, the second embodiment will be described with reference to FIGS. 14 and 15. The clock switching circuit 1A of this embodiment is different from the first embodiment in that the number of input clock signals to be selected is increased from two to eight. Hereinafter, the difference from the first embodiment will be mainly described.

図14に示すように、クロック切替回路1Aは、同期化回路10Aと、検出回路20Aと、マスク信号生成回路30と、クロック選択回路40Aと、解除回路60とを有している。   As illustrated in FIG. 14, the clock switching circuit 1A includes a synchronization circuit 10A, a detection circuit 20A, a mask signal generation circuit 30, a clock selection circuit 40A, and a release circuit 60.

同期化回路10Aは、D−FF11,12を含むFF群13A〜13Cを有している。FF群13A〜13Cには、8つの入力クロック信号CLK1〜CLK8の中から1つの入力クロック信号を選択するために必要な3ビットの選択信号SEL1〜SEL3がそれぞれ供給される。ここで、同期化回路10A内のFF群は、選択対象の入力クロック信号の数をNとしたときに、logN(小数点以下切り上げ)個、ここではlog8=log=3個設けられている。 The synchronization circuit 10 </ b> A includes FF groups 13 </ b> A to 13 </ b> C including D-FFs 11 and 12. The FF groups 13A to 13C are respectively supplied with 3-bit selection signals SEL1 to SEL3 necessary for selecting one input clock signal from the eight input clock signals CLK1 to CLK8. Here, when the number of input clock signals to be selected is N, the FF group in the synchronization circuit 10A is log 2 N (rounded up after the decimal point), here log 2 8 = log 2 2 3 = 3. One is provided.

FF群13Aは、選択信号SEL1を出力クロック信号CLKOUTの立ち上がりエッジで同期化し、その同期化後の選択信号SEL1aを検出回路20A及びクロック選択回路40Aに出力する。FF群13Bは、選択信号SEL2を出力クロック信号CLKOUTの立ち上がりエッジで同期化し、その同期化後の選択信号SEL2aを検出回路20A及びクロック選択回路40Aに出力する。FF群13Cは、選択信号SEL3を出力クロック信号CLKOUTの立ち上がりエッジで同期化し、その同期化後の選択信号SEL3aを検出回路20A及びクロック選択回路40Aに出力する。   The FF group 13A synchronizes the selection signal SEL1 at the rising edge of the output clock signal CLKOUT, and outputs the synchronized selection signal SEL1a to the detection circuit 20A and the clock selection circuit 40A. The FF group 13B synchronizes the selection signal SEL2 with the rising edge of the output clock signal CLKOUT, and outputs the synchronized selection signal SEL2a to the detection circuit 20A and the clock selection circuit 40A. The FF group 13C synchronizes the selection signal SEL3 at the rising edge of the output clock signal CLKOUT, and outputs the synchronized selection signal SEL3a to the detection circuit 20A and the clock selection circuit 40A.

検出回路20Aは、インバータ回路21及びXOR回路22を含む検出部23A〜23Cと、AND回路25とを有している。検出部23A〜23Cには、選択信号SEL1a〜SEL3aがそれぞれ供給される。ここで、検出回路20A内の検出部は、選択対象の入力クロック信号の数をNとしたときに、logN(小数点以下切り上げ)個、ここではlog8=3個設けられている。 The detection circuit 20 </ b> A includes detection units 23 </ b> A to 23 </ b> C including an inverter circuit 21 and an XOR circuit 22, and an AND circuit 25. Selection signals SEL1a to SEL3a are supplied to the detectors 23A to 23C, respectively. Here, when the number of input clock signals to be selected is N, the number of detection units in the detection circuit 20A is log 2 N (rounded up after the decimal point), here, log 2 8 = 3.

検出部23Aは、選択信号SEL1aの信号レベルの変化を検出したときにXOR回路22からLレベルの出力信号を出力する。検出部23Bは、選択信号SEL2aの信号レベルの変化を検出したときにXOR回路22からLレベルの出力信号を出力する。検出部23Cは、選択信号SEL3aの信号レベルの変化を検出したときにXOR回路22からLレベルの出力信号を出力する。そして、AND回路25は、検出部23A〜23C内のXOR回路22、つまり3つのXOR回路22の出力信号を論理積演算した結果を持つマスク開始信号MSを生成する。すなわち、AND回路25は、検出部23A〜23Cにおいて選択信号SEL1a〜SEL3aのいずれか1つの選択信号の信号レベルの変化が検出されたときに、Lレベルのマスク開始信号MSを生成する。このマスク開始信号MSは、マスク信号生成回路30内のD−FF31のクリア端子に供給される。   The detection unit 23A outputs an L level output signal from the XOR circuit 22 when detecting a change in the signal level of the selection signal SEL1a. The detection unit 23B outputs an L level output signal from the XOR circuit 22 when detecting a change in the signal level of the selection signal SEL2a. The detection unit 23C outputs an L level output signal from the XOR circuit 22 when detecting a change in the signal level of the selection signal SEL3a. The AND circuit 25 generates a mask start signal MS having a result obtained by performing an AND operation on the output signals of the XOR circuits 22 in the detection units 23A to 23C, that is, the three XOR circuits 22. That is, the AND circuit 25 generates an L-level mask start signal MS when a change in the signal level of any one of the selection signals SEL1a to SEL3a is detected in the detection units 23A to 23C. The mask start signal MS is supplied to the clear terminal of the D-FF 31 in the mask signal generation circuit 30.

クロック選択回路40Aは、セレクタ41Aと、OR回路42とを有している。セレクタ41Aは、選択信号SEL1a〜SEL3aに応じて、入力クロック信号CLK1〜CLK8のいずれか1つの入力クロック信号を選択し、その選択した入力クロック信号を選択クロック信号SCLKとして出力する。例えば選択信号SEL1a〜SEL3aが全てLレベルのときに入力クロック信号CLK1が選択クロック信号SCLKとして出力され、選択信号SEL1a〜SEL3aが全てHレベルのときに入力クロック信号CLK8が選択クロック信号SCLKとして出力される。この選択クロック信号SCLKは、OR回路42に供給されるとともに、解除回路60内のNAND回路61に供給される。   The clock selection circuit 40A includes a selector 41A and an OR circuit 42. The selector 41A selects any one of the input clock signals CLK1 to CLK8 according to the selection signals SEL1a to SEL3a, and outputs the selected input clock signal as the selected clock signal SCLK. For example, when all the selection signals SEL1a to SEL3a are at the L level, the input clock signal CLK1 is output as the selection clock signal SCLK, and when all the selection signals SEL1a to SEL3a are at the H level, the input clock signal CLK8 is output as the selection clock signal SCLK. The This selected clock signal SCLK is supplied to the OR circuit 42 and also to the NAND circuit 61 in the release circuit 60.

次に、上記クロック切替回路1Aの動作を図15に従って説明する。ここでは、入力クロック信号CLK2から入力クロック信号CLK8に切り替える動作について説明する。
時刻t14の直前においては、選択信号SEL1aがHレベル、選択信号SEL2aがLレベル、選択信号SEL3aがLレベルであり、これら選択信号SEL1a〜SEL3aに応じて入力クロック信号CLK2が出力クロック信号CLKOUTとして出力されている。その後、時刻t14において、入力クロック信号CLK2から入力クロック信号CLK8に切り替えるために選択信号SEL2a,SEL3aがLレベルからHレベルに遷移される。すると、それら選択信号SEL2a,SEL3aが出力クロック信号CLKOUT(ここでは、入力クロック信号CLK2)で同期化され、出力クロック信号CLKOUTの立ち上がりエッジに同期してHレベルの選択信号SEL2a,SEL3aが出力される(時刻t15)。
Next, the operation of the clock switching circuit 1A will be described with reference to FIG. Here, an operation of switching from the input clock signal CLK2 to the input clock signal CLK8 will be described.
Immediately before time t14, the selection signal SEL1a is at the H level, the selection signal SEL2a is at the L level, and the selection signal SEL3a is at the L level, and the input clock signal CLK2 is output as the output clock signal CLKOUT in accordance with these selection signals SEL1a to SEL3a Has been. Thereafter, at time t14, the selection signals SEL2a and SEL3a are changed from the L level to the H level in order to switch from the input clock signal CLK2 to the input clock signal CLK8. Then, the selection signals SEL2a and SEL3a are synchronized with the output clock signal CLKOUT (here, the input clock signal CLK2), and the H-level selection signals SEL2a and SEL3a are output in synchronization with the rising edge of the output clock signal CLKOUT. (Time t15).

これら選択信号SEL2a,SEL3aがLレベルからHレベルに遷移すると、その遷移(変化)に応答して検出部23B,23CからLレベルの出力信号が所定期間だけ出力され、AND回路25からLレベルのマスク開始信号MSが所定期間だけ出力される。このLレベルのマスク開始信号MSに応答してD−FF31からHレベルのマスク信号MASKが出力される。   When these selection signals SEL2a and SEL3a transition from the L level to the H level, in response to the transition (change), an L level output signal is output from the detection units 23B and 23C for a predetermined period, and the AND circuit 25 outputs the L level signal. The mask start signal MS is output for a predetermined period. In response to the L level mask start signal MS, the D-FF 31 outputs an H level mask signal MASK.

一方、クロック選択回路40では、上記遷移後の選択信号SEL1a〜SEL3aに応じて入力クロック信号CLK8がセレクタ41で選択され、その入力クロック信号CLK8が選択クロック信号SCLKとして出力される。すなわち、セレクタ41では、Hレベルの選択信号SEL1a〜SEL3aに応じて、入力クロック信号CLK2から入力クロック信号CLK8への切り替えが行われる。但し、このときのOR回路42には上記Hレベルのマスク信号MASKが入力されるため、そのマスク信号MASKにより選択クロック信号SCLKがマスクされ、出力クロック信号CLKOUTがHレベルに固定される。   On the other hand, in the clock selection circuit 40, the input clock signal CLK8 is selected by the selector 41 in accordance with the selection signals SEL1a to SEL3a after the transition, and the input clock signal CLK8 is output as the selection clock signal SCLK. In other words, the selector 41 switches from the input clock signal CLK2 to the input clock signal CLK8 in accordance with the H level selection signals SEL1a to SEL3a. However, since the H level mask signal MASK is input to the OR circuit 42 at this time, the selection clock signal SCLK is masked by the mask signal MASK, and the output clock signal CLKOUT is fixed to the H level.

また、上記時刻t15において、上記Hレベルのマスク信号MASK及びLレベルの選択クロック信号SCLKに応じてマスク解除信号MRがLレベルに遷移する。その後、選択クロック信号SCLK(ここでは、入力クロック信号CLK8)がHレベルに遷移すると(時刻t16)、マスク解除信号MRがHレベルに立ち上がる。このマスク解除信号MRの立ち上がりエッジに応答してマスク信号MASKがHレベルからLレベルに遷移する。すると、選択クロック信号SCLKに対するマスクが解除されるため、その選択クロック信号SCLK(ここでは、クロック切替後の入力クロック信号CLK8)が出力クロック信号CLKOUTとして出力される。このようにして、入力クロック信号CLK2から入力クロック信号CLK8への切り替えが完了する。   At time t15, the mask release signal MR transits to L level in response to the H level mask signal MASK and the L level selected clock signal SCLK. Thereafter, when the selected clock signal SCLK (here, the input clock signal CLK8) transitions to the H level (time t16), the mask release signal MR rises to the H level. In response to the rising edge of the mask release signal MR, the mask signal MASK changes from the H level to the L level. Then, since the mask for the selected clock signal SCLK is released, the selected clock signal SCLK (here, the input clock signal CLK8 after the clock switching) is output as the output clock signal CLKOUT. In this way, switching from the input clock signal CLK2 to the input clock signal CLK8 is completed.

以上説明した本実施形態によれば、上記第1実施形態と同様の効果を奏する。
(第2実施形態の変形例)
・上記第2実施形態のクロック切替回路1Aにおける各回路10A,20A,30,40A,60を、上記第1実施形態の変形例と同様に変更するようにしてもよい。
According to this embodiment described above, the same effects as those of the first embodiment can be obtained.
(Modification of the second embodiment)
The circuits 10A, 20A, 30, 40A, and 60 in the clock switching circuit 1A of the second embodiment may be changed in the same manner as the modification of the first embodiment.

・上記第2実施形態における解除回路60の内部構成例は特に限定されない。例えばNAND回路61の前段に、マスク信号MASKを所定時間だけ遅延させる遅延回路を設けるようにしてもよい。これにより、マスク信号MASKがHレベルに遷移されてから所定時間経過後にNAND回路61から選択クロック信号SCLKが出力クロック信号CLKOUTとして出力される。このため、クロック選択回路40A内のセレクタ41Aによるクロック切替が終了する前に、NAND回路61から選択クロック信号SCLK(クロック切替前の入力クロック信号)が出力クロック信号CLKOUTとして出力されることを好適に抑制することができる。   -The internal configuration example of the release circuit 60 in the second embodiment is not particularly limited. For example, a delay circuit that delays the mask signal MASK by a predetermined time may be provided before the NAND circuit 61. As a result, the NAND circuit 61 outputs the selected clock signal SCLK as the output clock signal CLKOUT after a predetermined time has elapsed since the mask signal MASK was changed to the H level. Therefore, it is preferable that the selection clock signal SCLK (input clock signal before clock switching) is output from the NAND circuit 61 as the output clock signal CLKOUT before the clock switching by the selector 41A in the clock selection circuit 40A is completed. Can be suppressed.

・上記第2実施形態における検出回路20の内部構成例は特に限定されない。例えばAND回路25から出力されるマスク開始信号MSを所定時間だけ遅延させた信号をAND回路25に出力する遅延回路を設けるようにしてもよい。これにより、マスク開始信号MSがLレベルに遷移された後、所定時間だけLレベルのマスク開始信号MSの出力を維持することができる。   -The internal configuration example of the detection circuit 20 in the second embodiment is not particularly limited. For example, a delay circuit that outputs a signal obtained by delaying the mask start signal MS output from the AND circuit 25 by a predetermined time to the AND circuit 25 may be provided. Thereby, after the mask start signal MS is transited to the L level, the output of the L level mask start signal MS can be maintained for a predetermined time.

(他の実施形態)
なお、上記各実施形態は、これを適宜変更した以下の態様にて実施することもできる。
・上記各実施形態では、非同期クロックである入力クロック信号CLK1,CLK2(又は、第2実施形態の入力クロック信号CLK1〜CLK8)を切り替えるクロック切替回路に具体化したが、非同期クロックの関係にない複数の入力クロック信号を切り替えるクロック切替回路に具体化してもよい。例えば、入力クロック信号CLK1と、その入力クロック信号CLK1を分周して生成した入力クロック信号CLK2とを切り替えるクロック切替回路に具体化してもよい。
(Other embodiments)
In addition, each said embodiment can also be implemented in the following aspects which changed this suitably.
In each of the above embodiments, the clock switching circuit that switches the input clock signals CLK1 and CLK2 (or the input clock signals CLK1 to CLK8 of the second embodiment) that are asynchronous clocks is embodied. The clock switching circuit for switching the input clock signal may be embodied. For example, the present invention may be embodied in a clock switching circuit that switches between the input clock signal CLK1 and the input clock signal CLK2 generated by dividing the input clock signal CLK1.

・上記各実施形態では、入力クロック信号CLK1,CLK2に対して非同期信号である選択信号SELに応じて入力クロック信号CLK1,CLK2を切り替えるようにした。また、入力クロック信号CLK1〜CLK8に対して非同期信号である選択信号SEL1〜SEL3に応じて入力クロック信号CLK1〜CLK8を切り替えるようにした。これに限らず、例えば入力クロック信号CLK1〜CLK8の少なくとも1つの入力クロック信号に同期した選択信号に応じて入力クロック信号CLK1〜CLK8を切り替えるようにしてもよい。   In the above embodiments, the input clock signals CLK1 and CLK2 are switched according to the selection signal SEL that is an asynchronous signal with respect to the input clock signals CLK1 and CLK2. Further, the input clock signals CLK1 to CLK8 are switched according to the selection signals SEL1 to SEL3 which are asynchronous signals with respect to the input clock signals CLK1 to CLK8. For example, the input clock signals CLK1 to CLK8 may be switched according to a selection signal synchronized with at least one of the input clock signals CLK1 to CLK8.

1,1A クロック切替回路
10,10A 同期化回路
20,20A 検出回路
21 インバータ回路
22 XOR回路(第1論理回路)
30 マスク信号生成回路
40,40A クロック選択回路
41,41A セレクタ(選択回路)
42 OR回路(第2論理回路)
60 解除回路
CLK1〜CLK8 入力クロック信号
CLKOUT 出力クロック信号
SEL,SEL1,SEL2,SEL3 選択信号
SELa,SEL1a,SEL2a,SEL3a 選択信号(同期化後の選択信号)
MASK マスク信号
MS マスク開始信号
MR マスク解除信号
IS 初期化信号
SCLK 選択クロック信号
1, 1A clock switching circuit 10, 10A synchronization circuit 20, 20A detection circuit 21 inverter circuit 22 XOR circuit (first logic circuit)
30 mask signal generation circuit 40, 40A clock selection circuit 41, 41A selector (selection circuit)
42 OR circuit (second logic circuit)
60 Release circuit CLK1 to CLK8 Input clock signal CLKOUT Output clock signal SEL, SEL1, SEL2, SEL3 selection signal SELa, SEL1a, SEL2a, SEL3a selection signal (selection signal after synchronization)
MASK mask signal MS mask start signal MR mask release signal IS initialization signal SCLK selection clock signal

Claims (9)

選択信号に応じて、複数の入力クロック信号の中からいずれか1つの入力クロック信号を選択して出力クロック信号として出力するクロック切替回路であって、
前記選択信号を前記出力クロック信号に基づいて同期化する同期化回路と、
前記同期化後の選択信号の信号レベルの変化を検出したときにマスク開始信号を生成する検出回路と、
前記マスク開始信号に基づいて、前記複数の入力クロック信号を所定レベルでマスクするマスク信号を生成するマスク信号生成回路と、
前記同期化後の選択信号及び前記マスク信号に基づいて、前記複数の入力クロック信号の中から選択される1つの入力クロック信号又は前記所定レベルに固定された信号を前記出力クロック信号として出力するクロック選択回路と、
前記同期化後の選択信号により選択される入力クロック信号の前記所定レベルへの遷移を検出したときにマスク解除信号を生成する解除回路と、を有し、
前記マスク信号生成回路は、前記マスク解除信号に基づいて前記マスク信号の生成を停止することを特徴とするクロック切替回路。
A clock switching circuit that selects any one input clock signal from a plurality of input clock signals according to a selection signal and outputs the selected clock signal as an output clock signal;
A synchronization circuit for synchronizing the selection signal based on the output clock signal;
A detection circuit that generates a mask start signal when a change in signal level of the selection signal after synchronization is detected;
A mask signal generation circuit for generating a mask signal for masking the plurality of input clock signals at a predetermined level based on the mask start signal;
A clock that outputs one input clock signal selected from the plurality of input clock signals or a signal fixed at the predetermined level as the output clock signal based on the selection signal after synchronization and the mask signal A selection circuit;
A release circuit that generates a mask release signal when a transition to the predetermined level of the input clock signal selected by the selection signal after synchronization is detected, and
The clock switching circuit, wherein the mask signal generation circuit stops generating the mask signal based on the mask release signal.
前記同期化回路は、前記出力クロック信号の第1レベルから第2レベルへの遷移に応答して前記選択信号を同期化し、
前記解除回路は、前記所定レベルが前記第2レベルであるときに、前記同期化後の選択信号により選択される入力クロック信号の前記第1レベルから前記第2レベルへの遷移に応答して前記マスク解除信号を生成することを特徴とする請求項1に記載のクロック切替回路。
The synchronization circuit synchronizes the selection signal in response to a transition of the output clock signal from a first level to a second level;
The release circuit responds to a transition from the first level to the second level of an input clock signal selected by the selection signal after synchronization when the predetermined level is the second level. 2. The clock switching circuit according to claim 1, wherein a mask release signal is generated.
前記同期化回路は、初期化信号により初期化され、所定のレベルに設定された信号を前記同期化後の選択信号として生成し、
前記マスク信号生成回路は、前記初期化信号により初期化され、前記マスク信号の生成を停止すること特徴とする請求項1又は2に記載のクロック切替回路。
The synchronization circuit is initialized by an initialization signal and generates a signal set to a predetermined level as the selection signal after the synchronization,
3. The clock switching circuit according to claim 1, wherein the mask signal generation circuit is initialized by the initialization signal and stops generating the mask signal.
前記マスク信号生成回路は、前記初期化信号を前記マスク開始信号として入力したときに前記マスク信号を生成し、前記マスク解除信号に基づいて前記マスク信号の生成を停止し、前記初期化を完了することを特徴とする請求項3に記載のクロック切替回路。   The mask signal generation circuit generates the mask signal when the initialization signal is input as the mask start signal, stops generating the mask signal based on the mask release signal, and completes the initialization. The clock switching circuit according to claim 3. 前記解除回路は、前記初期化信号に基づいて、前記初期化により生成される前記同期化後の選択信号に応じて選択される入力クロック信号の前記所定レベルへの遷移を検出したときに前記マスク解除信号を生成し、
前記マスク信号生成回路は、前記初期化信号に基づき生成された前記マスク解除信号に基づいて前記マスク信号の生成を停止し、前記初期化を完了することを特徴とする請求項3に記載のクロック切替回路。
The cancellation circuit detects the transition of the input clock signal selected according to the synchronized selection signal generated by the initialization based on the initialization signal when the transition to the predetermined level is detected. Generate a release signal,
The clock signal generation circuit according to claim 3, wherein the mask signal generation circuit stops generation of the mask signal based on the mask release signal generated based on the initialization signal and completes the initialization. Switching circuit.
前記同期化回路は、前記選択信号を前記出力クロック信号に従って取り込む複数段のフリップフロップ回路を有することを特徴とする請求項1〜5のいずれか1つに記載のクロック切替回路。   6. The clock switching circuit according to claim 1, wherein the synchronization circuit includes a plurality of stages of flip-flop circuits that take in the selection signal in accordance with the output clock signal. 前記検出回路は、前記同期化後の選択信号を論理反転させた信号を生成する奇数段のインバータ回路と、前記同期化後の選択信号と前記インバータ回路の出力信号との一致に応答して前記マスク開始信号を生成する第1論理回路とを有することを特徴とする請求項1〜6のいずれか1つに記載のクロック切替回路。   The detection circuit is configured to generate an odd-stage inverter circuit that generates a signal obtained by logically inverting the synchronized selection signal, and in response to a match between the synchronized selection signal and the output signal of the inverter circuit. The clock switching circuit according to claim 1, further comprising a first logic circuit that generates a mask start signal. 前記クロック選択回路は、前記同期化後の選択信号に応じて、複数の入力クロック信号の中からいずれか1つの入力クロック信号を選択して選択クロック信号として出力する選択回路と、前記マスク信号に応じて、前記選択クロック信号を前記所定レベルでマスクする第2論理回路とを有することを特徴とする請求項1〜7のいずれか1つに記載のクロック切替回路。   The clock selection circuit selects one input clock signal from a plurality of input clock signals according to the synchronized selection signal, and outputs the selected clock signal as a selection clock signal. The clock switching circuit according to claim 1, further comprising: a second logic circuit that masks the selected clock signal at the predetermined level. 前記解除回路は、前記マスク信号に応答して、前記選択クロック信号の信号レベルに応じた前記マスク解除信号を生成し、
前記マスク信号生成回路は、前記マスク解除信号をクロック端子に入力し、前記マスク信号を出力するフリップフロップ回路を有することを特徴とする請求項8に記載のクロック切替回路。
The release circuit generates the mask release signal according to the signal level of the selected clock signal in response to the mask signal,
9. The clock switching circuit according to claim 8, wherein the mask signal generation circuit includes a flip-flop circuit that inputs the mask release signal to a clock terminal and outputs the mask signal.
JP2012059001A 2012-03-15 2012-03-15 Clock switching circuit Active JP5900053B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012059001A JP5900053B2 (en) 2012-03-15 2012-03-15 Clock switching circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012059001A JP5900053B2 (en) 2012-03-15 2012-03-15 Clock switching circuit

Publications (2)

Publication Number Publication Date
JP2013196011A true JP2013196011A (en) 2013-09-30
JP5900053B2 JP5900053B2 (en) 2016-04-06

Family

ID=49394955

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012059001A Active JP5900053B2 (en) 2012-03-15 2012-03-15 Clock switching circuit

Country Status (1)

Country Link
JP (1) JP5900053B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020129170A (en) 2019-02-07 2020-08-27 キオクシア株式会社 Verification device and verification method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0722927A (en) * 1993-06-22 1995-01-24 Fujitsu Ltd Clock switching circuit
JP2000339056A (en) * 1999-05-27 2000-12-08 Nec Yamagata Ltd Clock switching circuit
JP2002182973A (en) * 2000-12-14 2002-06-28 Canon Inc Memory interface and its signal processing method
JP2005050327A (en) * 2003-07-14 2005-02-24 Matsushita Electric Ind Co Ltd Clock signal switching device, clock signal switching method, data bus switching device, and data bus switching method
JP2010225057A (en) * 2009-03-25 2010-10-07 Seiko Epson Corp Clock switching circuit, integrated circuit device, and electronic device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0722927A (en) * 1993-06-22 1995-01-24 Fujitsu Ltd Clock switching circuit
JP2000339056A (en) * 1999-05-27 2000-12-08 Nec Yamagata Ltd Clock switching circuit
JP2002182973A (en) * 2000-12-14 2002-06-28 Canon Inc Memory interface and its signal processing method
JP2005050327A (en) * 2003-07-14 2005-02-24 Matsushita Electric Ind Co Ltd Clock signal switching device, clock signal switching method, data bus switching device, and data bus switching method
JP2010225057A (en) * 2009-03-25 2010-10-07 Seiko Epson Corp Clock switching circuit, integrated circuit device, and electronic device

Also Published As

Publication number Publication date
JP5900053B2 (en) 2016-04-06

Similar Documents

Publication Publication Date Title
US8375239B2 (en) Clock control signal generation circuit, clock selector, and data processing device
US7180336B2 (en) Glitch-free clock switching apparatus
US8837639B2 (en) Parallel synchronizing cell with improved mean time between failures
JP5401180B2 (en) Digital noise filter circuit
KR101138831B1 (en) Delay locked loop of open loop type
US7135899B1 (en) System and method for reducing skew in complementary signals that can be used to synchronously clock a double data rate output
JP4192228B2 (en) Data generator
JP2005191877A (en) Clock switching circuit
JP2007086960A (en) Clock switching circuit
JP5900053B2 (en) Clock switching circuit
KR101136936B1 (en) Semiconductor device and operating method thereof
US6667638B1 (en) Apparatus and method for a frequency divider with an asynchronous slip
JP2012070233A (en) Edge detection circuit and edge detection method
JP4588435B2 (en) Synchronous circuit that generates output signal stably
JP6387896B2 (en) Divider
JP3562321B2 (en) Clock signal switching device
JP3317923B2 (en) Clock switching circuit
KR20080012574A (en) Clock switching circuit
JP2010252012A (en) Semiconductor integrated circuit and operating method thereof
KR101418519B1 (en) Frequency Divider And Method For Dividing Frequency Of Frequency Divider
JP5813588B2 (en) Switch control circuit and switch device
JP2001339376A (en) Synchronization circuit
KR101211684B1 (en) Semiconductor device and operating method thereof
JPH10163821A (en) Initialization circuit
JPH09130235A (en) Digital pll circuit

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20141201

A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20150612

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20151021

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20151110

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20151216

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20160209

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20160222

R150 Certificate of patent or registration of utility model

Ref document number: 5900053

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150