JPS6112286B2 - - Google Patents
Info
- Publication number
- JPS6112286B2 JPS6112286B2 JP55129586A JP12958680A JPS6112286B2 JP S6112286 B2 JPS6112286 B2 JP S6112286B2 JP 55129586 A JP55129586 A JP 55129586A JP 12958680 A JP12958680 A JP 12958680A JP S6112286 B2 JPS6112286 B2 JP S6112286B2
- Authority
- JP
- Japan
- Prior art keywords
- circuit
- digit
- input
- encoding
- 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.)
- Expired
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F7/00—Methods or arrangements for processing data by operating upon the order or content of the data handled
- G06F7/38—Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
- G06F7/48—Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
- G06F7/491—Computations with decimal numbers radix 12 or 20.
- G06F7/4915—Multiplying; Dividing
Landscapes
- Engineering & Computer Science (AREA)
- Computing Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computational Mathematics (AREA)
- Mathematical Analysis (AREA)
- Mathematical Optimization (AREA)
- Pure & Applied Mathematics (AREA)
- General Engineering & Computer Science (AREA)
Description
【発明の詳細な説明】
本発明は、2進化10進数の4倍数を生成する方
式に関する。DETAILED DESCRIPTION OF THE INVENTION The present invention relates to a method for generating quadruple numbers of binary coded decimal numbers.
第1図は従来の4倍数生成方式を示すブロツク
図である。 FIG. 1 is a block diagram showing a conventional quadruple number generation method.
4倍数を生成すべき2進化10進数はレジスタ1
とレジスタ2の両方に入力される。レジスタ1の
出力はシフト回路3によつて左(上位桁側)へ2
ビツトシフトされたのち、2進加算回路6の一方
の入力に与えられる。レジスタ2の出力は各桁毎
に符号化回路4によつて4ビツトの符号に符号化
され、さらにシフト回路5によつて左(上位桁
側)へ1ビツトシフトされたのち2進加算回路6
の他方の入力に与えられる。2進加算回路6は2
つの入力の値を加算する。レジスタ1,2に入力
された2進化10進数の4倍数(これも2進化10進
数である)は、2進加算回路6の出力用レジスタ
7に求まる。 The binary coded decimal number to generate the quadruple is in register 1.
and register 2. The output of register 1 is shifted to the left (upper digit side) by shift circuit 3.
After being bit shifted, it is applied to one input of the binary adder circuit 6. The output of the register 2 is encoded into a 4-bit code by the encoding circuit 4 for each digit, and then shifted by 1 bit to the left (to the upper digit side) by the shift circuit 5, and then sent to the binary adder circuit 6.
is given to the other input of The binary adder circuit 6 is 2
Add the values of two inputs. A quadruple of the binary coded decimal number input to registers 1 and 2 (which is also a binary coded decimal number) is found in the output register 7 of the binary adder circuit 6.
符号化回路の符号化規則を第2図に示し、これ
を簡単に説明する。 The encoding rules of the encoding circuit are shown in FIG. 2 and will be briefly explained.
2進化10進数は、周知のように、10進数の1つ
の桁を4ビツトで表現している。すなわち、0、
1、2、3、………9を(0000)2、(0001)2、
(0010)2、(0011)2………(1001)2のように表現す
る。これらの桁を複数持つことにより、複数桁の
10進数を表現する。符号化回路4は、このような
2進化10進数を桁ごとに4ビツト符号に符号化す
るものであり、その符号化規則は第2図に示す如
くである。 As is well known, in binary coded decimal numbers, one decimal digit is expressed using 4 bits. That is, 0,
1, 2, 3,……9 (0000) 2 , (0001) 2 ,
Express as (0010) 2 , (0011) 2 ......(1001) 2 . By having multiple of these digits, multi-digit
Represents a decimal number. The encoding circuit 4 encodes such a binary coded decimal number into a 4-bit code for each digit, and the encoding rules are as shown in FIG.
まず入力桁が(0000)2の場合、および入力桁が
(0001)2の場合、シフト回路3で左へ2ビツトシ
フトした後の値は、それぞれ(0000)2、(0100)2
となり、すでに4倍数が得られている。したがつ
てこの場合は、符号化回路4は入力桁(0000)2、
(0001)2に対して(0000)2を出力する。 First, when the input digit is (0000) 2 and when the input digit is (0001) 2 , the values after being shifted 2 bits to the left by shift circuit 3 are (0000) 2 and (0100) 2, respectively.
Therefore, we have already obtained a quadrupling number. Therefore, in this case, the encoding circuit 4 inputs the input digit (0000) 2 ,
Outputs (0000) 2 for (0001) 2 .
入力桁が(0011)2、(0100)2の場合、シフト回
路3の出力は1つ上位の桁も含めて表すと、それ
ぞれ(0000 1100)2、(0001 0000)2となる。この
場合、実際に求めたい4倍数は、(0001 0010)2と
(0001 0110)2である。この値を得るためには、
(0110)2を加えればよく、そのために符号化回路
4は(0011)2を出力する。この値をシフト回路5
で1ビツト左シフトし、シフト回路3の出力値と
加算することにより、4倍数が得られる。 When the input digits are (0011) 2 and (0100) 2 , the output of the shift circuit 3 including the next higher digit becomes (0000 1100) 2 and (0001 0000) 2 , respectively. In this case, the quadruple numbers that we actually want to find are (0001 0010) 2 and (0001 0110) 2 . To get this value,
It is sufficient to add (0110) 2 , and for that purpose the encoding circuit 4 outputs (0011) 2 . This value is shifted by the shift circuit 5
By shifting the value to the left by 1 bit and adding it to the output value of the shift circuit 3, a quadrupling number can be obtained.
同様に、入力桁が(0101)2、(01、10)のとき
は(0110)2が、(1000)2、(1001)2のときは
(1001)2が符号化回路4によつて作成される。 Similarly, when the input digits are (0101) 2 and (01, 10), (0110) 2 is created by the encoding circuit 4 , and when the input digits are (1000) 2 and (1001) 2 , (1001) 2 is created by the encoding circuit 4. be done.
一方、入力桁が(0010)2、(0111)2の場合、符
号化回路4の出力値は下位の入力桁の値によつて
変わる。例えば入力桁が(0010)2の場合、シフト
回路3の出力は下位桁の上位2ビツトを含むこと
になるために(1000)2になるとは限らず、下位桁
の上位2ビツトによつて異なる。つまり下位桁の
最上位ビツトが“1”のとき、シフト回路3の出
力は(1010)2または(1011)2となり、この値は9
より大きいため(0110)2を加えて上位桁への桁上
げを行なう必要がある。そこで符号化回路4は入
力桁の下位桁の最上位ビツトが“1”の場合は、
(0011)2を出力する。たゞし、下位桁の最上位ビ
ツトが“0”のときは、シフト回路3の出力は
(1000)2または(1001)2であり、桁上げは不要で
あるから、符号化回路4は(0000)2を出力する。
同様の理由から、符号化回路4は、入力桁が
(0111)2の場合、下位桁の最上位ビツトが“0”
なら(0110)2を出力し、下位桁の最上位ビツトが
“1”なら(1001)2を出力する。 On the other hand, when the input digits are (0010) 2 or (0111) 2 , the output value of the encoding circuit 4 changes depending on the value of the lower input digit. For example, if the input digit is (0010) 2 , the output of shift circuit 3 will include the upper 2 bits of the lower digit, so it will not necessarily be (1000) 2 , but will differ depending on the upper 2 bits of the lower digit. . In other words, when the most significant bit of the lower digit is "1", the output of shift circuit 3 is (1010) 2 or (1011) 2 , and this value is 9.
Since it is larger (0110), it is necessary to add 2 and carry to the upper digit. Therefore, when the most significant bit of the lower digit of the input digit is "1", the encoding circuit 4
(0011) Outputs 2 . However, when the most significant bit of the lower digit is "0", the output of the shift circuit 3 is (1000) 2 or (1001) 2 , and no carry is necessary, so the encoding circuit 4 outputs ( 0000) Outputs 2 .
For the same reason, when the input digit is (0111) 2 , the most significant bit of the lower digit is "0" in the encoding circuit 4.
If (0110) 2 is output, and if the most significant bit of the lower digit is "1" then (1001) 2 is output.
以上に述べたように、従来の4倍数生成方式で
は、符号化回路は各入力桁を符号化する際に下位
桁の最上位ビツトを参照する必要がある。このた
め、符号化回路を桁単位あるいはバイト単位で論
理ブロツクに構成する場合、論理ブロツク間での
やりとりが必要となり、論理ブロツク実装上の大
きな問題点となつていた。 As described above, in the conventional quadruple generation method, the encoding circuit needs to refer to the most significant bit of the lower digit when encoding each input digit. For this reason, when an encoding circuit is configured into logic blocks in units of digits or bytes, communication between the logic blocks is required, which poses a major problem in implementing the logic blocks.
したがつて本発明の目的は、上記の如き従来方
式の問題点を除去できる2進化10進数の4倍数生
成方式を提供することにある。 SUMMARY OF THE INVENTION Accordingly, an object of the present invention is to provide a method for generating quadruple numbers of binary coded decimal numbers, which can eliminate the problems of the conventional method as described above.
しかして本発明の特徴は、2進加算回路の出力
側に6減算回路を設けることにより、符号化回路
で入力各桁を下位桁を参照することなしに符号化
可能とする点にある。 However, the feature of the present invention is that by providing a 6-subtraction circuit on the output side of the binary addition circuit, it is possible to encode each input digit in the encoding circuit without referring to the lower digits.
第3図は本発明の一実施例を示すブロツク図で
あり、第1図と同一部分には同符号を付してあ
る。 FIG. 3 is a block diagram showing one embodiment of the present invention, and the same parts as in FIG. 1 are given the same reference numerals.
本実施例は、レジスタ2とシフト回路5の間に
介在する符号化回路8の符号化規則および2進加
算回路6と出力用レジスタ7の間に6減算回路9
を設けた点が、従来と異なる。 In this embodiment, the encoding rule of the encoding circuit 8 interposed between the register 2 and the shift circuit 5, and the 6 subtraction circuit 9 between the binary addition circuit 6 and the output register 7 are explained.
It is different from the conventional method in that it is provided with .
4倍すべき2進化10進数は、レジスタ1および
レジスタ2の両方に格納される。レジスタ1の出
力はシフト回路3により左(上位桁側)へ2ビツ
トシフトされる。レジスタ2の出力は符号化回路
8により符号化され、さらにシフト回路5により
左(上位桁側)へ1ビツトシフトされる。 The binary coded decimal number to be multiplied by 4 is stored in both register 1 and register 2. The output of register 1 is shifted by 2 bits to the left (toward the upper digits) by shift circuit 3. The output of the register 2 is encoded by the encoding circuit 8, and further shifted by 1 bit to the left (toward the upper digit side) by the shift circuit 5.
シフト回路3,5の出力は2進加算回路6によ
り2進加算される。その出力は6減算回路9によ
り補正され、4倍数が得られる。この結果は出力
用レジスタ7に格納される。 The outputs of the shift circuits 3 and 5 are subjected to binary addition by a binary addition circuit 6. The output is corrected by a 6-subtraction circuit 9 to obtain a 4-fold multiple. This result is stored in the output register 7.
符号化回路8の符号化規則および6減算回路9
の動作条件は第4図に示す如くである。符号化回
路8は、1桁ごとに符号化を行い、6減算回路9
は1桁ごとに6を減算するか否かによりその桁の
補正を行う。入力の2進化10進数が複数桁ある場
合には、第4図に示す符号化及び6減算回路によ
り補正を各桁ごとに行なう。符号化回路8による
各桁の符号化は下位桁を参照することなく行なわ
れるが、これが可能なのは6減算回路9による補
正を導入したゝめである。 Encoding rules for encoding circuit 8 and 6 subtraction circuit 9
The operating conditions are as shown in FIG. The encoding circuit 8 encodes each digit, and the 6 subtraction circuit 9
corrects each digit depending on whether or not to subtract 6 for each digit. If the input binary coded decimal number has multiple digits, correction is performed for each digit using the encoding and 6-subtraction circuit shown in FIG. The encoding circuit 8 encodes each digit without referring to the lower digits, but this is possible because the correction by the 6-subtraction circuit 9 is introduced.
以下、動作を詳細に説明する。 The operation will be explained in detail below.
まず入力桁が(0000)2、(0001)2、(0010)2、
(0011)2の場合について説明する。この場合、入
力桁はシフト回路3によつて左へ2ビツトシフト
されたのち2進加算回路6に入力される。また入
力桁は符号化回路8によつて(0011)2に符号化さ
れ(第4図参照)、シフト回路5によつて左へ1
ビツトシフトされたのち2進加算回路6へ入力さ
れる。2進加算回路6による加算結果は6減算回
路9に入力される。6減算回路9の動作は、入力
桁の2進加算時に1つ上位の桁への桁上りがある
か否かによつて次のように制御される(第4図参
照)。すなわち、2進加算時に上位桁に桁上りが
あつた桁は6つまり(0110)2を減算して出力し、
桁上りの無かつた桁はそのまゝ出力する。このよ
うにして、目的の4倍数が出力用レジスタ7に求
まる。 First, the input digits are (0000) 2 , (0001) 2 , (0010) 2 ,
(0011) Case 2 will be explained. In this case, the input digit is shifted to the left by two bits by the shift circuit 3 and then input to the binary adder circuit 6. In addition, the input digit is encoded as (0011) 2 by the encoding circuit 8 (see Figure 4), and the input digit is encoded as 1 to the left by the shift circuit 5.
After being bit shifted, it is input to the binary adder circuit 6. The addition result by the binary addition circuit 6 is input to the 6-subtraction circuit 9. The operation of the 6-subtraction circuit 9 is controlled as follows depending on whether or not there is a carry to the next higher digit during binary addition of input digits (see FIG. 4). In other words, the digit with a carry in the upper digit during binary addition is 6, or (0110) .2 is subtracted and output.
Digits with no carry are output as is. In this way, the desired quadrupling is found in the output register 7.
入力桁が(0100)2の場合も同様に符号化回路8
から(0011)2が出力され、それを1ビツト左シフ
トした値と入力桁を2ビツト左シフトした値が2
進加算回路6で加算される。たゞしこの場合、6
減算回路9は桁上りの有無にかゝわらず2進加算
回路6の出力を減算を施すことなくそのまゝ出力
する。 Similarly, when the input digit is (0100) 2 , the encoding circuit 8
(0011) 2 is output, and the value obtained by shifting it to the left by 1 bit and the value by shifting the input digit by 2 bits to the left are 2.
The digits are added by the base addition circuit 6. In this case, 6
The subtraction circuit 9 outputs the output of the binary addition circuit 6 as it is without subtracting it, regardless of the presence or absence of a carry.
入力桁が(0101)2、(0110)2、(0111)2の場合
は、符号化回路8から(1001)2が出力される。そ
して6減算回路9は、2進加算時に桁上りがある
場合は2進加算の結果をそのまゝ出力し、桁上り
が無い場合は2進加算結果から6を減算し、その
結果を出力する。 When the input digits are (0101) 2 , (0110) 2 , or (0111) 2 , the encoding circuit 8 outputs (1001) 2 . If there is a carry during binary addition, the 6 subtraction circuit 9 outputs the result of the binary addition as is, and if there is no carry, it subtracts 6 from the binary addition result and outputs the result. .
入力桁が(1000)2、(1001)2の場合も同様に、
符号化回路8から(1001)2が出力される。たゞし
6減算回路9は、2進加算時の桁上りの有無に
かゝわらず2進加算結果をそのまゝ出力する。 Similarly, if the input digit is (1000) 2 or (1001) 2 ,
(1001) 2 is output from the encoding circuit 8. The 6-subtraction circuit 9 outputs the binary addition result as is, regardless of the presence or absence of carry during binary addition.
以上に述べたように、本実施例では、符号化回
路8は各入力桁を符号化する際に下位桁を参照す
る必要がない。たゞし、当該符号化回路8の符号
化規則は第4図に示したものに限られるものでは
ない。 As described above, in this embodiment, the encoding circuit 8 does not need to refer to the lower digits when encoding each input digit. However, the encoding rules of the encoding circuit 8 are not limited to those shown in FIG.
例えば、符号化回路8の符号化規則を第5図に
示すように定めることもできる。このようにする
と、入力桁の全てに対し6減算回路9の動作条件
は第5図最右欄に示すようになる。 For example, the encoding rules for the encoding circuit 8 may be determined as shown in FIG. In this way, the operating conditions of the 6 subtraction circuit 9 for all input digits are as shown in the rightmost column of FIG.
前記実施例の符号化規則との違いは、次の通り
である。 The differences from the encoding rules of the previous embodiments are as follows.
入力桁が(0100)2、(0101)2の場合に、符号化
回路が(0110)2を出力し、また入力桁が
(1000)2、(1001)2の場合に符号化回路が(1100)2
を出力する。 When the input digits are (0100) 2 and (0101) 2 , the encoding circuit outputs (0110) 2 , and when the input digits are (1000) 2 and (1001) 2 , the encoding circuit outputs (1100) 2. ) 2
Output.
尚、前記実施例では4倍数を求めようとする2
進化10進数の入力用レジスタを2つ設けている
が、これは1つだけ設けるようにしてもよい。 In addition, in the above example, when trying to find a quadruple multiple,
Although two registers for inputting evolved decimal numbers are provided, only one register may be provided.
本発明は以上に述べた如くであり、符号化回路
は入力桁の符号化に際して下位桁を参照する必要
がないため、符号化回路を桁単位またはバイト単
位の論理ブロツクに構成する場合、各論理ブロツ
ク間のやりとりが不要になり、従来のような論理
ブロツク実装上の問題点を解消できる。 The present invention is as described above, and since the encoding circuit does not need to refer to lower digits when encoding input digits, when the encoding circuit is configured into logic blocks in units of digits or bytes, Communication between blocks is no longer necessary, and problems associated with conventional logic block implementation can be solved.
第1図は従来の4倍数生成方式のブロツク図、
第2図は第1図中の符号化回路の符号化規則を示
す表図、第3図は本発明による4倍数生成方式の
一実施例を示すブロツク図、第4図は第3図中の
符号化回路の符号化規則および6減算回路の動作
条件の一例を示す表図、第5図は第3図中の符号
化回路の符号化規則および6減算回路の動作条件
の他の一例を示す表図である。
1,2……入力用レジスタ、3,5……シフト
回路、6……2進加算回路、7……出力用レジス
タ、8……符号化回路、9……減算回路。
Figure 1 is a block diagram of the conventional quadruple generation method.
FIG. 2 is a table showing the encoding rules of the encoding circuit in FIG. 1, FIG. 3 is a block diagram showing an embodiment of the quadruple generation method according to the present invention, and FIG. A table showing an example of the encoding rules of the encoding circuit and the operating conditions of the 6-subtraction circuit; FIG. 5 shows another example of the encoding rules of the encoding circuit and the operating conditions of the 6-subtraction circuit in FIG. It is a table diagram. 1, 2...Input register, 3, 5...Shift circuit, 6...Binary addition circuit, 7...Output register, 8...Encoding circuit, 9...Subtraction circuit.
Claims (1)
トシフトして出力する第1のシフト回路と、該入
力2進化10進数の各桁を他の桁と関係なく特定の
規則にしたがつて4ビツト符号に符号化する符号
化回路と、該符号化回路の出力を上位桁側に1ビ
ツトシフトして出力する第2のシフト回路と、該
第1と第2のシフト回路の出力を2進加算する2
進加算回路と、該2進加算回路の出力の各桁に対
し、符号化回路の入力あるいは加算時の上位桁へ
の桁上りの有無に基づいて、そのまゝ出力するか
6を減じるかする6減算回路を具備し、該入力2
進化10進数の4倍数を該6減算回路の出力として
得ることを特徴とする2進化10進数の4倍数生成
方式。1. A first shift circuit that shifts an input binary coded decimal number by 2 bits toward the higher digits and outputs the result, and 4 An encoding circuit that encodes into a bit code, a second shift circuit that shifts the output of the encoding circuit by one bit to the higher digit side, and performs binary addition of the outputs of the first and second shift circuits. do 2
For each digit of the output of the decimal addition circuit and the binary addition circuit, either output it as is or subtract 6 based on the input of the encoding circuit or the presence or absence of a carry to the upper digit during addition. 6 subtraction circuits, the input 2
A quadruple number generation method for a binary evolved decimal number, characterized in that a quadruple number of the evolved decimal number is obtained as an output of the 6-subtraction circuit.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP55129586A JPS5755450A (en) | 1980-09-18 | 1980-09-18 | Producing system of multiple of four in binary coded decimal number |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP55129586A JPS5755450A (en) | 1980-09-18 | 1980-09-18 | Producing system of multiple of four in binary coded decimal number |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPS5755450A JPS5755450A (en) | 1982-04-02 |
| JPS6112286B2 true JPS6112286B2 (en) | 1986-04-07 |
Family
ID=15013106
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP55129586A Granted JPS5755450A (en) | 1980-09-18 | 1980-09-18 | Producing system of multiple of four in binary coded decimal number |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPS5755450A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS63164287U (en) * | 1987-04-16 | 1988-10-26 |
-
1980
- 1980-09-18 JP JP55129586A patent/JPS5755450A/en active Granted
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS63164287U (en) * | 1987-04-16 | 1988-10-26 |
Also Published As
| Publication number | Publication date |
|---|---|
| JPS5755450A (en) | 1982-04-02 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US6233597B1 (en) | Computing apparatus for double-precision multiplication | |
| JPH0428180B2 (en) | ||
| KR100413529B1 (en) | Apparatus and method for digital multiplication using a redundant binary arithmetic | |
| US5745399A (en) | Decimal arithmetic apparatus and method | |
| US3842250A (en) | Circuit for implementing rounding in add/subtract logic networks | |
| US4677583A (en) | Apparatus for decimal multiplication | |
| JPS6112286B2 (en) | ||
| JPH0149973B2 (en) | ||
| US6546411B1 (en) | High-speed radix 100 parallel adder | |
| JPH0157372B2 (en) | ||
| JPH07118654B2 (en) | Arithmetic unit | |
| JPS6049328B2 (en) | Decimal quadruple generation circuit | |
| JP2682142B2 (en) | Multiplier | |
| JPH11126157A (en) | Multiplication method and multiplication circuit | |
| TWI898521B (en) | A method of adding binary strings and a circuit therefor | |
| JPH04232529A (en) | Unified ratio decoder and method for determining diviser multiple | |
| JPS6054045A (en) | Divider | |
| GB1359427A (en) | Data processing systems | |
| JPH05265715A (en) | Adder/multiplier | |
| JPS5985540A (en) | +-5-notation divider circuit | |
| JPH01130628A (en) | Adder circuit | |
| JPH10187664A (en) | Read-only memory and arithmetic unit | |
| JPH0241051B2 (en) | SAIKINCHIHANTEIKAIRO | |
| JPH0377538B2 (en) | ||
| JPH01176120A (en) | Decoder circuit |