オートマトン理論 において、順序論理は、出力が入力信号の現在の値と過去の入力のシーケンス、つまり入力履歴に依存する論理回路の一種です。 [ 1 ] [ 2 ] [ 3 ] [ 4 ]これは、出力が現在の入力のみの関数である組み合わせ論理とは対照的です。つまり、順序論理は状態(メモリ)を持ちますが、組み合わせ論理は持ちません。
順序論理は、すべてのデジタル回路の基本構成要素である有限状態機械を構築するために使用されます。実用的なデジタル機器の回路は、ほぼすべて組み合わせ論理と順序論理の組み合わせで構成されています。
シーケンシャルロジックを備えたデバイスの身近な例としては、「チャンネルアップ」ボタンと「チャンネルダウン」ボタンを備えたテレビがあります。 [ 1 ]「アップ」ボタンを押すと、テレビは現在受信しているチャンネルの次のチャンネルに切り替えるように指示する入力を受け取ります。テレビがチャンネル 5 の場合、「アップ」を押すとチャンネル 6 に切り替わります。しかし、テレビがチャンネル 8 の場合、「アップ」を押すとチャンネル 9 に切り替わります。チャンネル選択が正しく機能するためには、テレビは過去のチャンネル選択によって決定された現在受信しているチャンネルを認識している必要があります。[ 1 ]テレビは現在のチャンネルを状態の一部として保存します。「チャンネルアップ」または「チャンネルダウン」の入力が与えられると、チャンネル選択回路のシーケンシャルロジックは入力と現在のチャンネルから新しいチャンネルを計算します。
デジタル順序回路は、同期型と非同期型に分類されます。同期型順序回路では、デバイスの状態はクロック信号に応じて離散的なタイミングでのみ変化します。一方、非同期型回路では、入力の変化に応じてデバイスの状態はいつでも変化します。
今日の順序論理回路のほぼすべては、クロック同期論理回路です。同期回路では、クロック(またはクロックジェネレータ)と呼ばれる電子発振器が、クロック信号と呼ばれる一連の繰り返しパルスを生成し、回路内のすべてのメモリ素子に分配します。同期論理回路の基本的なメモリ素子はフリップフロップです。各フリップフロップの出力はクロックパルスによってトリガーされたときにのみ変化するため、回路全体の論理信号の変化はすべて、クロックによって同期された一定の間隔で同時に開始されます。
回路内のすべての記憶素子(フリップフロップ)の出力、つまりそれらが格納するバイナリデータは、回路の状態と呼ばれます。同期回路の状態はクロックパルスによってのみ変化します。各サイクルにおいて、次の状態は、クロックパルスが発生した時点での現在の状態と入力信号の値によって決定されます。
同期論理回路の主な利点はそのシンプルさです。データに対して演算を行う論理ゲートは、入力の変化に応答するのに一定の時間を要します。これを伝搬遅延と呼びます。クロックパルスの間隔は、すべての論理ゲートが変化に応答し、次のクロックパルスが発生する前に出力が安定した論理値に「落ち着く」のに十分な長さでなければなりません。この条件が満たされている限り(他のいくつかの詳細を無視すれば)、回路は安定かつ信頼できることが保証されます。これが同期回路の最大動作速度を決定します。
同期ロジックには主に2つの欠点がある。
Asynchronous (clockless or self-timed) sequential logic is not synchronized by a clock signal; the outputs of the circuit change directly in response to changes in inputs. The advantage of asynchronous logic is that it can be faster than synchronous logic, because the circuit doesn't have to wait for a clock signal to process inputs. The speed of the device is potentially limited only by the propagation delays of the logic gates used.
However, asynchronous logic is more difficult to design and is subject to problems not encountered in synchronous designs. The main problem is that digital memory elements are sensitive to the order that their input signals arrive; if two signals arrive at a flip-flop or latch at almost the same time, which state the circuit goes into can depend on which signal gets to the gate first. Therefore, the circuit can go into the wrong state, depending on small differences in the propagation delays of the logic gates. This is called a race condition. This problem is not as severe in synchronous circuits because the outputs of the memory elements only change at each clock pulse. The interval between clock signals is designed to be long enough to allow the outputs of the memory elements to "settle" so they are not changing when the next clock comes. Therefore, the only timing problems are due to "asynchronous inputs"; inputs to the circuit from other systems which are not synchronized to the clock signal.
Asynchronous sequential circuits are typically used only in a few critical parts of otherwise synchronous systems where speed is at a premium, such as parts of microprocessors and digital signal processing circuits.
The design of asynchronous logic uses different mathematical models and techniques from synchronous logic, and is an active area of research.