JP2002222078A - Binary-decimal conversion circuit and its method - Google Patents

Binary-decimal conversion circuit and its method

Info

Publication number
JP2002222078A
JP2002222078A JP2001020210A JP2001020210A JP2002222078A JP 2002222078 A JP2002222078 A JP 2002222078A JP 2001020210 A JP2001020210 A JP 2001020210A JP 2001020210 A JP2001020210 A JP 2001020210A JP 2002222078 A JP2002222078 A JP 2002222078A
Authority
JP
Japan
Prior art keywords
decimal
data
binary
output
input
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
JP2001020210A
Other languages
Japanese (ja)
Other versions
JP3592242B2 (en
Inventor
Atsushi Naito
淳 内藤
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.)
NEC Computertechno Ltd
Original Assignee
NEC Computertechno 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 NEC Computertechno Ltd filed Critical NEC Computertechno Ltd
Priority to JP2001020210A priority Critical patent/JP3592242B2/en
Publication of JP2002222078A publication Critical patent/JP2002222078A/en
Application granted granted Critical
Publication of JP3592242B2 publication Critical patent/JP3592242B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To provide a binary-decimal conversion circuit which is increased in the processing speed for conversion from a 4-bit binary number to a decimal number. SOLUTION: This circuit has a decimal adder 13 which adds decimal data and has two data inputs and a carry input, a decimal-binary 20-multiple generating circuit 15, and a decimal 4-multiple generating circuit 16, and inputs the output of the decimal 20-multiple generating circuit 15 inputting the output of a decimal data register 14 as an arithmetic result to the high-order part of one input of the decimal adder 13 and the most significant 4 bits of the binary data register 12 holding binary data to be converted to the low-order part of a decimal 20-multiple inputted to one input of the decimal adder 13. Further, data generated by inverting the output of the decimal 4-multiple generating circuit 16 inputting the arithmetic result are inputted to the other input of the decimal adder and 1 is always inputted to the carry input of the decimal adder 13 to generate a complement of 2 to the decimal 4-multiple.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、情報処理装置にお
ける2進数を10進数に変換する回路に関し、特に2進
数を4ビットずつ10進数に変換する事で変換速度の高
速化を図った2進10進変換回路に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a circuit for converting a binary number into a decimal number in an information processing apparatus, and in particular, to a binary number which converts a binary number into a decimal number by 4 bits to increase the conversion speed. The present invention relates to a decimal conversion circuit.

【0002】[0002]

【従来の技術】従来の2進10進変換回路においては、
たとえば、「特開昭59−168543号公報」記載の
技術のように、2進データの各ビットを1ビット毎に検
査することにより変換を行っている。
2. Description of the Related Art In a conventional binary-decimal conversion circuit,
For example, conversion is performed by checking each bit of binary data bit by bit as in the technique described in Japanese Patent Application Laid-Open No. Sho 59-168543.

【0003】図9は、この従来の技術を示すブロック図
である。図9を参照すると、この2進10進変換回路
は、2進データセレクタ11と、2進データレジスタ1
2と、10進加算器13と、10進データレジスタ14
とから構成される。
FIG. 9 is a block diagram showing this conventional technique. Referring to FIG. 9, this binary-decimal conversion circuit includes a binary data selector 11 and a binary data register 1.
2, decimal adder 13 and decimal data register 14
It is composed of

【0004】変換対象2進データ000と2進データレ
ジスタ12を1ビット左にシフトしたデータ300とを
2進データセレクタ11に入力し、2進データセレクタ
11の出力100を2進データレジスタ12に入力し、
10進データレジスタ14の出力500を10進加算器
13の両方の入力に入力し、2進データレジスタ12の
最上位1ビット200を10進加算器13のキャリー入
力に入力し、10進加算器13の出力400を10進デ
ータレジスタ14に入力する。
The binary data 000 to be converted and the data 300 obtained by shifting the binary data register 12 to the left by one bit are input to the binary data selector 11, and the output 100 of the binary data selector 11 is input to the binary data register 12. type in,
The output 500 of the decimal data register 14 is input to both inputs of the decimal adder 13, the most significant bit 200 of the binary data register 12 is input to the carry input of the decimal adder 13, and the decimal adder 13 is input to the decimal data register 14.

【0005】まず、変換対象の2進データ000を2進
データセレクタ11を経由して2進データレジスタ12
にロードし、同時に10進データレジスタ14をリセッ
トする。
[0005] First, binary data 000 to be converted is transferred to a binary data register 12 via a binary data selector 11.
And reset the decimal data register 14 at the same time.

【0006】次に、2進データレジスタ12の最上位ビ
ット200と10進データレジスタ14のデータ500
とを10進加算器13で加算することにより、10進デ
ータレジスタ14の値500の2倍数と2進データレジ
スタ12の最上位ビット200との加算を行う。また、
10進加算器13の出力400を10進データレジスタ
14に格納すると同時に、2進データレジスタ12のデ
ータを1ビット左シフトしたデータ300を、2進デー
タセレクタ11を経由して2進データレジスタ12に格
納する。
Next, the most significant bit 200 of the binary data register 12 and the data 500 of the decimal data register 14
Are added by the decimal adder 13 to add the double number of the value 500 of the decimal data register 14 and the most significant bit 200 of the binary data register 12. Also,
The output 400 of the decimal adder 13 is stored in the decimal data register 14, and at the same time, the data 300 obtained by shifting the data of the binary data register 12 to the left by one bit is transferred via the binary data selector 11 to the binary data register 12. To be stored.

【0007】この動作を2進データのビット数分だけ繰
り返すことにより2進10進変換を行っている。
This operation is repeated by the number of bits of binary data, thereby performing binary-decimal conversion.

【0008】[0008]

【発明が解決しようとする課題】上述した従来の2進1
0進変換回路では、2進データがn(正整数)ビットと
すると、n回の加算動作が演算回路に要求される。この
ため2進10進変換に必要な実行時間が大きくなり、演
算速度の低下および処理時間の増大を招くという欠点が
ある。このため本発明者による特開2000−2001
74号公報によって一演算サイクルにおいて3ビットず
つの2進10進変換を行う改善を行ったが本発明ではさ
らにそれを4ビットずつ処理することで、一層の高速化
を図るものである。
SUMMARY OF THE INVENTION The above-described conventional binary 1
In the zero-ary conversion circuit, assuming that the binary data has n (positive integer) bits, the arithmetic circuit is required to perform an addition operation n times. For this reason, there is a disadvantage that the execution time required for the binary-decimal conversion is increased, which causes a reduction in the operation speed and an increase in the processing time. For this reason, Japanese Patent Application Laid-Open No. 2000-2001
No. 74 has made an improvement to perform binary-to-decimal conversion for each three bits in one operation cycle. In the present invention, however, further processing is performed for each four bits, thereby further increasing the speed.

【0009】[0009]

【課題を解決するための手段】本発明の第1の2進10
進変換回路は、10進データを20倍する10進20倍
数生成回路と、10進データを4倍する10進4倍数生
成回路と、変換の対象となる2進数値を格納し演算サイ
クルに従って上位4ビットの2進数値を出力すると次の
演算サイクルに備え2進数値を左へ4ビットシフトさせ
る2進データレジスタと、前記2進データレジスタの左
端上位の4ビットを入力して5ビットの10進数値に変
換する4ビット2進10進変換器と、前記10進20倍
数生成回路の出力データと前記4ビット2進10進変換
器の出力データとを第1のデータ入力とし前記10進4
倍数生成回路の出力データを反転したデータを第2のデ
ータ入力とし且つ1のキャリを入力して第1のデータ入
力と第2のデータ入力との加算を行う10進加算器と、
前記10進加算器の演算結果を保持し次の演算サイクル
に前記10進20倍数生成回路と前記10進4倍数生成
回路とに保持したデータを出力する10進データレジス
タと、を備え、前記2進データレジスタからの4ビット
の2進数値の出力と前記10進データレジスタからの1
0進数値の出力とを1演算サイクルにおいて同期して行
うことを特徴とする。
SUMMARY OF THE INVENTION A first binary 10 according to the present invention.
The decimal conversion circuit includes a decimal 20-fold generation circuit for multiplying decimal data by 20, a decimal 4-fold generation circuit for quadrupling decimal data, and a binary value to be converted. When a 4-bit binary value is output, a binary data register that shifts the binary value to the left by 4 bits in preparation for the next operation cycle, and inputs the upper 4 bits at the left end of the binary data register to input 5 bits of 10 bits A 4-bit binary-decimal converter for converting to a decimal value, the output data of the 20-fold decimal generation circuit and the output data of the 4-bit binary-decimal converter as a first data input,
A decimal adder that uses the data obtained by inverting the output data of the multiple generation circuit as a second data input and inputs a carry of 1 to add the first data input and the second data input;
A decimal data register for holding the operation result of the decimal adder and outputting the data held in the decimal 20-times multiple generation circuit and the decimal 4-times generation circuit in the next operation cycle; Output of a 4-bit binary value from the decimal data register and 1 from the decimal data register
It is characterized in that the output of the 0-base value is performed synchronously in one operation cycle.

【0010】本発明の第2の2進10進変換回路は、第
1の発明において、前記10進20倍数生成回路の出力
する10進20倍数データと前記10進20倍数データ
の下位5ビットは0であることを利用し前記4ビット2
進10進変換器の出力データを前記下位5ビットの位置
に取り込んで第1のデータ入力とし、前記10進4倍数
生成回路による10進4倍数を反転したデータを第2の
データ入力とし、前記10進20倍数データと前記4ビ
ット2進10進変換器の出力データと前記10進4倍数
データとを1回の演算で加算する10進加算器を備え
る。
According to a second binary-decimal conversion circuit of the present invention, in the first invention, the 20-fold decimal data output from the 20-fold decimal number generating circuit and the lower 5 bits of the 20-fold decimal data are 4 bits 2
The output data of the decimal-decimal converter is taken into the position of the lower 5 bits and used as a first data input, and the data obtained by inverting the decimal quadruple by the decimal quadruple generation circuit is used as a second data input. There is provided a decimal adder for adding the 20-fold decimal data, the output data of the 4-bit binary-decimal converter, and the 4-fold decimal data in one operation.

【0011】本発明の第3の2進10進変換回路は、第
1または第2の発明において、前記第1のデータ入力と
前記第2のデータ入力とを元に前演算サイクルでの演算
結果の10進16倍数に前記4ビット2進10進変換器
の出力結果を合計する数値を出力する10進加算器を備
える。
[0011] The third binary-decimal conversion circuit according to the first or second invention, wherein the operation result in the previous operation cycle is based on the first data input and the second data input. And a decimal adder for outputting a numerical value that sums the output result of the 4-bit binary-decimal converter to a 16-times decimal number.

【0012】本発明の第4の2進10進変換回路は、第
1の発明において、10進データを2倍する10進2倍
数生成回路を2段に直列に接続した構成からなる前記1
0進4倍数生成回路を備える。
The fourth binary-decimal conversion circuit of the present invention is the first invention, wherein the first binary-decimal number generating circuit for doubling the decimal data is connected in series in two stages.
A quadruple-number generation circuit is provided.

【0013】本発明の第5の2進10進変換回路は、第
1の発明において、10進2倍数を前記10進2倍数生
成回路で生成しその結果を4ビット左へシフトする事で
10進20倍数を生成する前記10進20倍数生成回路
を備える。
The fifth binary-decimal conversion circuit according to the first invention is the same as the first invention, except that the double-decimal number is generated by the double-decimal number generating circuit and the result is shifted to the left by 4 bits. And a decimal 20-fold multiple generation circuit for generating a binary 20-fold multiple.

【0014】本発明の第6の2進10進変換回路は、第
1の発明において、前記2進データレジスタに格納され
た2進数値の変換後の10進数値を格納する前記10進
データレジスタを備える。
A sixth binary-decimal conversion circuit according to the first invention is the decimal data register for storing the converted decimal value of the binary value stored in the binary data register. Is provided.

【0015】本発明の第1の2進10進変換方法は、変
換の対象となる2進数値の上位から4ビットを出力する
と当該2進数値を左へ4ビットシフトして次の演算サイ
クルの準備をする第1のステップと、第1のステップで
出力された4ビットの2進数値を5ビットの10進数値
に変換する第2のステップと、前演算サイクルで生成さ
れた10進数の20倍数と4倍数とを生成する第3のス
テップと、第3のステップで生成された4倍数に対して
反転を行う第4のステップと、第2のステップによる1
0進数値と前記第3のステップの20倍数とを第1の入
力とし前記第4のステップで反転された4倍数を第2の
入力としキャリに1を入力して加算を行い10進数を生
成する第5のステップと、第5のステップで生成された
結果を保持し次の演算サイクルにおいて第3のステップ
への出力を行う第6のステップと、を備える。
According to the first binary-decimal conversion method of the present invention, when the upper 4 bits of a binary value to be converted are output, the binary value is shifted by 4 bits to the left, and the next arithmetic cycle is executed. A first step of preparing, a second step of converting the 4-bit binary value output in the first step into a 5-bit decimal value, and a 20-bit decimal number generated in the previous operation cycle A third step of generating a multiple and a quadruple, a fourth step of inverting the quadruple generated in the third step, and 1 of a second step.
A decimal number is generated by inputting a 0-ary value and a 20-fold multiple of the third step as a first input, a quadruple inverted in the fourth step as a second input, and inputting 1 into a carry to perform addition, thereby generating a decimal number. And a sixth step of holding the result generated in the fifth step and outputting the result to the third step in the next operation cycle.

【0016】[0016]

【発明の実施の形態】次に、本発明の実施の形態につい
て図面を参照して詳細に説明する。
Next, embodiments of the present invention will be described in detail with reference to the drawings.

【0017】図1は本発明の構成を示すブロック図であ
る。
FIG. 1 is a block diagram showing the configuration of the present invention.

【0018】図1を参照すると、2進数データであって
10進数への変換が行われる変換対象2進データ000
と2進データレジスタ12の出力データを4ビット左に
シフトしたデータ300とを選択して取り込む2進デー
タセレクタ11を備え、2進データセレクタ11の出力
100を2進データレジスタ12に入力する。
Referring to FIG. 1, binary data 000 to be converted, which is binary data and is converted to a decimal number.
And a binary data selector 11 for selecting and taking in data 300 obtained by shifting the output data of the binary data register 12 to the left by 4 bits. The output 100 of the binary data selector 11 is input to the binary data register 12.

【0019】2進データレジスタ12の上位4ビット
は、演算サイクルに対応して4ビット2進10進変換器
18に逐次取り込まれ、4ビットの2進数が5ビットか
らなる10進数に変換されて10進加算器13に供給さ
れる。
The upper 4 bits of the binary data register 12 are sequentially taken in by a 4-bit binary-decimal converter 18 corresponding to the operation cycle, and the 4-bit binary number is converted into a 5-bit decimal number. It is supplied to a decimal adder 13.

【0020】また、10進データレジスタ14の出力9
00は、20倍する10進数値を生成する10進20倍
数生成回路15と、同じく出力900を4倍する10進
数値を生成する10進4倍数生成回路16と、に入力さ
れる。
The output 9 of the decimal data register 14
00 is input to a decimal 20-fold generation circuit 15 that generates a decimal value to be multiplied by 20, and a decimal quadruple generation circuit 16 that also generates a decimal value to quadruple the output 900.

【0021】そして、10進20倍数生成回路15の出
力400(20倍数は最下位5ビットが00000とな
っている。)を10進加算器13の2つある入力の1つ
の入力位置に入力し、4ビット2進10進変換器18か
ら出力された5ビットからなる10進数値を10進20
倍数400を入力した入力の最下位5ビットにそのまま
取り込み、10進4倍数生成回路16の出力500を反
転回路17で反転したデータ600を10進加算器13
のもう一つの入力に入力し、10進加算器13のキャリ
入力700には常に1を入力して10進加算器13によ
る10進数値の加算演算を実行する。10進加算器13
の出力800は、10進データレジスタ14に格納され
る。
Then, the output 400 of the decimal 20-multiple generating circuit 15 (the least significant 5 bits are 00000 for the 20-multiple) is input to one input position of the two inputs of the decimal adder 13. The 5-bit decimal value output from the 4-bit binary-decimal converter 18 is converted to a decimal 20
The data 400 obtained by inverting the output 500 of the decimal quadruple number generating circuit 16 by the inverting circuit 17 is taken as it is into the decimal adder 13
, And 1 is always input to the carry input 700 of the decimal adder 13 to execute the addition operation of the decimal value by the decimal adder 13. Decimal adder 13
Is stored in the decimal data register 14.

【0022】図2を参照すると、入力された数値の2倍
の10進数値を生成する10進2倍数生成回路は、 j桁(jは正整数)の10進データ d0(0),d0(1),d0(2),d0(3),・
・・,di−1(0),di−1(1),di−1
(2),di−1(3),di(0),di(1),d
i(2),di(3),di+1(0),di+1
(1),di+1(2),di+1(3),・・・,d
j−1(0),dj−1(1),dj−1(2),dj
−1(3) から、10進2倍数データ D−1(3),D0(0),D0(1),D0(2),
・・・、Di−2(3),Di−1(0),Di−1
(1),Di−1(2),Di−1(3)、Di
(0),Di(1),Di(2),Di(3)、Di+
1(0),Di+1(1),Di+1(2),・・・,
Dj−2(3)、Dj−1(0),Dj−1(1),D
j−1(2) を生成するように、1桁の10進2倍数生成回路20〜
24から構成される(これらはすべて同一の構成を持
つ)。
Referring to FIG. 2, a decimal double number generating circuit for generating a decimal value twice as large as an input numerical value includes j-digit (j is a positive integer) decimal data d0 (0), d0 ( 1), d0 (2), d0 (3),.
.., di-1 (0), di-1 (1), di-1
(2), di-1 (3), di (0), di (1), d
i (2), di (3), di + 1 (0), di + 1
(1), di + 1 (2), di + 1 (3),..., D
j-1 (0), dj-1 (1), dj-1 (2), dj
From -1 (3), decimal double data D-1 (3), D0 (0), D0 (1), D0 (2),
..., Di-2 (3), Di-1 (0), Di-1
(1), Di-1 (2), Di-1 (3), Di
(0), Di (1), Di (2), Di (3), Di +
1 (0), Di + 1 (1), Di + 1 (2),...
Dj-2 (3), Dj-1 (0), Dj-1 (1), D
j-1 (2) so as to generate 1-digit decimal double generation circuits 20 to
24 (they all have the same configuration).

【0023】図3は、図2の1桁の10進2倍数生成回
路20〜24の詳細回路図である。
FIG. 3 is a detailed circuit diagram of the single-digit decimal double generation circuits 20 to 24 of FIG.

【0024】図4は、1桁の10進2倍数生成回路20
〜24の変換表である。
FIG. 4 shows a single-digit decimal double generation circuit 20.
24 is a conversion table of FIG.

【0025】図4に示すとおり、10進データの4ビッ
トからなる1桁は、10進数の“0”から“9”までで
あることから、その2倍数は“0”から“18”までで
あり、10進2倍数生成結果の変換桁の最下位ビットD
(3)は必ず“0”となる。図5は、複数桁の10進数
の10進2倍数生成回路の1桁単位の変換表である。複
数桁の10進数の10進2倍数の生成においては、下位
桁からの桁上がりが1ビット生じるが、図4で説明した
通り、各桁の最下位ビットは2倍されることにより
“0”となるため、下位桁からの桁上がり1ビットをそ
のまま入れることができる。
As shown in FIG. 4, one digit consisting of four bits of decimal data is from "0" to "9" of the decimal number, and its double is from "0" to "18". Yes, the least significant bit D of the conversion digit of the result of generating a decimal double number
(3) is always "0". FIG. 5 is a conversion table in units of one digit of the circuit for generating a decimal double number of a plurality of decimal numbers. In the generation of a decimal double of a multi-digit decimal number, one bit carries from the lower digit, but as described with reference to FIG. 4, the least significant bit of each digit is doubled to “0”. Therefore, one bit of carry from the lower digit can be directly input.

【0026】したがって、j桁(jは正整数)の10進
数の任意の1桁のdi(0),di(1),di
(2),di(3)を10進2倍数Di−1(3),D
i(0),Di(1),Di(2),Di(3)に変換
する場合(iは0からj−1の正整数)、 Di−1(3)=di(0)+di(1)*(di
(2)+di(3)) Di(0) =di(0)*di(3)+di(1)
*di(2)’*di(3)’ Di(1) =di(0)*di(3)’+di
(1)’*di(2)+di(2)*di(3) Di(2) =di(0)’*di(1)’*di
(3)+di(1)*di(2)*di(3)’+di
(0)*di(3)’ の論理により生成できる。(ここで、「*」は論理積、
「+」は論理和、「’」は反転(コンプリメント)を示
している。) よって、図3の10進1桁の10進2倍数生成回路を、
図2のように並列に接続して10進2倍数生成回路を構
成することにより、複数桁の10進数の10進2倍数を
生成することができる。この2倍数生成回路を直列に2
段組み合わせることで10進4倍数生成回路16を実現
する。
Therefore, any one digit of di (0), di (1), di of a j-digit (j is a positive integer) decimal number
(2), di (3) is a decimal double Di-1 (3), D
When converting to i (0), Di (1), Di (2), Di (3) (i is a positive integer from 0 to j-1), Di-1 (3) = di (0) + di (1) ) * (Di
(2) + di (3)) Di (0) = di (0) * di (3) + di (1)
* Di (2) '* di (3)' Di (1) = di (0) * di (3) '+ di
(1) '* di (2) + di (2) * di (3) Di (2) = di (0)' * di (1) '* di
(3) + di (1) * di (2) * di (3) '+ di
It can be generated by the logic of (0) * di (3) ′. (Where "*" is a logical product,
“+” Indicates a logical sum, and “′” indicates an inversion (complement). Therefore, the decimal 1-digit double doubling circuit of FIG.
As shown in FIG. 2, by connecting them in parallel to form a decimal double number generation circuit, it is possible to generate a decimal double number of a decimal number of a plurality of digits. This double number generation circuit is connected in series to 2
The combination of stages realizes the decimal quadruple number generation circuit 16.

【0027】図7を参照すると、10進20倍数生成回
路15は、 j桁(jは正整数)の10進データ d0(0),d0(1),d0(2),d0(3)・・
・ di−1(0),di−1(1),di−1(2),d
i−1(3),di(0),di(1),di(2),
di(3),di+1(0),di+1(1),di+
1(2),di+1(3),・・・,dj−1(0),
dj−1(1),dj−1(2),dj−1(3) から、10進20倍数データ E0(0),E0(1),E0(2),E0(3)・・
・ Ei−1(0),Ei−1(1),Ei−1(2),E
i−1(3),Ei(0),Ei(1),Ei(2),
Ei(3),Ei+1(0),Ei+1(1),Ei+
1(2),Ei+1(3),・・・,Ej−1(0),
Ej−1(1),Ej−1(2),Ej−1(3),E
j(0),Ej(1),Ej(2),Ej(3)を生成
する。
Referring to FIG. 7, the decimal 20 multiple generation circuit 15 generates j-digit (j is a positive integer) decimal data d0 (0), d0 (1), d0 (2), d0 (3).・
-Di-1 (0), di-1 (1), di-1 (2), d
i-1 (3), di (0), di (1), di (2),
di (3), di + 1 (0), di + 1 (1), di +
1 (2), di + 1 (3), ..., dj-1 (0),
From dj-1 (1), dj-1 (2), dj-1 (3), decimal multiple data E0 (0), E0 (1), E0 (2), E0 (3), etc.
Ei-1 (0), Ei-1 (1), Ei-1 (2), E
i-1 (3), Ei (0), Ei (1), Ei (2),
Ei (3), Ei + 1 (0), Ei + 1 (1), Ei +
1 (2), Ei + 1 (3), ..., Ej-1 (0),
Ej-1 (1), Ej-1 (2), Ej-1 (3), E
j (0), Ej (1), Ej (2), and Ej (3) are generated.

【0028】10進20倍数データは上記10進2倍数
生成回路を使用し、その出力を10倍することで得られ
る。10進データレジスタ14の出力10進データ90
0を10進2倍数生成回路に入力し10進2倍数を生成
し、その出力を1桁分(4bit)左へシフト(10進
数の特徴として10進数の10倍は最下位桁に4bit
の0を付加するだけで得られる。)することで10進数
の10進20倍数を生成することができる。
The 20-fold decimal data can be obtained by using the above-mentioned double-decimal number generating circuit and multiplying the output by 10 times. Output decimal data 90 of decimal data register 14
0 is input to the decimal double number generation circuit to generate a decimal double number, and the output is shifted to the left by one digit (4 bits) (as a characteristic of the decimal number, 10 times the decimal number is 4 bits at the least significant digit)
Can be obtained simply by adding 0 to ) To generate a decimal 20 multiple of a decimal number.

【0029】次に、本発明の実施の形態の動作について
図面を参照して説明する。
Next, the operation of the embodiment of the present invention will be described with reference to the drawings.

【0030】本発明の実施例の動作について、図1と図
6を参照して説明する。
The operation of the embodiment of the present invention will be described with reference to FIGS.

【0031】図6は、2進データの例として例えば“0
0001110010000110110”を10進デ
ータに変換する場合の演算動作を、演算サイクル毎に各
構成回路の出力値を示した状態推移表である。(尚、こ
の2進数値を10進数にすると5桁の58422とな
る。)まず、変換対象2進データ000を2進データセ
レクタ11を経由して2進データレジスタ12にロード
し、2進データレジスタの先頭の4ビットを取りだし4
ビット2進10進変換器18に入力して5ビットからな
る10進数に変換をする。図8にその変換の内容を示
す。
FIG. 6 shows an example of binary data such as "0".
0001110010000110110 "is a state transition table showing the operation of converting each constituent circuit in each operation cycle in the case of converting" 0001110010000110110 "to decimal data. (If this binary value is converted to a decimal number, it is a five-digit 58422. First, the binary data 000 to be converted is loaded into the binary data register 12 via the binary data selector 11, and the first four bits of the binary data register are taken out.
It is input to a bit binary-decimal converter 18 and converted to a 5-bit decimal number. FIG. 8 shows the contents of the conversion.

【0032】同時に10進データレジスタ14を0でリ
セットする。
At the same time, the decimal data register 14 is reset to 0.

【0033】次に、10進データレジスタ14の10進
データ900から10進20倍数生成回路15により1
0進20倍数データ400(最下位5ビットは除いたデ
ータ)を生成する。また、10進4倍数生成回路16に
より10進4倍数500を生成し、反転回路17により
反転したデータ600を生成する。
Next, the decimal data 900 in the decimal data register 14 is used to generate 1
It generates 20-fold decimal 0 data 400 (data excluding the least significant 5 bits). Further, a decimal quadruple number generating circuit 16 generates a decimal quadruple number 500, and an inverting circuit 17 generates inverted data 600.

【0034】4ビット2進10進変換器18によって図
8に示すように変換された5ビットのデータを10進2
0倍数生成回路15の出力400の下位5ビットの位置
に挿入し、10進4倍数生成回路15の出力500の出
力したデータを反転させた反転データ600とを10進
加算器13で加算する。このとき10進加算器13のキ
ャリ入力700には”1”を常に入力する。よって3つ
の10進数値の加算を1回の演算処理で実行したことに
なるわけである。
The 5-bit data converted by the 4-bit binary-decimal converter 18 as shown in FIG.
The decimal adder 13 adds the inverted data 600, which is inserted into the lower 5 bits of the output 400 of the 0 multiple generation circuit 15 and inverted from the data output from the output 500 of the decimal quadruple generation circuit 15, by the decimal adder 13. At this time, "1" is always input to the carry input 700 of the decimal adder 13. Thus, the addition of three decimal values is performed in one operation.

【0035】これにより、10進20倍数生成回路の出
力した数値に4ビット2進10進変換器によって変換さ
れた10進数値が足し込まれこの数値から10進4倍数
生成回路16の出力した数値が減算されることになる。
結果として10進データレジスタ14の値の16倍数
(20倍数−4倍数)に、2進データレジスタ12の最
上位4ビットの加算が行われたことになる。
As a result, the decimal value converted by the 4-bit binary-decimal converter is added to the numerical value output from the decimal 20-multiple generating circuit, and the numerical value output from the decimal quadruple-generating circuit 16 is obtained from this numerical value. Is to be subtracted.
As a result, the most significant 4 bits of the binary data register 12 have been added to the 16 times (20 times to 4 times) value of the decimal data register 14.

【0036】また、10進加算器13の出力800を1
0進データレジスタ14に格納すると同時に、2進デー
タレジスタ12のデータを4ビット左シフトしたデータ
300を、2進データレジスタ12に格納する。
The output 800 of the decimal adder 13 is 1
At the same time as storing the data 300 in the binary data register 12, the data 300 obtained by shifting the data in the binary data register 12 to the left by 4 bits is stored in the binary data register 12.

【0037】図6によれば、最初の演算サイクルにおい
て、10進データレジスタ14の初期化された状態の”
00000”(10進)が取り出され10進20倍数生
成回路5と10進4倍数生成回路16とに入力されるこ
とによってそれぞれ10進の20倍数と4倍数とが生成
される。10進20倍数(00000)と2進データレ
ジスタ12の先頭の4ビット(0000)が10進数に
変換された(00)と10進4倍数には反転が施されて
2の補数(0000)とされ1のキャリ入力のもと10
進加算器13で10進20倍数から10進4倍数の減算
が行われる。この加算処理の結果、最初の演算サイクル
では10進数(00000)が求められる。
According to FIG. 6, in the first operation cycle, the decimal data register 14 is initialized.
00000 "(decimal) is taken out and input to the decimal 20-times multiple generation circuit 5 and the decimal 4-times multiple generation circuit 16 to generate the decimal 20-times multiple and the quadruple-times multiple, respectively. (0000) and the first four bits (0000) of the binary data register 12 are converted to decimal numbers (00), and the decimal quadruples are inverted to 2's complement (0000) to carry 1's. Source 10
The decimal adder 13 subtracts a quadruple decimal from a 20-fold decimal. As a result of this addition, a decimal number (00000) is obtained in the first operation cycle.

【0038】2回目の演算サイクルでは、10進20倍
数生成回路15と10進4倍数生成回路16からの出力
は、最初の演算サイクルと同じ10進数(00000)
であるが、2進データレジスタ12の内容は左に4ビッ
トシフトされているため、2進数(1110)が出力さ
れるため4ビット2進10進変換器18の変換結果とし
て10進数(14)が出力される。それによって、10
進加算器13の演算結果として10進数(14)が10
進データレジスタ14に出力される。
In the second operation cycle, the outputs from the decimal 20 multiple generation circuit 15 and the decimal quadruple generation circuit 16 output the same decimal number (00000) as in the first arithmetic cycle.
However, since the contents of the binary data register 12 are shifted to the left by 4 bits, a binary number (1110) is output. Therefore, the conversion result of the 4-bit binary-decimal converter 18 is a decimal number (14). Is output. Thereby, 10
Decimal number (14) is 10
Output to the binary data register 14.

【0039】3回目の演算サイクルでは、10進データ
レジスタ14の内容である10進(14)が取り出さ
れ、それぞれ10進20倍数生成回路15によって10
進(280=14X20)が、10進4倍数生成回路1
6によって10進(56=14X4)が生成される。2
進データレジスタ12からはさらに左に4ビットシフト
した2進数(0100)が取り出され4ビット2進10
進変換器18によって10進数(04)に変換される。
以上の数値が10進加算器13によって演算され(28
0+4−56)結果として228が10進データレジス
タ14に出力される。
In the third operation cycle, the decimal (14), which is the content of the decimal data register 14, is extracted, and the decimal 20 multiple generation circuit 15 outputs the decimal (14).
Hexadecimal (280 = 14X20) is the decimal quadruple generation circuit 1
6 produces a decimal (56 = 14 × 4). 2
From the binary data register 12, a binary number (0100) shifted further to the left by 4 bits is extracted, and a 4-bit binary 10
It is converted to a decimal number (04) by the decimal converter 18.
The above values are calculated by the decimal adder 13 (28
0 + 4-56) As a result, 228 is output to the decimal data register 14.

【0040】以上の処理を繰り返し、結果として図6に
示すような58422を10進データレジスタ14に得
ることができる。
The above processing is repeated, and as a result, 58422 as shown in FIG. 6 can be obtained in the decimal data register 14.

【0041】この動作を2進データのビット数の4分の
1の回数だけ繰り返すことにより、変換対象の2進デー
タ000が10進10進データ900に2進10進変換
される。このようにして、本発明により、2進データ
“00001110010000110110”を10
進データ“58422”に変換する動作が、変換対象2
進データのビット数の1/4回のサイクル数で実現でき
る。
By repeating this operation by a quarter of the number of bits of the binary data, the binary data 000 to be converted is converted into the decimal / decimal data 900. In this way, according to the present invention, the binary data “000001110010000111010” is converted to 10
Is converted to binary data “58422”.
This can be realized with 1/4 cycle number of the bit number of binary data.

【0042】[0042]

【発明の効果】本発明には、nビットの2進データを4
ビット単位に10進データに変換することにより、従来
必要とした1ビット毎n回の演算数がn/4回となり、
演算速度の向上を達成できるという効果がある。
According to the present invention, n-bit binary data is converted to 4 bits.
By converting the data into decimal data in bit units, the number of operations of n times per bit conventionally required becomes n / 4 times,
There is an effect that the calculation speed can be improved.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明の実施の形態の構成を示すブロック図で
ある。
FIG. 1 is a block diagram showing a configuration of an embodiment of the present invention.

【図2】本発明の10進2倍数を生成する回路の構成を
示すブロック図である。
FIG. 2 is a block diagram illustrating a configuration of a circuit that generates a decimal double according to the present invention.

【図3】本発明の1桁の10進2倍数を生成する回路図
である。
FIG. 3 is a circuit diagram for generating a single-digit decimal double according to the present invention;

【図4】本発明の1桁の10進2倍数生成時の変換表で
ある。
FIG. 4 is a conversion table at the time of generating a one-digit decimal double according to the present invention.

【図5】本発明の複数桁変換時の10進2倍数生成時の
変換表である。
FIG. 5 is a conversion table at the time of generating a decimal double at the time of multi-digit conversion according to the present invention.

【図6】本発明の2進数を10進数に変換する時の実施
例を用いた状態推移表である。
FIG. 6 is a state transition table using an embodiment when converting a binary number to a decimal number according to the present invention.

【図7】本発明の10進20倍数を生成する回路の構成
を示すブロック図である。
FIG. 7 is a block diagram illustrating a configuration of a circuit that generates a decimal 20 multiple according to the present invention.

【図8】本発明の4ビット2進10進変換器の変換結果
を表す変換表である。
FIG. 8 is a conversion table showing conversion results of the 4-bit binary-decimal converter of the present invention.

【図9】従来の2進10進変換回路を示すブロック図で
ある。
FIG. 9 is a block diagram showing a conventional binary-decimal conversion circuit.

【符号の説明】[Explanation of symbols]

000 変換対象2進データ 11 2進データセレクタ 12 2進データレジスタ 13 10進加算器 14 10進データレジスタ 15 10進20倍数生成回路 16 10進4倍数生成回路 17 反転回路 18 4ビット2進10進変換器 400 10進20倍数 500 10進4倍数 700 キャリ入力 900 10進データ 000 Conversion target binary data 11 Binary data selector 12 Binary data register 13 Decimal adder 14 Decimal data register 15 Decimal 20 multiple generation circuit 16 Decimal quadruple generation circuit 17 Inverting circuit 18 4-bit binary decimal Converter 400 Decimal 20 times 500 Decimal 4 times 700 Carry input 900 Decimal data

Claims (7)

【特許請求の範囲】[Claims] 【請求項1】 10進データを20倍する10進20倍
数生成回路と、10進データを4倍する10進4倍数生
成回路と、変換の対象となる2進数値を格納し演算サイ
クルに従って上位4ビットの2進数値を出力すると次の
演算サイクルに備え2進数値を左へ4ビットシフトさせ
る2進データレジスタと、前記2進データレジスタの左
端上位の4ビットを入力して5ビットの10進数値に変
換する4ビット2進10進変換器と、前記10進20倍
数生成回路の出力データと前記4ビット2進10進変換
器の出力データとを第1のデータ入力とし前記10進4
倍数生成回路の出力データを反転したデータを第2のデ
ータ入力とし且つ1のキャリを入力して第1のデータ入
力と第2のデータ入力との加算を行う10進加算器と、
前記10進加算器の演算結果を保持し次の演算サイクル
に前記10進20倍数生成回路と前記10進4倍数生成
回路とに保持したデータを出力する10進データレジス
タと、を備え、 前記2進データレジスタからの4ビットの2進数値の出
力と前記10進データレジスタからの10進数値の出力
とを1演算サイクルにおいて同期して行うことを特徴と
する2進10進変換回路。
1. A decimal 20-fold generation circuit for multiplying decimal data by 20, a decimal 4-fold generation circuit for quadrupling decimal data, and a binary value to be converted are stored and stored in accordance with an operation cycle. When a 4-bit binary value is output, a binary data register that shifts the binary value to the left by 4 bits in preparation for the next operation cycle, and inputs the upper 4 bits at the left end of the binary data register to input 5 bits of 10 bits A 4-bit binary-decimal converter for converting to a decimal value, the output data of the 20-fold decimal generation circuit and the output data of the 4-bit binary-decimal converter as a first data input,
A decimal adder that uses the data obtained by inverting the output data of the multiple generation circuit as a second data input and inputs a carry of 1 to add the first data input and the second data input;
A decimal data register for holding the operation result of the decimal adder and outputting the data held in the decimal 20-times generation circuit and the decimal 4-times generation circuit in the next operation cycle; A binary-to-decimal conversion circuit for synchronizing the output of a 4-bit binary value from a decimal data register and the output of a decimal value from the decimal data register in one operation cycle.
【請求項2】 前記10進20倍数生成回路の出力する
10進20倍数データと前記10進20倍数データの下
位5ビットは0であることを利用し前記4ビット2進1
0進変換器の出力データを前記下位5ビットの位置に取
り込んで第1のデータ入力とし、前記10進4倍数生成
回路による10進4倍数を反転したデータを第2のデー
タ入力とし、前記10進20倍数データと前記4ビット
2進10進変換器の出力データと前記10進4倍数デー
タとを1回の演算で加算する10進加算器を備えること
を特徴とする請求項1記載の2進10進変換回路。
2. The four-bit binary one using the fact that the decimal twenty-multiple data output from the decimal twenty-multiple generation circuit and the lower five bits of the decimal twenty-multiple data are 0.
The output data of the zero-decimal converter is taken into the position of the lower 5 bits and used as the first data input, and the data obtained by inverting the decimal quadruple by the decimal quadruple generation circuit is used as the second data input. 2. The decimal adder according to claim 1, further comprising a decimal adder that adds the 20-fold decimal data, the output data of the 4-bit binary-decimal converter, and the 4-fold decimal data in one operation. Decimal-decimal conversion circuit.
【請求項3】 前記第1のデータ入力と前記第2のデー
タ入力とを元に前演算サイクルでの演算結果の10進1
6倍数に前記4ビット2進10進変換器の出力結果を合
計する数値を出力する10進加算器を備えることを特徴
とする請求項1または2記載の2進10進変換回路。
3. A decimal 1 of an operation result in a previous operation cycle based on the first data input and the second data input.
3. The binary-decimal conversion circuit according to claim 1, further comprising a decimal adder that outputs a numerical value that sums an output result of the 4-bit binary-decimal converter to a multiple of six.
【請求項4】 10進データを2倍する10進2倍数生
成回路を2段に直列に接続した構成からなる前記10進
4倍数生成回路を備えることを特徴とする請求項1記載
の2進10進変換回路。
4. The binary system according to claim 1, further comprising a decimal quadruple number generating circuit having a configuration in which a decimal double number generating circuit for doubling decimal data is connected in series in two stages. Decimal conversion circuit.
【請求項5】 10進2倍数を前記10進2倍数生成回
路で生成しその結果を4ビット左へシフトする事で10
進20倍数を生成する前記10進20倍数生成回路を備
えることを特徴とする請求項1記載の2進10進変換回
路。
5. A double-decimal number is generated by the double-decimal number generating circuit, and the result is shifted to the left by 4 bits.
2. The binary-decimal conversion circuit according to claim 1, further comprising the decimal 20-multiple generation circuit that generates a 20-fold decimal number.
【請求項6】 前記2進データレジスタに格納された2
進数値の変換後の10進数値を格納する前記10進デー
タレジスタを備えることを特徴とする請求項1記載の2
進10進変換回路。
6. The data stored in the binary data register.
2. The system according to claim 1, further comprising the decimal data register for storing a decimal value after conversion of the decimal value.
Decimal-decimal conversion circuit.
【請求項7】 変換の対象となる2進数値の上位から4
ビットを出力すると当該2進数値を左へ4ビットシフト
して次の演算サイクルの準備をする第1のステップと、 第1のステップで出力された4ビットの2進数値を5ビ
ットの10進数値に変換する第2のステップと、前演算
サイクルで生成された10進数の20倍数と4倍数とを
生成する第3のステップと、第3のステップで生成され
た4倍数に対して反転を行う第4のステップと、第2の
ステップによる10進数値と前記第3のステップの20
倍数とを第1の入力とし前記第4のステップで反転され
た4倍数を第2の入力としキャリに1を入力して加算を
行い10進数を生成する第5のステップと、第5のステ
ップで生成された結果を保持し次の演算サイクルにおい
て第3のステップへの出力を行う第6のステップと、を
備えることを特徴とする2進10進変換方法。
7. The four most significant binary values to be converted
When the bits are output, a first step of shifting the binary value to the left by 4 bits to prepare for the next operation cycle, and converting the 4-bit binary value output in the first step to a 5-bit decimal value A second step of converting to a numerical value, a third step of generating 20 times and 4 times the decimal number generated in the previous operation cycle, and inversion of the 4 times number generated in the third step. Performing the fourth step, the decimal value obtained by the second step, and the 20th of the third step.
A fifth step in which a multiple is set as a first input, a quadruple inverted in the fourth step is set as a second input, and 1 is input to the carry to add and generate a decimal number; and a fifth step And a sixth step of holding the result generated in step (1) and outputting the result to the third step in the next operation cycle.
JP2001020210A 2001-01-29 2001-01-29 Binary-decimal conversion circuit and method Expired - Fee Related JP3592242B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001020210A JP3592242B2 (en) 2001-01-29 2001-01-29 Binary-decimal conversion circuit and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001020210A JP3592242B2 (en) 2001-01-29 2001-01-29 Binary-decimal conversion circuit and method

Publications (2)

Publication Number Publication Date
JP2002222078A true JP2002222078A (en) 2002-08-09
JP3592242B2 JP3592242B2 (en) 2004-11-24

Family

ID=18885955

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001020210A Expired - Fee Related JP3592242B2 (en) 2001-01-29 2001-01-29 Binary-decimal conversion circuit and method

Country Status (1)

Country Link
JP (1) JP3592242B2 (en)

Also Published As

Publication number Publication date
JP3592242B2 (en) 2004-11-24

Similar Documents

Publication Publication Date Title
JPS6059470A (en) Basic cell suitable for multiplication- accumulation processor and said processor
JPH1032492A (en) Code conversion circuit
JP2002222078A (en) Binary-decimal conversion circuit and its method
JP3417286B2 (en) Multiplier
US5691930A (en) Booth encoder in a binary multiplier
JPS5841532B2 (en) Sekiwa Keisan Cairo
JP2991788B2 (en) Decoder
JP3241642B2 (en) Binary-decimal conversion circuit
CN114327370B (en) Method and circuit for calculating MR value in Montgomery modular multiplication algorithm
JP3017203B1 (en) Binary-decimal conversion circuit and method
JP3190826B2 (en) Product-sum operation unit
JP3157741B2 (en) Binary-decimal conversion circuit
JP3071607B2 (en) Multiplication circuit
JP4042215B2 (en) Arithmetic processing apparatus and method
JP3106767B2 (en) Multiplication method and multiplication circuit
JP3123060B2 (en) Digital arithmetic circuit
JPH01116826A (en) Decimal multiplier
JP2003037504A (en) Device for generating gray code
JP3855491B2 (en) Multiplier
KR0161485B1 (en) A multiplier of booth algorithm using arithmetic unit
JP2529890B2 (en) Multiplicative remainder calculator
JPS58119047A (en) Decimal multiplier and divider
JPH02300930A (en) Multiplication circuit
JPH05216626A (en) Multiplier
JPH04123129A (en) Multiplier

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20040728

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: 20040803

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20040824

R150 Certificate of patent (=grant) or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees