JPH0313011A - Binary to decimal converter - Google Patents

Binary to decimal converter

Info

Publication number
JPH0313011A
JPH0313011A JP1147501A JP14750189A JPH0313011A JP H0313011 A JPH0313011 A JP H0313011A JP 1147501 A JP1147501 A JP 1147501A JP 14750189 A JP14750189 A JP 14750189A JP H0313011 A JPH0313011 A JP H0313011A
Authority
JP
Japan
Prior art keywords
output
decimal
register file
binary
bit
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
JP1147501A
Other languages
Japanese (ja)
Other versions
JP2830075B2 (en
Inventor
Hiromi Oishi
博見 大石
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 Corp
Original Assignee
NEC 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 NEC Corp filed Critical NEC Corp
Priority to JP1147501A priority Critical patent/JP2830075B2/en
Publication of JPH0313011A publication Critical patent/JPH0313011A/en
Application granted granted Critical
Publication of JP2830075B2 publication Critical patent/JP2830075B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Abstract

PURPOSE:To easily convert a large binary number to a decimal number by providing an output control counter to split an output of a conversion storage device with respect to a data converter. CONSTITUTION:In the case of a 32-bit binary number at a split output to an output line, since number of output lines of a conversion storage device 6 is 16, the data is outputted while being split into three divisions. An output control counter 10 controls the division of the output. Register files 2, 3 have the constitution of 16-bitX16, each 16-bit is accessed and able to subject to read/write. In the case of converting a 32-bit binary number, a decimal number in 10-digit is split by 4-digit (16-bit) each and stored in the register file 2. In this case, the data is converted into a decimal number while 4-bit each is processed for light times to obtain a partial sum and the decimal number is obtained by the total sum.

Description

【発明の詳細な説明】 (産業上の利用分野) 本発明は、データ変換装置に関し、特に、2進数から1
0進数へ変換する装置に関する。
DETAILED DESCRIPTION OF THE INVENTION (Field of Industrial Application) The present invention relates to a data conversion device, and in particular, to a data conversion device that converts binary numbers to
This invention relates to a device for converting into 0-decimal numbers.

(従来の技術) 2進数から10進数に変換する装置としては2進数をm
ビット単位で桁分けを行いその桁単位でその桁位置情報
とともに変換fCtILで10進数に変換し、それを部
分和とし1分割桁すべてを変換して総和をとることによ
シ変換する装置が従来より存在する。
(Prior art) As a device for converting binary numbers into decimal numbers,
Conventional equipment performs conversion by dividing digits in bits, converting each digit along with its digit position information into a decimal number using fCtIL, using it as a partial sum, converting all the digits in one division, and calculating the sum. More present.

第2図は16bitの2進数’5−10進数に変換する
従来技術の回路図である。
FIG. 2 is a circuit diagram of a conventional technique for converting a 16-bit binary number into a 5-decimal number.

内部パスlに、レジスタファイル1、レジスタファイル
2.4bitのラッチ8、カウンタ7およびシフタ9が
接続されている。レジスタファイル1および2は16b
itX16の構成を持ち。
A register file 1, a 2.4-bit register file latch 8, a counter 7, and a shifter 9 are connected to the internal path 1. Register files 1 and 2 are 16b
It has the configuration of itX16.

16 bit幅でアドレス指定を行いリード/ライトが
可能である。(第2図では省略) レジスタファイル2にある16bitの2進数は% 1
0進加算器4をスルーで通り、シフタ9でシフトし、内
部バス1へ出力さnる。そして4 bitのラッチ8へ
入力され、そのビット位置はカウンタ7で設定され、そ
の位置情報を元にし、変換用記憶装置6は、10進数へ
変換する。
Read/write is possible by specifying addresses in 16-bit width. (Omitted in Figure 2) The 16-bit binary number in register file 2 is %1
It passes through the 0-ary adder 4, is shifted by the shifter 9, and is output to the internal bus 1. The data is then input to a 4-bit latch 8, the bit position of which is set by the counter 7, and the conversion storage device 6 converts it into a decimal number based on the position information.

変換用記憶装置6の出力はセレクタ5により選択されl
O進加算器4で、レジスタファイル3の部分和と加算さ
れ、その結果は新しい部分和としてレジスタファイル3
へ書き込まれる。
The output of the conversion storage device 6 is selected by the selector 5.
O-adic adder 4 adds the partial sum of register file 3, and the result is added to register file 3 as a new partial sum.
is written to.

16 bitの2進数であるので4bitずつ4回で変
換が終了する(例えば特願昭57−52947)。
Since it is a 16-bit binary number, the conversion is completed in four times of 4 bits each (for example, Japanese Patent Application No. 57-52947).

(発明が解決しようとする課題) 従来の回路は、上述したように分割2進数とその桁位置
情報により変換回路により変換しているが% 2進数の
ビット数が多くなるにつれて変換回路の出力線の数が多
くなってしまう。
(Problem to be Solved by the Invention) As mentioned above, in the conventional circuit, conversion is performed using a conversion circuit based on divided binary numbers and their digit position information. The number of cases will increase.

例えば、32bitの2進数の場合、40bitもの出
力線を必要とするという欠点がある。特に、32bit
を越えると、マシンのインプリメント上望ましくない。
For example, a 32-bit binary number has the drawback of requiring as many as 40-bit output lines. In particular, 32 bit
Exceeding is undesirable for machine implementation.

つま9.変換可能な2進数のビット数が変換・回路の出
力ヒツト6によ)決定されてしまう。
Toe 9. The number of bits of the binary number that can be converted is determined by the output hit 6 of the conversion circuit.

本発明の目的は、上記欠点を解決するものでビット数の
大きい2進数でも容易に10進数に変換できる2進10
進変換方式を提供することにある。
An object of the present invention is to solve the above-mentioned drawbacks, and it is an object of the present invention to create a binary decimal system that can easily convert even binary numbers with a large number of bits into decimal numbers.
The purpose of this invention is to provide a system for converting decimal numbers.

(課題を解決するための手段) 前記目的を達成するために本発明による21@10進変
換装置は2進数を格納する第1のレジスタファイルと、
変換段階の部分和を一時格納する第2のレジスタファイ
ルと、10進数と前記第1のレジスタファイル内の部分
2進数のいずれかを選択する選択手段と、前記選択手段
で選択された部分2進数をラッチするラッチ部を。
(Means for Solving the Problems) In order to achieve the above object, the 21@decimal conversion device according to the present invention includes a first register file that stores binary numbers;
a second register file for temporarily storing a partial sum in the conversion stage; a selection means for selecting either a decimal number or a partial binary number in the first register file; and a partial binary number selected by the selection means. the latch part to latch.

前記ラッチ部にラッチされた部分2進数が2進数のどの
部分かその位置を示すカウンタと、前記カウンタの位置
情報に従い1選択した部分2進数を10進数へ変換する
変換装置と、前記選択手段と第2のレジスタファイルに
接続され、前記選択手段が第1のレジスタファイル内の
部分2進数を選択したときは、そのまま通過させ。
a counter that indicates which part of the binary number the partial binary number latched in the latch section is; a conversion device that converts the selected partial binary number into a decimal number according to the position information of the counter; and the selection means. connected to a second register file, and when the selection means selects a partial binary number in the first register file, it passes through as is;

前記選択手段が前記変換装置の10進数出力を選択した
ときはその10進数出力を前記第2のレジスタファイル
の部分和に加算する10進加算器とを含み% 2進数を
分割し、その分割単位で2進数から10進数へ変換する
2進10進変換装置において、前記変換装置の出力を分
割出力するための出力制御カウンタを設け1分割した2
進数を変換装置で変換し出力する際、分割して10進数
を出力させるように構成しである。
and a decimal adder for adding the decimal output to the partial sum of the second register file when the selection means selects the decimal output of the conversion device. In a binary-to-decimal conversion device that converts a binary number into a decimal number, an output control counter is provided to divide and output the output of the conversion device.
When converting and outputting a decimal number using a conversion device, the system is configured so that the decimal number is divided and output as a decimal number.

(実 施 例) 以下、図面を参照して本発明をさらに詳しく説明する。(Example) Hereinafter, the present invention will be explained in more detail with reference to the drawings.

第1図は5本発明による2進10進変換装置の一実施例
を示すブロック図である。従来技術のyjlC2図の回
路に出力制御カウンタ10が付加されている。
FIG. 1 is a block diagram showing an embodiment of a binary-to-decimal conversion device according to the present invention. An output control counter 10 is added to the conventional circuit shown in FIG. yjlC2.

従来技術では、変換記憶装置6で、10進数へ変換する
際、その出力線数で変換可能数の範囲が決まってしまう
。つまり、出力線数16本では、9999 (□Q、1
.)までとなり20本では99999 (10m)まで
となる。逆に2進数から言えば16bittl−変換す
るには20本必要であり、32bit′を変換するには
40本の出力線を必要としていた。
In the conventional technology, when converting into a decimal number in the conversion storage device 6, the range of convertible numbers is determined by the number of output lines. In other words, with 16 output lines, 9999 (□Q, 1
.. ), and for 20 lines, the maximum length is 99999 (10m). Conversely, in terms of binary numbers, 20 output lines are required to convert 16 bits, and 40 output lines are required to convert 32 bits.

本発明では、装置のインプリメントに都合がいい、出力
線に分割出力を行うものである。例えば、32 bit
の2進数の場合、変換記憶装置6の出力線が16本であ
るので、3分割して出力する。その出力の分割をコント
ロールするのが出力制御カウンタ10である。
In the present invention, divided output is performed on the output line, which is convenient for device implementation. For example, 32 bits
In the case of a binary number, the conversion storage device 6 has 16 output lines, so it is divided into three and output. The output control counter 10 controls the division of the output.

レジスタファイル2.3は、  16 bit X l
 6の構成を持ち、各16 bitに対しアドレスでき
、かつリード/ライトができる。
Register file 2.3 is 16 bits
It has 6 configurations, can address each 16 bits, and can read/write.

32 bitの2進数を変換する場合を説明する。A case of converting a 32-bit binary number will be explained.

10進数lO桁を4桁(16bit)ずつ分割し。Divide the decimal number lO digits into 4 digits (16 bits) each.

レジスタファイル2に格納する。この場合、4bitず
つ8回に分けて10進数へ変換し部分和とし、その総和
により10進数を得る。
Store in register file 2. In this case, 4 bits are divided into 8 times and converted into a decimal number to form a partial sum, and the decimal number is obtained by the summation.

4 bitの変換を行う場合、その変換結果は16bi
tずつ下位桁より順次3回に分けて出力され、レジスタ
ファイル3の部分和に加算される。
When performing 4 bit conversion, the conversion result is 16 bit
The data is output three times sequentially starting from the lower digit by t, and is added to the partial sum in the register file 3.

このようにして16 bitのlO進加算器で。In this way, with a 16-bit lO-adic adder.

32bitの2進数を最大10桁の10進数へ変換でき
る。
A 32-bit binary number can be converted to a maximum of 10-digit decimal number.

(発明の効果) 以上、説明したように本発明は、変換記憶装置の出力を
分割するための出力制御カウンタを設けることにより大
きい2進数を容易に10進数へ変換できるという効果が
ある。
(Effects of the Invention) As described above, the present invention has the effect that a large binary number can be easily converted into a decimal number by providing an output control counter for dividing the output of the conversion storage device.

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

第1図は本発明による2進lO進変換装置の実施例を示
すブロック図、第2図は従来技術の2進10進変換装置
のブロック図である。 l・・・内部ハス  2.3・・・レジスタファイル4
・・・10進加算器  5・・・セレクタ6・・・変換
記憶装置  7・・・カウンタ8・・・4ピツトのラッ
チ部  9・・・シフタ10・・・出力制御カウンタ
FIG. 1 is a block diagram showing an embodiment of a binary-to-decimal converter according to the present invention, and FIG. 2 is a block diagram of a conventional binary-to-decimal converter. l...Internal lotus 2.3...Register file 4
... Decimal adder 5 ... Selector 6 ... Conversion storage device 7 ... Counter 8 ... 4-pit latch section 9 ... Shifter 10 ... Output control counter

Claims (1)

【特許請求の範囲】[Claims] 2進数を格納する第1のレジスタファイルと、変換段階
の部分和を一時格納する第2のレジスタファイルと、1
0進数と前記第1のレジスタファイル内の部分2進数の
いずれかを選択する選択手段と、前記選択手段で選択さ
れた部分2進数をラッチするラッチ部を、前記ラッチ部
にラッチされた部分2進数が2進数のどの部分かその位
置を示すカウンタと、前記カウンタの位置情報に従い、
選択した部分2進数を10進数へ変換する変換装置と、
前記選択手段と第2のレジスタファイルに接続され、前
記選択手段が第1のレジスタファイル内の部分2進数を
選択したときは、そのまま通過させ、前記選択手段が前
記変換装置の10進数出力を選択したときはその10進
数出力を前記第2のレジスタファイルの部分和に加算す
る10進加算器とを含み、2進数を分割し、その分割単
位で2進数から10進数へ変換する2進10進変換装置
において、前記変換装置の出力を分割出力するための出
力制御カウンタを設け、分割した2進数を変換装置で変
換し出力する際、分割して10進数を出力させるように
構成したことを特徴とする2進10進変換装置。
a first register file for storing binary numbers; a second register file for temporarily storing partial sums in the conversion stage;
a selection means for selecting either a 0-base number or a partial binary number in the first register file; and a latch section for latching the partial binary number selected by the selection means; A counter indicating which part of the binary number the base number is located in, and according to the position information of the counter,
a conversion device that converts the selected partial binary number into a decimal number;
connected to the selection means and a second register file, when the selection means selects a partial binary number in the first register file, it passes through as is, and the selection means selects the decimal output of the conversion device; a decimal adder that adds the decimal output to the partial sum of the second register file when The conversion device is characterized in that an output control counter is provided for dividing and outputting the output of the conversion device, and when the divided binary number is converted and output by the conversion device, it is configured to divide and output the decimal number. Binary to decimal conversion device.
JP1147501A 1989-06-09 1989-06-09 Binary to decimal converter Expired - Fee Related JP2830075B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1147501A JP2830075B2 (en) 1989-06-09 1989-06-09 Binary to decimal converter

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1147501A JP2830075B2 (en) 1989-06-09 1989-06-09 Binary to decimal converter

Publications (2)

Publication Number Publication Date
JPH0313011A true JPH0313011A (en) 1991-01-22
JP2830075B2 JP2830075B2 (en) 1998-12-02

Family

ID=15431799

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1147501A Expired - Fee Related JP2830075B2 (en) 1989-06-09 1989-06-09 Binary to decimal converter

Country Status (1)

Country Link
JP (1) JP2830075B2 (en)

Also Published As

Publication number Publication date
JP2830075B2 (en) 1998-12-02

Similar Documents

Publication Publication Date Title
US4635220A (en) Binary coded decimal number division apparatus
US3882483A (en) Code converter system and method
EP0180157B1 (en) Information processing unit
US4604723A (en) Bit-slice adder circuit
JPH0313011A (en) Binary to decimal converter
JPH0342715A (en) Approximated inverse number generation device for division
US4241414A (en) Binary adder employing a plurality of levels of individually programmed PROMS
US4331951A (en) BCD-to-Binary converter
JPS6043742A (en) Reading circuit of variable length data
JPH0381175B2 (en)
JP2734438B2 (en) Multiplier
KR880001011B1 (en) Digital signal process method
JPS6336017B2 (en)
JP3055558B2 (en) n-bit arithmetic unit
JPS62259140A (en) Address generating circuit
JP2624738B2 (en) Rounding method
JP2001237710A (en) Binary number conversion circuit of binarized decimal number
KR900007798B1 (en) Data arithemetic apparatus
SU750478A1 (en) Converter of integer binary-decimal numbers into binary
KR100265358B1 (en) Speedy shift apparatus
JPS63137328A (en) Multiplier
JPS6148177B2 (en)
JPH0566922A (en) Decimal arithmetic circuit
JPH0736857A (en) Signal processor
JPS6037486B2 (en) sine function generator

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees