JPH0290756A - Double buffer line setting device - Google Patents
Double buffer line setting deviceInfo
- Publication number
- JPH0290756A JPH0290756A JP24197288A JP24197288A JPH0290756A JP H0290756 A JPH0290756 A JP H0290756A JP 24197288 A JP24197288 A JP 24197288A JP 24197288 A JP24197288 A JP 24197288A JP H0290756 A JPH0290756 A JP H0290756A
- Authority
- JP
- Japan
- Prior art keywords
- input terminal
- ram
- terminal
- selector
- output
- 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.)
- Pending
Links
- 238000010586 diagram Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 1
Landscapes
- Communication Control (AREA)
Abstract
Description
【発明の詳細な説明】
〔産業上の利用分野〕
本発明は、ダブルブァッファ方弐の回線設定装置に関す
るものである。DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a double buffer line setting device.
従来、この種のダブルプアソファによる回線設定装置は
例えば第4図に示すように2つのRAMを用い、それら
を交互に書き込みまたは読み出し状態として回線設定デ
ータを作成していた。すなわち、一方のRAM202を
書き込み状態とし、そのRAMに端子210から入力さ
れた回線情報を回線情報の1周期分だけカウントするカ
ウンタ209により設定されるアドレスにシーケンシャ
ルに記憶させ、同時にもう一方のRAM203を読み出
し状態とし、ROM20Bからの出力によって設定され
たアドレスから任意に読み出して端子213から外部に
出力する。更に、回線情報が1周期分書き込まれたとこ
ろで書き込み状態であったRAM202を読み出し状態
とし、ROM2O3により前の1周期で取り込まれた回
線情報の読み出しを行い、読み出し状態であったR A
M2O3を書き込み状態とし、カウンタ209による
シーケンシャル書き込みを行う。以上の状態を回線情報
1周期毎に繰り返すことにより、目的を達成していた。Conventionally, this type of line setting device using a double poor sofa uses two RAMs as shown in FIG. 4, and creates line setting data by alternately writing or reading them. That is, one RAM 202 is put into a writing state, and the line information input from the terminal 210 is sequentially stored in that RAM at an address set by the counter 209 that counts one cycle of the line information, and at the same time, the other RAM 203 is written. It is set in a read state, and is arbitrarily read from the address set by the output from the ROM 20B and outputted from the terminal 213 to the outside. Furthermore, when the line information has been written for one cycle, the RAM 202, which was in the write state, is set to the read state, and the line information taken in in the previous cycle is read by the ROM2O3.
M2O3 is put into a writing state, and sequential writing is performed by the counter 209. The purpose was achieved by repeating the above state for each cycle of line information.
なお、2−1セレクタ206.207はカウンタ209
の出力00〜1またはROM2O3の出力のいずれかを
選択してRA M2O2,203に出力するためのもの
である。また、選択回路201は回線前Ig210をR
AM202またはRA M2O3のいずれかに与え、2
−1セレクタ204はRA M2O2またはRA M2
O3から読み出されたデータのいずれかを選択し、回線
設定データとして出力するだめのものである。Note that the 2-1 selectors 206 and 207 are the counters 209
This is for selecting either the outputs 00 to 1 of the ROM2O3 or the output of the ROM2O3 and outputting it to the RAM2O2, 203. In addition, the selection circuit 201 sets the Ig 210 in front of the line to R.
to either AM202 or RAM M2O3, 2
-1 selector 204 is RAM M2O2 or RAM M2
This is for selecting any of the data read from O3 and outputting it as line setting data.
そして、これら選択回路201、セレクタ204.20
6゜207、さらニRA M2O2,203ノ書き込み
・読み出しはすべて端子211に入力されるRAM書き
込み・読み出し制御信号により制御される。These selection circuits 201, selectors 204.20
All writing and reading of RAM M2O2 and 203 is controlled by a RAM write/read control signal inputted to a terminal 211.
C発明が解決しようとするa!題〕
しかし、上述した従来のダブルプアソフ1回線設定装置
では、2つの独立したR A M2O2,203を用い
るために部品の実装面積が大きくなるという欠点がある
。C invention tries to solve a! [Problem] However, the above-mentioned conventional double-poor software single line setting device has a drawback that the mounting area of the components becomes large because two independent RAM 2 O 2, 203 are used.
本発明の目的は、このような欠点を除去し、部品の実装
面積を小さくしたダブルブアッフ7回線設定装置を提供
することにある。SUMMARY OF THE INVENTION An object of the present invention is to provide a double buffer 7 line setting device which eliminates such drawbacks and reduces the mounting area of components.
本発明は、RAMと、
第1および第2の2−1セレクタと、
ROMと、
桁あふれを出力するn+lビットカウンタと、桁あふれ
入力を持つlビットカウンタと、Dフリップフロップと
により構成し、
外部からのデータの入力端子を前記RAMのデータ入力
端子に接続し、前記RAMの出力端子を前記Dフリップ
フロップのD入力端子に接続し、前記Dフリップフロッ
プのQ出力端子を回線設定データの出力端子に接続し、
外部からのRAM書き込み・読み出し制御信号の入力端
子を前記第1および第2の2−1セレクタのセレクト信
号入力端子と前記RAMの書き込み・読み出し制御端子
とに接続し、外部からのクロックパルスの入力端子を前
記n+1ビットカウンタのクロック入力端子と前記1ビ
ットカウンタのクロック入力端子とDフリップフロップ
のクロック入力端子とに接続し、前記n+1ビットカウ
ンタからのカウント出力端子を前記ROMのアドレス入
力端子と前記第2の2−1セレクタのA入力端子に接続
し、前記ROMの出力端子を前記第2の2−1セレクタ
のB入力端子に接続し、前記1ビットカウンタの非反転
出力端子を前記第1の2−1セレクタのA入力端子に接
続し、前記lビットカウンタの反転出力端子を前記第1
の2−1セレクタのB入力端子に接続し、前記第1の2
−1セレクタの出力端子と前記第2の2−1セレクタの
出力端子とを前記RAMのアドレス入力端子に接続し、
前記n+1ビットカウンタの桁あふれ出力端子を前記l
ビットカウンタの桁あふれ入力端子に接続したごとを特
徴とする。The present invention includes a RAM, first and second 2-1 selectors, a ROM, an n+l bit counter that outputs an overflow, an l bit counter that has an overflow input, and a D flip-flop. An input terminal for external data is connected to a data input terminal of the RAM, an output terminal of the RAM is connected to a D input terminal of the D flip-flop, and a Q output terminal of the D flip-flop is used to output line setting data. Connect to the terminal,
An input terminal for an external RAM write/read control signal is connected to the select signal input terminal of the first and second 2-1 selectors and the RAM write/read control terminal, and a clock pulse is input from the outside. A terminal is connected to a clock input terminal of the n+1-bit counter, a clock input terminal of the 1-bit counter, and a clock input terminal of the D flip-flop, and a count output terminal from the n+1-bit counter is connected to the address input terminal of the ROM and the clock input terminal of the D flip-flop. The output terminal of the ROM is connected to the B input terminal of the second 2-1 selector, and the non-inverting output terminal of the 1-bit counter is connected to the A input terminal of the second 2-1 selector. The inverting output terminal of the l-bit counter is connected to the A input terminal of the 2-1 selector of the first
Connect to the B input terminal of the 2-1 selector of the first 2-1 selector.
-1 selector output terminal and the second 2-1 selector output terminal are connected to the address input terminal of the RAM,
The overflow output terminal of the n+1 bit counter is connected to the l
The feature is that it is connected to the overflow input terminal of the bit counter.
次に、本発明の実施例について図面を参照して説明する
。Next, embodiments of the present invention will be described with reference to the drawings.
第1図は本発明に係わるダブルブァッファ回線設定装置
の一実施例を示す回路図である。このダプルプア・7フ
ア回線設定装置は、RAMl0I と、2−1セレクタ
102.103と、ROM104 と、桁あふれを出力
するn+1ビットN進カウンタ105と、桁あふれ入力
を持つ1ビツト2進カウンタ106と、Dフリップフロ
ップ107とにより構成する。そして、外部からデータ
を入力する入力端子108をRAMl0Iのデータ入力
端子に接続し、RAMl0Iの出力端子をDフリソプフ
ロンプ107のD入力端子に接続し、Dフリップフロッ
プ107のQ出力端子をデータの出力端子111に接続
し、外部からのRA M書き込み・読み出し制御信号の
入力端子109を2−1セレクタ102.103のセレ
クト信号入力端子およびRA MIOIの書き込み・読
み出し制御端子に接続し、外部からのクロックパルスの
入力端子110をn+1ビットN進カウンタ105のク
ロック入力端子と1ビットカウンタ106のクロック入
力端子とDフリップフロップ107のクロック入力端子
に接続し、n+lビットN進カウンタ105のカウント
出力端子をROM104のアドレス入力端子と2−1セ
レクタ103のへ入力端子に接続し、ROM104の出
力端子を2−1セレクタ103のB入力端子に接続し、
1ビットカウンタ106の非反・軸出力端子(Qo)を
2−1セレクタ102のへ入力端子に接続し、1ビソト
カウンl−106の反転出力端子(do)を2−1セレ
クタ102のB入力端子に接続し、2−1セレクタ10
2のY出力をRAM 101の最上位アドレス入力とし
、2−1セレクタ103のY出力をRAMl0Iの残り
のアドレス入力とし、n+1ビツトN進カウンク105
の桁あふれ出力端子を1ビワトカウンタ106の桁あふ
れ入力端子に接続する。FIG. 1 is a circuit diagram showing an embodiment of a double buffer line setting device according to the present invention. This double-poor/7-way line setting device includes a RAM 10I, a 2-1 selector 102.103, a ROM 104, an n+1-bit N-ary counter 105 that outputs an overflow, and a 1-bit binary counter 106 that has an overflow input. , and a D flip-flop 107. Then, the input terminal 108 for inputting data from the outside is connected to the data input terminal of RAMl0I, the output terminal of RAMl0I is connected to the D input terminal of the D flip-flop 107, and the Q output terminal of the D flip-flop 107 is connected to the data output terminal. 111, and connect the input terminal 109 of the external RAM write/read control signal to the select signal input terminal of the 2-1 selector 102 and 103 and the write/read control terminal of the RAM MIOI, and The input terminal 110 of the n+1 bit N-ary counter 105 is connected to the clock input terminal of the 1-bit counter 106 and the clock input terminal of the D flip-flop 107, and the count output terminal of the n+1 bit N-ary counter 105 is connected to the clock input terminal of the n+1 bit N-ary counter 105, and the clock input terminal of the D flip-flop 107. Connect the address input terminal and the input terminal of the 2-1 selector 103, connect the output terminal of the ROM 104 to the B input terminal of the 2-1 selector 103,
Connect the non-reverse output terminal (Qo) of the 1-bit counter 106 to the input terminal of the 2-1 selector 102, and connect the inverted output terminal (do) of the 1-bit counter 106 to the B input terminal of the 2-1 selector 102. 2-1 selector 10
The Y output of the 2-1 selector 103 is used as the highest address input of the RAM 101, and the Y output of the 2-1 selector 103 is used as the remaining address input of the RAM 10I.
The overflow output terminal of the 1-biwato counter 106 is connected to the overflow input terminal of the 1-biwato counter 106.
次に、この実施例の動作について第1図、第2図、第3
図を用いて説明する。入力端子108から入力され、N
個のデータで1周期となる回線情報A、B、C,・・・
は、個々のデータの区切りの前半でロウレベル、後半で
ハイレベルとなる入力端子109から入力されるRAM
書き込み・読み出し制御信号により、前半のロウレベル
でRAMl0Iに書き込まれ、後半のハイレベルでRA
Ml0Iから読み出される。また、この入力端子109
からの制御信号によりRAMl0Iが書き込み状態の時
は、2−1セレクタ102.103はA側を選択し、読
み出し状態の時はB側を選択する。いま仮に1ビットカ
ウンタ106の非反転出力Q0がロウレベルであったと
すると、回線情報は1ビットカウンタの非反転出力Q0
とカウンタ出力によりRAMの下位アドレスからシーケ
ンシャルに書き込まれ、lビットカウンタの反転出力d
0とROM104からの出力により、RAMl0Iの上
位アドレスから任意に読み出され、出力される。この時
のメモリの使用状態を第2図(a)に示す。次に回線情
報の1周期が終了すると、n+1ビットN進カウンタ1
05の桁あふれ出力と端子110からのクロックパルス
により1ビットカウンタ106のQ0出力は反転する。Next, the operation of this embodiment will be explained in Figs. 1, 2, and 3.
This will be explained using figures. Input from input terminal 108, N
Line information A, B, C, . . . where one period consists of data of
is a RAM input from the input terminal 109 which becomes low level in the first half of each data division and high level in the second half.
According to the write/read control signal, it is written to RAM10I at low level in the first half, and written to RAM10I at high level in the second half.
Read from Ml0I. In addition, this input terminal 109
The 2-1 selectors 102 and 103 select the A side when the RAM 10I is in the write state, and select the B side when the RAM 10I is in the read state. Now, if the non-inverted output Q0 of the 1-bit counter 106 is at low level, the line information is the non-inverted output Q0 of the 1-bit counter 106.
is sequentially written from the lower address of the RAM by the counter output and the inverted output d of the l-bit counter.
0 and the output from the ROM 104, the data is arbitrarily read from the upper address of RAMl0I and output. The usage state of the memory at this time is shown in FIG. 2(a). Next, when one cycle of line information ends, the n+1 bit N-ary counter 1
The Q0 output of the 1-bit counter 106 is inverted by the overflow output of 05 and the clock pulse from the terminal 110.
このため、次の桁あぶれが起きるまでの1周期は逆にR
AMl0Iの上位アドレスにシーケンシャルに書き込ま
れ、下位アドレスからROM104により任意に読み出
される。このときのメモリの使用状態を第2図(b)に
示す。Therefore, one cycle until the next digit error occurs is reversely R.
The data is sequentially written to the upper addresses of AMl0I and read out by the ROM 104 from the lower addresses. The usage state of the memory at this time is shown in FIG. 2(b).
以上の一連の動作を第3図に示すタイムチャートを用い
て説明する。第3図において、(a)は端子110に入
力されるクロックパルス、(b)は入力端子10Bから
の入力データ、(C)は端子109に入力される書き込
み・読み出し制御信号、(d)はn+lビットN進カウ
ンタ106のQ出力、(e)は2−1セレクタ103の
出力、(f)は1ビツト2進カウンタ106の非反転出
力Q、、(g)は2−1セレクタ102の出力、(h)
はRAMl0Iのアドレス入力である。第3図に示すよ
うに、読み出し・書き込み制御信号(C)がロウレベル
の時、2−1セレクタ103の出力(e)として、カウ
ンタ106の値(d)が出力され、また、2−1セレク
タ102の出力(g)として、2進カウンタのQoの値
(f)が出力される。更に、RAM書き込み・読み出し
制御信号(C)がハイレベルの時、2−1セレクタ10
3の出力(6)としてROM104の値が出力され、2
−1セレクタ102の出力(g)として、2進カウンタ
106のQoの反転値が出力され、回線情報の1周期が
終了すると、2進カウンタ106のQ0出力は反転する
。The above series of operations will be explained using the time chart shown in FIG. In FIG. 3, (a) is the clock pulse input to the terminal 110, (b) is the input data from the input terminal 10B, (C) is the write/read control signal input to the terminal 109, and (d) is the clock pulse input to the terminal 110. Q output of the n+l bit N-ary counter 106, (e) is the output of the 2-1 selector 103, (f) is the non-inverted output Q of the 1-bit binary counter 106, and (g) is the output of the 2-1 selector 102. , (h)
is the address input of RAMl0I. As shown in FIG. 3, when the read/write control signal (C) is at low level, the value (d) of the counter 106 is output as the output (e) of the 2-1 selector 103, and the value (d) of the counter 106 is output as the output (e) of the 2-1 selector 103. As the output (g) of 102, the Qo value (f) of the binary counter is output. Furthermore, when the RAM write/read control signal (C) is at high level, the 2-1 selector 10
The value of ROM104 is output as the output (6) of 2.
The inverted value of Qo of the binary counter 106 is output as the output (g) of the -1 selector 102, and when one cycle of line information ends, the Q0 output of the binary counter 106 is inverted.
以上の動作により、1つのRAMを用いたダブルプアソ
ファ回線設定が可能となる。Through the above operations, it becomes possible to set up a double poor sofa line using one RAM.
以上説明したように本発明のダブルプアッフ7回線設定
装置は、回線情報の各区切りの前半および後半でそれぞ
れ書き込みおよび読み出しを行う構成としたため、1つ
のRAMを用いてダブルプアソフ7回線設定を行うこと
ができる。従って、従来の2つのRAMを用いたダブル
ブアンファ回線設定装置に比べ、部品の実装面積を縮小
することができる。As explained above, the double-poor 7-line setting device of the present invention has a configuration in which writing and reading are performed in the first half and the second half of each division of line information, so that double-poor 7-line setting can be performed using one RAM. . Therefore, compared to the conventional double amplifier line setting device using two RAMs, the mounting area of components can be reduced.
第1図は本発明によるダブルブアッファ回線設定装置の
一実施例を示す回路図、
第2図(a)、 (b)はそれぞれ第1図の回線設定
装置を構成するRAMのメモリマツプであり、第2図(
a)は下位アドレスが書き込み、上位アドレスが読み出
しの状態を示し、第2図(b)は下位アドレスが読み出
し、上位アドレスが書き込みの状態を示し、
第3図は動作を示すためのタイムチャート、第4図は従
来の2つのRAMを用いたダブルブァッファ回線設定装
置を示す回路図である。
101 ・・・・・RAM
102、103・・・2−1セレクク
104 ・・・・・ROM
105 ・・・・・n+lビットN進カウンタ106
・・・・ ・lビット2進カウンタ107 ・
・ ・ ・ ・Dフリップフロップ108 ・・・・
・データ入力端子
109 ・・・・・RAM書き込み・読み出し制御信
号入力端子
110 ・・・・・クロックパルス入力端子111
・・・・・データ出力端子
201 ・・・・・選択回路
202、203・・・RAM
204、206.207 ・・・2−1セレクタ20
9 ・・・・・n+lビットカウンタ210 ・・
・・・データ入力端子
211 ・・・・・RAM書き込み・読み出し制御信
号入力端子
213 ・・・・・データ出力端子FIG. 1 is a circuit diagram showing an embodiment of the double buffer line setting device according to the present invention, and FIGS. 2(a) and 2(b) are memory maps of the RAM constituting the line setting device of FIG. figure(
a) shows a state where the lower address is writing and an upper address is reading; FIG. 2(b) shows a state where the lower address is reading and the upper address is writing; FIG. 3 is a time chart to show the operation; FIG. 4 is a circuit diagram showing a conventional double buffer line setting device using two RAMs. 101...RAM 102, 103...2-1 selector 104...ROM 105...n+l bit N-ary counter 106
...・l-bit binary counter 107・
・ ・ ・ ・D flip-flop 108 ・・・・
-Data input terminal 109...RAM write/read control signal input terminal 110...Clock pulse input terminal 111
...Data output terminal 201 ...Selection circuit 202, 203...RAM 204, 206.207 ...2-1 selector 20
9...n+l bit counter 210...
...Data input terminal 211 ...RAM write/read control signal input terminal 213 ...Data output terminal
Claims (1)
入力を持つ1ビットカウンタと、Dフリップフロップと
により構成し、 外部からのデータの入力端子を前記RAMのデータ入力
端子に接続し、前記RAMの出力端子を前記Dフリップ
フロップのD入力端子に接続し、前記Dフリップフロッ
プのQ出力端子を回線設定データの出力端子に接続し、
外部からのRAM書き込み・読み出し制御信号の入力端
子を前記第1および第2の2−1セレクタのセレクト信
号入力端子と前記RAMの書き込み・読み出し制御端子
とに接続し、外部からのクロックパルスの入力端子を前
記n+1ビットカウンタのクロック入力端子と前記1ビ
ットカウンタのクロック入力端子とDフリップフロップ
のクロック入力端子とに接続し、前記n+1ビットカウ
ンタからのカウント出力端子を前記ROMのアドレス入
力端子と前記第2の2−1セレクタのA入力端子に接続
し、前記ROMの出力端子を前記第2の2−1セレクタ
のB入力端子に接続し、前記1ビットカウンタの非反転
出力端子を前記第1の2−1セレクタのA入力端子に接
続し、前記1ビットカウンタの反転出力端子を前記第1
の2−1セレクタのB入力端子に接続し、前記第1の2
−1セレクタの出力端子と前記第2の2−1セレクタの
出力端子とを前記RAMのアドレス入力端子に接続し、
前記n+1ビットカウンタの桁あふれ出力端子を前記1
ビットカウンタの桁あふれ入力端子に接続したことを特
徴とするダブルブァッファ回線設定装置。(1) Consists of RAM, first and second 2-1 selectors, ROM, n+1-bit counter that outputs overflow, 1-bit counter with overflow input, and D flip-flop, and external A data input terminal from the RAM is connected to a data input terminal of the RAM, an output terminal of the RAM is connected to a D input terminal of the D flip-flop, and a Q output terminal of the D flip-flop is connected to a line setting data output terminal. connect to
An input terminal for an external RAM write/read control signal is connected to the select signal input terminal of the first and second 2-1 selectors and the RAM write/read control terminal, and a clock pulse is input from the outside. A terminal is connected to a clock input terminal of the n+1-bit counter, a clock input terminal of the 1-bit counter, and a clock input terminal of the D flip-flop, and a count output terminal from the n+1-bit counter is connected to the address input terminal of the ROM and the clock input terminal of the D flip-flop. The output terminal of the ROM is connected to the B input terminal of the second 2-1 selector, and the non-inverting output terminal of the 1-bit counter is connected to the A input terminal of the second 2-1 selector. The inverting output terminal of the 1-bit counter is connected to the A input terminal of the 2-1 selector of the first
Connect to the B input terminal of the 2-1 selector of the first 2-1 selector.
-1 selector output terminal and the second 2-1 selector output terminal are connected to the address input terminal of the RAM,
The overflow output terminal of the n+1 bit counter is connected to the 1
A double buffer line setting device characterized by being connected to an overflow input terminal of a bit counter.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP24197288A JPH0290756A (en) | 1988-09-27 | 1988-09-27 | Double buffer line setting device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP24197288A JPH0290756A (en) | 1988-09-27 | 1988-09-27 | Double buffer line setting device |
Publications (1)
Publication Number | Publication Date |
---|---|
JPH0290756A true JPH0290756A (en) | 1990-03-30 |
Family
ID=17082326
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP24197288A Pending JPH0290756A (en) | 1988-09-27 | 1988-09-27 | Double buffer line setting device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH0290756A (en) |
-
1988
- 1988-09-27 JP JP24197288A patent/JPH0290756A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JPH0391188A (en) | Fifo memory | |
JPS6364413A (en) | Sequential approximation registor | |
JPH0290756A (en) | Double buffer line setting device | |
JP3249280B2 (en) | Interleave circuit | |
KR100209039B1 (en) | Parallel data outputting storage circuit | |
JPS61288636A (en) | Frame conversion circuit | |
SU640300A1 (en) | Arrangement for storing and converting information | |
JPS61160129A (en) | Timing generating circuit | |
KR890004805Y1 (en) | Digital data order conversion circuits of cd-rom driver | |
JPS5923941A (en) | Data arrangement converting circuit | |
JP3057728B2 (en) | Semiconductor storage device | |
JPH0235700A (en) | Memory circuit | |
JPS6043592B2 (en) | Large capacity static shift register | |
JPS626500A (en) | Semiconductor device | |
JPH0637351Y2 (en) | Logistic pattern Energy generator | |
JPS5927937B2 (en) | information processing circuit | |
JPH0421884B2 (en) | ||
JPH01191393A (en) | Dual port memory | |
JPS62195924A (en) | Counter circuit | |
JPS6237464B2 (en) | ||
JPH04205376A (en) | Moving average circuit | |
JPS5849960B2 (en) | Information check method | |
JPS59227086A (en) | Shift register | |
JPH05289933A (en) | Memory address generating device | |
JPH02280527A (en) | Counter circuit |