JP3657350B2 - Function generator - Google Patents
Function generator Download PDFInfo
- Publication number
- JP3657350B2 JP3657350B2 JP13070896A JP13070896A JP3657350B2 JP 3657350 B2 JP3657350 B2 JP 3657350B2 JP 13070896 A JP13070896 A JP 13070896A JP 13070896 A JP13070896 A JP 13070896A JP 3657350 B2 JP3657350 B2 JP 3657350B2
- Authority
- JP
- Japan
- Prior art keywords
- register
- adders
- adder
- data
- arithmetic processing
- 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 - Lifetime
Links
Images
Landscapes
- Controls And Circuits For Display Device (AREA)
- Image Generation (AREA)
Description
【0001】
【発明の属する技術分野】
この発明は、例えば、3次元コンピュータグラフィックスに適用される画像生成装置における曲面分割を行うためのスプライト関数の演算を行うのに好適な関数発生器に関する。
【0002】
【従来の技術】
3次元コンピュータグラフィックスでは、多数のポリゴン(例えば三角形や四角形などの多角形)の集合として物体を表示している。このため、3次元コンピュータグラフィックスに適用される画像生成装置において、曲面を含む画像の当該曲面部分を、より自然に表現しようとする場合には、細かい多くのポリゴンを生成して画像を描画画像を生成するようにする必要がある。
【0003】
しかし、この多数のポリゴンの頂点座標のデータを格納するためには、大容量のメモリが必要であり、ゲーム機などのようにメモリ容量に制限がある場合には、ポリゴンの大きさが大きくなり、きめの細かい曲面を表現することが困難である。
【0004】
そこで、従来から曲面などの形状をスプライン関数等を合成して表現し、ポリゴンの頂点座標の代わりに曲面を決定するコントロールポイントのデータのみをメモリに格納して、メモリを節約する手法が用いられている。
【0005】
この方法は、例えば3次元等の多次元関数であるスプライン関数を高速に生成しなければならなず、多数個の積和演算器が必要になる。このため、ハードウエア構成が複雑になり、LSI化したときに、チップ面積が大きくなり、また、高価格になってしまう。
【0006】
【発明が解決しようとする課題】
ところで、後述するように、微分解析器を組み合わせることにより、スプライン関数を逐次計算することができる。しかし、スプライン関数を専用に計算するための微分解析器を命令実行型演算処理装置(以下、マイクロプロセッサという)の演算処理部分に内蔵するには、専用の回路をマイクロプロセッサ内に設ける必要があり、チップ面積の増大を伴い、製造コストの上昇を招くという問題がある。このため、従来は、このような計算機能を専用化したマイクロプロセッサは存在せず、その結果、スプライン関数は、通常の加算命令等を組み合わせてソフトウエアで作成する必要があり、計算速度が遅いという問題があった。
【0007】
この発明は、以上のような欠点の生じない関数発生器を提供することを目的とする。
【0008】
【課題を解決するための手段】
上記課題を解決するために、この発明による関数発生器は、マイクロプロセッサ内部の算術演算回路における加算器に変更を加えて、機能を拡張したものであり、
m個(mは自然数)の加算器と、少なくとも一つのレジスタとを備えると共に、
前記マイクロプロセッサ内の一つのレジスタのうちの全部もしくは一部が、それぞれ所定ビット数のワードをストアする0番からm番までの(m+1)個のレジスタ部分に分割され、
前記m個の加算器のうちのi(i≦m)番目の加算器における2個の入力端の一方がi番目の前記レジスタ部分に、他方が(i−1)番目の前記レジスタ部分に、それぞれ接続され、当該i番目の加算器の出力端が、前記i番目のレジスタ部分に接続されて構成されることを特徴とする。
【0009】
そして、一つの命令により、前記m個の加算器の加算が同時に実行させられることにより、高速に関数演算が実行される。
【0010】
【発明の実施の形態】
以下、この発明による関数発生器の一実施の形態を、ゲーム機内に設けられ、曲面描画のときの曲面分割処理に用いられる命令実行型演算処理部に適用した場合について、図を参照しながら説明する。
【0011】
図3は、この発明の一実施の形態の画像生成装置の構成例を示すもので、この例は3Dグラフィックス機能と、動画再生機能とを備えるゲーム機の場合の例である。
【0012】
図4は、この例のゲーム機の外観を示すもので、この例のゲーム機は、ゲーム機本体1と、ユーザの操作入力部を構成するコントロールパッド2とからなる。コントロールパッド2は、このコントロールパッド2に接続されているケーブル3の先端に取り付けられているコネクタプラグ4を、ゲーム機本体1のコネクタジャック5Aに結合させることにより、ゲーム機本体1に接続される。この例では、いわゆる対戦ゲーム等のために、2個のコントロールパッド2がゲーム機本体1に対して接続することができるように、2個のコネクタジャック5A,5Bがゲーム機本体1に設けられている。
【0013】
この例のゲーム機は、ゲームプログラムや画像データが書き込まれたCD−ROMディスク6をゲーム機本体1に装填することにより、ゲームを楽しむことができる。
【0014】
次に、図3を参照しながら、この例の画像生成装置の構成について説明する。この例の画像生成装置としてのゲーム機は、メインバス10と、サブバス20とからなる2つのシステムバスを備える構成を有している。これらメインバス1と、サブバス2との間のデータのやり取りは、バスコントローラ30により制御される。
【0015】
そして、メインバス10には、メインCPU11と、メインメモリ12と、画像伸長部13と、前処理部14と、描画処理部15と、メインのDMAコントローラ16(以下、メインDMACという)が接続されている。描画処理部15には、処理用メモリ17が接続されていると共に、この描画処理部15は表示データ用のいわゆるフレームメモリと、D/A変換回路を含み、この描画処理部15からのアナログビデオ信号がビデオ出力端子18に出力される。図示しないが、このビデオ出力端子18は、表示装置としての例えばCRTディスプレイに接続される。
【0016】
サブバス20には、サブCPU21と、サブメモリ22と、ブートROM23と、サブのDMAコントローラ24と、音声処理用プロセッサ25と、入力部26と、CD−ROMデコーダ27と、拡張用の通信インターフェース部28とが接続される。ブートROM23には、ゲーム機としての立ち上げを行うためのプログラムが格納されている。また、音声処理用プロセッサ25に対しては、音声処理用メモリ25Mが接続されている。そして、この音声処理用プロセッサ25はD/A変換回路を備え、これよりはアナログ音声信号を音声出力端子29に出力する。
【0017】
そして、CD−ROMデコーダ27は、CD−ROMドライバ40に接続されており、CD−ROMドライバ40に装填されたCD−ROMディスク6に記録されているアプリケーションプログラム(例えばゲームのプログラム)やデータをデコードする。CD−ROMディスク6には、例えば離散コサイン変換(DCT)により画像圧縮された動画や静止画の画像データや、ポリゴンを修飾するためのテクスチャー画像の画像データも記録されている。
【0018】
CD−ROMディスク6のアプリケーションプログラムには、ポリゴン描画命令が含まれており、曲面の場合には、使用するスプライン関数を特定するデータと、曲面を決定するコントロールポイントのデータが、このCD−ROM31に記憶されている。後述するように、コントロールポイントのデータの代わりに、微分解析器からなるスプライン関数発生器に与える初期化データに適するデータを記憶しておくようにしてもよい。
【0019】
入力部26は、前述した操作入力手段としてのコントロールパッド2と、ビデオ信号の入力端子と、音声信号の入力端子を備えるものである。
【0020】
メインCPU11は、メインバス10側の各部の管理および制御を行なう。また、このメインCPU11は、物体を多数のポリゴンの集まりとして描画する場合の処理の一部を行う。メインCPU11は、後述もするように、1画面分の描画画像を生成するための描画命令例をメインメモリ12上に作成する。
【0021】
また、このメインCPU11は、キャッシュメモリ11Mを有し、CPUインストラクションの一部は、メインバス10からフェッチすることなく実行できる。さらに、メインCPU11には、描画命令を作成する際にポリゴンについての座標変換演算を行なうための座標演算部11Gが、CPU内部コプロセッサとして設けられている。座標演算部11Gは、3次元座標変換及び3次元から表示画面上の2次元への変換の演算を行なう。
【0022】
このように、メインCPU11は、内部に命令キャッシュ11Mと座標演算部11Gを有しているため、その処理をメインバス10を使用しなくても、ある程度行うことができるため、メインバス10を開放しやすい。
【0023】
メインメモリ12は、動画や静止画の画像データに対しては、圧縮された画像データのメモリ領域と、伸長デコード処理された伸長画像データのメモリ領域とを備えている。また、メインメモリ12は、描画命令列などのグラフィックスデータのメモリ領域(これをパケットバッファという)を備える。このパケットバッファは、メインCPU11による描画命令列の設定と、描画命令列の描画処理部への転送とに使用される。
【0024】
画像伸長部13は、CD−ROMディスク6から再生された圧縮画像データの伸長処理を行なうもので、ハフマン符号のデコーダと、逆量子化回路と、逆離散コサイン変換回路のハードウエアを備える。ハフマン符号のデコーダの部分は、メインCPU11がソフトウエアとしてその処理を行うようにしてもよい。
【0025】
描画処理部15は、メインメモリ12から転送されてくる描画命令を実行して、その結果をフレームメモリに書き込む。フレームメモリから読み出された画像データは、D/A変換器を介してビデオ出力端子18に出力され、画像モニター装置の画面に表示される。
【0026】
前処理部14は、CPUを備えるプロセッサの構成とされるもので、メインCPU11の処理の一部を分担することができるようにするものである。この例の場合には、後述するように、この前処理部14において、曲面についての画像生成処理を行うようにする。その場合には、曲面分割処理と、分割処理により得られた多数個のポリゴンデータを、表示のための2次元座標データに変換する処理も、この前処理部14が行う。
【0027】
このゲーム機の基本的な処理について以下に説明する。
【0028】
[CD−ROMディスク6からのデータの取り込み]
図3の例のゲーム機に電源が投入され、ゲーム機本体1にCD−ROMディスク6が装填されると、ブートROM23の、ゲームを実行するためのいわゆる初期化処理をするためのプログラムが、サブCPU21により実行される。すると、CD−ROMディスク6の記録データが次のようにして取り込まれる。
【0029】
すなわち、CD−ROMディスク6から、圧縮画像データ、描画命令及びメインCPU11が実行するプログラムが、CD−ROMドライバ40、CD−ROMデコーダ27を介して読み出され、サブDMAC24によってサブメモリ22に一旦ロードされる。
【0030】
そして、このサブメモリ22に取り込まれたデータは、サブDMACおよびバスコントローラ30、さらにはメインDMAC16によってメインメモリ12に転送される。なお、サブCPU21は、描画処理部15のフレームに対して直接的にアクセスできるように構成されており、このサブCPU21によっても表示画像内容の変更が、描画処理部15の制御とは離れて可能とされている。
【0031】
[圧縮画像データの伸長及び転送]
メインメモリ12の入力データのうち、圧縮画像データは、この例では、メインCPU11がハフマン符号のデコード処理を行った後、再びメインCPU11によりメインメモリ12に書き込まれる。そして、メインDMAC16は、このハフマン符号のデコード処理後の画像データをメインメモリ12から画像伸長部13に転送する。画像伸長部13は、逆量子化の処理と、逆DCTの処理を行って画像データの伸長デコード処理を行う。伸長された画像データは、メインDMAC16が、メインメモリ12に転送する。
【0032】
メインCPU11は、伸長された画像データのマクロブロックと呼ばれる単位データが一定量、メインメモリ12に蓄積された時点で、当該伸長データを描画処理部15のフレームメモリに転送する。この際に、伸長画像データがフレームメモリの画像メモリ領域に転送されれば、そのまま背景動画像として画像モニター装置で表示されることになる。また、フレームメモリのテクスチャー領域に転送される場合もある。このテクスチャー領域の画像データは、テクスチャー画像として、ポリゴンの修飾に使用される。
【0033】
[描画命令列についての処理と転送]
物体の面を構成するポリゴンは、3次元的な奥行きの情報であるZデータに従って奥行き方向の深い位置にあるポリゴンから順に描画することにより、2次元画像表示面に立体的に画像を表示することができる。メインCPU11は、このように奥行き方向の深い位置にあるポリゴンから順に、描画処理部15で描画が行われるようにするための描画命令列をメインメモリ12上に作成する。
【0034】
メインCPU11は、入力部26のコントロールパッドからのユーザーの操作入力に基づいて、物体や視点の動きを計算し、メインメモリ12上にポリゴン描画命令列を作成する。
【0035】
この描画命令列が完成すると、メインDMAC16は、前処理部14を通じて、描画命令毎に、メインメモリ12から描画処理部15に転送する。この際に、前処理部14において、曲面のデータについては後述のような曲面分割演算およびポリゴン生成処理が施される。
【0036】
描画処理部15では、送られてきたデータを順次実行して、その結果を、フレームメモリの描画領域に格納する。このポリゴン描画の際、データは、描画処理部15の勾配計算ユニットに送られ、勾配計算が行なわれる。勾配計算は、ポリゴン描画で多角形の内側をマッピングデータで埋めていく際、マッピングデータの平面の傾きを求める計算である。テクスチャーの場合はテクスチャー画像データでポリゴンが埋められ、また、グーローシェーディングの場合は輝度値でポリゴンが埋められる。
【0037】
更に、動画のテクスチャーが可能である。つまり、動画テクスチャーの場合には、前述したように、CD−ROMディスクからの圧縮された動画データは、一旦、メインメモリ12に読み込まれる。そして、この圧縮画像データは、画像伸長部13に送られる。画像伸長部13で、画像データが伸長される。このとき、前述したように、伸長処理の一部は、メインCPU11が負担する。
【0038】
そして、伸長された動画データは描画処理部15のフレームメモリ上のテクスチャー領域に送られる。テクスチャー領域は、この描画処理部15のフレームメモリ内に設けられているので、テクスチャーパターン自身も、フレーム毎に書き換えることが可能である。このように、テクスチャー領域に動画を送ると、テクスチャーが1フレーム毎に動的に書き換えられて変化する。このテクスチャー領域の動画により、ポリゴンへのテクスチャーマッピングを行えば、動画のテクスチャーが実現される。
【0039】
[曲面描画処理の説明]
図5は、曲面描画処理についての、前処理部14と、描画処理部15の要部の構成を示す図である。
【0040】
この図5に示すように、前処理部14は、ポリゴン分割手段141と、スプライン関数発生器142と、座標変換手段143とを備える。ポリゴン分割手段141と、座標変換手段143とは曲線描画処理の場合の前処理部出の機能をブロックとして示したものである。スプライン関数発生器142は、この発明による関数発生器の一実施例であり、後述するように、複数の加算器からなる微分解析器で構成される。
【0041】
そして、描画処理部15は、機能手段としての描画手段151と、フレームメモリ152とからなる。
【0042】
曲面描画処理の場合には、前処理部14には、この例の場合には、曲面のコントローラポイントのデータがメインメモリ12から転送される。ポリゴン分割手段141は、このコントローラポイントのデータを加工して、スプライン関数発生器142に供給する初期化データを生成する。また、ポリゴン分割手段141は、予め、描画しようとする曲面を分割したときの分割ステップの大きさを定めておく。そして、生成した初期化データと、分割ステップの大きさの情報とを、スプライン関数発生器142に与え、このスプライン関数発生器142を初期化する。
【0043】
スプライン関数発生器142は、初期化データを起算点として関数演算処理を行う。そして、各分割ステップごとのスプライン関数値を生成する。生成されたスプライン関数値は、ポリゴン分割手段141により、読み出される。
【0044】
ポリゴン分割手段141は、スプライン関数発生器142から読み出したスプライン関数値を元に、描画しようとする曲面を前記の分割ステップで分割したときに生じる分割平面の、例えば4角形ポリゴンのポリゴンデータを生成する。この各分割平面のポリゴンデータは、座標変換手段143に送られる。座標変換手段143は、このポリゴンデータを、表示装置としてのCRTディスプレイに適合するスクリーン座標系の2次元頂点データに変換し、描画手段151に送る。
【0045】
描画手段151は、受け取った2次元頂点データに基づいて平面の塗り潰し、必要に応じてテクスチャーや光源計算から得られた輝度値を元にしたシェーディングを施すような処理をした画像データをフレームメモリ152に書き込む。フレームメモリ152のデータは、適宜、読み出されて、D/A変換され、ビデオ出力端子18より画像モニター装置としてのCRTディスプレイに供給されて曲面を含む画像が表示される。
【0046】
次に、以上の曲面描画処理について、さらに説明する。
【0047】
図6は、描画しようとする一つの曲面の例を示すものである。この図6において、u,vは、曲面に関するパラメータ座標であり、図6のように、曲面に沿ってそれぞれ矢印の方向に増加するものとする。Q(u,v)は、この曲面上の点であり、3次元ベクトルである。今、3次のスプライン関数を用いた曲面を考え、この曲面のコントロールポイントを3次元ベクトルPijとすると、u,v曲面上の点Q(u,v)は、図7の式(eq1)で表される。
【0048】
この式(eq1)で、Bi(u),Bj(v)は3次のスプライン関数であり、Bi(u)は図7の式(eq2)のように表され、Bj(v)は図7の式(eq3)のように表される。
【0049】
そして、図7の式(eq1)を変形すると、図7の式(eq4)のようになる。ただし、この式(eq4)のSk(v)は、図7の式(eq5)のように表されるスプライン関数であり、3次元ベクトルである。また、式(eq5)におけるvの各次数の項の係数Rklは、図7の式(eq6)であり、これも3次元ベクトルである。
【0050】
以上のことから、式(eq6)で表される3次元ベクトルRklが求まると、式(eq5)で表される3次元ベクトルSk(v)が求まり、これにより点Q(u,v)が求められることになる。式(eq6)において、akjおよびaljは、スプライン関数が決まれば決まる値であり、CD−ROMディスク6には、曲面のデータとしてのコントロールポイントのデータのほかに、曲面を決定するスプライン関数を特定するための情報として記憶されている。
【0051】
したがって、今、曲面をu方向にG個、v方向にH個に、等分割すれば、各々の分割により得られる分割平面の頂点は、以下に説明するアルゴリズムにより求めることができる。このアルゴリズムを図8および図9のフローチャートを参照しながら説明する。
【0052】
まず、ステップS1において、式(eq6)より、k,l∈{0,1,2,3}に対して、コントロールポイントの3次元ベクトルPijから、前記3次元ベクトルRklを求める。なお、このようにして、演算により3次元ベクトルRklを求めるのではなく、予め曲面データとして、コントロールポイントのデータの代わりに、この3次元ベクトルRklをCD−ROMディスク6に記憶しておき、このCD−ROMディスク6から直接的に読み出すようにしてもよい。
【0053】
ステップS1が終了すると、ステップS2に進み、この例では、曲面をu方向にG個、v方向にH個に、等分割するときの、u方向およびv方向の分割ステップ幅ΔuおよびΔvを、Δu=1/G、Δv=1/Hとして設定する。
【0054】
次に、ステップS3に進み、k∈{0,1,2,3}に対する各々の3次のスプライン関数Sk(v)の関数発生器に、v方向の分割ステップ幅Δvと、前記3次元ベクトルRklを渡して、前記スプライン関数発生器を初期化する。すなわち、このときには、スプライン関数発生器112は、スプライン関数Sk(v)の関数発生器として働くものである。
【0055】
そして、次のステップS4において、vの値を0、v方向の繰り返しのステップ回数rvを0として初期設定をした後、v方向の以下の処理をrv=H回だけ、繰り返す。すなわち、ステップS5においては、rv=H回のv方向の処理が終了したか否か判断し、未だ、終了していなければ、ステップS6に進む。
【0056】
このステップS6では、関数発生器112において、現在の3次元ベクトルSk(v)を求め、この求めたSk(v)と、u方向の分割ステップ幅Δuとを、スプライン関数Q(u,v)の関数発生器の初期化データとして渡して、このスプライン関数発生器を初期化する。すなわち、このときには、スプライン関数発生器112は、スプライン関数Q(u,v)の関数発生器として働くことになる。
【0057】
そして、次のステップS7において、uの値を0、u方向の繰り返しのステップ回数ruを0として初期設定をした後、u方向の以下の処理をru=G回だけ、繰り返す。すなわち、ステップ85においては、ru=G回のu方向の処理が終了したか否か判断し、未だ、終了していなければ、ステップS9に進む。
【0058】
ステップS9では、現在のスプライン関数Q(u,v)の値を求めて、その値をポリゴン分割手段141に出力する。そして、ステップS10に進み、uの値を分割ステップ幅Δuだけ大きくすると共に、u方向の繰り返しステップ回数ruを1だけ、インクリメントする。そして、ステップS8〜ステップS10の処理を繰り返し、u方向の次の分割ステップのところでの、スプライン関数Q(u,v)の値を求めて、その値をポリゴン分割手段141に出力する。
【0059】
ステップS8〜ステップS10の処理を、ru=G回だけ繰り返して、v方向の1つの分割ステップのところでの、u方向のすべての分割ステップについての、スプライン関数Q(u,v)の値が求まると、ステップS8からステップS11に進み、vの値を分割ステップΔvだけ大きくすると共に、v方向の繰り返しステップ回数rvを1だけ、インクリメントする。そして、ステップS5以降の処理を繰り返す。これにより、v方向の各分割ステップ点ごとの、u方向のすべての分割ステップ点についての、スプライン関数Q(u,v)の値が求まり、その値がポリゴン分割手段141に送られる。
【0060】
以上のようにして繰り返し処理が行われて、ステップS5において、v方向の繰り返しステップ回数rv=Hとなったことが判別されると、このステップS5からステップS12に進み、ポリゴン分割手段141は、蓄えていた各分割ステップ点ごとのスプライン関数Q(u,v)の値を元にして、G×H個の4角形ポリゴンを作成し、これを座標変換手段143に送る。
【0061】
座標変換手段143は、前述したように、4角形ポリゴンのデータをCRTディスプレイに表示するための2次元頂点データに変換して、描画処理部15に送る。描画処理部15は、これに基づいて、前述したような描画処理を実行し、CRTディスプレイの画面には、曲面の画像が表示される。
【0062】
なお、上記のアルゴリズムにおいては3次元ベクトルを扱ったが、同時座標系の4次元ベクトル系にも同様な手法で拡張可能である。また、上述のアルゴリズムでは、分割ステップ幅Δu、Δvごとのスプライン関数Q(u,v)の値を、すべて得た後に、G×H個の4角形ポリゴンを作成し、これを座標変換手段143に送るようにしたが、ステップS9において、スプライン関数Q(u,v)が得られた時点で、ポリゴン分割手段141が対応する4角形ポリゴンを作成して、座標変換手段143に出力するようにしてもよい。
【0063】
また、上述したように、曲面のスプライン関数を特定する情報と、曲面のコントロールポイントのデータとを、CD−ROMディスク6に記憶しておくのではなく、コントロールポイントのデータに代えて、スプライン関数発生器の初期化データに適した情報、例えば上記の例で言えば、3次元ベクトルRklを、CD−ROMディスク6に保存しておくようにすれば、上述した計算アルゴリズムの計算時間の短縮化が図れるものである。
【0064】
[関数発生器の一実施例]
この例の関数発生器の構成を説明する前に、前処理部14を構成するマイクロプロセッサの内部の要部のハードウエア構成について説明する。図10は、この例のマイクロプロセッサのALU(論理演算装置)の部分の要部構成例を示すもので、加算部51、減算部52、掛算部53、割算部54の四則演算部に加えて微分解析部55を備える。
【0065】
これら加算部51、減算部52、掛算部53、割算部54、微分解析部55には、図示しないレジスタからの入力データIN1,IN2がそれぞれ供給される。また、これら加算部51、減算部52、掛算部53、割算部54、微分解析部55の出力は、スイッチ回路56にそれぞれ供給される。スイッチ回路56は、切換制御命令CNTにより切り換えられ、図示しないレジスタに出力が送られるものである。
【0066】
微分解析器55は、複数個の加算器により構成されるもので、上述したアルゴリズムの場合のように、3次元ベクトル値(3次元関数値)を計算するものである場合には、3個の加算器を用いて構成できる。
【0067】
図1は、このように3次元ベクトル値を計算する場合の微分解析器55の構成の一例を、レジスタとの関連も併せて示した図である。この例の場合の微分解析器55は、スプライン関数発生器142を構成するものである。
【0068】
すなわち、この例の微分解析器55は、3個の加算器A1,A2,A3を備える。そして、この例の場合、マイクロプロセッサには、複数個のレジスタが設けられるが、各レジスタのビット数は、例えば64ビット分とされている。つまり、このマイクロプロセッサは、64ビットを1ワードとして扱うことができるものである。
【0069】
微分解析器55では、図1にも示すように、一つのレジスタRGの、この例では、全容量を、加算器の数mとしたとき、(m+1)個のレジスタ部分に分割して、その各レジスタ部分のデータを1ワードとして扱うようにする。すなわち、図1の例では、m=3であるので、64ビットの容量のレジスタRGを、16ビットを1ワードとする4個のレジスタ部分RA0,RA1,RA2,RA3に分割したものと見做して使用する。
【0070】
そして、説明を一般化するために、レジスタ部分RA0,RA1,RA2,RA3と、3個の加算器A1,A2,A3を、図1のように、図の右側から、そのサフィックスの数値の小さいものから順に並べたと仮定した場合、i(i≦3)番目の加算器Aiの2個の入力端は、i番目および(i−1)番目のレジスタ部分RAiおよびRA(i−1)に、それぞれ接続される。また、当該i番目の加算器Aiの出力端は、前記i番目のレジスタ部分RAiに接続される。
【0071】
そして、一つの命令により、この微分解析器55の3個の加算器A1〜A3は、加算演算を同時に実行する。すなわち、3個の加算器Ai(i=1,2,3)は、レジスタRA(i−1)とレジスタRAiからデータを読み出し、加算した結果をレジスタRAiに書き込むという動作を、同時に行うものである。
【0072】
ここで、前述した分割ステップ幅Δuごとの、uに関する3次のスプライン関数の値は、次のようにして、この図1の構成の微分解析器55からなるスプライン関数発生器142から得られる。
【0073】
この場合、スプライン関数演算に当たって、まず、レジスタ部分RA0,RA1,RA2,RA3のそれぞれには、図11Aに示すような初期値が書き込まれる。この図11Aから分かるように、この初期値には、分割ステップ幅Δuが含まれる。なお、このΔuの大きさは、前述したように、等分割の場合には、その分割数によって定まるものであり、分割数がユーザの入力や、CD−ROMディスク6に記憶されている情報に基づいて設定されることにより、定まるものであり、一定ではない。もっとも、曲面分割が等分割でない場合であっても勿論良い。
【0074】
このようにレジスタ部分RA0〜RA3に初期値が設定された後、加算器A1,A2,A3による加算を同時に実行すると、レジスタ部分RA0〜RA3の内容は、その実行回数により、図11Bに示すように変わる。この図11Bから分かるように、加算器A1,A2,A3による加算を、この例では、3回、同時に実行すると、レジスタ部分RA3には、3次のスプライン関数の値が得られるものである。
【0075】
このように、所定回数rだけ、加算器A1,A2,A3による加算を同時に実行すると、レジスタRA3には、
a・(r・Δu)3 +b・(r・Δu)2 +c・(r・Δu)+d
が格納されるものである。すなわち、分割ステップ幅Δuごとの、uに関する3次のスプライン関数がレジスタ部分RA3に得られる。したがって、各分割ステップ幅Δuごとのr回の加算器A1,A2,A3による加算の同時実行後のレジスタ部分RA3の値を、スプライン関数発生器142の出力とすることで、上述したアルゴリズム中の各分割ステップごとのスプライン関数の値がポリゴン分割手段141に与えられるものである。
【0076】
なお、3次以上のn次のスプライン関数を発生する関数発生器は、n個の加算器を用いた微分解析器により関数発生器を構成して、上述と同様の手法で求めることができる。
【0077】
従来のマルチメディア命令においては、図2に示すように、4個の加算器A0〜A3のj番目(j=0,1,2,3)の加算器Ajの2つの入力の一方には、レジスタRG1の各分割レジスタ部分RAjの値を、他方にはレジスタRG2の各分割レジスタ部分RBjの値を、それぞれ供給する構成として、それぞれのレジスタ部分の内容を書き換えながら、それぞれの加算器Ajにそれぞれ加算命令を加えるようにしなければならない。
【0078】
これに対して、図1に示した、この実施の形態による微分解析器の構成によれば、レジスタは一つでよく、また、加算器Aiを同時に実行させる命令を設けることにより、高速にスプライン関数の値を、レジスタ部分RA3に得ることができる。
【0079】
図12は、この発明による関数発生器の他の実施の形態を示すものである。
【0080】
この実施の形態は、4個の加算器A0,A1,A2,A3を備える場合である。この例の場合も、レジスタ部分RA0,RA1,RA2,RA3と、4個の加算器A0,A1,A2,A3を、図1のように図の右側から、そのサフィックスの数値の小さいものから順に並べたと仮定した場合、加算器A1〜A3については、図1の例とまったく同様に接続構成される。そして、この例の場合には、加算器A0の一方の入力端には、定数、例えば「0」が供給され、他方の入力端には、レジスタ部分RA0の値が供給される。
【0081】
この図12の例は、機能的には、図1の実施の形態の場合と同じ機能を有するが、この構成は、図2に示した構成と近い構成になり、より現実的な構成例となる。
【0082】
図13は、この発明による関数発生器のさらに他の実施の形態を示すものである。この例は、図11の構成と同様に、4個の加算器A0〜A3を用いる場合の例であるが、加算器A0の一方の入力端には、定数に代えて、他のレジスタの分割レジスタ部分からのデータを取り入れるようにしたものである。
【0083】
すなわち、この図13の実施の形態の場合には、2個のレジスタRGkとレジスタRG(k+1)(kは整数)を想定すると共に、これらのレジスタRGkとレジスタRG(k+1)を、前述の実施の形態と同様に16ビット単位で分割して、それぞれ4個のレジスタ部分RA0〜RA3、RB0〜RB3を備えるものとする。そして、レジスタRGkのレジスタ部分RB3からの16ビットワードを、加算器A0の他方の入力とする。
【0084】
なお、この場合、レジスタRGk,RG(k+1)は、加算器A0〜A3に対して固定的なものではなく、命令により切り換えられる任意のものである。
【0085】
この図13の実施の形態によれば、スプライン関数の次数が微分解析器を構成する加算器の個数よりも多い場合にも、以下に説明するような手法により、その高次のスプライン関数の値を、効率よく求めることができる。
【0086】
例えば7次のスプライン関数を計算する場合について、この図13の実施の形態の動作について説明する。
【0087】
(1)まず、予め適切な初期値をレジスタRG(k+1)の各レジスタ部分RA3,RA2,RA1,RA0に設定し、また、レジスタRGkのレジスタ部分RB3に「0」を設定しておく。
【0088】
(2)次に、一つの命令により、それぞれの加算器A1,A2,A3は、以下のような計算を同時に行い、その計算結果を、矢印で示すように、対応するレジスタに格納する。この場合、計算上は、3つのレジスタを使用することになるので、それらのレジスタをR0,R1,R2とする。そして、それぞれのレジスタ部分に格納される16ビットワードを、R0(W0)〜R0(W3)、R1(W1)〜R1(W3)、R2(W2)〜R2(W3)とする。つまり、Rk(Wi)は、レジスタRGkにおけるレジスタ部分RAiのワードを示している。
【0089】
R2(W3)←R2(W3)+R2(W2)
R2(W2)←R2(W2)+R2(W1)
R2(W1)←R2(W1)+R2(W0)
R2(W0)←R2(W0)+R1(W3)。
【0090】
(3)次に、一つの命令により、それぞれの加算器A1,A2,A3は、以下のような計算を同時に行い、その計算結果を、矢印で示すように、対応するレジスタに格納する。
R1(W3)←R1(W3)+R1(W2)
R1(W2)←R1(W2)+R1(W1)
R1(W1)←R1(W1)+R1(W0)
R1(W0)←R1(W0)+R0(W3)。
【0091】
(4)前記(3)で求めたワードR1(W3)を得る。
【0092】
(5)そして、前記(2)に戻り、以上をr回繰り返す。
【0093】
以上のアルゴリズムにより、前記(4)では、r回目の繰り返し計算の結果のワードR1(W3)として、
で表される7次のスプライン関数の値を得ることができる。
【0094】
図14は、この発明による関数発生器の、さらに他の実施の形態である。この例では、図13の実施の形態において、加算器A0の一方の入力端側にスイッチ回路SWを設け、このスイッチ回路SWを、命令により切り換えるようにすることによって、この加算器A0の一方の入力として、定数「0」と、他のレジスタRGkのレジスタ部分RB3のデータとのいずれかを、選択的に選べるように構成している。
【0095】
この図14の実施の形態によれば、前記の計算のアルゴリズムの(1)において、レジスタRGkのレジスタ部分RB3に「0」を設定する代わりに、スイッチ回路SWを切換制御して、定数「0」を選択して入力する状態にすることができ、レジスタを、その分だけ、節約することができる。
【0096】
図12および図14の実施の形態においては、加算器A0の一方の入力としての定数は、「0」としたが、この定数としては、「0」以外の値や一般的なレジスタ値であってもよい。例えば、定数を「0」以外にすることにより、より多様なスプライン関数が生成可能となる。
【0097】
以上のようにして、マイクロプロセッサの算術演算装置に、若干の変更を加えて、命令を拡張することにより、スプライン関数等の関数発生機能を、マイクロプロセッサに持たせることが簡単にできる。
【0098】
そして、図13および図14の実施の形態のような構成とすることにより、限られた数の加算器を用いた微分解析器を用いて、高次のスプライン関数を効率よく発生する関数発生器を実現することができる。
【0099】
さらに、基本演算を1命令として実行し、また、中間データを汎用レジスタに置くことができるようにしているので、管理がしやすく、ソフトウエア作成上、使いやすいというメリットもある。
【0100】
なお、以上の例では、1つのレジスタのすべての容量部分を分割し、その分割レジスタ部分を用いるようにしたが、レジスタの容量のが大きい場合には、その一部の容量部分を分割して、その分割レジスタ部分を用いるようにしてもよい。
【0101】
また、以上の説明では、この発明による関数発生器を、コンピュータグラフィックス機能を備えるゲーム機における、曲面分割のために使用する場合について説明したが、使用用途はこれに限られるものではなく、多次の多項式を計算する関数発生器のすべてに適用可能である。
【0102】
【発明の効果】
以上説明したように、この発明によれば、マイクロプロセッサの算術演算装置に若干の変更を加えて、命令を拡張するという簡単な構成により、n次のスプライン関数等の値を得ることができる関数発生器を実現することができる。
【図面の簡単な説明】
【図1】この発明による関数発生器の一実施の形態を示すブロック図である。
【図2】一般的なマルチメディア命令の例を示す図である。
【図3】この発明の適用例としてのゲーム機の構成例を示すブロック図である。
【図4】図3の例のゲーム機の外観例を示す図である。
【図5】この発明による関数発生器の一例を用いて曲面分割処理を行うための構成を示すブロック図である。
【図6】曲面の分割例を説明するための図である。
【図7】3次のスプライン関数を説明するための図である。
【図8】この発明による画像生成方法の一実施の形態の要部の動作手順を説明するフローチャートの一部である。
【図9】この発明による画像生成方法の一実施の形態の要部の動作手順を説明するフローチャートの一部である。
【図10】この発明による関数発生器の一例を含むマイクロプロセッサの要部の構成例を示す図である。
【図11】図5の関数発生器142に与える初期値データおよび関数発生動作を説明するために用いる図である。
【図12】この発明の関数発生器の他の実施の形態を説明するための図である。
【図13】この発明の関数発生器の他の実施の形態を説明するための図である。
【図14】この発明の関数発生器の他の実施の形態を説明するための図である。
【符号の説明】
141…ポリゴン分割手段、142…スプライン関数発生器、143…座標変換手段、15…描画処理部、151…描画手段、152…フレームメモリ、A1〜A3…加算器、RG,RGk,RG(k+1)…レジスタ、RA0〜RA3,RB0〜RB3…分割されたレジスタ部分、SW…スイッチ回路[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a function generator suitable for calculating a sprite function for performing curved surface division in an image generation apparatus applied to, for example, three-dimensional computer graphics.
[0002]
[Prior art]
In three-dimensional computer graphics, an object is displayed as a set of many polygons (for example, polygons such as triangles and quadrangles). For this reason, in an image generation apparatus applied to three-dimensional computer graphics, when the curved surface portion of an image including a curved surface is to be expressed more naturally, a large number of fine polygons are generated to draw the image. Need to be generated.
[0003]
However, in order to store the data of the vertex coordinates of many polygons, a large amount of memory is required. When there is a limited memory capacity such as a game machine, the size of the polygon becomes large. It is difficult to express a fine curved surface.
[0004]
Therefore, conventionally, a method has been used in which the shape of a curved surface is expressed by combining a spline function, etc., and only the control point data that determines the curved surface is stored in the memory instead of the vertex coordinates of the polygon, thereby saving the memory. ing.
[0005]
In this method, for example, a spline function that is a multidimensional function such as a three-dimensional function must be generated at high speed, and a large number of product-sum operation units are required. For this reason, the hardware configuration becomes complicated, and when the LSI is realized, the chip area becomes large and the price becomes high.
[0006]
[Problems to be solved by the invention]
By the way, as will be described later, the spline function can be sequentially calculated by combining differential analyzers. However, it is necessary to provide a dedicated circuit in the microprocessor in order to incorporate a differential analyzer for calculating a spline function in the arithmetic processing part of an instruction execution type arithmetic processing unit (hereinafter referred to as a microprocessor). However, there is a problem that the manufacturing cost increases with an increase in chip area. For this reason, conventionally, there is no microprocessor dedicated to such a calculation function, and as a result, the spline function must be created by software by combining normal addition instructions and the calculation speed is slow. There was a problem.
[0007]
It is an object of the present invention to provide a function generator that does not cause the above disadvantages.
[0008]
[Means for Solving the Problems]
In order to solve the above-described problem, the function generator according to the present invention is a function expanded by adding a change to the adder in the arithmetic operation circuit in the microprocessor.
m (m is a natural number) adders and at least one register;
All or a part of one register in the microprocessor is divided into (m + 1) register parts from 0th to mth, each storing a predetermined number of bits.
Of the m adders, one of the two input terminals of the i (i ≦ m) adder is in the i th register portion, and the other is in the (i−1) th register portion. The i-th adder is connected to each other, and the output terminal of the i-th adder is connected to the i-th register portion.
[0009]
Then, the addition of the m adders is simultaneously executed by one instruction, so that the function operation is executed at high speed.
[0010]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, a case where an embodiment of a function generator according to the present invention is applied to an instruction execution type arithmetic processing unit provided in a game machine and used for curved surface division processing at the time of curved surface drawing will be described with reference to the drawings. To do.
[0011]
FIG. 3 shows a configuration example of the image generation apparatus according to the embodiment of the present invention. This example is an example of a game machine having a 3D graphics function and a moving image playback function.
[0012]
FIG. 4 shows an external appearance of the game machine of this example, and the game machine of this example includes a game machine
[0013]
The game machine of this example can enjoy the game by loading the CD-
[0014]
Next, the configuration of the image generation apparatus of this example will be described with reference to FIG. The game machine as the image generation apparatus of this example has a configuration including two system buses including a
[0015]
A main CPU 11, a
[0016]
The sub bus 20 includes a
[0017]
The CD-
[0018]
The application program of the CD-
[0019]
The
[0020]
The main CPU 11 manages and controls each unit on the
[0021]
The main CPU 11 has a
[0022]
Thus, since the main CPU 11 has the
[0023]
The
[0024]
The
[0025]
The
[0026]
The
[0027]
The basic processing of this game machine will be described below.
[0028]
[Importing data from CD-ROM disc 6]
When the game machine in the example of FIG. 3 is turned on and the CD-
[0029]
That is, the compressed image data, the drawing command, and the program executed by the main CPU 11 are read from the CD-
[0030]
The data fetched into the
[0031]
[Decompression and transfer of compressed image data]
Of the input data to the
[0032]
The main CPU 11 transfers the decompressed data to the frame memory of the
[0033]
[Processing and transfer of drawing instruction sequence]
Polygons that make up the surface of an object are displayed in a three-dimensional manner on a two-dimensional image display surface by drawing in order from polygons that are deep in the depth direction according to Z data that is three-dimensional depth information. Can do. The main CPU 11 creates a drawing command sequence on the
[0034]
The main CPU 11 calculates the movement of the object and the viewpoint based on the user's operation input from the control pad of the
[0035]
When this drawing command sequence is completed, the
[0036]
The
[0037]
Furthermore, moving image textures are possible. That is, in the case of moving image texture, as described above, the compressed moving image data from the CD-ROM disk is once read into the
[0038]
The decompressed moving image data is sent to the texture area on the frame memory of the
[0039]
[Explanation of curved surface drawing process]
FIG. 5 is a diagram showing the configuration of the main parts of the
[0040]
As shown in FIG. 5, the preprocessing
[0041]
The
[0042]
In the case of the curved surface drawing process, the controller point data of the curved surface is transferred from the
[0043]
The spline function generator 142 performs function calculation processing using the initialization data as a starting point. Then, a spline function value for each division step is generated. The generated spline function value is read by the polygon dividing unit 141.
[0044]
Based on the spline function value read from the spline function generator 142, the polygon dividing unit 141 generates polygon data of, for example, a quadrilateral polygon of the dividing plane generated when the curved surface to be drawn is divided in the above dividing step. To do. The polygon data of each divided plane is sent to the coordinate conversion means 143. The coordinate
[0045]
The
[0046]
Next, the above curved surface drawing process will be further described.
[0047]
FIG. 6 shows an example of one curved surface to be drawn. In FIG. 6, u and v are parameter coordinates relating to a curved surface, and increase in the direction of the arrow along the curved surface as shown in FIG. Q (u, v) is a point on the curved surface and is a three-dimensional vector. Now, considering a curved surface using a cubic spline function and assuming that the control point of this curved surface is a three-dimensional vector Pij, the point Q (u, v) on the u, v curved surface is expressed by the equation (eq1) in FIG. expressed.
[0048]
In this equation (eq1), Bi (u) and Bj (v) are cubic spline functions, Bi (u) is expressed as equation (eq2) in FIG. 7, and Bj (v) is shown in FIG. (Eq3).
[0049]
Then, when the equation (eq1) in FIG. 7 is modified, the equation (eq4) in FIG. 7 is obtained. However, Sk (v) in this equation (eq4) is a spline function expressed as equation (eq5) in FIG. 7, and is a three-dimensional vector. Further, the coefficient Rkl of each order term of v in the equation (eq5) is the equation (eq6) of FIG. 7, which is also a three-dimensional vector.
[0050]
From the above, when the three-dimensional vector Rkl represented by the equation (eq6) is obtained, the three-dimensional vector Sk (v) represented by the equation (eq5) is obtained, thereby obtaining the point Q (u, v). Will be. In equation (eq6), akj and alj are values that are determined when the spline function is determined. In addition to the control point data as the curved surface data, the CD-
[0051]
Therefore, now, if the curved surface is equally divided into G pieces in the u direction and H pieces in the v direction, the vertex of the divided plane obtained by each division can be obtained by an algorithm described below. This algorithm will be described with reference to the flowcharts of FIGS.
[0052]
First, in step S1, the three-dimensional vector Rkl is obtained from the three-dimensional vector Pij of the control point with respect to k, lε {0, 1, 2, 3} from the equation (eq6). In this way, instead of calculating the three-dimensional vector Rkl by calculation, this three-dimensional vector Rkl is stored in advance on the CD-
[0053]
When step S1 ends, the process proceeds to step S2. In this example, the divided step widths Δu and Δv in the u direction and the v direction when the curved surface is equally divided into G pieces in the u direction and H pieces in the v direction are set as follows: Δu = 1 / G and Δv = 1 / H are set.
[0054]
Next, proceeding to step S3, the function generator of each cubic spline function Sk (v) for kε {0, 1, 2, 3} is divided into the division step width Δv in the v direction and the three-dimensional vector. Pass Rkl to initialize the spline function generator. That is, at this time, the spline function generator 112 functions as a function generator of the spline function Sk (v).
[0055]
Then, in the next step S4, the value of v is set to 0, and the number of steps r in the v direction is repeated. v After the initial setting with 0, the following processing in the v direction is v Repeat for H times. That is, in step S5, r v It is determined whether or not H times of processing in the v direction have been completed. If not, the process proceeds to step S6.
[0056]
In step S6, the function generator 112 obtains the current three-dimensional vector Sk (v), and the obtained Sk (v) and the division step width Δu in the u direction are represented by the spline function Q (u, v). The spline function generator is initialized by passing it as initialization data of the function generator. That is, at this time, the spline function generator 112 functions as a function generator of the spline function Q (u, v).
[0057]
In the next step S7, the value of u is set to 0, and the number of repeated steps r in the u direction. u After the initial setting with 0, the following processing in the u direction is u Repeat for G times. That is, in step 85, r u It is determined whether or not G times of processing in the u direction have been completed. If not, the process proceeds to step S9.
[0058]
In
[0059]
The process from step S8 to step S10 is changed to r u When the value of the spline function Q (u, v) is obtained for all the division steps in the u direction at one division step in the v direction after repeating G times, the process proceeds from step S8 to step S11. While increasing the value of v by the division step Δv, the number of repetition steps r in the v direction v Is incremented by one. And the process after step S5 is repeated. As a result, the value of the spline function Q (u, v) is obtained for every division step point in the u direction for each division step point in the v direction, and the value is sent to the polygon division means 141.
[0060]
The iterative process is performed as described above, and the number of repetitive steps r in the v direction is determined in step S5. v If it is determined that = H, the process proceeds from step S5 to step S12, and the polygon dividing unit 141 is based on the stored value of the spline function Q (u, v) for each divided step point. , G × H quadrilateral polygons are created and sent to the coordinate conversion means 143.
[0061]
As described above, the coordinate
[0062]
Although the above algorithm deals with a three-dimensional vector, it can be extended to a four-dimensional vector system of a simultaneous coordinate system by a similar method. Further, in the above-described algorithm, after all the values of the spline function Q (u, v) for each of the division step widths Δu and Δv are obtained, G × H rectangular polygons are created, and this is converted into the coordinate conversion means 143. However, when the spline function Q (u, v) is obtained in step S9, the polygon dividing unit 141 creates a corresponding quadrilateral polygon and outputs it to the coordinate
[0063]
Further, as described above, the information for specifying the curved surface spline function and the curved surface control point data are not stored in the CD-
[0064]
[One Example of Function Generator]
Before describing the configuration of the function generator in this example, the hardware configuration of the main part of the microprocessor constituting the
[0065]
Input data IN1 and IN2 from a register (not shown) are supplied to the
[0066]
The
[0067]
FIG. 1 is a diagram showing an example of the configuration of the
[0068]
That is, the
[0069]
As shown in FIG. 1, the
[0070]
In order to generalize the description, the register portions RA0, RA1, RA2 and RA3 and the three adders A1, A2 and A3 are reduced from the right side of the figure as shown in FIG. Assuming that they are arranged in order, the two input ends of the i (i ≦ 3) -th adder Ai are connected to the i-th and (i−1) -th register portions RAi and RA (i−1), respectively. Each is connected. The output terminal of the i-th adder Ai is connected to the i-th register portion RAi.
[0071]
Then, according to one command, the three adders A1 to A3 of the
[0072]
Here, the value of the cubic spline function relating to u for each of the division step widths Δu described above is obtained from the spline function generator 142 including the
[0073]
In this case, in the spline function calculation, first, initial values as shown in FIG. 11A are written in each of the register portions RA0, RA1, RA2, and RA3. As can be seen from FIG. 11A, this initial value includes the division step width Δu. As described above, the size of Δu is determined by the number of divisions in the case of equal division. The number of divisions is determined by user input or information stored in the CD-
[0074]
After the initial values are set in the register portions RA0 to RA3 as described above, when additions by the adders A1, A2 and A3 are simultaneously performed, the contents of the register portions RA0 to RA3 are as shown in FIG. Changes to. As can be seen from FIG. 11B, when the additions by the adders A1, A2, and A3 are simultaneously executed three times in this example, the value of the cubic spline function is obtained in the register portion RA3.
[0075]
As described above, when the additions by the adders A1, A2, and A3 are simultaneously performed a predetermined number of times r, the register RA3 has
a · (r · Δu) Three + B · (r · Δu) 2 + C · (r · Δu) + d
Is stored. That is, for each division step width Δu, a cubic spline function relating to u is obtained in the register portion RA3. Therefore, the value of the register portion RA3 after the simultaneous addition by the adders A1, A2, A3 for r times for each divided step width Δu is used as the output of the spline function generator 142, so that The value of the spline function for each division step is given to the polygon division means 141.
[0076]
A function generator that generates a third-order or higher-order n-order spline function can be obtained by a method similar to that described above by configuring a function generator with a differential analyzer using n adders.
[0077]
In the conventional multimedia instruction, as shown in FIG. 2, one of the two inputs of the jth adder Aj of the four adders A0 to A3 (j = 0, 1, 2, 3) is The configuration is such that the value of each divided register portion RAj of register RG1 and the value of each divided register portion RBj of register RG2 are supplied to the other, and the contents of the respective register portions are rewritten to each adder Aj. You must add an add instruction.
[0078]
On the other hand, according to the configuration of the differential analyzer according to the present embodiment shown in FIG. 1, only one register is necessary, and by providing an instruction for simultaneously executing the adder Ai, the spline can be processed at high speed. The value of the function can be obtained in the register part RA3.
[0079]
FIG. 12 shows another embodiment of the function generator according to the present invention.
[0080]
In this embodiment, four adders A0, A1, A2, and A3 are provided. Also in this example, the register portions RA0, RA1, RA2, and RA3 and the four adders A0, A1, A2, and A3 are arranged in order from the right side of the drawing as shown in FIG. Assuming that they are arranged, the adders A1 to A3 are connected and configured in the same manner as in the example of FIG. In this example, a constant, for example, “0” is supplied to one input terminal of the adder A0, and the value of the register portion RA0 is supplied to the other input terminal.
[0081]
The example of FIG. 12 functionally has the same function as that of the embodiment of FIG. 1, but this configuration is similar to the configuration shown in FIG. Become.
[0082]
FIG. 13 shows still another embodiment of the function generator according to the present invention. This example is an example in which four adders A0 to A3 are used as in the configuration of FIG. 11. However, one input terminal of the adder A0 is divided into other registers instead of constants. The data from the register part is taken in.
[0083]
That is, in the embodiment shown in FIG. 13, two registers RGk and RG (k + 1) (k is an integer) are assumed, and these registers RGk and RG (k + 1) In the same manner as in the first embodiment, each of the four register portions RA0 to RA3 and RB0 to RB3 is divided in units of 16 bits. Then, the 16-bit word from the register portion RB3 of the register RGk is used as the other input of the adder A0.
[0084]
In this case, the registers RGk and RG (k + 1) are not fixed with respect to the adders A0 to A3, but can be arbitrarily switched by an instruction.
[0085]
According to the embodiment of FIG. 13, even when the order of the spline function is larger than the number of adders constituting the differential analyzer, the value of the higher-order spline function can be obtained by the method described below. Can be obtained efficiently.
[0086]
For example, in the case of calculating a seventh-order spline function, the operation of the embodiment of FIG. 13 will be described.
[0087]
(1) First, appropriate initial values are set in advance in the register portions RA3, RA2, RA1, and RA0 of the register RG (k + 1), and “0” is set in the register portion RB3 of the register RGk.
[0088]
(2) Next, according to one instruction, each of the adders A1, A2 and A3 performs the following calculation simultaneously, and stores the calculation result in the corresponding register as indicated by an arrow. In this case, since three registers are used for calculation, these registers are R0, R1, and R2. The 16-bit words stored in the respective register portions are R0 (W0) to R0 (W3), R1 (W1) to R1 (W3), and R2 (W2) to R2 (W3). That is, Rk (Wi) indicates a word of the register portion RAi in the register RGk.
[0089]
R2 (W3) ← R2 (W3) + R2 (W2)
R2 (W2) ← R2 (W2) + R2 (W1)
R2 (W1) ← R2 (W1) + R2 (W0)
R2 (W0) ← R2 (W0) + R1 (W3).
[0090]
(3) Next, according to one instruction, each of the adders A1, A2, and A3 performs the following calculation simultaneously, and stores the calculation result in a corresponding register as indicated by an arrow.
R1 (W3) ← R1 (W3) + R1 (W2)
R1 (W2) ← R1 (W2) + R1 (W1)
R1 (W1) ← R1 (W1) + R1 (W0)
R1 (W0) ← R1 (W0) + R0 (W3).
[0091]
(4) The word R1 (W3) obtained in (3) is obtained.
[0092]
(5) Then, return to the above (2) and repeat the above r times.
[0093]
By the above algorithm, in the above (4), as the word R1 (W3) as the result of the r-th repeated calculation,
The value of the seventh-order spline function represented by
[0094]
FIG. 14 shows still another embodiment of the function generator according to the present invention. In this example, in the embodiment of FIG. 13, a switch circuit SW is provided on one input end side of the adder A0, and the switch circuit SW is switched by an instruction, so that one of the adders A0 is switched. As an input, either a constant “0” or data of the register part RB3 of another register RGk can be selectively selected.
[0095]
According to the embodiment of FIG. 14, in the calculation algorithm (1), instead of setting “0” in the register portion RB3 of the register RGk, the switch circuit SW is controlled to switch to the constant “0”. "Can be selected and entered, and the register can be saved accordingly.
[0096]
In the embodiment of FIGS. 12 and 14, the constant as one input of the adder A0 is “0”, but this constant may be a value other than “0” or a general register value. May be. For example, by setting the constant to a value other than “0”, more various spline functions can be generated.
[0097]
As described above, the microprocessor can be easily provided with a function generation function such as a spline function by extending the instructions by slightly changing the arithmetic operation unit of the microprocessor.
[0098]
The function generator that efficiently generates a high-order spline function using a differential analyzer using a limited number of adders by employing the configuration as in the embodiment of FIGS. Can be realized.
[0099]
Furthermore, since basic operations are executed as one instruction and intermediate data can be placed in a general-purpose register, there are advantages that management is easy and software is easy to use.
[0100]
In the above example, all the capacity parts of one register are divided and the divided register part is used. However, when the capacity of the register is large, a part of the capacity part is divided. The division register portion may be used.
[0101]
In the above description, the case where the function generator according to the present invention is used for dividing a curved surface in a game machine having a computer graphics function has been described. It is applicable to all function generators that calculate the following polynomials:
[0102]
【The invention's effect】
As described above, according to the present invention, a function capable of obtaining a value such as an nth-order spline function or the like with a simple configuration in which the arithmetic operation unit of the microprocessor is slightly changed and the instruction is extended. A generator can be realized.
[Brief description of the drawings]
FIG. 1 is a block diagram showing an embodiment of a function generator according to the present invention.
FIG. 2 is a diagram illustrating an example of a general multimedia instruction.
FIG. 3 is a block diagram showing a configuration example of a game machine as an application example of the present invention.
FIG. 4 is a diagram showing an example of the appearance of the game machine of the example of FIG.
FIG. 5 is a block diagram showing a configuration for performing curved surface division processing using an example of a function generator according to the present invention;
FIG. 6 is a diagram for explaining an example of curved surface division;
FIG. 7 is a diagram for explaining a cubic spline function.
FIG. 8 is a part of a flowchart for explaining the operation procedure of the main part of one embodiment of the image generation method according to the present invention;
FIG. 9 is a part of a flowchart for explaining an operation procedure of a main part of an embodiment of the image generation method according to the present invention.
FIG. 10 is a diagram showing a configuration example of a main part of a microprocessor including an example of a function generator according to the present invention.
11 is a diagram used for explaining initial value data and a function generation operation given to the function generator 142 of FIG. 5; FIG.
FIG. 12 is a diagram for explaining another embodiment of the function generator of the present invention.
FIG. 13 is a diagram for explaining another embodiment of the function generator of the present invention.
FIG. 14 is a diagram for explaining another embodiment of the function generator of the present invention.
[Explanation of symbols]
141 ... Polygon dividing means, 142 ... Spline function generator, 143 ... Coordinate converting means, 15 ... Drawing processing section, 151 ... Drawing means, 152 ... Frame memory, A1 to A3 ... Adder, RG, RGk, RG (k + 1) ... Registers, RA0-RA3, RB0-RB3 ... Divided register part, SW ... Switch circuit
Claims (6)
m個(mは自然数)の加算器と、少なくとも一つのレジスタとを備えると共に、
一つのレジスタのうちの全部もしくは一部が、それぞれ所定ビット数のデータを格納する0番からm番までの(m+1)個のレジスタ部分に分割され、
前記m個の加算器のうちのi(i≦mである自然数)番目の加算器における2個の入力端の一方がi番目の前記レジスタ部分に、他方が(i−1)番目の前記レジスタ部分に、それぞれ接続され、当該i番目の加算器の出力端が、前記i番目のレジスタ部分に接続され、
前記i番名の加算器は、前記2個の入力端を介して、前記i番目のレジスタ部分に格納されているデータおよび前記(i−1)番目のレジスタ部分に格納されているデータの入力を受付け、該受付けたデータを用いて加算演算を行い、該加算結果を前記出力端を介して前記i番目のレジスタに格納する演算処理を行い、
一つの命令により、前記m個の加算器は、各々、前記演算処理を同じタイミングで実行し、
前記m個の加算器は、前記演算処理を所定の回数繰り返し実行すること
を特徴とする関数発生器。A function generator provided in the instruction execution type arithmetic processing unit,
m (m is a natural number) adders and at least one register;
All or part of one register is divided into (m + 1) register portions from 0th to mth, each storing data of a predetermined number of bits,
Of the m adders, one of the two input terminals in the i (natural number that is i ≦ m) -th adder is the i-th register portion, and the other is the (i−1) -th register. Each of the i-th adder is connected to the i-th register portion.
The i-th adder inputs the data stored in the i-th register part and the data stored in the (i-1) -th register part via the two input terminals. And performing an addition operation using the received data, and performing an operation process of storing the addition result in the i-th register through the output terminal,
According to one instruction, each of the m adders executes the arithmetic processing at the same timing,
The function generator is characterized in that the m adders repeatedly execute the arithmetic processing a predetermined number of times .
0番からm番までの(m+1)個(mは自然数)の加算器と、少なくとも一つのレジスタとを備えると共に、
一つのレジスタのうちの全部もしくは一部が、それぞれ所定ビット数のデータを格納する0番からm番までの(m+1)個のレジスタ部分に分割され、
前記m+1個の加算器のうちの0番目の加算器の2個の入力端に0番目のレジスタ部分に格納されたデータと所定の定数を示すデータとが入力され、該0番目の加算器の出力端が、前記0番目のレジスタ部分に接続され、
前記m+1個の加算器のうちのi(1≦i≦mを満足する自然数)番目の加算器における2個の入力端の一方がi番目の前記レジスタ部分に、他方が(i−1)番目の前記レジスタ部分に、それぞれ接続され、当該i番目の加算器の出力端が、前記i番目のレジスタ部分に接続され、
前記m+1個の加算器のうちの0番目の加算器は、前記2個の入力端を介して、前記0番目のレジスタ部分に格納されたデータおよび前記所定の定数を示すデータの入力を受付け、該受付けたデータを用いて加算演算を行い、該加算結果を前記出力端を介して前記0番目のレジスタ部分に格納する演算処理を行い、
前記m+1個の加算器のうちのi番目の加算器は、前記2個の入力端を介して、前記i番目のレジスタ部分に格納されているデータおよび前記(i−1)番目のレジスタ部分に格納されているデータの入力を受付け、該受付けたデータを用いて加算演算を行い、該加算結果を前記出力端を介して前記i番目のレジスタに格納する演算処理を行い、
一つの命令により、前記m+1個の加算器は、各々、前記演算処理を同じタイミングで実行し、
前記m+1個の加算器は、前記演算処理を所定の回数繰り返し実行すること
を特徴とする関数発生器。A function generator provided in the instruction execution type arithmetic processing unit,
(M + 1) (m is a natural number) adders from 0 to m and at least one register,
All or part of one register is divided into (m + 1) register portions from 0th to mth, each storing data of a predetermined number of bits,
Data stored in the 0th register portion and data indicating a predetermined constant are input to two input terminals of the 0th adder of the m + 1 adders, and the 0th adder The output terminal is connected to the 0th register part,
Of the m + 1 adders, one of the two input ends of the i (natural number satisfying 1 ≦ i ≦ m) -th adder is the i-th register portion, and the other is the (i−1) -th adder. Each of the i-th adder is connected to an output terminal of the i-th adder,
The 0th adder of the m + 1 adders receives data stored in the 0th register portion and data indicating the predetermined constant via the two input terminals, An addition operation is performed using the received data, and an operation process for storing the addition result in the 0th register portion via the output end is performed.
The i-th adder of the m + 1 adders is connected to the data stored in the i-th register part and the (i−1) -th register part via the two input terminals. Receiving input of stored data, performing an addition operation using the received data, performing an operation process of storing the addition result in the i-th register through the output end,
According to one instruction, each of the m + 1 adders executes the arithmetic processing at the same timing,
The function generator, wherein the (m + 1) adders repeatedly execute the arithmetic processing a predetermined number of times .
0番からm番までの(m+1)個(mは自然数)の加算器と、少なくとも一つのレジスタとを備えると共に、
一つのレジスタのうちの全部もしくは一部が、それぞれ所定ビット数のデータを格納する0番からm番までの(m+1)個のレジスタ部分に分割され、
前記m+1個の加算器のうちの0番目の加算器の2個の入力端の一方に0番目のレジスタ部分に格納されたデータが入力され、他方に前記レジスタ以外の他のレジスタに格納されたデータが入力され、該0番目の加算器の出力端が、前記0番目のレジスタ部分に接続され、
前記m+1個の加算器のうちのi(1≦i≦mを満足する自然数)番目の加算器における2個の入力端の一方がi番目の前記レジスタ部分に、他方が(i−1)番目の前記レジスタ部分に、それぞれ接続され、当該i番目の加算器の出力端が前記i番目のレジスタ部分に接続され、
前記m+1個の加算器のうちの前記0番目の加算器は、前記2個の入力端を介して、前記0番目のレジスタ部分に格納されたデータ、および、前記他のレジスタに格納されたデータの入力を受付け、該受付けたデータを用いて加算演算を行い、該加算結果を前記出力端を介して前記0番目のレジスタ部分に格納する演算処理を行い、
前記m+1個の加算器のうちの前記i番目の加算器は、前記2つの入力端を介して、前記i番目のレジスタ部分に格納されているデータ、および、前記(i−1)番目のレジスタ部分に格納されているデータの入力を受付け、該取得したデータを用いて加算演算を行い、該加算結果を前記出力端を介して前記i番目のレジスタに格納する演算処理を行い、
一つの命令により、前記m+1個の加算器は、各々、前記演算処理を同じタイミングで実行し、
前記m+1個の加算器は、前記演算処理を所定の回数繰り返し実行すること
を特徴とする関数発生器。In the function generator provided in the instruction execution type arithmetic processing unit,
(M + 1) (m is a natural number) adders from 0 to m and at least one register,
All or part of one register is divided into (m + 1) register portions from 0th to mth, each storing data of a predetermined number of bits,
The data stored in the 0th register portion is input to one of the two input terminals of the 0th adder of the m + 1 adders, and the other is stored in a register other than the register . Data is input, and the output terminal of the 0th adder is connected to the 0th register part,
Of the m + 1 adders, one of the two input ends of the i (natural number satisfying 1 ≦ i ≦ m) -th adder is the i-th register portion, and the other is the (i−1) -th adder. in the register portion of the respectively connected, the output end of the i-th adder is connected before SL i-th register portion,
Of the m + 1 adders, the 0th adder receives data stored in the 0th register portion and data stored in the other registers via the two input terminals. And performing an addition operation using the received data, and performing an operation process of storing the addition result in the 0th register portion via the output terminal,
The i-th adder of the (m + 1) adders includes the data stored in the i-th register portion and the (i−1) -th register via the two input terminals. Receiving the input of data stored in the part, performing an addition operation using the acquired data, performing an operation process of storing the addition result in the i-th register through the output end,
According to one instruction, each of the m + 1 adders executes the arithmetic processing at the same timing,
The function generator, wherein the (m + 1) adders repeatedly execute the arithmetic processing a predetermined number of times .
0番からm番までの(m+1)個(mは自然数)の加算器と、少なくとも一つのレジスタと、スイッチ回路とを備えると共に、
一つのレジスタのうちの全部もしくは一部が、それぞれ所定ビット数のデータを格納する0番からm番までの(m+1)個のレジスタ部分に分割され、
前記m+1個の加算器のうちの0番目の加算器の2個の入力端の一方に、0番目のレジスタ部分に格納されたデータが入力され、他方に前記スイッチ回路により選択された前記レジスタ以外の他のレジスタに格納されたデータおよび所定の定数を示すデータの一方が選択的に入力され、該0番目の加算器の出力端が前記0番目のレジスタ部分に接続され、
前記m+1個の加算器のうちの前記i(1≦i≦mを満足する自然数)番目の加算器における2個の入力端の一方がi番目の前記レジスタ部分に、他方が(i−1)番目の前記レジスタ部分にそれぞれ接続され、当該i番目の加算器の出力端が前記i番目のレジスタ部分に接続され、
前記m+1個の加算器のうちの前記0番目の加算器は、前記2つの入力端を介して、前記0番目のレジスタ部分に格納されたデータ、および、前記スイッチ回路により選択された前記他のレジスタに格納されたデータおよび前記定数を示すデータのいずれかの入力を受付け、該受付けたデータを用いて加算演算を行い、該加算結果を前記出力端を介して前記0番目のレジスタ部分に格納する演算処理を行い、
前記m+1個の加算器のうちのi番目の加算器は、前記2つの入力端を介して、前記i番目のレジスタ部分に格納されているデータおよび前記(i−1)番目のレジスタ部分に格納されているデータの入力を受付け、該受付けたデータを用いて加算演算を行い、該加算結果を前記出力端を介して前記i番目のレジスタに格納する演算処理を行い、
一つの命令により、前記m+1個の加算器は、各々、前記演算処理を同じタイミングで実行し、
前記m+1個の加算器は、前記演算処理を所定の回数繰り返し実行すること
を特徴とする関数発生器。In the function generator provided in the instruction execution type arithmetic processing unit,
And (m + 1) (m is a natural number) adders from 0 to m, at least one register, and a switch circuit,
All or part of one register is divided into (m + 1) register portions from 0th to mth, each storing data of a predetermined number of bits,
Data stored in the 0th register portion is input to one of the two input terminals of the 0th adder of the m + 1 adders, and the other than the register selected by the switch circuit. while data indicating the stored data and a predetermined constant other registers is selectively input, the output end of the 0-th adder the connected before Symbol 0 th register portion of,
The i (1 ≦ i ≦ m a natural number satisfying the) th one is i-th register portions of the two inputs of the adder of the m + 1 adders, the other (i-1) th to the register portion are connected, the output end of the i-th adder is connected before SL i-th register portion,
The 0th adder of the (m + 1) adders receives the data stored in the 0th register part via the two input terminals, and the other selected by the switch circuit. Accepts either the data stored in the register or the data indicating the constant, performs an addition operation using the received data, and stores the addition result in the 0th register portion via the output terminal To perform the arithmetic processing
The i-th adder of the (m + 1) adders stores the data stored in the i-th register part and the (i−1) -th register part via the two input terminals. Receiving the input of the received data, performing an addition operation using the received data, performing an operation process of storing the addition result in the i-th register through the output terminal,
According to one instruction, each of the m + 1 adders executes the arithmetic processing at the same timing,
The function generator, wherein the (m + 1) adders repeatedly execute the arithmetic processing a predetermined number of times .
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP13070896A JP3657350B2 (en) | 1996-04-26 | 1996-04-26 | Function generator |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP13070896A JP3657350B2 (en) | 1996-04-26 | 1996-04-26 | Function generator |
Publications (2)
Publication Number | Publication Date |
---|---|
JPH09292927A JPH09292927A (en) | 1997-11-11 |
JP3657350B2 true JP3657350B2 (en) | 2005-06-08 |
Family
ID=15040726
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP13070896A Expired - Lifetime JP3657350B2 (en) | 1996-04-26 | 1996-04-26 | Function generator |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP3657350B2 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2017207747A (en) | 2016-05-17 | 2017-11-24 | 株式会社半導体エネルギー研究所 | Display system and vehicle |
JP7467883B2 (en) * | 2019-04-29 | 2024-04-16 | セイコーエプソン株式会社 | Circuit device, electronic device and mobile device |
-
1996
- 1996-04-26 JP JP13070896A patent/JP3657350B2/en not_active Expired - Lifetime
Also Published As
Publication number | Publication date |
---|---|
JPH09292927A (en) | 1997-11-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6807620B1 (en) | Game system with graphics processor | |
JP3886184B2 (en) | Image data processing method and image processing apparatus | |
KR100725331B1 (en) | Image generating device | |
JP3645024B2 (en) | Drawing apparatus and drawing method | |
JP2002008060A (en) | Data processing method, recording medium and data processing device | |
US10600142B2 (en) | Compression and decompression of indices in a graphics pipeline | |
JP2000507009A (en) | Method and apparatus for performing an operation multiple times in response to a single instruction | |
US20020101435A1 (en) | Apparatus and method for rendering antialiased image | |
US8482559B2 (en) | Method and apparatus for triangle tessellation | |
US8254701B1 (en) | Data compression using a geometry shading unit | |
US8243086B1 (en) | Variable length data compression using a geometry shading unit | |
US8295621B1 (en) | Data decompression using a geometry shading unit | |
JP3338043B2 (en) | Parallel arithmetic device, entertainment device, arithmetic processing method, computer program, semiconductor device | |
US11978234B2 (en) | Method and apparatus of data compression | |
JP3657350B2 (en) | Function generator | |
CN114882149A (en) | Animation rendering method and device, electronic equipment and storage medium | |
JP2023530306A (en) | Delta triplet index compression | |
CN116664735B (en) | Large-scale animation rendering method, device, equipment and medium for virtual object | |
JPH0353668B2 (en) | ||
EP1288863B1 (en) | Method and device for drawing | |
JP2004280157A (en) | Image processor | |
JP3638568B2 (en) | Image processing program, recording medium storing image processing program, image processing apparatus and method | |
JP3479184B2 (en) | Image generation method and image generation device | |
CA2298337C (en) | Game system with graphics processor | |
JP3548648B2 (en) | Drawing apparatus and drawing method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20041005 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20041206 |
|
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: 20050301 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20050309 |
|
R150 | Certificate of patent 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: 20080318 Year of fee payment: 3 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20090318 Year of fee payment: 4 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20090318 Year of fee payment: 4 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100318 Year of fee payment: 5 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100318 Year of fee payment: 5 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110318 Year of fee payment: 6 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110318 Year of fee payment: 6 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120318 Year of fee payment: 7 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120318 Year of fee payment: 7 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130318 Year of fee payment: 8 |