JP4428778B2 - Arithmetic device, arithmetic method, and computing device - Google Patents

Arithmetic device, arithmetic method, and computing device Download PDF

Info

Publication number
JP4428778B2
JP4428778B2 JP35663499A JP35663499A JP4428778B2 JP 4428778 B2 JP4428778 B2 JP 4428778B2 JP 35663499 A JP35663499 A JP 35663499A JP 35663499 A JP35663499 A JP 35663499A JP 4428778 B2 JP4428778 B2 JP 4428778B2
Authority
JP
Japan
Prior art keywords
unit
exponent
arithmetic
format
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 - Fee Related
Application number
JP35663499A
Other languages
Japanese (ja)
Other versions
JP2001175456A (en
Inventor
英男 山下
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 JP35663499A priority Critical patent/JP4428778B2/en
Publication of JP2001175456A publication Critical patent/JP2001175456A/en
Application granted granted Critical
Publication of JP4428778B2 publication Critical patent/JP4428778B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は演算装置及び演算方法並びに計算装置に係り、特に、浮動小数点演算を行う演算装置及び演算方法並びに計算装置に関する。
現在、浮動小数点演算には、ディジット単精度浮動小数点形式、ディジット倍精度浮動小数点形式、IEEE単精度浮動小数点形式など複数の浮動小数点演算形式が存在する。これら複数の浮動小数点演算形式は、指数演算幅、指数の基数、丸め演算の有無等が異なる。
【0002】
このため、複数の浮動小数点演算を一つの浮動小数点演算回路では対応できなかった。複数の浮動小数点演算形式に対応できる演算装置を実現しようとすると、それぞれの浮動小数点演算形式に対応した演算回路を設ける必要があり、回路規模が大きくなる。よって、複数の浮動小数点形式を回路規模を大きくすることなく演算できるようにすることが望まれている。
【0003】
【従来の技術】
浮動小数点数は、数値を指数及び仮数で表す数値表現方法である。例えば、数値をx、仮数をm、指数をe、基数をBとすると、
x=m×Be ・・・(1)
で表される。浮動小数点数は、科学技術計算、コンピュータグラフィックスの分野の演算で広く使用される。
【0004】
図1は浮動小数点を2進数での表現を説明するための図を示す。
浮動小数点数値1は、符号部2、指数部3、仮数部4から構成される。
符号部2には、数値1の正又は負を識別するための符号が2進数で格納される。例えば、符号部2が「0」であれば正、符号部2が「1」であれば負を示す。
指数部3には、式(1)の「e」に対応する数値が2進数で格納される。
【0005】
仮数部4には、式(1)の「m」に対応する数値が2進数で格納される。
この浮動小数点数には、様々な表現形式がある。主なものに、ディジット浮動小数点形式及びIEEE(The Institute of Electrical and Electronic Engineers)浮動小数点形式がある。
ディジット浮動小数点形式は、数値x16
16=m×16e ・・・(2)
で表される形式である。
【0006】
また、IEEE浮動小数点形式は、数値xIEEE
IEEE=m×2e ・・・(3)
で表される形式である。
次に、ディジット浮動小数点形式、IEEE浮動小数点形式をビット表現した場合について説明する。
【0007】
まず、ディジット浮動小数点形式をビット表現した場合について説明する。
ディジット浮動小数点形式は、それをビット表現した場合の表現形式としては、例えば、単精度表現形式又は倍精度表現形式、拡張精度表現方式などがある。
図2はディジット浮動小数点形式の数値をビット表現したとき場合を説明するための図である。図2(A)はディジット単精度浮動小数点形式、図2(B)はディジット倍精度浮動小数点形式を示す。
【0008】
ディジット単精度浮動小数点形式のビット列5は、図2(A)に示すように1ビットの符号部6、7ビットの指数部7、24ビットの仮数部8の計32ビットのビット列で表現される。
ディジット倍精度浮動小数点形式のビット列9は、図2(B)に示すように1ビットの符号部10、7ビットの指数部11、56ビットの仮数部12の計64ビットのビット列で表現される。
【0009】
なお、ディジット浮動小数点形式では、演算処理により桁合わせ等で表現できなくなった値についてはそれを切り捨てた値が結果となる。
次に、IEEE浮動小数点形式をビット表現した場合について説明する。
IEEE浮動小数点形式は、それをビット表現した場合の表現形式としては、例えば、単精度表現形式、倍精度表現形式、拡張精度表現方式などがある。
【0010】
図3はIEEE浮動小数点形式の数値をビット表現したとき場合を説明するための図である。図3(A)はIEEE単精度浮動小数点形式、図3(B)はIEEE倍精度浮動小数点形式を示す。
IEEE単精度浮動小数点形式のビット列13は、図3(A)に示すように1ビットの符号部14、8ビットの指数部7、23ビットの仮数部15の計32ビットのビット列で表現される。
【0011】
IEEE倍精度浮動小数点形式のビット列17は、図3(B)に示すように1ビットの符号部18、11ビットの指数部19、52ビットの仮数部20の計64ビットのビット列で表現される。
なお、IEEE浮動小数点形式では、演算処理により桁合わせ等で表現できなくなった値については切り捨てるのではなく、指定されたモードで丸め処理を行ったものを結果とする。このため、IEEE浮動小数点形式の方がディジット浮動小数点形式に比べて演算誤差が少なくなる。このように、IEEE浮動小数点形式を処理する演算装置では、ディジット浮動小数点形式では必要のないビット単位シフタ、丸め演算回路等が必要となる。
【0012】
一方、従来のディジット浮動小数点形式のみを扱う計算機においては、指数演算部の演算幅は、7ビットでよい。また、演算後の丸め処理も必要なかった。しかし、ディジット浮動小数点形式は、演算誤差が多い。さらに、近年JAVAなどのプログラムにおいてはIEEE浮動小数点形式が標準となっている。このため、ディジット浮動小数点形式の他に、精度の高いIEEE浮動小数点形式を扱える計算機が望まれている。
【0013】
そこで、従来のディジット浮動小数点形式を扱う浮動小数点演算装置に、指数演算部の演算幅を拡張するとともに、仮数桁合わせビットシフタ及び丸め回路を追加し、IEEE浮動小数点形式の処理を可能とした演算装置が開発されている。
ここで、まず、従来の浮動小数点加減算装置について説明する。
【0014】
図4は、従来の浮動小数点加減算装置の一例のブロック図を示す。
浮動小数点加減算装置21は、ディジット浮動小数点形式の加減算及びIEEE浮動小数点形式の数値の加減算を行うものである。
浮動小数点加減算装置21は、入力部22、23、指数比較部24、指数差検出部25、桁合部26、加算部27、正規化数カウント部28、正規化部29、指数補正部30、選択部31〜34、出力部35、桁溢れビット保持部36、丸め演算部37、制御部38から構成される。
【0015】
入力部22、23には、浮動小数点形式の数値が供給される。入力部22、23は、ディジット浮動小数点形式とIEEE浮動小数点形式とで指数ビット桁数と仮数ビット桁数とが切り換えられる。
入力部22、23から入力された数値のうち指数ビットは、指数比較部24、指数差検出部25、選択部31に供給される。また、仮数ビットは、選択部32、33に供給される。
【0016】
指数比較部24は、入力部22からの指数ビットと入力部23からの指数ビットとを比較し、選択部31、32、33を制御する。選択部31は、大きい方の指数ビットを選択し、指数補正部30に供給する。
選択部32は、指数ビットの小さい方の数値の仮数ビットを選択し、桁合部26に供給する。選択部33は、指数ビットの大きい方の数値の仮数ビットを選択し、加算部27に供給する。
【0017】
指数差検出部25は、入力部22からの指数ビットと入力部23からの指数ビットとの指数差を検出し、桁合部26に供給する。桁合部26は、選択部32から供給された仮数ビットを指数差検出部25から供給された指数差に応じてシフトし、桁合わせを行う。桁合部26で桁合わせされた仮数ビットは、加算部27に供給される。なお、桁合部26は、IEEE浮動小数点形式で加減算を行うときには、桁溢れビット保持部36に桁溢れビットを保持する。
【0018】
加算部27は、桁合部26からの仮数ビットと選択部33からの仮数ビットとを加算する。加算部27で加算された仮数ビットは、正規化部29及び選択部34に供給される。また、加算部27は、正規化カウント部28に正規化の必要な数を設定する。
正規化カウント部28は、加算部27から設定された数に応じて正規化部29を制御する。正規化部29は、加算部27から加算結果が供給され、正規化カウント部28に設定された数だけ加算結果を正規化をする。なお、正規化部29は、IEEE浮動小数点形式の演算を行うときには、ビット単位で桁合わせシフトを行う。
【0019】
正規化部29で正規化された仮数ビットは、選択部34に供給される。選択部34は、正規化カウント部28により正規化部29からの仮数ビット又は加算部29からの仮数ビットのいずれかを選択し、出力部35に供給する。選択部34は、正規化カウント部28で正規化が必要ないと判断された場合には、加算部27からの仮数ビットを選択出力し、正規化カウント部28で正規化が必要であると判断された場合には、正規化部29で正規化された仮数ビットを選択出力する。
【0020】
また、正規化カウント部28は、加算部27から設定された数に応じた補正値を指数補正部30に供給する。指数補正部30は、選択部31からの指数ビットを正規化カウント部28からの補正値に応じて補正する。丸め演算部37は、ディジット浮動小数点形式の数値の加減算を行うときには、選択部34からの仮数ビットをそのまま出力部35に供給する。丸め演算部37は、IEEE浮動小数点形式の数値の加減算を行うときには、桁溢れビット保持部36に保持された桁溢れビットに応じて丸め演算を行い、丸め演算結果を出力部35に供給する。
【0021】
出力部35は、指数補正部30からの指数ビットと選択部34からの仮数ビットとを合成して演算結果として出力する。
制御部38は、ディジット浮動小数点形式とIEEE浮動小数点形式とで指数ビットと仮数ビットとの桁数及び桁溢れビット保持部36での桁溢れビット保持動作並びに丸め演算部37での演算を制御する。
【0022】
次に、浮動小数点乗算装置について説明する。
図5は従来の浮動小数点乗算装置の一例のブロック図を示す。
浮動小数点乗算装置39は、入力部40、41、指数演算部42、仮数乗算部43、正規化カウント部44、正規化部45、指数補正部46、丸め演算部47、出力部48、制御部49から構成される。
【0023】
入力部40、41は、図4の入力部22、23と同様に入力された浮動小数点の数値を指数と仮数に分割する。入力部40、41で分割された指数は、指数演算部42に供給される。
指数演算部42は、入力部40、41からの指数を加算する。指数演算部42で加算された指数は、指数補正部46に供給される。
【0024】
また、入力部40、41で分割された仮数は、仮数乗算部43に供給される。仮数乗算部43は、入力部40、41から供給された仮数を乗算する。仮数乗算部43での乗算結果は、正規化部45に供給される。また、仮数乗算部43は、乗算結果、必要な正規化の回数を正規化カウント部44に供給する。
正規化カウント部44は、仮数乗算部43から供給された正規化回数に応じて正規化部45の正規化数を制御するとともに、指数補正部46に指数補正値を供給する。
【0025】
正規化部45は、仮数乗算部43からの乗算結果を正規化カウント部44からの正規化回数分だけ正規化して、その結果を丸め演算部47に供給する。また、正規化部45は、正規化が不要なときには、仮数乗算部43からの乗算結果をそのまま出力する。なお、正規化部45は、IEEE浮動小数点で演算を行うときには、ビット単位で桁合せシフトを行う。
【0026】
丸め演算部47は、正規化部45からの正規化結果を丸め演算する。丸め演算部47は、制御部49によってIEEE浮動小数点演算時に丸め演算を行い、ディジット浮動小数点演算時には正規部45の出力をそのまま出力する。丸め演算部47の出力は、出力部48に供給される。
出力部48には、指数補正部46から指数が供給され、丸め演算部47から仮数が供給される。出力部48は、指数補正部46からの指数と丸め演算部47からの仮数を合成して出力する。
【0027】
次に、従来の浮動小数点除算装置について説明する。
図6は従来の浮動小数点除算装置の一例のブロック構成図を示す。
浮動小数点除算装置50は、入力部51、52、指数演算部53、仮数除算部54、正規化カウント部55、正規化部56、指数補正部57、丸め演算部58、出力部59、制御部60から構成される。
【0028】
入力部51、52は、図4に示す入力部22、23、図5に示す入力部40、41と同様に、浮動小数点を指数と仮数とに分割する。指数演算部53には、入力部51、52から指数が供給される。指数演算部53は、指数の減算を行う。指数演算部53での演算結果は、指数補正部57に供給される。
仮数除算部54には、入力部40、41から仮数が供給される。仮数除算部54は、入力部40からの仮数を入力部40からの仮数で除算する。仮数除算部54の除算結果は、正規化部56に供給される。また、仮数除算部54は、除算結果に応じて必要な正規化の回数を正規化カウント部55に供給する。
【0029】
正規化カウント部55は、図5の正規化カウント部44と同様に仮数除算部54から供給された正規化回数に応じて正規化部56の正規化数を制御するとともに、指数補正部57に指数補正値を供給する。
また、指数補正部57は、図5の指数補正部46と同様に、指数演算部53からの指数を正規化カウント部55からの指数補正値により補正する。指数補正部57で補正された指数は、出力部59に供給される。
【0030】
丸め演算部58は、図5の丸め演算部47と同様に、正規化部55からの正規化結果を丸め演算する。丸め演算部58は、制御部60によってIEEE浮動小数点演算時に丸め演算を行い、ディジット浮動小数点演算時には正規部58の出力をそのまま出力する。丸め演算部58の出力は、出力部59に供給される。
出力部59には、指数補正部57から指数が供給され、丸め演算部58から仮数が供給される。出力部59は、図5の出力部47と同様に、指数補正部57からの指数と丸め演算部58からの仮数を合成して出力する。
【0031】
【発明が解決しようとする課題】
しかるに、従来のディジット形式とIEEE形式とでは、指数演算幅、指数の基数が相違する。この相違によりディジット形式の演算装置でIEEE形式の演算を行う場合には、演算前後のビット単位の桁合わせシフト、演算後の丸め演算が必要となる。
【0032】
従来、ディジット形式の演算装置でIEEE形式の演算を行えるようにするために加減算、乗算、除算の各演算装置にそれぞれにビット単位の桁合わせシフタ、丸め演算回路を設けていた。このため、ゲート数が多くなるなどの問題点があった。
本発明は上記の点に鑑みてなされたもので、簡単な構成で複数のデータ形式のデータの演算が行える演算装置及び計算装置を提供することを目的とする。
【0033】
【課題を解決するための手段】
本発明の演算装置は、それぞれが演算内容の異なる演算を実行するとともに、指数の基数が相違する複数の異なる浮動小数点の表現形式の入力データに対して複数の浮動小数点表現形式で共通の演算を行なう複数の演算手段と、演算手段に入力する入力データの浮動小数点表現形式を判定する判定手段と、複数の演算手段に共有して用いられ、複数の演算手段による演算結果が入力し、判定手段での判定結果に応じて、所定の浮動小数点表現形式のデータに対する演算結果に対し、複数の演算手段に共通の付加的処理を行なう処理手段とを有するものである。
【0034】
また、本発明は、演算手段の出力と処理手段の出力とを選択的に出力する選択手段を更に備えるものである。さらに、本発明の判定手段は、複数の演算手段のそれぞれに設けられるものである
【0035】
また、本発明の処理手段は、複数の演算手段による演算結果に対するビットシフト或いは丸め演算を行うものである。
【0036】
さらに、本発明は、指数の基数が相違する複数の異なる浮動小数点の表現形式の入力データに対して演算を行なう演算回路を有する計算装置において、前記演算回路は、複数の異なる浮動小数点表現形式の入力データに対して共通の演算を行なう、それぞれ演算内容の異なる複数の演算部と、前記演算回路に入力する入力データの浮動小数点表現形式を判定する判定部と、前記複数の演算部に共有に用いられ、前記判定部での判定結果に応じて、前記演算部から出力される所定の浮動小数点表現形式のデータに対する演算結果に対し、前記複数の演算部に共通の付加的処理を行なう処理部とを有するものである。
【0037】
本発明によれば、複数の演算手段それぞれで共通の付加的処理を行う必要がないので、回路構成を簡略化できる。
また、複数の演算手段では、予め決められた処理を実行すればよいので、複数の演算手段で付加的処理による遅延が生じることがなく、処理を効率よく行える。
【0038】
【発明の実施の形態】
図7は本発明の計算装置の一実施例の概略ブロック構成図を示す。
本実施例の計算装置100は、命令制御ユニット101、演算ユニット102、記憶制御ユニット103から構成される。命令制御ユニット101は、外部から供給される命令に応じて演算ユニット102、記憶制御ユニット103を制御する。
【0039】
演算ユニット102は、浮動小数点演算ユニット104を含む構成とされている。浮動小数点演算ユニット104は、後述するような構成とされており、複数の浮動小数点形式のデータの演算が可能とされている。記憶制御ユニット104は、入力データ、演算結果を外部に接続されたメモリに記憶する。
次に、本実施例の浮動小数点演算ユニットについて詳細に説明する。
【0040】
図8に本発明の計算装置の一実施例の浮動小数点演算ユニットのブロック構成図を示す。
浮動小数点演算ユニット104は、入力レジスタ105、106、加減算部107、乗算部108、除算部109、IEEE後処理部110、結果選択部111、結果レジスタ112から構成される。
【0041】
入力レジスタ105、106には、浮動小数点形式の数値が供給され、供給された数値を一時的に保持する。入力レジスタ105、106に保持された数値は、加減算部107、乗算部108、除算部109に供給される。
加減算部107は、後述するように入力レジスタ105、106から供給された数値を加減算する。乗算部108は、後述するように入力レジスタ105、106から供給された数値を乗算する。除算部109は、後述するように入力レジスタ105、106から供給された数値を除算する。
【0042】
IEEE後処理部110は、加減算部107、乗算部108、除算部109で共通して設けられており、IEEE浮動小数点形式の数値を演算するときに必要な正規化ビットシフト及び丸め演算を加減算、乗算、除算で共通して行う。
次に、本実施例の加減算部107について詳細に説明する。
図9は本発明の計算装置の一実施例の加減算部のブロック構成図を示す。同図中、図4と同一構成部分には同一符号を付し、その説明は省略する。
【0043】
本実施例の加減算部107は、図4の加減算装置21で丸め演算部37をなくし、形式判定部113、形式補正部114、IEEE制御部115を設けてなる。
形式判定部113には、命令制御ユニット101から命令制御信号が供給される。形式判定部113は、命令制御ユニット101から供給される命令制御信号に応じて演算する浮動小数点の形式がディジット形式か、IEEE形式かを判定する。形式判定部113の判定結果は、形式補正部114及びIEEE制御部115に供給される。
【0044】
形式補正部114は、形式判定部113からの判定結果がディジット形式であると判定された場合には、ディジット形式の指数部の7ビットが指数差検出部25に供給されるようにビット長を補正する。また、形式補正部114は、形式判定部113からの判定結果がIEEE単精度形式であると判定された場合には、IEEE単精度形式の指数部の9ビットが指数差検出部25に供給されるようにビット長を補正し、IEEE倍精度形式であると判定された場合には、IEEE倍精度形式の指数部の12ビットが指数差検出部25に供給されるようにビット長を補正する。
【0045】
IEEE制御部115は、形式判定部113からの判定結果に応じた情報をIEEE後処理部110に出力する。IEEE後処理部110は、IEEE制御部115からの情報がIEEE形式のときには動作し、ディジット形式のときには動作が停止するように制御される。
また、図4では正規化部29の出力は、選択部34にのみ供給されていたが、本実施例では正規化部29の出力をIEEE後処理部110に直接供給可能にしている。さらに、図4では指数補正部30の出力は、出力部35にのみ供給されていたが、本実施例では指数補正部30をIEEE後処理部110に直接供給可能にしている。また、本実施例では桁溢れビット保持部36に保持された桁溢れビットはIEEE後処理部110に直接供給される。
【0046】
次に、乗算部108について詳細に説明する。
図10は本発明の計算装置の一実施例の乗算部のブロック構成図を示す。同図中、図5、図9と同一構成部分には同一符号を付し、その説明は省略する。
本実施例の乗算部108は、図5に示す乗算部39の丸め演算部47を削除し、図9に示す形式判定部113、形式補正部114、IEEE制御部115を設た構成とされている。また、乗算部108は、指数補正部46、正規化部45の出力を直接IEEE後処理部110に供給可能とされている。
【0047】
次に、除算部109について詳細に説明する。
図11は本発明の計算装置の一実施例の除算部のブロック構成図を示す。同図中、図6、図9と同一構成部分には同一符号を付し、その説明は省略する。
本実施例の除算部109は、図6に示す除算部50の丸め演算部58を削除し、図9に示す形式判定部113、形式補正部114、IEEE制御部115が設けられている。また、除算部109は、指数補正部57、正規化部56の出力が直接IEEE後処理部110に供給可能となっている。
【0048】
次に、IEEE後処理部110について詳細に説明する。
図12は本発明の計算装置の一実施例のIEEE後処理部のブロック構成図を示す。
IEEE後処理部110は、制御部116、選択部117、118、ビットシフト数カウント回路119、ビットシフタ120、指数補正部121、122、丸め演算部123、出力部124から構成される。
【0049】
制御部116には、加減算部107、乗算部108、除算部109のIEEE制御部115から演算形式を示す制御情報が供給される。制御部116は、制御情報に応じて選択部117、118及び出力部124を制御する。
選択部117には、加減算部107、乗算部108、除算部109の指数補正部30、46、57から指数が供給される。選択部117は、制御部116からの制御信号に応じて指数補正部30、46、57からの指数を択一的に出力する。選択部117から出力された指数は、指数補正部121に供給される。
【0050】
選択部118には、加減算部107、乗算部108、除算部109の正規化部29、45、56から仮数が供給される。選択部118は、制御部116からの制御信号に応じて正規化部29、45、56からの仮数を択一的に出力する。選択部118から出力された仮数は、ビットシフト数カウント回路119、ビットシフタ120に供給される。
【0051】
ビットシフト数カウント回路119は、選択部118からの仮数に対して行われるビットシフトの残りのビットシフト数をカウントする。また、ビットシフタ120は、供給された仮数に対してビットシフトを行う。
図13に本発明の計算機の一実施例のビットシフトの動作を説明するための図を示す。図13(A)は各形式の符号部、指数部、仮数部のビット位置を示す図、図13(B)はビットシフトの動作を説明するための図を示す。
【0052】
図13(A)に示すようにIEEE単精度形式では0ビットが符号、1〜8ビットが指数、9〜13ビットが仮数となる。
このとき、図13(B)に示すようにIEEE単精度形式の場合は、9ビット目の「8ビット」が最上位有効ビットとなるように左シフトが行われ、IEEE倍精度形式の場合は、12ビット目の「11ビット」が最上位有効ビットとなるように右シフトが行われる。ビットシフタ120の出力は、丸め演算部123に供給される。
【0053】
丸め演算部123は、ビットシフタ120から供給された仮数に丸め演算を行う。丸め演算は、ビットシフトなどにより溢れた桁を所定のビットに丸め込む演算処理である。丸め演算部123には、命令制御ユニット101から制御信号が供給される。丸め演算部123は、制御信号に応じて動作がオン・オフされる。丸め演算部123の出力仮数は、出力部124に供給される。
【0054】
また、指数補正部121には、ビットシフト数カウント回路119のカウント値が供給される。指数補正部121は、ビットシフト数カウント回路119からのカウント値を選択部117で選択された指数にシフト方向に応じて加算又は減算し、指数の補正を行う。
指数補正部121で補正された指数は、指数補正部122に供給される。指数補正部122は、丸め演算部123に接続され、丸め演算部123から指数補正値が供給される。丸め演算部123は、丸め演算時に桁溢れが生じた場合に桁溢れに応じた補正値を指数補正部122に供給する。指数補正部122は、丸め演算部123から供給された補正値を指数補正部121からの指数に加減算することにより指数補正部121からの指数を補正する。指数補正部122の出力指数は、出力部124に供給される。
【0055】
出力部124には、指数補正部122から指数が供給されるとともに、丸め演算部123から仮数が供給される。出力部124は、指数補正部122からの指数と丸め演算部123からの仮数とを合成して出力する。出力部124には、制御部116から制御信号が供給される。出力部124は、制御部116からの制御信号がディジット形式を示す信号のときには出力を停止する。出力部124の出力がIEEE後処理部110の出力となる。IEEE後処理部110の出力は、選択部111に供給される。
【0056】
選択部111には、加減算部107の出力部35の出力、乗算部108の出力部48の出力、除算部109の出力部59の出力、IEEE後処理部110の出力部124の出力が供給され、命令制御ユニット101から供給される制御信号に応じて何れかの出力を択一的に出力する。
選択部111は、ディジット形式の加減算のときには、加減算部107からのデータを出力し、ディジット形式の乗算のときには、乗算部108からのデータを出力し、ディジット形式の除算のときには、除算部108からのデータを出力する。また、選択部111は、IEEE形式の演算のときににはIEEE後処理部110からのデータを出力する。
【0057】
選択部111から出力されたデータは、結果レジスタ112に供給される。結果レジスタ112は、選択部111からのデータを保持する。
本実施例によれば、IEEE形式の演算のビットシフト及び丸め演算は、IEEE後処理部110でまとめて行われるので、加減算部107、乗算部108、除算部109には、ビットシフタ及び丸め演算部が不要となる。よって、演算装置の構成を簡略化できる。
【0058】
また、加減算部107、乗算部108、除算部109は、加減算、乗算、除算のみを行えばよいので、演算時にビットシフト、丸め演算処理により遅延が発生することがなく、効率よく演算を行うことができる。
次に、演算の具体例について図面とともに説明する。
図14は本発明の計算機の一実施例のIEEE単精度形式の加減算の計算経過を示す図を示す。図14において左欄201は加算時の計算経過、右欄202は減算時の計算経過を示す。図15は本発明の計算機の一実施例のIEEE倍精度形式の加算の計算経過を示す図を示す。図16は本発明の計算機の一実施例のIEEE倍精度形式の減算の計算経過を示す図を示す。
【0059】
図14、図15、図16において、第1行L1は、入力部22、23への入力データを示す。第2行L2は、指数補正部114の出力を示す。第3行L3は、指数差検出部25の出力を示す。第4行L4は、桁合部26の出力を示す。第5行L5は、桁溢れビット保持部36の保持データを示す。第6行L6は、仮数加減算部27の入出力を示す。第7行L7は、正規化数カウント部28の出力を示す。第8行L8は、正規化部29の出力を示す。第9行L9は、指数補正部30の出力を示す。第10行L10は、指数補正部30からIEEE後処理部110に供給される指数データ及び正規化部29からIEEE後処理部110に供給される仮数データを示す。
【0060】
第11行L11は、ビットシフト数カウント部119の出力を示す。第12行L12は、ビットシフタ120の出力を示す。第13行L13は、指数補正部122の出力を示す。第14行L14は、丸め演算部123の出力を示す。第15行L15は、出力部124の出力を示す。
図17は本発明の計算機の一実施例のIEEE単精度形式の乗算の計算経過を示す図、図18は本発明の計算機の一実施例のIEEE倍精度形式の乗算の計算経過を示す図を示す。
【0061】
図17、図18において、第1行L1は、入力部40、41への入力データを示す。第2行L2は、指数補正部114の出力を示す。第3行L3は、指数差検出部42の出力を示す。第4行L4は、仮数乗算部43の出力を示す。第5行L5は、正規化カウント部44の出力を示す。第6行L6は、正規化部45の出力を示す。第7行L7は、指数補正部46の出力を示す。第8行L8は、指数補正部46及び正規化部45の出力を示す。第9行L9は、ビットシフト数カウント部119の出力を示す。第10行L10は、ビットシフタ120の出力を示す。第11行L11は、指数補正部122の出力を示す。第12行L12は、丸め演算部123の出力を示す。第13行L13は、出力部124の出力を示す。
【0062】
図19は本発明の計算機の一実施例のIEEE単精度形式の除算の計算経過を示す図、図20は本発明の計算機の一実施例のIEEE倍精度形式の除算の計算経過を示す図を示す。
図19、図20において、第1行L1は、入力部51、52への入力データを示す。第2行L2は、指数補正部114の出力を示す。第3行L3は、指数差検出部53の出力を示す。第4行L4は、仮数除算部54の出力を示す。第5行L5は、正規化カウント部55の出力を示す。第6行L6は、正規化部56の出力を示す。第7行L7は、指数補正部57の出力を示す。第8行L8は、指数補正部57及び正規化部56の出力を示す。第9行L9は、ビットシフト数カウント部119の出力を示す。第10行L10は、ビットシフタ120の出力を示す。第11行L11は、指数補正部122の出力を示す。第12行L12は、丸め演算部123の出力を示す。第13行L13は、出力部124の出力を示す。
【0063】
【発明の効果】
上述の如く、本発明によれば、複数の演算手段それぞれで付加的処理を行う必要がないので、回路構成を簡略化できる等の特長を有する。
また、本発明によれば、複数の演算手段では、予め決められた処理を実行すればよいので、複数の演算手段で付加的処理による遅延が生じることがなく、処理を効率よく行える等の特長を有する。
【図面の簡単な説明】
【図1】浮動小数点を2進数での表現を説明するための図である。
【図2】ディジット浮動小数点形式の数値をビット表現した場合を説明するための図である。
【図3】IEEE浮動小数点形式の数値をビット表現した場合を説明するための図である。
【図4】従来の浮動小数点加減算装置の一例のブロック図である。
【図5】従来の浮動小数点乗算装置の一例のブロック図である。
【図6】従来の浮動小数点除算装置の一例のブロック構成図である。
【図7】本発明の計算装置の一実施例の概略ブロック構成図である。
【図8】本発明の計算装置の一実施例の浮動小数点演算ユニットのブロック構成図である。
【図9】本発明の計算装置の一実施例の加減算部のブロック構成図である。
【図10】本発明の計算装置の一実施例の乗算部のブロック構成図である。
【図11】本発明の計算装置の一実施例の除算部のブロック構成図である。
【図12】本発明の計算装置の一実施例のIEEE後処理部のブロック構成図である。
【図13】本発明の計算機の一実施例のビットシフトの動作を説明するための図である。
【図14】本発明の計算機の一実施例のIEEE単精度形式の加減算の計算経過を示す図である。
【図15】本発明の計算機の一実施例のIEEE倍精度形式の加算の計算経過を示す図である。
【図16】本発明の計算機の一実施例のIEEE倍精度形式の減算の計算経過を示す図である。
【図17】本発明の計算機の一実施例のIEEE単精度形式の乗算の計算経過を示す図である。
【図18】本発明の計算機の一実施例のIEEE倍精度形式の乗算の計算経過を示す図である。
【図19】本発明の計算機の一実施例のIEEE単精度形式の除算の計算経過を示す図である。
【図20】本発明の計算機の一実施例のIEEE倍精度形式の除算の計算経過を示す図である。
【符号の説明】
100 計算装置
101 命令制御ユニット
102 演算ユニット
103 記憶制御ユニット
104 浮動小数点ユニット
105、106 入力レジスタ
107 加減算部
108 乗算部
109 除算部
110 IEEE後処理部
111 結果選択部
112 結果レジスタ
113 形式判定部
114 形式補正部
115 IEEE制御部
116 制御部
117、118 選択部
119 ビットシフト数カウント部
120 ビットシフタ
121、122 指数補正部
123 丸めビット演算部
124 出力部
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an arithmetic device, an arithmetic method, and a computing device, and more particularly, to an arithmetic device, an arithmetic method, and a computing device that perform floating point arithmetic.
Currently, there are a plurality of floating point arithmetic formats for floating point arithmetic, such as a digit single precision floating point format, a digit double precision floating point format, and an IEEE single precision floating point format. These multiple floating-point arithmetic formats differ in the exponent operation width, the exponent radix, the presence or absence of rounding operations, and the like.
[0002]
For this reason, a plurality of floating point operations cannot be handled by a single floating point operation circuit. In order to realize an arithmetic device capable of supporting a plurality of floating-point arithmetic formats, it is necessary to provide arithmetic circuits corresponding to the respective floating-point arithmetic formats, which increases the circuit scale. Therefore, it is desired to be able to calculate a plurality of floating point formats without increasing the circuit scale.
[0003]
[Prior art]
A floating-point number is a numerical expression method for expressing a numerical value by an exponent and a mantissa. For example, if the numerical value is x, the mantissa is m, the exponent is e, and the radix is B,
x = m × Be                                            ... (1)
It is represented by Floating point numbers are widely used in scientific and computer computing operations.
[0004]
FIG. 1 is a diagram for explaining the floating point representation in binary.
A floating-point value 1 includes a sign part 2, an exponent part 3, and a mantissa part 4.
The sign part 2 stores a sign for identifying positive or negative of the numerical value 1 as a binary number. For example, if the sign part 2 is “0”, it is positive, and if the sign part 2 is “1”, it is negative.
In the exponent part 3, a numerical value corresponding to “e” in the equation (1) is stored in binary.
[0005]
In the mantissa part 4, a numerical value corresponding to “m” in the equation (1) is stored in binary.
There are various representation formats for this floating-point number. The main ones are the digit floating point format and the IEEE (The Institute of Electrical and Electronic Engineers) floating point format.
The digit floating point format is numeric x16But
x16= M x 16e                                        ... (2)
It is a form represented by.
[0006]
The IEEE floating point format is a numeric value x.IEEEBut
xIEEE= M x 2e                                        ... (3)
It is a form represented by.
Next, the case where the digit floating-point format and the IEEE floating-point format are expressed in bits will be described.
[0007]
First, the case where the digit floating-point format is expressed in bits will be described.
The digit floating-point format includes, for example, a single-precision representation format, a double-precision representation format, and an extended-precision representation format when the bit floating-point format is represented in bits.
FIG. 2 is a diagram for explaining a case where a numerical value in the digit floating point format is expressed in bits. 2A shows a digit single precision floating point format, and FIG. 2B shows a digit double precision floating point format.
[0008]
As shown in FIG. 2A, the bit string 5 in the digit single-precision floating-point format is expressed by a 32-bit bit string including a 1-bit sign part 6, a 7-bit exponent part 7, and a 24-bit mantissa part 8. .
As shown in FIG. 2B, the bit string 9 in the digit double-precision floating point format is expressed by a 64-bit bit string including a 1-bit sign part 10, a 7-bit exponent part 11, and a 56-bit mantissa part 12. .
[0009]
In the digit floating point format, the value obtained by truncating the value that cannot be expressed by digit alignment or the like by the arithmetic processing is the result.
Next, a case where the IEEE floating point format is expressed in bits will be described.
The IEEE floating-point format includes, for example, a single-precision representation format, a double-precision representation format, and an extended-precision representation method as a representation format when the bit representation is used.
[0010]
FIG. 3 is a diagram for explaining a case where a numerical value in the IEEE floating point format is expressed in bits. 3A shows the IEEE single precision floating point format, and FIG. 3B shows the IEEE double precision floating point format.
As shown in FIG. 3A, the bit string 13 in the IEEE single-precision floating-point format is expressed by a 32-bit bit string, which includes a 1-bit sign part 14, an 8-bit exponent part 7, and a 23-bit mantissa part 15. .
[0011]
The bit string 17 in the IEEE double-precision floating-point format is expressed by a 64-bit bit string in total of a 1-bit sign part 18, an 11-bit exponent part 19, and a 52-bit mantissa part 20 as shown in FIG. .
In the IEEE floating point format, a value that cannot be expressed by digit alignment or the like due to arithmetic processing is not rounded down, but a result of rounding in a designated mode is the result. For this reason, the IEEE floating point format has fewer calculation errors than the digit floating point format. As described above, an arithmetic unit that processes the IEEE floating point format requires a bit unit shifter, a rounding arithmetic circuit, and the like that are not required in the digit floating point format.
[0012]
On the other hand, in a computer that handles only the conventional digit floating point format, the calculation width of the exponent operation unit may be 7 bits. In addition, rounding after the operation was not necessary. However, the digit floating point format has a lot of calculation errors. Further, in recent years, IEEE floating point format has become a standard in programs such as JAVA. For this reason, in addition to the digit floating point format, a computer that can handle a high precision IEEE floating point format is desired.
[0013]
Therefore, an arithmetic unit capable of processing the IEEE floating-point format by expanding the arithmetic range of the exponent operation unit to the conventional floating-point arithmetic unit that handles the digit floating-point format and adding a mantissa digit alignment bit shifter and a rounding circuit. Has been developed.
Here, first, a conventional floating point adder / subtracter will be described.
[0014]
FIG. 4 is a block diagram showing an example of a conventional floating point adder / subtracter.
The floating point addition / subtraction device 21 performs addition / subtraction in the digit floating point format and addition / subtraction in the IEEE floating point format.
The floating point adder / subtracter 21 includes an input unit 22, 23, an exponent comparison unit 24, an exponent difference detection unit 25, a digit alignment unit 26, an addition unit 27, a normalized number count unit 28, a normalization unit 29, an exponent correction unit 30, A selection unit 31 to 34, an output unit 35, an overflow bit holding unit 36, a rounding operation unit 37, and a control unit 38 are included.
[0015]
The input units 22 and 23 are supplied with numerical values in a floating-point format. In the input units 22 and 23, the number of exponent bit digits and the number of mantissa bits digits are switched between the digit floating point format and the IEEE floating point format.
Of the numerical values input from the input units 22 and 23, the exponent bit is supplied to the exponent comparison unit 24, the exponent difference detection unit 25, and the selection unit 31. The mantissa bits are supplied to the selection units 32 and 33.
[0016]
The exponent comparison unit 24 compares the exponent bit from the input unit 22 with the exponent bit from the input unit 23 and controls the selection units 31, 32, and 33. The selection unit 31 selects the larger exponent bit and supplies it to the exponent correction unit 30.
The selection unit 32 selects the mantissa bit of the numerical value with the smaller exponent bit and supplies it to the digit unit 26. The selector 33 selects the mantissa bit of the numerical value having the larger exponent bit and supplies the selected mantissa bit to the adder 27.
[0017]
The exponent difference detection unit 25 detects the exponent difference between the exponent bit from the input unit 22 and the exponent bit from the input unit 23 and supplies it to the digit unit 26. The digit alignment unit 26 shifts the mantissa bits supplied from the selection unit 32 according to the exponent difference supplied from the exponent difference detection unit 25 and performs digit alignment. The mantissa bits digit-aligned by the digit alignment unit 26 are supplied to the addition unit 27. The digit unit 26 holds an overflow bit in the overflow bit holding unit 36 when performing addition / subtraction in the IEEE floating point format.
[0018]
The adding unit 27 adds the mantissa bits from the digit unit 26 and the mantissa bits from the selector 33. The mantissa bits added by the addition unit 27 are supplied to the normalization unit 29 and the selection unit 34. Further, the adding unit 27 sets the number necessary for normalization in the normalization counting unit 28.
The normalization count unit 28 controls the normalization unit 29 according to the number set from the addition unit 27. The normalization unit 29 is supplied with the addition result from the addition unit 27, and normalizes the addition result by the number set in the normalization count unit 28. Note that the normalizing unit 29 performs digit shift in bit units when performing an IEEE floating point format operation.
[0019]
The mantissa bits normalized by the normalization unit 29 are supplied to the selection unit 34. The selection unit 34 selects either the mantissa bit from the normalization unit 29 or the mantissa bit from the addition unit 29 by the normalization count unit 28 and supplies the selected mantissa bit to the output unit 35. When the normalization count unit 28 determines that normalization is not necessary, the selection unit 34 selectively outputs the mantissa bits from the addition unit 27 and the normalization count unit 28 determines that normalization is necessary. If it is, the mantissa bits normalized by the normalizing unit 29 are selected and output.
[0020]
Further, the normalization count unit 28 supplies a correction value corresponding to the number set from the addition unit 27 to the exponent correction unit 30. The exponent correction unit 30 corrects the exponent bit from the selection unit 31 according to the correction value from the normalization count unit 28. The rounding operation unit 37 supplies the mantissa bits from the selection unit 34 to the output unit 35 as they are when performing addition / subtraction of numerical values in the digit floating point format. When performing addition / subtraction of numerical values in the IEEE floating point format, the rounding operation unit 37 performs rounding operation according to the overflow bit held in the overflow bit holding unit 36 and supplies the rounding operation result to the output unit 35.
[0021]
The output unit 35 combines the exponent bit from the exponent correction unit 30 and the mantissa bit from the selection unit 34 and outputs the result as a calculation result.
The control unit 38 controls the number of digits of the exponent bit and the mantissa bit in the digit floating point format and the IEEE floating point format, the overflow bit holding operation in the overflow bit holding unit 36, and the calculation in the rounding calculation unit 37. .
[0022]
Next, the floating point multiplier will be described.
FIG. 5 shows a block diagram of an example of a conventional floating-point multiplier.
The floating-point multiplier 39 includes input units 40 and 41, an exponent operation unit 42, a mantissa multiplication unit 43, a normalization count unit 44, a normalization unit 45, an exponent correction unit 46, a rounding operation unit 47, an output unit 48, and a control unit. 49.
[0023]
The input units 40 and 41 divide the input floating-point numbers into exponents and mantissas as in the input units 22 and 23 of FIG. The exponents divided by the input units 40 and 41 are supplied to the exponent calculation unit 42.
The exponent operation unit 42 adds the exponents from the input units 40 and 41. The exponent added by the exponent calculation unit 42 is supplied to the exponent correction unit 46.
[0024]
The mantissa divided by the input units 40 and 41 is supplied to the mantissa multiplication unit 43. The mantissa multiplication unit 43 multiplies the mantissa supplied from the input units 40 and 41. The multiplication result in the mantissa multiplication unit 43 is supplied to the normalization unit 45. The mantissa multiplication unit 43 supplies the multiplication result and the necessary number of normalizations to the normalization count unit 44.
The normalization count unit 44 controls the normalization number of the normalization unit 45 according to the number of normalizations supplied from the mantissa multiplication unit 43 and supplies an exponent correction value to the exponent correction unit 46.
[0025]
The normalization unit 45 normalizes the multiplication result from the mantissa multiplication unit 43 by the number of times of normalization from the normalization count unit 44 and supplies the result to the rounding operation unit 47. Further, when normalization is not required, the normalization unit 45 outputs the multiplication result from the mantissa multiplication unit 43 as it is. Note that the normalization unit 45 performs digit shift in units of bits when performing an operation in the IEEE floating point.
[0026]
The rounding calculator 47 rounds the normalized result from the normalizer 45. The rounding calculation unit 47 performs rounding calculation at the time of IEEE floating point calculation by the control unit 49 and outputs the output of the normal unit 45 as it is at the time of digit floating point calculation. The output of the rounding calculator 47 is supplied to the output unit 48.
An exponent is supplied from the exponent correction unit 46 and a mantissa is supplied from the rounding calculation unit 47 to the output unit 48. The output unit 48 synthesizes and outputs the exponent from the exponent correction unit 46 and the mantissa from the rounding calculation unit 47.
[0027]
Next, a conventional floating point division apparatus will be described.
FIG. 6 is a block diagram showing an example of a conventional floating point division apparatus.
The floating-point division device 50 includes input units 51 and 52, an exponent operation unit 53, a mantissa division unit 54, a normalization count unit 55, a normalization unit 56, an exponent correction unit 57, a rounding operation unit 58, an output unit 59, and a control unit. 60.
[0028]
Similar to the input units 22 and 23 shown in FIG. 4 and the input units 40 and 41 shown in FIG. 5, the input units 51 and 52 divide the floating point into an exponent and a mantissa. An exponent is supplied to the exponent calculation unit 53 from the input units 51 and 52. The exponent operation unit 53 performs exponent subtraction. The calculation result in the exponent calculation unit 53 is supplied to the exponent correction unit 57.
The mantissa division unit 54 is supplied with mantissas from the input units 40 and 41. The mantissa division unit 54 divides the mantissa from the input unit 40 by the mantissa from the input unit 40. The division result of the mantissa division unit 54 is supplied to the normalization unit 56. Further, the mantissa division unit 54 supplies the normalization count unit 55 with the number of times of normalization necessary according to the division result.
[0029]
The normalization count unit 55 controls the normalization number of the normalization unit 56 according to the number of normalizations supplied from the mantissa division unit 54 as in the normalization count unit 44 of FIG. Supply exponential correction value.
Further, the exponent correction unit 57 corrects the exponent from the exponent calculation unit 53 with the exponent correction value from the normalization count unit 55, similarly to the exponent correction unit 46 of FIG. The exponent corrected by the exponent correction unit 57 is supplied to the output unit 59.
[0030]
The rounding calculation unit 58 rounds the normalized result from the normalization unit 55 in the same manner as the rounding calculation unit 47 in FIG. The rounding calculation unit 58 performs rounding calculation at the time of IEEE floating point calculation by the control unit 60, and outputs the output of the normalization unit 58 as it is at the time of digit floating point calculation. The output of the rounding operation unit 58 is supplied to the output unit 59.
The output unit 59 is supplied with an exponent from the exponent correction unit 57 and a mantissa from the rounding calculation unit 58. The output unit 59 synthesizes the exponent from the exponent correction unit 57 and the mantissa from the rounding calculation unit 58 and outputs the result, as in the output unit 47 of FIG.
[0031]
[Problems to be solved by the invention]
However, the exponent digit width and the exponent radix are different between the conventional digit format and the IEEE format. Due to this difference, when an arithmetic operation in the IEEE format is performed by an arithmetic device in the digit format, a digit alignment shift before and after the operation and a rounding operation after the operation are required.
[0032]
Conventionally, in order to enable a digit-type arithmetic unit to perform an IEEE-type arithmetic operation, a bit-wise digit shifter and a rounding arithmetic circuit are provided in each of the addition / subtraction, multiplication, and division arithmetic units. For this reason, there are problems such as an increase in the number of gates.
The present invention has been made in view of the above points, and an object of the present invention is to provide an arithmetic device and a calculation device that can perform calculation of data in a plurality of data formats with a simple configuration.
[0033]
[Means for Solving the Problems]
  The arithmetic device of the present invention each performs an operation with different operation contents,Index base is differentSeveral differentFloating point representationMultiple input formatsFloating point representationA plurality of computing means that perform common computations in a format, and input data that is input to the computing means.Floating point representationThe determination means for determining the format and the plurality of calculation means are used in common, and the calculation results by the plurality of calculation means are input, and depending on the determination result by the determination means, a predeterminedFloating point representationAnd processing means for performing additional processing common to a plurality of arithmetic means on the arithmetic result of the format data.
[0034]
  The present invention further includes selection means for selectively outputting the output of the calculation means and the output of the processing means. Furthermore, the determination means of the present invention is provided for each of the plurality of calculation means..
[0035]
  The processing means of the present invention performs a bit shift or rounding operation on the operation results obtained by the plurality of operation means.
[0036]
  Furthermore, the present invention providesIndex base is differentSeveral differentFloating point representationIn a calculation device having an arithmetic circuit that performs an operation on input data in a format, the arithmetic circuit includes a plurality of differentFloating point representationA common operation is performed on input data in a format, a plurality of operation units each having different operation contents, and input data to be input to the operation circuitFloating point representationA determination unit that determines a format and a predetermined output that is used by the plurality of calculation units and is output from the calculation unit according to a determination result in the determination unitFloating point representationA processing unit that performs additional processing common to the plurality of calculation units on the calculation result of the format data.
[0037]
According to the present invention, it is not necessary to perform a common additional process in each of the plurality of arithmetic means, so that the circuit configuration can be simplified.
In addition, since a plurality of calculation means only need to execute a predetermined process, a delay due to additional processing does not occur in the plurality of calculation means, and the processing can be performed efficiently.
[0038]
DETAILED DESCRIPTION OF THE INVENTION
FIG. 7 shows a schematic block diagram of an embodiment of the computing device of the present invention.
The computing device 100 according to this embodiment includes an instruction control unit 101, an arithmetic unit 102, and a storage control unit 103. The instruction control unit 101 controls the arithmetic unit 102 and the storage control unit 103 in accordance with an instruction supplied from the outside.
[0039]
The arithmetic unit 102 is configured to include a floating point arithmetic unit 104. The floating point arithmetic unit 104 is configured as will be described later, and can calculate a plurality of floating point format data. The storage control unit 104 stores input data and calculation results in an externally connected memory.
Next, the floating point arithmetic unit of this embodiment will be described in detail.
[0040]
FIG. 8 is a block diagram of a floating point arithmetic unit of an embodiment of the computing device of the present invention.
The floating point arithmetic unit 104 includes input registers 105 and 106, an addition / subtraction unit 107, a multiplication unit 108, a division unit 109, an IEEE post-processing unit 110, a result selection unit 111, and a result register 112.
[0041]
The input registers 105 and 106 are supplied with numerical values in a floating-point format, and temporarily hold the supplied numerical values. The numerical values held in the input registers 105 and 106 are supplied to the adder / subtractor 107, the multiplier 108, and the divider 109.
The addition / subtraction unit 107 adds / subtracts the numerical values supplied from the input registers 105 and 106 as will be described later. The multiplier 108 multiplies the numerical values supplied from the input registers 105 and 106 as will be described later. The division unit 109 divides the numerical values supplied from the input registers 105 and 106 as will be described later.
[0042]
The IEEE post-processing unit 110 is provided in common by the addition / subtraction unit 107, the multiplication unit 108, and the division unit 109, and performs addition / subtraction of normalized bit shift and rounding operations necessary when calculating numeric values in the IEEE floating point format. Common to multiplication and division.
Next, the addition / subtraction unit 107 of this embodiment will be described in detail.
FIG. 9 is a block diagram of the addition / subtraction unit of an embodiment of the calculation apparatus of the present invention. In the figure, the same components as those in FIG.
[0043]
The addition / subtraction unit 107 of this embodiment is configured by eliminating the rounding operation unit 37 in the addition / subtraction device 21 of FIG. 4 and providing a format determination unit 113, a format correction unit 114, and an IEEE control unit 115.
A command control signal is supplied from the command control unit 101 to the format determination unit 113. The format determination unit 113 determines whether the floating-point format to be calculated according to the command control signal supplied from the command control unit 101 is a digit format or an IEEE format. The determination result of the format determination unit 113 is supplied to the format correction unit 114 and the IEEE control unit 115.
[0044]
The format correction unit 114 sets the bit length so that 7 bits of the exponent part of the digit format are supplied to the exponent difference detection unit 25 when the determination result from the format determination unit 113 is determined to be the digit format. to correct. If the determination result from the format determination unit 113 is determined to be in IEEE single precision format, the format correction unit 114 supplies 9 bits of the exponent part of the IEEE single precision format to the exponent difference detection unit 25. The bit length is corrected so that the 12 bits of the exponent part of the IEEE double precision format are supplied to the exponent difference detection unit 25 when the IEEE double precision format is determined. .
[0045]
The IEEE control unit 115 outputs information corresponding to the determination result from the format determination unit 113 to the IEEE post-processing unit 110. The IEEE post-processing unit 110 is controlled to operate when the information from the IEEE control unit 115 is in the IEEE format, and is stopped when the information is in the digit format.
In FIG. 4, the output of the normalization unit 29 is supplied only to the selection unit 34, but in this embodiment, the output of the normalization unit 29 can be directly supplied to the IEEE post-processing unit 110. Further, although the output of the exponent correction unit 30 is supplied only to the output unit 35 in FIG. 4, the exponent correction unit 30 can be directly supplied to the IEEE post-processing unit 110 in this embodiment. In this embodiment, the overflow bit held in the overflow bit holding unit 36 is directly supplied to the IEEE post-processing unit 110.
[0046]
Next, the multiplication unit 108 will be described in detail.
FIG. 10 is a block diagram of the multiplication unit of an embodiment of the calculation apparatus of the present invention. In the figure, the same components as those in FIGS. 5 and 9 are denoted by the same reference numerals, and the description thereof is omitted.
The multiplication unit 108 of the present embodiment is configured such that the rounding calculation unit 47 of the multiplication unit 39 shown in FIG. 5 is deleted, and a format determination unit 113, a format correction unit 114, and an IEEE control unit 115 shown in FIG. 9 are provided. Yes. Further, the multiplication unit 108 can directly supply the outputs of the exponent correction unit 46 and the normalization unit 45 to the IEEE post-processing unit 110.
[0047]
Next, the division unit 109 will be described in detail.
FIG. 11 is a block diagram of the division unit of an embodiment of the calculation apparatus of the present invention. In the figure, the same components as those in FIGS. 6 and 9 are denoted by the same reference numerals, and the description thereof is omitted.
The division unit 109 of this embodiment deletes the rounding operation unit 58 of the division unit 50 shown in FIG. 6, and is provided with a format determination unit 113, a format correction unit 114, and an IEEE control unit 115 shown in FIG. Further, the division unit 109 can directly supply the outputs of the exponent correction unit 57 and the normalization unit 56 to the IEEE post-processing unit 110.
[0048]
Next, the IEEE post-processing unit 110 will be described in detail.
FIG. 12 is a block diagram of the IEEE post-processing unit of an embodiment of the computing device of the present invention.
The IEEE post-processing unit 110 includes a control unit 116, selection units 117 and 118, a bit shift number counting circuit 119, a bit shifter 120, exponent correction units 121 and 122, a rounding operation unit 123, and an output unit 124.
[0049]
Control information indicating the calculation format is supplied to the control unit 116 from the IEEE control unit 115 of the addition / subtraction unit 107, the multiplication unit 108, and the division unit 109. The control unit 116 controls the selection units 117 and 118 and the output unit 124 according to the control information.
The selection unit 117 is supplied with exponents from the exponent correction units 30, 46, and 57 of the addition / subtraction unit 107, multiplication unit 108, and division unit 109. The selection unit 117 alternatively outputs the exponents from the exponent correction units 30, 46, and 57 in accordance with the control signal from the control unit 116. The exponent output from the selection unit 117 is supplied to the exponent correction unit 121.
[0050]
The mantissa is supplied to the selection unit 118 from the addition / subtraction unit 107, the multiplication unit 108, and the normalization units 29, 45, and 56 of the division unit 109. The selection unit 118 alternatively outputs the mantissa from the normalization units 29, 45, and 56 according to the control signal from the control unit 116. The mantissa output from the selection unit 118 is supplied to the bit shift number counting circuit 119 and the bit shifter 120.
[0051]
The bit shift number counting circuit 119 counts the remaining bit shift number of the bit shift performed on the mantissa from the selection unit 118. The bit shifter 120 performs a bit shift on the supplied mantissa.
FIG. 13 is a diagram for explaining the bit shift operation of one embodiment of the computer of the present invention. FIG. 13A is a diagram showing the bit positions of the sign part, exponent part, and mantissa part of each format, and FIG. 13B is a diagram for explaining the operation of bit shift.
[0052]
As shown in FIG. 13A, in the IEEE single precision format, 0 bit is a sign, 1 to 8 bits are exponents, and 9 to 13 bits are mantissas.
At this time, in the case of the IEEE single precision format as shown in FIG. 13B, the left shift is performed so that the “8 bits” of the ninth bit becomes the most significant bit, and in the case of the IEEE double precision format, The right shift is performed so that the “11th bit” of the 12th bit becomes the most significant bit. The output of the bit shifter 120 is supplied to the rounding calculator 123.
[0053]
The rounding operation unit 123 performs a rounding operation on the mantissa supplied from the bit shifter 120. The rounding operation is an arithmetic processing for rounding a digit overflowed by bit shift or the like to a predetermined bit. A control signal is supplied from the instruction control unit 101 to the rounding operation unit 123. The operation of the rounding calculator 123 is turned on / off according to the control signal. The output mantissa of the rounding operation unit 123 is supplied to the output unit 124.
[0054]
The exponent correction unit 121 is supplied with the count value of the bit shift number counting circuit 119. The exponent correction unit 121 corrects the exponent by adding or subtracting the count value from the bit shift number counting circuit 119 to the exponent selected by the selection unit 117 according to the shift direction.
The exponent corrected by the exponent correction unit 121 is supplied to the exponent correction unit 122. The exponent correction unit 122 is connected to the rounding calculation unit 123, and the exponent correction value is supplied from the rounding calculation unit 123. The rounding operation unit 123 supplies a correction value corresponding to the overflow to the exponent correction unit 122 when an overflow occurs during the rounding operation. The exponent correction unit 122 corrects the exponent from the exponent correction unit 121 by adding or subtracting the correction value supplied from the rounding calculation unit 123 to the exponent from the exponent correction unit 121. The output exponent of the exponent correction unit 122 is supplied to the output unit 124.
[0055]
The output unit 124 is supplied with an exponent from the exponent correction unit 122 and a mantissa from the rounding calculation unit 123. The output unit 124 combines the exponent from the exponent correction unit 122 and the mantissa from the rounding calculation unit 123 and outputs the result. A control signal is supplied from the control unit 116 to the output unit 124. The output unit 124 stops outputting when the control signal from the control unit 116 is a signal indicating a digit format. The output of the output unit 124 becomes the output of the IEEE post-processing unit 110. The output of the IEEE post-processing unit 110 is supplied to the selection unit 111.
[0056]
The selection unit 111 is supplied with the output of the output unit 35 of the addition / subtraction unit 107, the output of the output unit 48 of the multiplication unit 108, the output of the output unit 59 of the division unit 109, and the output of the output unit 124 of the IEEE post-processing unit 110. Any one of the outputs is alternatively output according to the control signal supplied from the instruction control unit 101.
The selector 111 outputs data from the adder / subtractor 107 during digit format addition / subtraction, outputs data from the multiplier 108 during digit format multiplication, and from the division unit 108 during digit format division. Output the data. In addition, the selection unit 111 outputs data from the IEEE post-processing unit 110 when performing an IEEE-format operation.
[0057]
Data output from the selection unit 111 is supplied to the result register 112. The result register 112 holds data from the selection unit 111.
According to the present embodiment, the bit shift and rounding operations of the IEEE format operations are performed collectively by the IEEE post-processing unit 110. Therefore, the addition / subtraction unit 107, the multiplication unit 108, and the division unit 109 include a bit shifter and a rounding operation unit. Is no longer necessary. Therefore, the configuration of the arithmetic device can be simplified.
[0058]
Further, the addition / subtraction unit 107, the multiplication unit 108, and the division unit 109 need only perform addition / subtraction, multiplication, and division, so that a delay is not caused by the bit shift and rounding operation processing, and the calculation can be performed efficiently. Can do.
Next, a specific example of calculation will be described with reference to the drawings.
FIG. 14 is a diagram showing a calculation process of addition / subtraction in IEEE single precision format according to an embodiment of the computer of the present invention. In FIG. 14, the left column 201 shows the calculation progress at the time of addition, and the right column 202 shows the calculation progress at the time of subtraction. FIG. 15 is a diagram showing a calculation process of addition in the IEEE double precision format according to an embodiment of the computer of the present invention. FIG. 16 is a diagram showing a calculation process of subtraction in the IEEE double precision format according to an embodiment of the computer of the present invention.
[0059]
14, 15, and 16, the first row L <b> 1 indicates input data to the input units 22 and 23. The second row L2 shows the output of the exponent correction unit 114. The third row L3 shows the output of the exponent difference detection unit 25. The fourth row L4 indicates the output of the digit unit 26. The fifth row L5 shows the data held in the overflow bit holding unit 36. The sixth line L6 indicates input / output of the mantissa addition / subtraction unit 27. The seventh line L7 shows the output of the normalized number counting unit 28. The eighth line L8 shows the output of the normalization unit 29. The ninth line L9 shows the output of the exponent correction unit 30. The tenth row L10 shows exponent data supplied from the exponent correction unit 30 to the IEEE post-processing unit 110 and mantissa data supplied from the normalization unit 29 to the IEEE post-processing unit 110.
[0060]
The eleventh row L11 shows the output of the bit shift number counting unit 119. The 12th row L12 shows the output of the bit shifter 120. The thirteenth row L13 shows the output of the exponent correction unit 122. The fourteenth row L14 shows the output of the rounding operation unit 123. The 15th line L15 indicates the output of the output unit 124.
FIG. 17 is a diagram illustrating a calculation process of multiplication in IEEE single precision format according to an embodiment of the computer of the present invention. FIG. 18 is a diagram illustrating a calculation process of multiplication in IEEE double precision format according to the embodiment of the computer of the present invention. Show.
[0061]
17 and 18, the first row L1 indicates input data to the input units 40 and 41. The second row L2 shows the output of the exponent correction unit 114. The third row L3 shows the output of the exponent difference detection unit 42. The fourth row L4 shows the output of the mantissa multiplication unit 43. The fifth row L5 shows the output of the normalization counting unit 44. The sixth line L6 shows the output of the normalization unit 45. The seventh row L7 shows the output of the exponent correction unit 46. The eighth row L8 shows the outputs of the exponent correction unit 46 and the normalization unit 45. The ninth row L9 shows the output of the bit shift number counting unit 119. The tenth row L10 shows the output of the bit shifter 120. The eleventh row L11 shows the output of the exponent correction unit 122. The 12th row L12 shows the output of the rounding operation unit 123. The thirteenth row L13 indicates the output of the output unit 124.
[0062]
FIG. 19 is a diagram showing the progress of division in IEEE single precision format according to an embodiment of the computer of the present invention, and FIG. 20 is a diagram showing the progress of division in IEEE double precision format in the embodiment of the computer of the present invention. Show.
19 and 20, the first row L1 indicates input data to the input units 51 and 52. The second row L2 shows the output of the exponent correction unit 114. The third row L3 shows the output of the exponent difference detection unit 53. The fourth row L4 shows the output of the mantissa division unit 54. The fifth row L5 shows the output of the normalization counting unit 55. The sixth line L6 shows the output of the normalization unit 56. The seventh row L7 shows the output of the exponent correction unit 57. The eighth row L8 shows the outputs of the exponent correction unit 57 and the normalization unit 56. The ninth row L9 shows the output of the bit shift number counting unit 119. The tenth row L10 shows the output of the bit shifter 120. The eleventh row L11 shows the output of the exponent correction unit 122. The 12th row L12 shows the output of the rounding operation unit 123. The thirteenth row L13 indicates the output of the output unit 124.
[0063]
【The invention's effect】
As described above, according to the present invention, since it is not necessary to perform additional processing in each of the plurality of arithmetic means, there is a feature that the circuit configuration can be simplified.
In addition, according to the present invention, since a plurality of calculation means only need to execute a predetermined process, there are no delays due to additional processing in the plurality of calculation means, and the processing can be performed efficiently. Have
[Brief description of the drawings]
BRIEF DESCRIPTION OF DRAWINGS FIG. 1 is a diagram for explaining a floating point representation in binary number.
FIG. 2 is a diagram for explaining a case where a numeric value in a digit floating point format is expressed in bits.
FIG. 3 is a diagram for explaining a case where a numerical value in IEEE floating-point format is expressed in bits.
FIG. 4 is a block diagram of an example of a conventional floating point adder / subtracter.
FIG. 5 is a block diagram of an example of a conventional floating point multiplication apparatus.
FIG. 6 is a block diagram of an example of a conventional floating-point division device.
FIG. 7 is a schematic block diagram of an embodiment of a computing device of the present invention.
FIG. 8 is a block configuration diagram of a floating point arithmetic unit of an embodiment of the computing device of the present invention.
FIG. 9 is a block configuration diagram of an addition / subtraction unit of an embodiment of the calculation apparatus of the present invention.
FIG. 10 is a block configuration diagram of a multiplication unit of an embodiment of the computing device of the present invention.
FIG. 11 is a block configuration diagram of a division unit of an embodiment of the computing device of the present invention.
FIG. 12 is a block configuration diagram of an IEEE post-processing unit of an embodiment of the computing device of the present invention.
FIG. 13 is a diagram for explaining the bit shift operation of the computer according to the embodiment of the present invention.
FIG. 14 is a diagram showing a calculation process of addition / subtraction in IEEE single precision format according to an embodiment of the computer of the present invention;
FIG. 15 is a diagram illustrating a calculation process of addition in IEEE double precision format according to an embodiment of the computer of the present invention;
FIG. 16 is a diagram showing a calculation process of subtraction in IEEE double precision format according to an embodiment of the computer of the present invention;
FIG. 17 is a diagram showing a calculation process of multiplication in IEEE single precision format according to an embodiment of the computer of the present invention;
FIG. 18 is a diagram showing a calculation process of multiplication in IEEE double precision format according to an embodiment of the computer of the present invention;
FIG. 19 is a diagram showing a calculation process of division in IEEE single precision format according to an embodiment of the computer of the present invention;
FIG. 20 is a diagram illustrating a calculation process of division in IEEE double precision format according to an embodiment of the computer of the present invention;
[Explanation of symbols]
100 calculator
101 Command control unit
102 arithmetic unit
103 Storage control unit
104 Floating point unit
105, 106 input registers
107 Addition / subtraction unit
108 Multiplier
109 Division
110 IEEE post-processing section
111 Result selection part
112 Result register
113 Type determination unit
114 Format correction unit
115 IEEE Control Unit
116 control unit
117, 118 selection unit
119 bit shift count section
120-bit shifter
121, 122 Index correction unit
123 Rounding bit operation part
124 Output unit

Claims (5)

それぞれが演算内容の異なる演算を実行するとともに、指数の基数が相違する複数の異なる浮動小数点の表現形式の入力データに対して前記複数のデータ形式で共通の演算を行なう複数の演算手段と、
前記演算手段に入力する入力データの浮動小数点表現形式を判定する判定手段と、
前記複数の演算手段に共有して用いられ、前記複数の演算手段による演算結果が入力し、前記判定手段での判定結果に応じて、所定の浮動小数点の表現形式によるデータに対する演算結果に対し、前記複数の演算手段に共通の付加的処理を行なう処理手段とを有する演算装置。
A plurality of computing means for performing computations having different computation contents, and performing a common computation in the plurality of data formats on input data in a plurality of different floating-point representation formats having different exponent bases ;
Determining means for determining a floating-point representation format of input data input to the arithmetic means;
The calculation results of the plurality of calculation means are input and used in common with the plurality of calculation means, and according to the determination result of the determination means, the calculation result for the data in a predetermined floating-point expression format , An arithmetic unit having processing means for performing additional processing common to the plurality of arithmetic means.
前記演算手段の出力と前記処理手段の出力とを選択的に出力する選択手段を更に備える請求項1記載の演算装置。The computing device according to claim 1, further comprising selection means for selectively outputting the output of the computing means and the output of the processing means. 前記判定手段は、前記複数の演算手段のそれぞれに設けられている請求項1又は2記載の演算装置。The arithmetic unit according to claim 1, wherein the determination unit is provided in each of the plurality of arithmetic units. 前記処理手段は、前記複数の演算手段による演算結果に対するビットシフト或いは丸め演算を行う請求項1乃至3のいずれか一項記載の演算装置。The arithmetic unit according to any one of claims 1 to 3, wherein the processing unit performs a bit shift or a rounding operation on a calculation result obtained by the plurality of calculation units. 指数の基数が相違する複数の異なる浮動小数点の表現形式の入力データに対して演算を行なう演算回路を有する計算装置において、
前記演算回路は、複数の異なる浮動小数点表現形式の入力データに対して共通の演算を行なう、それぞれ演算内容の異なる複数の演算部と、
前記演算回路に入力する入力データの浮動小数点表現形式を判定する判定部と、
前記複数の演算部に共有に用いられ、前記判定部での判定結果に応じて、前記演算部から出力される所定の浮動小数点表現形式のデータに対する演算結果に対し、前記複数の演算部に共通の付加的処理を行なう処理部とを有する計算装置。
In a computing device having an arithmetic circuit that performs an operation on input data in a plurality of different floating-point representation formats having different radixes of exponents ,
The arithmetic circuit performs a common operation on input data in a plurality of different floating-point representation formats, each of a plurality of operation units having different operation contents;
A determination unit for determining a floating-point expression format of input data input to the arithmetic circuit;
Commonly used by the plurality of arithmetic units for the arithmetic result of data in a predetermined floating point representation format output from the arithmetic unit according to the determination result of the determination unit. And a processing unit for performing additional processing.
JP35663499A 1999-12-15 1999-12-15 Arithmetic device, arithmetic method, and computing device Expired - Fee Related JP4428778B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP35663499A JP4428778B2 (en) 1999-12-15 1999-12-15 Arithmetic device, arithmetic method, and computing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP35663499A JP4428778B2 (en) 1999-12-15 1999-12-15 Arithmetic device, arithmetic method, and computing device

Publications (2)

Publication Number Publication Date
JP2001175456A JP2001175456A (en) 2001-06-29
JP4428778B2 true JP4428778B2 (en) 2010-03-10

Family

ID=18450013

Family Applications (1)

Application Number Title Priority Date Filing Date
JP35663499A Expired - Fee Related JP4428778B2 (en) 1999-12-15 1999-12-15 Arithmetic device, arithmetic method, and computing device

Country Status (1)

Country Link
JP (1) JP4428778B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104866278B (en) * 2014-02-21 2018-05-18 北京国睿中数科技股份有限公司 For the apparatus and method of the parallel plus-minus of floating-point complex

Also Published As

Publication number Publication date
JP2001175456A (en) 2001-06-29

Similar Documents

Publication Publication Date Title
KR100994862B1 (en) Floating-point processor with reduced power requirements for selectable subprecision
US4941120A (en) Floating point normalization and rounding prediction circuit
US10019231B2 (en) Apparatus and method for fixed point to floating point conversion and negative power of two detector
US9608662B2 (en) Apparatus and method for converting floating-point operand into a value having a different format
KR20080055985A (en) Floating-point processor with selectable subprecision
JP3178746B2 (en) Format converter for floating point numbers
US5677861A (en) Arithmetic apparatus for floating-point numbers
US5943249A (en) Method and apparatus to perform pipelined denormalization of floating-point results
CN108694037B (en) Apparatus and method for estimating shift amount when floating point subtraction is performed
US5408426A (en) Arithmetic unit capable of performing concurrent operations for high speed operation
US10061561B2 (en) Floating point addition with early shifting
JPH05250146A (en) Arithmetic operation circuit executing integer involution processing
EP0394161A2 (en) Selection of divisor multipliers in a floating point divide circuit
US7016930B2 (en) Apparatus and method for performing operations implemented by iterative execution of a recurrence equation
US4866651A (en) Method and circuit arrangement for adding floating point numbers
US20090164544A1 (en) Dynamic range enhancement for arithmetic calculations in real-time control systems using fixed point hardware
JP4428778B2 (en) Arithmetic device, arithmetic method, and computing device
JPH0283728A (en) Floating point multiplier
JPS62128331A (en) Information processor
US11704092B2 (en) High-precision anchored-implicit processing
JPH07146777A (en) Arithmetic unit
JPH0413734B2 (en)
JP3137131B2 (en) Floating point multiplier and multiplication method
JP3100868B2 (en) Arithmetic unit for floating point numbers
JP3124286B2 (en) Floating point arithmetic unit

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060308

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20081107

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20081118

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20090109

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20090714

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20091013

A911 Transfer of reconsideration by examiner before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20091021

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

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20091215

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121225

Year of fee payment: 3

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

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121225

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20131225

Year of fee payment: 4

LAPS Cancellation because of no payment of annual fees