JPS5858645A - Converting system of decimal number and binary number - Google Patents

Converting system of decimal number and binary number

Info

Publication number
JPS5858645A
JPS5858645A JP15645281A JP15645281A JPS5858645A JP S5858645 A JPS5858645 A JP S5858645A JP 15645281 A JP15645281 A JP 15645281A JP 15645281 A JP15645281 A JP 15645281A JP S5858645 A JPS5858645 A JP S5858645A
Authority
JP
Japan
Prior art keywords
byte
converting
cycles
conversion
data
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
JP15645281A
Other languages
Japanese (ja)
Inventor
Hisashi Ibe
井辺 寿
Hideaki Ando
秀明 安藤
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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP15645281A priority Critical patent/JPS5858645A/en
Publication of JPS5858645A publication Critical patent/JPS5858645A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M7/00Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
    • H03M7/02Conversion to or from weighted codes, i.e. the weight given to a digit depending on the position of the digit within the block or code word
    • H03M7/06Conversion to or from weighted codes, i.e. the weight given to a digit depending on the position of the digit within the block or code word the radix thereof being a positive integer different from two
    • H03M7/08Conversion to or from weighted codes, i.e. the weight given to a digit depending on the position of the digit within the block or code word the radix thereof being a positive integer different from two the radix being ten, i.e. pure decimal code

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Executing Machine-Instructions (AREA)

Abstract

PURPOSE:To increase a speed of converting operation, by checking whether the byte concerned is all zero or not at every 1 byte from the upper rank part of a converting data, and omitting the converting operation by the number of zero connected in the upper rank part of the converting data. CONSTITUTION:In case of a CVB instruction, as for an operation of B'j=B'j-1X 10+dj, 4 operation cycles consisting of shifting operation of 2 times and adding operation of 2 times are required, but as for a speed for skipping the operation, it can be executed by about 1.5 operation cycles by deciding whether the upper rank byte is zero or not. Accordingly, the operation cycle of a converting data of 40 bits becomes as follows: 1.5 operation cycles + converting operation 10 times, when 1 byte ''0'' is not ''0''. 3 Operation cycles + converting operation 8 times, when byte ''1'' is ''0''. 4.5 Operation cycles + converting operation 6 times, when byte 2 is ''0''. 6 Operations cycles + converting operation 4 times, when byte 3 is ''0''. 7.5 Operation cycles + converting operation 2 times, when byte 4 is ''0''. In this way, except the case when byte ''0'' is not ''0'', the operating speed is increased.

Description

【発明の詳細な説明】 本発明は、変換演算を省略できるようにし変換速度を向
上させたマイクロ・プログラム制御計算機による10進
数と2進数の変換方式に関する。
DETAILED DESCRIPTION OF THE INVENTION The present invention relates to a method for converting decimal numbers and binary numbers using a microprogram-controlled computer, which can omit conversion operations and improve conversion speed.

従来よりマイクロ−プログラム制御計算機による10進
数と2進数の変換方式においては、 10進数から2進
数への変換命令としてCVB命令、2進数からlθ進数
への変換命令としてCVD命令が6す、各々の変換アル
ゴリズムは次のようになる。
Conventionally, in the conversion method between decimal and binary numbers using micro-program controlled computers, there are six commands: CVB instruction for converting from decimal number to binary number, and CVD instruction for converting from binary number to lθ base number. The conversion algorithm is as follows.

盛、CVB命令アルゴリズム D−(d@dld、・・・・・・・・・ 4)寡・ ;
変換前の10進数。
Mori, CVB instruction algorithm D-(d@dld,・・・・・・・・・ 4) Dou・;
Decimal number before conversion.

B= (6・h168・・・・・・・・・ 〜)s ;
変換後の2進数との1乗算、加算は4ビツトずつ2進的
に行うものとする。
B= (6・h168・・・・・・・・・~)s;
Multiplying by 1 and adding with the converted binary number are performed in binary format for each 4 bits.

B・’w d・ 八′;〜X10+dl B、/冨Bt’X 10 + d@ ■ B/= B j−/X 10 + dlB = B、/
X 10 + d。
B・'w d・ 8';~X10+dl B,/Ten Bt'X 10 + d@ ■ B/= B j-/X 10 + dlB = B,/
X 10 + d.

ただしB/は途中結果である〇 み、CVD命令アルゴリズム B:l+=(&・h1&3・・・・・・・・・ b%)
3 ;変換前の2進数とし、これを上位から3ビツトず
つグルービングすると B z (0eOxOr・・・・・・・・ ヘ)$  
となる。そして変換後のlO進数を D冨(dId1d冨・・・・・・・・・ ら)toとし
1乗算、加算は4ビツトずつlO進的に行うものとする
However, B/ is an intermediate result〇mi, CVD instruction algorithm B:l+=(&h1&3... b%)
3; Take the binary number before conversion, and groove it by 3 bits from the high order: B z (0eOxOr......F) $
becomes. Then, assume that the converted lO-adic number is D-to (dId1d-to) to, and the multiplication and addition are performed in lO-adic increments of 4 bits.

)′=へ DXI〒I)、X8+Oi D4輸5−1’x s + oイ ! : D%冨Dn−t’X 8+へ ただし■は途中結果である。)′=to DXI〒I), X8+Oi D4 export 5-1'x s + o i ! : D% wealth Dn-t’X to 8+ However, ■ indicates interim results.

し九がりて、CVD命令の場合第1図0)に示すような
変換データの全桁について変換演算をくり返すことにな
り、例えば第1図(&)に示すような変換データのよう
に区間6が全部零のときs B?1′×io+d7の演
算は実行しても0になり、演算時間に無駄音生じること
になる。
Finally, in the case of a CVD instruction, the conversion operation is repeated for all digits of the converted data as shown in Figure 1 (0). When 6 is all zero, s B? Even if the calculation 1'×io+d7 is executed, the result will be 0, resulting in wasted noise during calculation time.

本発明は前記したことく鑑み、マイクロ・プログラム制
御計算機により10進数と2進数を変換する方式におい
て、変換データの上位部から1バイト毎に該バイトが全
部零でめるかどうかチェックする手段、および全部零で
はないバイトを見つけたとき変換データの上位部から各
バイト毎にlO進数と2進数の変換演算手順のうち該バ
イトについての変換演算手順にジャンプさせる手段を備
えることにより、変換データの上位部に連なる零の数だ
け変換演算を省略できるようにし210進数と2進数の
変換方式を提供することを目的とする〇以下本発明の実
施例を添付図面を参照して説明する。
In view of the foregoing, the present invention provides means for checking whether each byte from the upper part of the converted data can contain all zeros in a method for converting decimal numbers and binary numbers using a micro-program controlled computer; And by providing a means for jumping to the conversion operation procedure for the byte among the conversion operation procedures for IO base and binary numbers for each byte from the upper part of the conversion data when a byte that is not all zero is found. Embodiments of the present invention will be described below with reference to the accompanying drawings, the object of which is to provide a system for converting decimal numbers and binary numbers by omitting conversion operations by the number of consecutive zeros in the upper part.

第2図は、 10進数と2進数の変換に用いられる回路
でめる0変換されるべきデータおよび変換されたデータ
は四−カル・スレージLSI上におかれ、論理演算ユニ
ツ)ALU5は2進加算と10進加算を行う機能をもち
、シフター5FT6はデータの左右シフトを行う0各レ
ジスタX、Y、Dへのデータ移動および論理演算ユニツ
)ALU5゜シフター5FT6からローカル・ストレー
ジLSIへのデータの移動は、コントルール・ストレー
ジC87内にあるiイクロ龜プ四グラムによって制御さ
れるi;ントロール・ストレージC87内のマイクp・
プログラムはアドレスレジスタC81R9により番地指
定され、遂時Cレジスタ8に読出される。Cレジスタ8
に読出されたコードはマイクロ命令となり各データの移
動の制御を行う。
Figure 2 shows that the data to be converted and the converted data are stored in a circuit used for converting decimal numbers and binary numbers, and the logic operation unit (ALU5) is a binary number. The shifter 5FT6 has the function of performing addition and decimal addition, and the shifter 5FT6 shifts data left and right.0 Moves data to each register The movement is controlled by the microphone in the control storage C87; the microphone in the control storage C87;
The program is addressed by address register C81R9 and finally read out to C register 8. C register 8
The code read out becomes a microinstruction and controls the movement of each data.

CVD命令における演算速度を考えると、nj”−mj
−1’X10+djの演算にはシフト演算2回、加算演
算2回の4演算サイクルかかるが、上位バイトが零テす
るかどうか利足して演算をスキップする速度は約1.5
演算サイクルで実行できる。そこで第3図に示すフロー
チャートに従って、Xレジスタ2上に変換データをロー
ドしバイト0から順に全部零で躯いバイトを見つけたと
きに変換データの上位部から各バイト毎KIG進数と2
進数の変換演算手順のうちμバイトについての変換演算
手順にジャンプさせる命令とをコントロール・ストレー
ジC8711f<。
Considering the calculation speed in CVD instructions, nj"-mj
The operation of -1'X10+dj takes 4 operation cycles, 2 shift operations and 2 addition operations, but the speed of skipping the operation by checking whether the upper byte becomes zero or not is about 1.5
It can be executed in arithmetic cycles. Therefore, according to the flowchart shown in Fig. 3, the conversion data is loaded onto the
The control storage C8711f includes an instruction to jump to the μ-byte conversion operation procedure from the base number conversion operation procedure.

したがって40ビツトの変換データの演算サイクルは第
4図に示すように、 ■バイト0が0でないとき、1.5演算サイクル+変換
演算lO回。
Therefore, as shown in FIG. 4, the calculation cycle for 40-bit conversion data is: (1) When byte 0 is not 0, 1.5 calculation cycles + 10 conversion calculations.

■バイト1が0のとき、3演算サイクル+変換演算8回
■When byte 1 is 0, 3 operation cycles + 8 conversion operations.

■バイト2が0のとき、4.5演算サイクル+変換演算
6回。
■When byte 2 is 0, 4.5 operation cycles + 6 conversion operations.

■バイト3が0のとき、6演算サイクル+変換演算4回
■When byte 3 is 0, 6 operation cycles + 4 conversion operations.

■バイト4が0のとき、7.5演算サイクル+変換演算
2回〇 となり、バイト0が0でない場谷を除き演算速度は向上
する。
■When byte 4 is 0, it becomes 7.5 calculation cycles + 2 conversion calculations, and the calculation speed improves except for cases where byte 0 is not 0.

なお、変換データの上位バイトから単純に金部零でちる
かチ゛ニックするのではなく使用されるパターンの頻度
を調べ、;ポルのセブト・イシデッ ・クス命令用に有
効数字2桁のケースから検出を行うこともできる。
In addition, instead of simply ticking or ticking from the high-order byte of the conversion data, we check the frequency of the used pattern and detect it from the case of 2 significant figures for Pol's Sebut-Isidex instruction. You can also do this.

また、CVD命令の場合も1回の演算 D、/−1)7
−;x 8 + Oシ にはシフト演算1回、 10進
加減算3回の4演算サイクルかかるので同様に速度向上
が計れる〇 以上説明したように、本発明によれば変換データの上位
部に連なる零の数だけ変換演算を省略できるよう圧した
ため、 10進数と2進数の変換演算の速度を向上させ
ることができる。
Also, in the case of CVD instructions, one operation D, /-1)7
−; Since the conversion operation can be omitted by the number of zeros, the speed of the conversion operation between decimal numbers and binary numbers can be improved.

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

第1図は本発明で用いられる変換データの例でToり、
第2図は本発明で用いられる回路を示し、第3図は本発
明の実施例管示すフローチャートでToす、第4図は本
発明の実施例による演算サイクルの短縮例でめる0 1・・・四−カル・ストレージ、5・・・論m演x:”
ニット、6・・・シフター、7・・・コントロール・ス
トレージ。 特許出願人 富士通株式会社 代理人弁理士 京 谷 四 部 X l 図 (ロ)区間05で・全部零り灸換干°ニタ′X3図 ヤ4図 ↑−30の、1*ス〜ツフ・ 1−− ダ回のう1スヤ2フ・
Figure 1 shows an example of conversion data used in the present invention.
FIG. 2 shows a circuit used in the present invention, FIG. 3 is a flowchart showing an embodiment of the present invention, and FIG. 4 shows an example of shortening the calculation cycle according to an embodiment of the present invention.・4-Cal Storage, 5...Er. x:”
Knit, 6... Shifter, 7... Control Storage. Patent Applicant: Fujitsu Ltd. Representative Patent Attorney Kyotani 4 Sections --The next 1st and 2nd time.

Claims (1)

【特許請求の範囲】[Claims] マイクロ・プログラム制御計算機によりlθ進数と2進
数を変換する方式において、変換データの上位部から1
バイト毎Kl*バイトが全部零でめるかどうかチェッー
クする手段、および全部零ではないパイ)t−見つけた
とき蛮勇データの上位部から各バイト毎KIO進数と2
進数の変換演算手順のうち腋バイトについての変換演算
手11にジャンプさせる手Rt備えることにより、変換
データの上位部に連なる零の数だけ変換演算を省略でき
るようにし&lO進数と2進数の変換方式。
In the method of converting lθ base numbers and binary numbers using a micro program control computer, 1 from the upper part of the converted data
Kl for each byte
By providing the step Rt for jumping to the conversion operation step 11 for the armpit byte in the conversion operation procedure of the base number, it is possible to omit the conversion operation by the number of zeros that are continuous in the upper part of the conversion data. .
JP15645281A 1981-09-30 1981-09-30 Converting system of decimal number and binary number Pending JPS5858645A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP15645281A JPS5858645A (en) 1981-09-30 1981-09-30 Converting system of decimal number and binary number

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP15645281A JPS5858645A (en) 1981-09-30 1981-09-30 Converting system of decimal number and binary number

Publications (1)

Publication Number Publication Date
JPS5858645A true JPS5858645A (en) 1983-04-07

Family

ID=15628051

Family Applications (1)

Application Number Title Priority Date Filing Date
JP15645281A Pending JPS5858645A (en) 1981-09-30 1981-09-30 Converting system of decimal number and binary number

Country Status (1)

Country Link
JP (1) JPS5858645A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0140158A2 (en) * 1983-09-30 1985-05-08 Honeywell Bull Inc. Apparatus and method for converting a number in binary format to a decimal format
RU2494445C1 (en) * 2012-01-31 2013-09-27 Петр Петрович Кувырков Method by kuvyrkov for information processing and calculation (versions) and device "generaliser" for method realisation

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0140158A2 (en) * 1983-09-30 1985-05-08 Honeywell Bull Inc. Apparatus and method for converting a number in binary format to a decimal format
JPS60150135A (en) * 1983-09-30 1985-08-07 ハネイウエル・インフオ−メ−シヨン・システムス・インコ−ポレ−テツド Method and apparatus for converting binary format number to decimal format number
RU2494445C1 (en) * 2012-01-31 2013-09-27 Петр Петрович Кувырков Method by kuvyrkov for information processing and calculation (versions) and device "generaliser" for method realisation

Similar Documents

Publication Publication Date Title
US4099229A (en) Variable architecture digital computer
JP3711422B2 (en) Information processing circuit
JPS61836A (en) Multiplier/divider
GB1585285A (en) Parallel data processor apparatus
JPH0470662B2 (en)
US3325785A (en) Efficient utilization of control storage and access controls therefor
JPS62226379A (en) Image size converting system
US4799181A (en) BCD arithmetic using binary arithmetic and logical operations
EP0356996A2 (en) Digital division circuit using N/2-Bit subtractor for N subtractions
JPS5858645A (en) Converting system of decimal number and binary number
US3001708A (en) Central control circuit for computers
US3969702A (en) Electronic computer with independent functional networks for simultaneously carrying out different operations on the same data
JPH034936B2 (en)
JP4873546B2 (en) Data processing apparatus and data processing method
EP0265972A2 (en) Control of the program counter used in a pipelined computer
JP3252029B2 (en) Encoding device and encoding method
JP3613466B2 (en) Data arithmetic processing apparatus and data arithmetic processing program
JP2734438B2 (en) Multiplier
JPH01116826A (en) Decimal multiplier
JPH0522935B2 (en)
JPS5844551A (en) Data writing control system
CN116991362A (en) Modular multiplication operation processing method, device, electronic equipment and readable medium
JPS592055B2 (en) Square root calculation method
JP2587407B2 (en) Micro program controller
JP3284717B2 (en) Barrel shifter