JPH01154239A - Parity detecting device - Google Patents
Parity detecting deviceInfo
- Publication number
- JPH01154239A JPH01154239A JP62312715A JP31271587A JPH01154239A JP H01154239 A JPH01154239 A JP H01154239A JP 62312715 A JP62312715 A JP 62312715A JP 31271587 A JP31271587 A JP 31271587A JP H01154239 A JPH01154239 A JP H01154239A
- Authority
- JP
- Japan
- Prior art keywords
- data
- parity
- value
- bits
- count
- 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
- 238000001514 detection method Methods 0.000 claims description 10
- 238000010586 diagram Methods 0.000 description 3
- 230000015572 biosynthetic process Effects 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 238000003786 synthesis reaction Methods 0.000 description 1
Landscapes
- Detection And Correction Of Errors (AREA)
Abstract
Description
【発明の詳細な説明】
産業上の利用分野
本発明はデータの重みづけが可能なパリティ検出装置に
関するものである。DETAILED DESCRIPTION OF THE INVENTION Field of the Invention The present invention relates to a parity detection device capable of weighting data.
従来の技術
従来はデータにパリティビットを設け、単にパリティを
検出するだけのものであった。以下に従来のパリティ検
出装置について説明する。第3図は従来の一実施例のブ
ロック図である。データ1にデータビットのほかに、パ
リティビットを設け、データビットの排他的論理和(E
X−OR)回路7による論理合成をとることでパリティ
値を検出し、データ書き込み時にパリティ値をパリティ
ビットに書き込み、読み出し時に、パリティ値を再度検
出し、比較器6においてパリティビットに書かれたパリ
ティ値の比較を行なう。2. Description of the Related Art Conventionally, a parity bit was provided in data and the parity was simply detected. A conventional parity detection device will be explained below. FIG. 3 is a block diagram of a conventional embodiment. In addition to the data bits, a parity bit is provided for data 1, and the exclusive OR (E
X-OR) The parity value is detected by logic synthesis using the circuit 7, the parity value is written to the parity bit when data is written, the parity value is detected again when reading, and the parity value is written to the parity bit by the comparator 6. Compare parity values.
発明が解決しようとする問題点
従来の技術は単純にパリティ値を検出し、パリティチエ
ツクを行なうという点では優れたものであるが、そのデ
ータに重みづけをする機能を備えていなかった。Problems to be Solved by the Invention Although conventional techniques are excellent in simply detecting parity values and performing parity checks, they do not have a function to weight the data.
本発明は上記の従来の問題点を解決するもので、データ
の1の個数もしくは0の個数によるデータの重みづけ検
出も実現することのできるパリティ検出装置を提供する
ことを目的とする。The present invention solves the above-mentioned conventional problems, and aims to provide a parity detection device that can also realize weighted detection of data depending on the number of 1's or 0's in the data.
問題点を解決するための手段
この目的を達成するために、本発明のパリティ検出装置
は、データの1もしくは0の個数を計数する回路を備え
、データの重みづけができる構成を有している。Means for Solving the Problems In order to achieve this object, the parity detection device of the present invention includes a circuit that counts the number of 1s or 0s in data, and has a configuration that can weight the data. .
作用
この構成によってデータの1もしくはOの個数を計数す
ることができ、これによりパリティ値検出とデータの重
みづけをすることができる。Function: With this configuration, it is possible to count the number of 1's or 0's in the data, thereby making it possible to detect the parity value and weight the data.
実施例 以下に本発明の一実施例について説明する。Example An embodiment of the present invention will be described below.
第1図は本発明の一実施例におけるパリティ検出装置を
ブロック図で示すものである。第1図において、1はデ
ータ、2はシフトレジスタ、3は1の個数を計数するの
か00個数を計数するのかを選択する回路、5はアップ
カウンタ、6は比較器である。ここでは8ビツトのデー
タビットと1ビツトのパリティビットとを含む9ビツト
のデータ構成である。FIG. 1 is a block diagram showing a parity detection device according to an embodiment of the present invention. In FIG. 1, 1 is data, 2 is a shift register, 3 is a circuit for selecting whether to count 1's or 00's, 5 is an up counter, and 6 is a comparator. Here, the data structure is 9 bits including 8 data bits and 1 parity bit.
データ1の1もしくはOの個数を計数する場合、8ビツ
トのデータビットはそのままシフトレジスタ2に転送さ
れる。1の個数を計数するのか、0の個数を計数するの
かを選択する回路3とシフトレジスタ2からの出力とで
論理積(AND回路)4がとられるビットのアップカウ
ンタ5に入力され、1の個数もしくはOの個数が計数さ
れる。第2図に真理値を示すように、1の個数計数値も
しくはOの個数計数値のLSBはそのデータのパリティ
値を示しており、第1図のアップカウンタ5のLSBの
値とデータ1のパリティビットを比較器6で比較するこ
とでパリティチエツクが可能となる。また1の個数もし
くはOの個数はアップカウンタ5の値を読み出せばよい
。When counting the number of 1's or O's in data 1, the 8 data bits are transferred to the shift register 2 as they are. The output from the shift register 2 and the circuit 3 that selects whether to count the number of 1's or the number of 0's are logically ANDed (AND circuit) 4. The number or number of O's is counted. As shown in the truth value in Figure 2, the LSB of the count value of 1 or the count value of O indicates the parity value of the data, and the LSB value of the up counter 5 in Figure 1 and the value of the data 1 By comparing the parity bits with the comparator 6, parity check becomes possible. Further, the number of 1's or the number of O's can be determined by reading the value of the up counter 5.
シフトレジスタ2とアップカウンタ5は必ずしもシステ
ムクロックで動作する必要はなく、動作可能な最小幅の
クロックで構成されるのが望ましい。The shift register 2 and up counter 5 do not necessarily need to operate with the system clock, but are preferably configured with a clock of the minimum width that can be operated.
以上のように本実施例によればパリティ検出と1の個数
もしくはOの個数によるデータの重みづけができ、これ
により、データそのものの値ではなく1の個数、0の個
数によってそのデータに対して重みづけが必要なときに
実現が可能である。As described above, according to this embodiment, it is possible to detect parity and weight data based on the number of 1's or O's, and this allows data to be weighted based on the number of 1's and 0's rather than the value of the data itself. This can be achieved when weighting is required.
尚、本実施例ではデータビットを8ビツトとしたが、こ
れは4ビツト、16ビツト、32ビツト等の任意のビッ
ト長でも可能である。この場合、データ長に合わせてシ
フトレジスタやアップカウンタの構成を変えることで実
現できる。In this embodiment, the data bits are 8 bits, but any bit length such as 4 bits, 16 bits, 32 bits, etc. is also possible. In this case, this can be achieved by changing the configuration of the shift register and up counter according to the data length.
発明の効果
本発明によると、データの1の個数もしくは0の個数を
計数する回路を設けることにより、パリティを検出でき
かつ、データの1もしくはOの個数による重みづけがで
き、データの1もしくはOの個数によりそのデータに対
する処理内容を変えたい場合、簡単に実現できる優れた
パリティ検出装置を実現できる。Effects of the Invention According to the present invention, by providing a circuit that counts the number of 1's or 0's in the data, parity can be detected and weighting can be performed according to the number of 1's or 0's in the data. If it is desired to change the processing content for the data depending on the number of data, an excellent parity detection device that can be easily implemented can be realized.
第1図は本発明の一実施例におけるパリティ検出回路、
第2図はデータと計数値、パリティの関係を示した真理
値図、第3図は従来のパリティ検出回路。
1・・・・・・データ、2・・・・・・シフトレジスタ
、3・・・・・・1もしくは0個数のどちらを計数する
か選択する回路、4・・・・・・AND回路、5・・・
・・・アップカウンタ、6・・・・・・比較器、7・・
・・・・EX−OR回路。FIG. 1 shows a parity detection circuit in an embodiment of the present invention.
Figure 2 is a truth diagram showing the relationship between data, count values, and parity, and Figure 3 is a conventional parity detection circuit. 1...Data, 2...Shift register, 3...Circuit for selecting whether to count 1 or 0, 4...AND circuit, 5...
...Up counter, 6...Comparator, 7...
...EX-OR circuit.
Claims (1)
れた値によりパリテイを検出し、かつ、前記1の個数も
しくは0の個数によるデータの重みづけ機能手段とをそ
なえたパリテイ検出装置。A parity detection device comprising a circuit for counting the number of 1's or 0's in data, and a function means for detecting parity based on the counted value and weighting the data according to the number of 1's or 0's.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP62312715A JPH01154239A (en) | 1987-12-10 | 1987-12-10 | Parity detecting device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP62312715A JPH01154239A (en) | 1987-12-10 | 1987-12-10 | Parity detecting device |
Publications (1)
Publication Number | Publication Date |
---|---|
JPH01154239A true JPH01154239A (en) | 1989-06-16 |
Family
ID=18032554
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP62312715A Pending JPH01154239A (en) | 1987-12-10 | 1987-12-10 | Parity detecting device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH01154239A (en) |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS56153511A (en) * | 1980-04-23 | 1981-11-27 | Hitachi Ltd | Magnetic tape storing system |
-
1987
- 1987-12-10 JP JP62312715A patent/JPH01154239A/en active Pending
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS56153511A (en) * | 1980-04-23 | 1981-11-27 | Hitachi Ltd | Magnetic tape storing system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP3012357B2 (en) | Shift amount detection circuit | |
JPH01154239A (en) | Parity detecting device | |
JP2565730B2 (en) | Overflow detection circuit | |
JPH06188872A (en) | Synchronization protective circuit | |
US4771402A (en) | Address comparator | |
US5307061A (en) | Absolute value circuit | |
JPH0736149B2 (en) | Shift flag generation circuit | |
JPS6260331A (en) | Circuit for detecting digital synchronizing word | |
JP2761558B2 (en) | Bit search device | |
JPH03102265A (en) | Maximum value detecting circuit | |
JPS6335038A (en) | Communication line state detection circuit | |
JPS62229335A (en) | Address comparator | |
JPH03104319A (en) | Error detection circuit | |
SU1137469A2 (en) | Device for determination of most significant bit | |
JPS61275936A (en) | Condition determining device | |
JPH035855A (en) | Single chip microcomputer | |
JPS63185136A (en) | Sampling clock recovery circuit | |
JPH0535362A (en) | Timer counter circuit | |
JP2001022557A (en) | Logic circuit | |
JPH02232722A (en) | Sign discriminating circuit for signed digit number | |
JPS622317A (en) | Multilevel comparison and coincidence detecting circuit | |
JPH05257608A (en) | Data detection device and data transfer device | |
JPH01217634A (en) | Multi-input interruption circuit | |
JPS6386936A (en) | Unique pattern detecting circuit | |
JPS5945260B2 (en) | Counter parity prediction circuit |