JPH0227487A - Circuit for counting/storing data number - Google Patents

Circuit for counting/storing data number

Info

Publication number
JPH0227487A
JPH0227487A JP63177494A JP17749488A JPH0227487A JP H0227487 A JPH0227487 A JP H0227487A JP 63177494 A JP63177494 A JP 63177494A JP 17749488 A JP17749488 A JP 17749488A JP H0227487 A JPH0227487 A JP H0227487A
Authority
JP
Japan
Prior art keywords
data
address
counting
line
storage means
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
Application number
JP63177494A
Other languages
Japanese (ja)
Inventor
Toshiyuki Tezuka
手塚 敏行
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.)
Sharp Corp
Original Assignee
Sharp Corp
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 Sharp Corp filed Critical Sharp Corp
Priority to JP63177494A priority Critical patent/JPH0227487A/en
Publication of JPH0227487A publication Critical patent/JPH0227487A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To easily count and store the number of data by successively reading the respective data in a data memory means when a data line is connected to an address line, applying them to a counting result memory means, reading number data from an address, and updating and storing them. CONSTITUTION:A data line 106 is switching-connected to an address line 107 by a switching means 101, and the respective data stored into a data memory means 102 are given to a counting result memory means 103 as address information. The number data are read from the said address at every given address, a counting means 104 updates them, and an updating result is stored into the said address of the counting result memory means 103. Thus, when the multibit pattern data typically such as picture data and voice data are processed, the existing number of arbitrary bit patterns can be promptly and easily counted.

Description

【発明の詳細な説明】 〔産業上の利用分野] この発明はデータの個数を計数記憶する回路に関し、特
に、映像信号をA/D変換して、メモリtCに記憶する
画像メモリ装置などにおいて用いられ、メモリIC内に
記憶されているデータの個数を計数記憶する回路に関す
る。
[Detailed Description of the Invention] [Industrial Application Field] The present invention relates to a circuit that counts and stores the number of pieces of data, and is particularly applicable to an image memory device that A/D converts a video signal and stores it in a memory tC. The present invention relates to a circuit that counts and stores the number of data stored in a memory IC.

[従来の技術〕 画像の二値化は、濃淡画像から対象と背景と分離するた
めによく行なわれる。従来、二値化の方法として、たと
えば、原画像の濃淡のヒストグラムを作成し、ヒストグ
ラムの谷あるいは変曲点等にしきい値を設定し、しきい
値との大小関係によって二値化を行なう方法がある。
[Prior Art] Image binarization is often performed to separate an object and a background from a grayscale image. Conventional binarization methods include, for example, creating a histogram of the gradations of the original image, setting thresholds at the valleys or inflection points of the histogram, and performing binarization based on the magnitude relationship with the threshold. There is.

第3図はヒストグラム作成に用いられる従来の回路構成
を示す図である。第3図において、データライン205
とアドレスライン206とは明確に分離されていて、こ
れらの各ラインには、CPO201、プログラムメモリ
202.データメモリ203および計数結果メモリ20
4が接続されている。CPU201は予めプログラムメ
モリ202に記憶された処理手順に従い、以下に説明す
る一連の動作を行なう。すなわち、データメモリ203
には、各画素ごとの画像の濃淡を示す度合を示すビット
パターンデータが記憶されていて、CPU201はデー
タメモリ203内の所望のデータをアドレスライン20
6によって指定し、データライン205によって取入れ
る。CPU201は取入れたデータのビットパターンと
それ以前に取入れたビットパターンとの大小を比較判断
し、ビットパターンデータの昇順あるいは降順に個数デ
ータを記憶した計数結果メモリ204のうち、今回取入
れたデータが格納されるべきアドレスに格納されている
個数データを+1する。上述のデータをデータメモリ2
03内のすべてのデータについて行なうことにより、ヒ
ストグラムが得られる。
FIG. 3 is a diagram showing a conventional circuit configuration used for creating a histogram. In FIG. 3, data line 205
and address lines 206 are clearly separated, and each of these lines includes CPO 201, program memory 202 . Data memory 203 and counting result memory 20
4 are connected. The CPU 201 performs a series of operations described below in accordance with a processing procedure stored in advance in the program memory 202. That is, data memory 203
, bit pattern data indicating the degree of shading of the image for each pixel is stored, and the CPU 201 transfers desired data in the data memory 203 to the address line 20.
6 and taken by data line 205. The CPU 201 compares and determines the size of the bit pattern of the imported data with the previously imported bit pattern, and stores the currently imported data in the counting result memory 204 that stores count data in ascending or descending order of bit pattern data. Add 1 to the number data stored at the address to be processed. Transfer the above data to data memory 2
By performing this on all data within 03, a histogram is obtained.

[発明が解決しようとする課題] 上述のごとく、従来の方式では、各ビットパターンデー
タごとに比較判断を行なっているので、処理に時間がか
かるため、処理速度が遅いという問題点と、比較判断を
行なうために、処理が複雑であるという問題点があった
[Problems to be Solved by the Invention] As mentioned above, in the conventional method, a comparative judgment is made for each bit pattern data, so it takes time to process, so there is a problem that the processing speed is slow, and the comparative judgment is slow. There was a problem in that the processing was complicated.

それゆえに、この発明の主たる目的は、ビットパターン
データの比較判断を行なうことなく、データの計数記憶
を行なうようなデータの個数を計数記憶する回路を提供
することである。
Therefore, the main object of the present invention is to provide a circuit that counts and stores the number of pieces of data without comparing and determining bit pattern data.

[課題を解決するための手段] この発明に係るデータの個数を計数記憶する回路は、デ
ータ線に接続され、計数すべきデータを記憶したデータ
記憶手段と、データの個数を計数するための計数手段と
、アドレス線に接続され、計数手段の計数結果を記憶す
るための計数結果記憶手段と、データ記憶手段に接続さ
れたデータ線を計数結果記憶手段に接続されたアドレス
線に接続するための切換手段と、切換手段によってデー
タ線とアドレス線とが接続されたとき、データ記憶手段
に記憶されている各データを順次、アドレス情報として
計数結果記憶手段に与えるとともに、与えられるアドレ
スごとに当該アドレスから個数データを読出して計数手
段に与えて更新させ、その更新結果を計数結果記憶手段
の当該アドレスに格納させる計数制御手段とを備えて構
成される。
[Means for Solving the Problems] A circuit for counting and storing the number of data according to the present invention includes a data storage means connected to a data line and storing data to be counted, and a counter for counting the number of data. counting result storage means connected to the address line for storing the counting results of the counting means; and counting result storage means for connecting the data line connected to the data storage means to the address line connected to the counting result storage means. When the data line and the address line are connected by the switching means, each data stored in the data storage means is sequentially given to the counting result storage means as address information, and for each given address, the corresponding address is and counting control means for reading out the number data from the counting means, updating it by giving it to the counting means, and storing the updated result at the corresponding address of the counting result storage means.

[作用] この発明では、切換手段によってデータ線とアドレス線
とが接続されたとき、データ記憶手段に記憶されている
各データを順次読出してアドレス情報として=1数結果
記憶手段に与え、与えられるアドレスごとにそのアドレ
スから個数データを読出して計数手段により更新させ、
その更新結果を計数結果記憶手段の当該アドレスに格納
させるようにしている。
[Operation] In this invention, when the data line and the address line are connected by the switching means, each data stored in the data storage means is sequentially read out and given as address information to the number result storage means. For each address, the number data is read from that address and updated by the counting means,
The updated result is stored at the corresponding address in the counting result storage means.

[発明の実施例] 第1図はこの発明の一実施例の回路構成を示す図である
。第1図において、切換回路101の一方端およびデー
タメモリ102には、それぞれが外部人出力に用いられ
るアドレスライン106およびデータライン107が接
続される。切換回路101の他方端、計数結果メモリ1
03およびカウンタ回路104には、内部バス108お
よび109が接続される。切換回路101は、通常の動
作モードでは、アドレスライン106が内部バス108
に接続され、かつデータライン107が内部バス109
に接続されるようにし、データの計数を行なうモードで
は、データライン107が内部バス108に接続される
ように切換動作を行なう。データメモリ102は、計数
を行なおうとするビットパターンデータを記憶するもの
である。
[Embodiment of the Invention] FIG. 1 is a diagram showing a circuit configuration of an embodiment of the invention. In FIG. 1, an address line 106 and a data line 107, each used for external output, are connected to one end of a switching circuit 101 and a data memory 102. The other end of the switching circuit 101, the counting result memory 1
Internal buses 108 and 109 are connected to 03 and counter circuit 104. In the normal operation mode, the switching circuit 101 connects the address line 106 to the internal bus 108.
and the data line 107 is connected to the internal bus 109
In the data counting mode, a switching operation is performed so that the data line 107 is connected to the internal bus 108. The data memory 102 stores bit pattern data to be counted.

カウンタ回路104は、データメモリ102に記憶され
たビットパターンデータの計数を行なうものである。計
数結果メモリ103は、カウンタ回路104の計数結果
を記憶するものである。内部バス108および109は
、データメモリ102の容量およびビット幅により規定
される数の線を有するバスである。アドレスライン10
6およびデータライン107は、データの人出力を制御
するタイミング信号発生回路105に接続される。
The counter circuit 104 counts bit pattern data stored in the data memory 102. The count result memory 103 stores the count results of the counter circuit 104. Internal buses 108 and 109 are buses having a number of lines defined by the capacity and bit width of data memory 102. address line 10
6 and data line 107 are connected to a timing signal generation circuit 105 that controls the output of data.

また、上述の切換回路101.データメモリ102、計
数結果メモリ103およびカウンタ回路104は、タイ
ミング信号発生回路105からの制御信号により制御さ
れる。
Moreover, the above-mentioned switching circuit 101. Data memory 102, count result memory 103, and counter circuit 104 are controlled by a control signal from timing signal generation circuit 105.

第2図は各種信号を説明するための図であり、特に、第
2図(a)はアドレスライン106に現われる信号30
1を示し、第2図(b)はデータライン107に現われ
る信号302を示し、第2図(C)は内部バス109に
現われる信号303を示す。
FIG. 2 is a diagram for explaining various signals. In particular, FIG. 2(a) shows the signal 30 appearing on the address line 106.
1, FIG. 2B shows the signal 302 appearing on the data line 107, and FIG. 2C shows the signal 303 appearing on the internal bus 109.

次に、第1図および第2図を参照して、この発明の一実
施例の動作について説明する。第1図に示す回路におい
てデータメモリ102には、これから計数を行なおうと
するビットパターンデータ、群が記憶されているものと
し、また、計数結果メモリ103の各エリアには、初期
値として0が書込まれているものとする。
Next, the operation of an embodiment of the present invention will be described with reference to FIGS. 1 and 2. In the circuit shown in FIG. 1, it is assumed that the data memory 102 stores bit pattern data and groups to be counted, and each area of the counting result memory 103 has 0 as an initial value. Assume that it has been written.

計数動作を行なうときには、切換回路101は、タイミ
ング信号発生回路105からの所定の制御信号を受けて
切換わり、データライン107と内部バス108とを接
続する。次に、データメモリ102の1つのビットパタ
ーンデータをアドレスライン106に与えられたアドレ
ス情報304によって読出す。データメモリ102から
読出されたデータ305はデータライン107および内
部バス108を介して、計数結果メモリ103のアドレ
ス線に与えられる。次に、計数結果メモリ103内のデ
ータを現在アドレス線に加えられている信号305に基
づいて読出す。計数結果メモリ103から読出されたデ
ータ306は内部バス109を介してカウンタ回路10
4に与えられる。
When performing a counting operation, switching circuit 101 switches in response to a predetermined control signal from timing signal generating circuit 105, and connects data line 107 and internal bus 108. Next, one bit pattern data of the data memory 102 is read out using the address information 304 applied to the address line 106. Data 305 read from data memory 102 is applied to address lines of count result memory 103 via data line 107 and internal bus 108. Next, the data in the count result memory 103 is read out based on the signal 305 currently applied to the address line. The data 306 read from the counting result memory 103 is sent to the counter circuit 10 via an internal bus 109.
given to 4.

カウンタ回路104では、与えられたデータ306を取
入れ、それに1を加えた後、再び内部バス109に送出
する。計数結果メモリ103には、初期値として0が記
憶されているので、送出されるデータは1を表わすデー
タである。送出されるデータを307で示す。
The counter circuit 104 takes in the applied data 306, adds 1 to it, and sends it out again to the internal bus 109. Since 0 is stored in the counting result memory 103 as an initial value, the data sent out is data representing 1. Data to be sent out is indicated by 307.

カウンタ回路104から送出されたデータ307は、計
数結果メモリ103に、現在アドレス線に加えられてい
る信号305に基づいて書込まれる。すなわち、計数結
果メモリ103には、前回読出されたのと同一のアドレ
スに更新後の個数データが書込まれる。たとえば、デー
タメモリ102内のたとえばXというデータについて説
明すると、その個数データは計数結果メモリ103のア
ドレスがXである位置に格納される。
Data 307 sent from the counter circuit 104 is written into the count result memory 103 based on the signal 305 currently applied to the address line. That is, the updated count data is written into the count result memory 103 at the same address as the one read last time. For example, regarding the data X in the data memory 102, the number data is stored at the address X in the count result memory 103.

上述した一連の動作をデータメモリ102内のすべての
データについて重複することなく繰返せば、データメモ
リ102内に記憶されているビットパターンデータの個
数をビットパターンごとに計数記憶することができる。
By repeating the above-described series of operations for all data in the data memory 102 without duplication, the number of bit pattern data stored in the data memory 102 can be counted and stored for each bit pattern.

外部より、計数結果を読出す際には、切換回路101に
よってアドレスライン106と内部バス108とを接続
し、かつデータライン107と内部バス109とを接続
する。これにより、計数結果メモリ103に記憶されて
いる個数データを従来と同様外部に読出すことができる
When reading the counting results from the outside, the switching circuit 101 connects the address line 106 and the internal bus 108, and connects the data line 107 and the internal bus 109. Thereby, the number data stored in the counting result memory 103 can be read out to the outside as in the conventional case.

[発明の効果] 以上のようにして、この発明によれば、切換手段によっ
てデータ線とアドレス線とを切換接続し、データ記憶手
段に記憶されている各データをアドレス情報として計数
結果記憶手段に与えるとともに、与えられるアドレスご
とに当該アドレスから個数データを読出して計数手段に
より更新させ、その更新結果を計数結果記憶手段の当該
アドレスに格納させるようにしたので、画像データ、音
声データ等に代表される多数のビットパターンデータを
扱う場合には、任意のビットパターンの存在個数を高速
に計数することが可能となり、また、従来のように比較
判別する必要がないので、プログラムを簡素化すること
ができる。
[Effects of the Invention] As described above, according to the present invention, the data line and the address line are switched and connected by the switching means, and each data stored in the data storage means is stored in the counting result storage means as address information. At the same time, for each given address, the number data is read from the address and updated by the counting means, and the updated result is stored in the corresponding address of the counting result storage means. When handling a large number of bit pattern data, it is possible to quickly count the number of existing bit patterns, and the program can be simplified because there is no need to compare and discriminate as in the past. can.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図はこの発明の一実施例の回路構成を示す図である
。第2図は第1図における各種信号を説明するための図
である。第3図はヒストグラム作成に用いられる従来の
回路構成を示す図である。 図において、101は切換回路、102はデータメモリ
、103は計数結果メモリ、104はカウンタ回路、1
05はタイミング信号発生回路、106はアドレスライ
ン、107はデータライン、108および109は内部
バス、301はアドレスラインに現われる信号、302
はデータラインに現われる信号、303は内部バスに現
われる信号、304はアドレス情報、305はデータメ
モリから読出されたデータ、306はカウンタ回路に与
えられるデータ、307はカウンタ回路から計数結果メ
モリに与えられるデータを示す。 第2図 萬1図 第3図 206:アドレベライン
FIG. 1 is a diagram showing a circuit configuration of an embodiment of the present invention. FIG. 2 is a diagram for explaining various signals in FIG. 1. FIG. 3 is a diagram showing a conventional circuit configuration used for creating a histogram. In the figure, 101 is a switching circuit, 102 is a data memory, 103 is a counting result memory, 104 is a counter circuit, 1
05 is a timing signal generation circuit, 106 is an address line, 107 is a data line, 108 and 109 are internal buses, 301 is a signal appearing on the address line, 302
is a signal appearing on the data line, 303 is a signal appearing on the internal bus, 304 is address information, 305 is data read from the data memory, 306 is data given to the counter circuit, 307 is given from the counter circuit to the counting result memory Show data. Figure 2 1 Figure 3 Figure 206: Address level line

Claims (1)

【特許請求の範囲】 データ線に接続され、計数すべきデータを記憶したデー
タ記憶手段と、 データの個数を計数するための計数手段と、アドレス線
に接続され、前記計数手段の計数結果を記憶するための
計数結果記憶手段と、 前記データ記憶手段に接続された前記データ線を前記計
数結果記憶手段に接続された前記アドレス線に接続する
ための切換手段と、 前記切換手段によって前記データ線と前記アドレス線と
が接続されたとき、前記データ記憶手段に記憶されてい
る各データを順次、アドレス情報として前記計数結果記
憶手段に与えるとともに、与えられるアドレスごとに当
該アドレスから個数データを読出して前記計数手段に与
えて更新させ、その更新結果を前記計数結果記憶手段の
当該アドレスに格納させる計数制御手段とを備えたデー
タの個数を計数記憶する回路。
[Claims] Data storage means connected to a data line and storing data to be counted; counting means for counting the number of pieces of data; and connected to an address line and storing counting results of the counting means. counting result storage means for connecting the data line connected to the data storage means to the address line connected to the counting result storage means; switching means for connecting the data line and the address line connected to the counting result storage means; When the address line is connected, each piece of data stored in the data storage means is sequentially given to the counting result storage means as address information, and count data is read from the address for each given address to A circuit for counting and storing the number of pieces of data, comprising a counting control means for updating the data by applying it to the counting means and storing the updated result at the corresponding address of the counting result storage means.
JP63177494A 1988-07-15 1988-07-15 Circuit for counting/storing data number Pending JPH0227487A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP63177494A JPH0227487A (en) 1988-07-15 1988-07-15 Circuit for counting/storing data number

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63177494A JPH0227487A (en) 1988-07-15 1988-07-15 Circuit for counting/storing data number

Publications (1)

Publication Number Publication Date
JPH0227487A true JPH0227487A (en) 1990-01-30

Family

ID=16031885

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63177494A Pending JPH0227487A (en) 1988-07-15 1988-07-15 Circuit for counting/storing data number

Country Status (1)

Country Link
JP (1) JPH0227487A (en)

Similar Documents

Publication Publication Date Title
US4839856A (en) Memory access control circuit
EP0173098A2 (en) Pattern outline tracking method and apparatus
EP0337325A2 (en) Image processing method
JPH0550783B2 (en)
JPH0227487A (en) Circuit for counting/storing data number
CN101562691A (en) Image processing device and method
JPH01288974A (en) Picture processing method
JPS6362083A (en) Projection data generation system
JP3260848B2 (en) Brightness conversion circuit
US5307454A (en) Apparatus for extracting local image from original image
JPH07302187A (en) Data sorting method and sorter
JPH07101382B2 (en) Margin processing device
JP2861435B2 (en) Pipeline type arithmetic unit
JPH02308377A (en) Picture processor
JPH0394325A (en) Data selector
JPS59114657A (en) Memory interface circuit of microcomputer
JPS58112124A (en) Dma controlling system
JPH05341957A (en) Ring buffer circuit
JPS62108381A (en) Density histogram detecting system
JPS6243752A (en) Signal controller
JPH0748309B2 (en) Symbol string matching memory and its cascade connection method
JPH0757079A (en) Dotting processing circuit of image processor
JPS63201788A (en) Picture data segmenting circuit
JPS61131084A (en) Picture processor
JPH01114961A (en) Directory memory access controller