JPH0567217A - Arithmetic unit - Google Patents

Arithmetic unit

Info

Publication number
JPH0567217A
JPH0567217A JP3226721A JP22672191A JPH0567217A JP H0567217 A JPH0567217 A JP H0567217A JP 3226721 A JP3226721 A JP 3226721A JP 22672191 A JP22672191 A JP 22672191A JP H0567217 A JPH0567217 A JP H0567217A
Authority
JP
Japan
Prior art keywords
register
value
arithmetic unit
divisor
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.)
Pending
Application number
JP3226721A
Other languages
Japanese (ja)
Inventor
Nobuko Matsuda
信子 松田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP3226721A priority Critical patent/JPH0567217A/en
Publication of JPH0567217A publication Critical patent/JPH0567217A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Generation (AREA)

Abstract

PURPOSE:To shorten the execution time of a processing for obtaining the remainder of division. CONSTITUTION:A multiplicand is stored in a register 103 and a divisor is stored in a register 104. A difference between values outputted from 7 most significant bit position detectors 107 and 108 connected to the registers 103 and 104 is obtained by using a computing element 111. The value of the register 104 is barrel-shifted in the direction of a high-order by using a barrel shifter 112 with the result as shifting quantity. Thus, the number of the bits of the registers 103 and 104 can be arranged in a single processing. Then, a processing for shifting the value of the register 104 to the direction of a low-order by one bit and a processing for subtracting the value of the register 104 from the register 103 are repeated until the value of the register 104 returns to the original value. Thus, the value remaining in the register 103 becomes a remainder.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、演算装置に関し、特に
画像処理において除算の剰余を高速に求める装置に関す
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an arithmetic device, and more particularly to a device for obtaining a remainder of division at high speed in image processing.

【0002】[0002]

【従来の技術】コンピュータ・グラフィックスにおいて
は、直線、円弧などの線図形の描画だけでなく、長方
形、円、多角形など、広さを持つ領域を塗りつぶす処理
が行われる。
2. Description of the Related Art In computer graphics, not only is a line drawing such as a straight line or an arc drawn, but an area having a wide area such as a rectangle, a circle or a polygon is filled.

【0003】その際、画面のクリアなどで、特定の1色
で塗りつぶす場合もあるが、図8(b)に示すような幅
と高さを持つイメージ・データを塗りつぶしパターンと
して用い、パターンを領域内に並べるようにして塗りつ
ぶす場合もある。さまざまなパターンを定義して、それ
らを用いることによって、画面上における図形表現を多
彩にすることができる。
At this time, there is a case where the image is painted with a specific one color to clear the screen, but image data having a width and a height as shown in FIG. In some cases, it is filled in so that it is lined up inside. By defining various patterns and using them, the graphic expression on the screen can be diversified.

【0004】通常、塗りつぶしパターンは、図8(a)
に示すように画面の原点を基準として繰り返される。こ
れにより、重なり合う複数の図形を同じパターンで塗り
つぶした場合にパターンの連続性が保たれる。
Usually, the filling pattern is as shown in FIG.
It is repeated based on the origin of the screen as shown in. As a result, the pattern continuity is maintained when a plurality of overlapping figures are painted with the same pattern.

【0005】パターンを原点相対で塗りつぶし領域に描
画するためには、画面上の描画開始点について、パター
ンのどの部分を参照すべきかを求める必要がある。これ
を図8(a)、(b)を用いて説明する。図8(a)、
(b)において、パターンの横幅をW、高さをHとす
る。Y幅の増加方向が上向きの場合、図8(a)の点
(X,Y)に対応するパターン参照点は、図8(b)に
示すように、パターンの左端から(X % W)
(“%”は除算の余りを求める演算子)、パターンの下
端から(Y % H)の位置にある。
In order to draw the pattern in the filled area relative to the origin, it is necessary to find which part of the pattern should be referred to with respect to the drawing start point on the screen. This will be described with reference to FIGS. FIG. 8 (a),
In (b), the width of the pattern is W and the height is H. When the increasing direction of the Y width is upward, the pattern reference point corresponding to the point (X, Y) in FIG. 8A is from the left end of the pattern (X% W) as shown in FIG. 8B.
("%" Is an operator for calculating the remainder of division), and is located at (Y% H) from the lower end of the pattern.

【0006】パターンは実際には図8(c)に示すよう
なビットの並びであり、通常メモリ上の作業領域に連続
して格納されている。上記の(X % W)、(Y %
H)の値を用いて、塗りつぶしに用いるべきデータが
格納されているアドレスを求め、該当データを読み出し
て、画面上の(X,Y)の位置に描画する。
The pattern is actually an array of bits as shown in FIG. 8C, and is normally stored continuously in the work area on the memory. (X% W), (Y%
Using the value of H), the address where the data to be used for filling is stored is obtained, the corresponding data is read, and drawing is performed at the (X, Y) position on the screen.

【0007】以上に述べたように、矩形パターンによる
塗りつぶし処理には、座標値をパターンのサイズで割っ
たときの余りを求める処理が含まれる。このとき商を求
める必要はない。
As described above, the filling process using the rectangular pattern includes a process of obtaining the remainder when the coordinate value is divided by the size of the pattern. At this time, it is not necessary to ask for a quotient.

【0008】従来は、除数を1ビットづつ左シフトしな
がら、被除数と比較する処理を繰り返した後、除数を1
ビット右シフトしながら被除数から減算していく方法を
用いて、除算の余りを求めていた。この方法を図5,
6,7を用いて説明する。図5に示すように、従来例の
演算装置は、データバス101と、マルチプレクサ10
2と、レジスタ103〜105と、定数“1”を格納し
たレジスタ106と、定数“−1”を格納したレジスタ
107と、マルチプレクサ109、110と、演算器1
11およびバレルシフタ112とを備えている。
Conventionally, the divisor is incremented by 1 after the process of comparing with the dividend is repeated while shifting the divisor by 1 bit to the left.
The remainder of the division was calculated using the method of subtracting from the dividend while shifting to the right by a bit. This method is shown in FIG.
This will be described using 6 and 7. As shown in FIG. 5, the conventional arithmetic unit includes a data bus 101 and a multiplexer 10.
2, registers 103 to 105, a register 106 storing a constant “1”, a register 107 storing a constant “−1”, multiplexers 109 and 110, and an arithmetic unit 1
11 and a barrel shifter 112.

【0009】演算器111は、サインフラグ212およ
びゼロフラグ213を出力する。バレルシフタ112
は、シフト量として負の値が入力されると左シフトを実
行し、正のシフト量が入力されると右シフトを実行す
る。レジスタ103、104、105はそれぞれ16ビ
ット長である。結果として求められた剰余は、レジスタ
103に格納される。
The calculator 111 outputs a sine flag 212 and a zero flag 213. Barrel shifter 112
Performs a left shift when a negative value is input as a shift amount, and performs a right shift when a positive shift amount is input. The registers 103, 104 and 105 are each 16 bits long. The remainder obtained as a result is stored in the register 103.

【0010】従来の処理の流れを図6を用いて説明す
る。本図は従来例における剰余計算処理の流れを示す図
である。まず、被除数をデータバス101からレジスタ
103にロードし(S201)、除数をレジスタ104
にロードする(S202)。ここで、被除数と除数は正
の数である。いずれかの値が負であった場合には正の値
に正規化しておく。レジスタ105は、ゼロで初期化し
ておく(S203)。
The conventional processing flow will be described with reference to FIG. This figure is a diagram showing the flow of the remainder calculation processing in the conventional example. First, the dividend is loaded from the data bus 101 into the register 103 (S201), and the divisor is registered in the register 104.
(S202). Here, the dividend and the divisor are positive numbers. If either value is negative, normalize it to a positive value. The register 105 is initialized to zero (S203).

【0011】次に、レジスタ103の値からレジスタ1
04の値を減算し(S204)、被除数と除数の大小を
比較する(S205)。レジスタ103の値の方が小さ
ければS208に分岐する。それ以外の場合、レジスタ
118の値“−1”をシフト量として、レジスタ104
の値を1ビット左シフトする(S206)。そして、レ
ジスタ105の値にレジスタ16の値“1”を加えてレ
ジスタ105に書き戻す。すなわちレジスタ105を1
だけインクリメントする(S207)。そしてS204
に戻る。以上のように、除数を1ビットずつ左シフトす
なわち2倍してゆき、被除数よりも大きくなるまでS2
04〜S207のループを繰り返す。
Next, from the value of register 103 to register 1
The value of 04 is subtracted (S204), and the dividend and the divisor are compared in size (S205). If the value in the register 103 is smaller, the process branches to S208. In other cases, the value “−1” in the register 118 is used as the shift amount and the register 104
The value of is shifted left by 1 bit (S206). Then, the value “1” of the register 16 is added to the value of the register 105 and the value is written back to the register 105. That is, register 105 is set to 1
Incremented only (S207). And S204
Return to. As described above, the divisor is left-shifted by 1 bit, that is, doubled, until the dividend becomes larger than the dividend S2.
The loop of 04 to S207 is repeated.

【0012】S205でループを抜けたとき、レジスタ
105には除数を左シフトした回数が格納されている。
この値すなわち除数のシフト量は、被除数のビット数か
ら除数のビット数を引いたものをdとすると、 (被除数) < ((除数)<<d) のときはdとなり、 (被除数) ≧ ((除数)<<d) のときはd+1となる。(<<は左シフト演算子。) そして、レジスタ105の値を、演算を施さず演算器1
11を通過させ(S208)、そのとき出力されるゼロ
フラグ213によってレジスタ105の値がゼロである
かどうかを判定する(S209)。ゼロであった場合、
すなわちもとの除数が被除数よりも大きかった場合に
は、被除数がそのまま剰余となるため、処理を終了す
る。レジスタ105の値が1以上であった場合には、ま
ずレジスタ106の値“1”をシフト量として、レジス
タ104の値を右に1ビットシフトする(S210)。
そして、レジスタ103の値からレジスタ104の値を
減算した結果をレジスタ103に書き戻す(S21
1)。このとき、演算器111から出力されるサインフ
ラグ212によりレジスタ103の値が負になったかど
うかを判定し(S212)、負であった場合にはレジス
タ103の値にレジスタ104の値を足して減算前の正
の値に戻す(S213)。そして、レジスタ105の値
からレジスタ106の値を減算する。すなわち、レジス
タ105の値を1デクリメントする(S214)。
When the loop is exited in S205, the number of times the divisor is left-shifted is stored in the register 105.
This value, that is, the shift amount of the divisor, is d when the number of bits of the dividend is subtracted from the number of bits of the divisor, and when (dividend) <((divisor) << d), d, and (dividend) ≥ ( When (divisor) << d, it becomes d + 1. (<< is a left shift operator.) Then, the value of the register 105 is not calculated, and the calculator 1
11 is passed (S208), and it is determined by the zero flag 213 output at that time whether the value of the register 105 is zero (S209). If it was zero,
That is, when the original divisor is larger than the dividend, the dividend directly remains as the remainder, and the process ends. If the value of the register 105 is 1 or more, first, the value of the register 104 is shifted to the right by 1 bit with the value "1" of the register 106 as the shift amount (S210).
Then, the result of subtracting the value of the register 104 from the value of the register 103 is written back to the register 103 (S21
1). At this time, it is determined by the sign flag 212 output from the arithmetic unit 111 whether or not the value of the register 103 becomes negative (S212). If the value is negative, the value of the register 103 is added to the value of the register 104. It returns to the positive value before the subtraction (S213). Then, the value of the register 106 is subtracted from the value of the register 105. That is, the value of the register 105 is decremented by 1 (S214).

【0013】そしてS209に戻り、レジスタ105の
値がゼロでなかった場合はS210以下の処理を繰り返
し、レジスタ105の値がゼロであれば処理を終了す
る。このときレジスタ103に残っている値が剰余であ
る。
Then, returning to S209, if the value of the register 105 is not zero, the processing from S210 onward is repeated, and if the value of the register 105 is zero, the processing is ended. At this time, the value remaining in the register 103 is the remainder.

【0014】被除数“455”をレジスタ103に格納
し、除数“10”をレジスタ104に格納して、上記の
方法で剰余計算を行ったときのレジスタ103(REG
A)、104(REGB)、105(REGC)の変化
を図7に示す。この例では、S204〜S207の第1
のループと、S209〜S214の第2のループをそれ
ぞれ6回づつ繰り返す。第1のループでは、REGBの
値がREGAよりも大きくなるまでREGBを1ビット
ずつ左シフトすなわち2倍する。第2のループでは、R
EGBの値を右に1ビットずつシフトしながらREGA
からREGBを減算する。減算結果が負になった場合に
はREGBの値を足し戻して、REGAの値を減算前の
値に回復する。この処理を繰り返し、最終的にREGA
に残った値すなわち剰余は“5”となる。
When the dividend “455” is stored in the register 103 and the divisor “10” is stored in the register 104, the remainder 103 is calculated by the above method.
A), 104 (REGB), and 105 (REGC) changes are shown in FIG. In this example, the first of S204 to S207
And the second loop of S209 to S214 are each repeated 6 times. In the first loop, REGB is shifted left by 1 bit, that is, doubled, until the value of REGB becomes larger than REGA. In the second loop, R
REGA while shifting the EGB value right by 1 bit
Subtract REGB from. When the subtraction result becomes negative, the value of REGB is added back to restore the value of REGA to the value before the subtraction. This process is repeated and finally REGA
The value left over, that is, the remainder is "5".

【0015】第1のループの処理を終えた時点のレジス
タ105(REGC)の値をnとすると、被除数から
(除数×2n )、(除数×2n-1 )、…(除数×20
を次々に引いていくことによって、除数が求められてい
る。ただし、途中で結果が負にならないようにする。
Assuming that the value of the register 105 (REGC) at the time of finishing the processing of the first loop is n, from the dividend, (divisor × 2 n ), (divisor × 2 n-1 ), ... (divisor × 2 0). )
The divisor is obtained by successively subtracting. However, make sure that the result does not become negative on the way.

【0016】[0016]

【発明が解決しようとする課題】上記の方法では、次の
欠点が考えられる。
The above-mentioned method may have the following drawbacks.

【0017】剰余を求める除算処理において、処理時間
は、被除数のビット数と除数のビット数の差に依存す
る。被除数と除数が近い値であれば、除数のシフト量も
少なく、ループ処理の回数が少なくてすむ。しかし、被
除数の方が除数よりも非常に大きい場合、ビット数の差
が大きくなり、処理時間は増える。
In the division process for obtaining the remainder, the processing time depends on the difference between the number of bits of the dividend and the number of bits of the divisor. When the dividend and the divisor are close to each other, the shift amount of the divisor is small and the number of loop processes can be small. However, when the dividend is much larger than the divisor, the difference in the number of bits becomes large and the processing time increases.

【0018】従来の方法では、シフト量を求める第1の
ループと、減算により剰余を求める第2のループのそれ
ぞれについて、被除数と除数のビット数の差またはビッ
ト数の差+1だけ繰り返さなければならなかった。
In the conventional method, each of the first loop for obtaining the shift amount and the second loop for obtaining the remainder by subtraction must be repeated by the difference between the number of bits of the dividend and the divisor or the difference between the number of bits + 1. There wasn't.

【0019】任意形状の領域を塗りつぶすために、1水
平ラインごとに塗りつぶす範囲を指定した座標値リスト
を用いて次々に塗りつぶしを行う場合、1水平ラインを
塗りつぶすごとに、パターン参照開始点を求めるための
剰余計算が必要となる。ある領域を塗りつぶすために、
そのライン数だけX方向・Y方向それぞれの剰余計算を
行わなければならない。ここで従来の剰余計算方法を用
いると、剰余計算がネックになって全体の塗りつぶしに
非常に時間がかかってしまう。
In order to fill a region of an arbitrary shape, when filling is performed one after another using a coordinate value list in which the range to be filled is specified for each horizontal line, the pattern reference start point is obtained each time one horizontal line is filled. The remainder calculation of is required. To fill an area,
Remainder calculation must be performed in each of the X and Y directions by the number of lines. If the conventional remainder calculation method is used here, the remainder calculation becomes a bottleneck and it takes a very long time to fill the entire area.

【0020】[0020]

【課題を解決するための手段】上記の欠点を解決するた
めに、本発明では、除算の被除数を格納する第1のレジ
スタと、除数を格納する第2のレジスタと、演算器およ
びバレルシフタを備えた演算装置において、第1のレジ
スタおよび第2のレジスタのそれぞれに対応する最上位
有意ビット位置検出器を有し、前記第1のレジスタに接
続された最上位有意ビット位置検出器が出力する値と、
前記第2のレジスタに接続された最上位有意ビット位置
検出器が出力する値の差を前記演算器によって算出し、
その結果をシフト量として、前記バレルシフタを用いて
前記第2のレジスタの値を上位方向にシフトした後に、
第1のレジスタから第2のレジスタの値を減算する処理
および第2のレジスタの値を下位方向に1ビットづつシ
フトする処理を繰り返すことによって、除算の剰余を求
める手段を有して構成されている。
In order to solve the above-mentioned drawbacks, the present invention comprises a first register for storing a dividend for division, a second register for storing a divisor, an arithmetic unit and a barrel shifter. And a value output by the most significant bit position detector connected to the first register, the most significant bit position detector corresponding to each of the first register and the second register. When,
The difference between the values output by the most significant bit position detector connected to the second register is calculated by the arithmetic unit,
Using the result as a shift amount, after shifting the value of the second register in the upper direction using the barrel shifter,
A means for obtaining the remainder of division is configured by repeating the process of subtracting the value of the second register from the first register and the process of shifting the value of the second register by 1 bit in the lower direction. There is.

【0021】[0021]

【実施例】以下、本発明の実施例について図面を用いて
説明する。
Embodiments of the present invention will be described below with reference to the drawings.

【0022】図1は、本発明の第1の実施例における演
算装置の構成を示すブロック図である。本実施例は、外
部とデータのやりとりをするデータバス101と、外部
から送られてくるデータ201と演算器111またはバ
レルシフタ112からの出力211をマルチプレクスす
るマルチプレクサ102と、レジスタ103(REG
A)、104(REGB)、105(REGC)と、定
数“1”を格納するレジスタ106と、最上位有意ビッ
ト位置検出器(PE)107、108と、演算器111
またはバレルシフタ112へ入力する第1のオペラン
ド、第2のオペランドを選択するマルチプレクサ10
9、110と、演算器111と、バレルシフタ112
と、データバス101からのデータ出力201と、マル
チプレクサ102からのデータ出力202と、レジスタ
103〜106からのデータ出力203〜206と、最
上位有意ビット位置検出器107、108からのデータ
出力207、208と、マルチプレクサ109、110
からのデータ出力209、210と、演算器111また
はバレルシフタ112からの演算結果出力211と、演
算器111から出力されるサインフラグ212、ゼロフ
ラグ213とを備える。さらに、命令実行部(図示せ
ず)から送られる制御信号として、レジスタ103〜1
05への入力を選択するためにマルチプレクサ102に
送られる選択信号301と、レジスタ103〜105へ
の書き込みタイミングを制御する制御信号302〜30
4と、演算器111またはバレルシフタ112へ第1の
オペランドとして入力するデータを選択する選択信号3
05と、演算器111またはバレルシフタ112へ第2
のオペランドとして入力するデータを選択する選択信号
306と、を備えている。
FIG. 1 is a block diagram showing the configuration of an arithmetic unit according to the first embodiment of the present invention. In this embodiment, a data bus 101 for exchanging data with the outside, a multiplexer 102 for multiplexing the data 201 sent from the outside and an output 211 from the arithmetic unit 111 or the barrel shifter 112, and a register 103 (REG).
A), 104 (REGB), 105 (REGC), a register 106 for storing a constant “1”, a most significant bit position detector (PE) 107, 108, and a computing unit 111.
Alternatively, the multiplexer 10 for selecting the first operand or the second operand input to the barrel shifter 112.
9, 110, arithmetic unit 111, barrel shifter 112
A data output 201 from the data bus 101, a data output 202 from the multiplexer 102, data outputs 203 to 206 from the registers 103 to 106, and data outputs 207 from the most significant bit position detectors 107 and 108, 208 and multiplexers 109 and 110
Data outputs 209 and 210, a calculation result output 211 from the arithmetic unit 111 or the barrel shifter 112, a sine flag 212 and a zero flag 213 output from the arithmetic unit 111. Further, as a control signal sent from an instruction execution unit (not shown), the registers 103 to 1
Selection signal 301 sent to the multiplexer 102 to select the input to the register 05 and control signals 302 to 30 for controlling the write timing to the registers 103 to 105.
4 and a selection signal 3 for selecting data to be input to the arithmetic unit 111 or the barrel shifter 112 as the first operand.
05 to the arithmetic unit 111 or the barrel shifter 112.
A selection signal 306 for selecting data to be input as an operand of.

【0023】本実施例において、レジスタ103、10
4、105はそれぞれ16ビット長である。除算した結
果求められた剰余は、レジスタ103に格納される。
In this embodiment, the registers 103 and 10 are used.
Each of 4 and 105 has a 16-bit length. The remainder obtained as a result of the division is stored in the register 103.

【0024】最上位有意ビット位置検出器107、10
8は、それぞれレジスタ103、104の値を入力し、
最上位ビット方向から見て最初に1が立っているビット
の位置を、最上位ビットからのビット数で出力する。こ
れは、プライオリティ・エンコーダと呼ばれる回路で実
現することができる。出力の例を図3(a)に示す。レ
ジスタ103の値が“455”であれば、2進表現する
と図3(a)のREGAのようになり、最上位有意ビッ
ト位置検出器107の出力は“7”となる。同様に、レ
ジスタ104の値が“10”であれば、2進表現すると
図3(a)のREGBのようになり、最上位有意ビット
位置検出器108の出力は“12”となる。
Most significant bit position detector 107, 10
8 inputs the values of the registers 103 and 104,
The position of the bit in which 1 is set first when viewed from the most significant bit direction is output as the number of bits from the most significant bit. This can be realized with a circuit called a priority encoder. An example of the output is shown in FIG. If the value of the register 103 is "455", the binary representation becomes REGA of FIG. 3A, and the output of the most significant bit position detector 107 is "7". Similarly, if the value of the register 104 is “10”, the binary representation becomes REGB of FIG. 3A, and the output of the most significant bit position detector 108 is “12”.

【0025】演算器111は、データ209、データ2
10から入力した2値の間で演算を行う。本実施例で
は、データ209からデータ210を減算する処理およ
びデータ209とデータ210を加算する処理を行う。
演算の結果のサインビットをサインフラグ212として
出力する。結果が正の時サインフラグ212は“0”と
なり、負の時は“1”となる。また、演算の結果がゼロ
だった場合は、ゼロフラグ213を“1”とし、ゼロ以
外だった場合は“0”とする。
The arithmetic unit 111 has data 209 and data 2
Calculation is performed between the two values input from 10. In this embodiment, a process of subtracting the data 210 from the data 209 and a process of adding the data 209 and the data 210 are performed.
The sign bit resulting from the operation is output as the sign flag 212. The sign flag 212 is "0" when the result is positive and "1" when the result is negative. If the result of the calculation is zero, the zero flag 213 is set to "1", and if it is other than zero, it is set to "0".

【0026】バレルシフタ112は、1サイクルで複数
ビットのシフトが可能である。データ209からシフト
される値を入力し、データ210からシフト数を入力
し、結果をデータ211に出力する。シフト数が正の場
合は右方向(下位側)にシフトし、上位ビット側に
“0”を入力する。シフト数が負の場合は左方向(上位
側)にシフトし、下位ビット側に“0”を入力する。
The barrel shifter 112 can shift a plurality of bits in one cycle. The value shifted from the data 209 is input, the shift number is input from the data 210, and the result is output to the data 211. When the number of shifts is positive, the shift is made to the right (lower side), and "0" is input to the upper bit side. When the number of shifts is negative, shift to the left (upper side), and "0" is input to the lower bit side.

【0027】図2に示す流れ図を参照して、本実施例の
動作について説明する。本実施例における剰余計算処理
の流れを示す図である。まず、データバス101から、
データ出力201、マルチプレクサ102を通じて被除
数をレジスタ103にロードし(S101)、除数をレ
ジスタ104にロードする(S102)。書き込みのタ
イミングはそれぞれ制御信号302、303によって制
御される。ここで、被除数と除数は正の数である。いず
れかの値が負であった場合には、前もって正の値に正規
化しておく。
The operation of this embodiment will be described with reference to the flow chart shown in FIG. It is a figure which shows the flow of the remainder calculation process in a present Example. First, from the data bus 101,
The dividend is loaded into the register 103 through the data output 201 and the multiplexer 102 (S101), and the divisor is loaded into the register 104 (S102). The write timing is controlled by control signals 302 and 303, respectively. Here, the dividend and the divisor are positive numbers. If either value is negative, normalize it to a positive value beforehand.

【0028】次に、レジスタ103の最上位有意ビット
位置データ207を演算器111への第1のオペランド
とし、レジスタ104の最上位有意ビット位置データ2
08を演算器111への第2のオペランドとして減算を
行い、その結果をレジスタ105に格納する(S10
3)。演算器からのサインフラグ212およびゼロフラ
グ213によって減算の結果の正負を判定する(S10
4)。サインフラグ212、ゼロフラグ213ともに
“0”で、減算結果がゼロより大きいと判断された場
合、レジスタ104の方がレジスタ103よりも上位側
に有意ビットを持っていることになる。すなわち、除数
の方が被除数よいも大きいので、被除数がそのまま剰余
となり処理を終了する。
Next, the most significant bit position data 207 of the register 103 is used as the first operand to the arithmetic unit 111, and the most significant bit position data 2 of the register 104 is used.
08 is subtracted as the second operand to the arithmetic unit 111, and the result is stored in the register 105 (S10).
3). Whether the result of the subtraction is positive or negative is determined by the sine flag 212 and the zero flag 213 from the arithmetic unit (S10).
4). When both the sign flag 212 and the zero flag 213 are “0” and it is determined that the subtraction result is larger than zero, the register 104 has a significant bit higher than the register 103. That is, since the divisor is larger than the dividend, the dividend becomes the remainder as it is, and the processing ends.

【0029】結果が負またはゼロであった場合は、レジ
スタ104の値をマルチプレクサ109を通じてバレル
シフタ112の第1のオペランドとして入力し、レジス
タ105に格納された減算結果をマルチプレクサ110
を通じて第2のオペランドとして入力して、バレルシフ
トを実行する。このとき、第2のオペランドすなわちシ
フト数が負であるため、左方向のシフトが行われる。シ
フト結果はレジスタ104に書き戻される(S10
5)。
If the result is negative or zero, the value of the register 104 is input as the first operand of the barrel shifter 112 through the multiplexer 109, and the subtraction result stored in the register 105 is input to the multiplexer 110.
As the second operand through to perform barrel shift. At this time, since the second operand, that is, the shift number is negative, the shift to the left is performed. The shift result is written back to the register 104 (S10).
5).

【0030】このあと、レジスタ105に格納されたシ
フト数は、カウンタ値として用いられる。
After that, the shift number stored in the register 105 is used as a counter value.

【0031】次に、レジスタ103の値からレジスタ1
04の値を減算し、その結果をレジスタ103に書き戻
す(S106)。その結果をサインフラグ212によっ
て判定し(S107)、負であったときはレジスタ10
3の値にレジスタ104の値を加算し、レジスタ103
の値を減算前の正の値に回復する(S108)。
Next, from the value of register 103 to register 1
The value of 04 is subtracted, and the result is written back to the register 103 (S106). The result is determined by the sign flag 212 (S107), and if negative, the register 10
The value of register 104 is added to the value of 3 and register 103
The value of is restored to the positive value before the subtraction (S108).

【0032】そして、シフト量カウンタであるレジスタ
105の値にレジスタ106の値を加える(S10
9)。レジスタ106には“1”が格納されているの
で、レジスタ105の値は1インクリメントされること
になる。ここで、加算時のサインフラグ212およびゼ
ロフラグ213によって結果を判定し(S110)、結
果がゼロより大きくなったときには、そこで処理を終了
する。負であった場合は、レジスタ106の値をシフト
量としてレジスタ104の値をシフトする(S11
1)。レジスタ106には“1”が格納されているの
で、レジスタ104の値は右に1ビットシフトされる。
その結果がレジスタ104に書き戻されたのち、S10
6の処理に戻る。
Then, the value of the register 106 is added to the value of the register 105 which is the shift amount counter (S10).
9). Since “1” is stored in the register 106, the value of the register 105 is incremented by 1. Here, the result is determined by the sine flag 212 and the zero flag 213 at the time of addition (S110), and when the result becomes larger than zero, the process ends there. If it is negative, the value of the register 104 is shifted using the value of the register 106 as the shift amount (S11).
1). Since "1" is stored in the register 106, the value of the register 104 is shifted to the right by 1 bit.
After the result is written back to the register 104, S10
Return to the process of 6.

【0033】被除数“455”をレジスタ103に格納
し、除数“10”をレジスタ104に格納して、本実施
例の演算装置で剰余計算を行ったときのレジスタ103
(REGA)、104(REGB)、105(REG
C)の変化を図3(b)に示す。
The dividend “455” is stored in the register 103, the divisor “10” is stored in the register 104, and the register 103 when the remainder calculation is performed by the arithmetic unit of this embodiment.
(REGA), 104 (REGB), 105 (REG
The change in C) is shown in FIG.

【0034】被除数の最上位有意ビット位置は“7”、
除数の最上有意ビット位置は“12”である。そこでS
103で求められるシフト量は、 7−12=(−5) となり、S105でレジスタ104の値を5ビット左に
バレルシフトする。そして、以降のループ処理では、R
EGBの値を右に1ビットずつシフトしながらREGA
からREGBを減算する。減算結果が負になった場合に
はREGBの値を足し戻して、REGAの値を減算前の
値に回復する。この処理を6回繰り返し、最終的にRE
GAに残った値すなわち剰余は“5”となる。
The most significant bit position of the dividend is "7",
The most significant bit position of the divisor is "12". So S
The shift amount obtained in 103 is 7-12 = (-5), and the value in the register 104 is barrel-shifted to the left by 5 bits in S105. Then, in the subsequent loop processing, R
REGA while shifting the EGB value right by 1 bit
Subtract REGB from. When the subtraction result becomes negative, the value of REGB is added back to restore the value of REGA to the value before the subtraction. This process is repeated 6 times, and finally RE
The value remaining in the GA, that is, the remainder is "5".

【0035】次に、本発明の第2の実施例について図面
を用いて説明する。
Next, a second embodiment of the present invention will be described with reference to the drawings.

【0036】第2の実施例においては、演算器、バレル
シフタ、カウンタ・レジスタをそれぞれ独立に動作させ
ているため、剰余を求める減算の繰り返し処理を1回1
サイクルで実行できるという点が第1の実施例と異なっ
ている。
In the second embodiment, since the arithmetic unit, the barrel shifter, and the counter register are operated independently, the iterative process of subtraction for finding the remainder is performed once.
It differs from the first embodiment in that it can be executed in cycles.

【0037】図4は、本発明の第2の実施例における演
算装置の構成を示すブロック図である。本実施例は、デ
ータバス101と、マルチプレクサ102と、レジスタ
103(REGA)、104(REGB)と、定数
“1”を格納するレジスタ106と、最上位有意ビット
位置検出器(PE)107、108と、マルチプレクサ
109、110と、演算器111と、マルチプレクサ1
02からの出力202とレジスタ103からの出力20
3のいずれかを選択して、レジスタ103へ入力するマ
ルチプレクサ113と、マルチプレクサ102からの出
力202とバレルシフタ116からの出力214のいず
れかを選択して、レジスタ104へ入力するマルチプレ
クサ114と、1ずつ値をインクリメントする機能を有
するカウンタ・レジスタ115と、レジスタ104の値
のシフトを専用に行うバレルシフタ116と、カウンタ
・レジスタ115からの出力216とレジスタ106か
らの出力206のいずれかを選択して、バレルシフタ1
16へ入力するマルチプレクサ117と、データバス1
01からのデータ出力201と、マルチプレクサ102
からのデータ出力202と、レジスタ103、104、
105、106からのデータ出力203、204、20
5、206と、最上位有意ビット検出器107、108
からのデータ出力207、208と、マルチプレクサ1
09、110からのデータ出力209、210と、演算
器111からの演算結果出力211と、演算器111か
ら出力されるサインフラグ212、ゼロフラグ213
と、マルチプレクサ113、114からのデータ出力2
14、215と、カウンタ・レジスタ115からのデー
タ出力216と、カウンタ・レジスタ115の値がゼロ
であるか否かを示すゼロフラグ217と、バレルシフタ
116からのデータ出力218と、マルチプレクサ11
7からのデータ出力219とを備えている。からに、命
令実行部(図示せず)から送られる制御信号として、マ
ルチプレクサ102に送られる選択信号301と、レジ
スタ103、104への書き込むタイミングを制御する
制御信号302、303と、演算器111へ第1のオペ
ランドとして入力するデータを選択する選択信号305
と、演算器111へ第2のオペランドとして入力するデ
ータを選択する選択信号306と、マルチプレクサ11
4に送られる選択信号307と、カウンタ・レジスタ1
15への書き込みおよびインクリメントのタイミングを
制御する制御信号308と、マルチプレクサ117に送
られる選択信号309とを備えている。
FIG. 4 is a block diagram showing the configuration of the arithmetic unit according to the second embodiment of the present invention. In this embodiment, a data bus 101, a multiplexer 102, registers 103 (REGA) and 104 (REGB), a register 106 for storing a constant “1”, and a most significant bit position detector (PE) 107 and 108. , Multiplexers 109 and 110, arithmetic unit 111, and multiplexer 1
Output 202 from 02 and output 20 from register 103
3 is selected and input to the register 103, the multiplexer 113 is selected, and any one of the output 202 from the multiplexer 102 and the output 214 from the barrel shifter 116 is selected and input to the register 104. A counter register 115 having a function of incrementing a value, a barrel shifter 116 dedicated to shifting the value of the register 104, or an output 216 from the counter register 115 or an output 206 from the register 106 is selected, Barrel shifter 1
16 input to multiplexer 16 and data bus 1
01 data output 201 and multiplexer 102
Data output 202 from the registers 103, 104,
Data output from 105, 106 203, 204, 20
5, 206 and the most significant bit detectors 107, 108
Data outputs 207, 208 from the multiplexer 1
09 and 110, data outputs 209 and 210, a calculation result output 211 from the arithmetic unit 111, a sine flag 212 and a zero flag 213 output from the arithmetic unit 111.
And the data output 2 from the multiplexers 113 and 114
14, 215, a data output 216 from the counter register 115, a zero flag 217 indicating whether the value of the counter register 115 is zero, a data output 218 from the barrel shifter 116, and a multiplexer 11
7 and data output 219. From the instruction execution unit (not shown) as a control signal sent to the multiplexer 102, control signals 302 and 303 for controlling the writing timing to the registers 103 and 104, and to the arithmetic unit 111. Selection signal 305 for selecting data to be input as the first operand
A selection signal 306 for selecting data to be input as a second operand to the arithmetic unit 111, and the multiplexer 11
4 and the selection signal 307 sent to the counter register 1
A control signal 308 for controlling the timing of writing and incrementing to 15 and a selection signal 309 sent to the multiplexer 117 are provided.

【0038】演算器111から出力されるサインフラグ
212が、選択信号としてマルチプレクサ113に入力
されている。マルチプレクサ113は、サインフラグ2
12が“0”のとき、データ出力202を選択してレジ
スタ103に書き込む。サインフラグ212が“1”の
ときは、レジスタ103の値203を選択して、レジス
タ103に書き込むので、レジスタ103の値は変わら
ない。
The sine flag 212 output from the arithmetic unit 111 is input to the multiplexer 113 as a selection signal. The multiplexer 113 uses the sign flag 2
When 12 is “0”, the data output 202 is selected and written in the register 103. When the sign flag 212 is "1", the value 203 of the register 103 is selected and written in the register 103, so the value of the register 103 does not change.

【0039】カウンタ・レジスタ115は、制御信号3
08によって、自身の値を1だけインクリメントする機
能を持っている。インクリメントの結果、カウンタ・レ
ジスタ115の値がゼロになったとき、ゼロフラグ21
7がアクティブになる。ゼロ以外の時は、ゼロフラグ2
17はインアクティブである。
The counter register 115 receives the control signal 3
08 has a function of incrementing its own value by 1. When the value of the counter register 115 becomes zero as a result of the increment, the zero flag 21
7 becomes active. Zero flag 2 when non-zero
17 is inactive.

【0040】バレルシフタ116は、レジスタ104の
値のシフト専用となっている。レジスタ104からの出
力204を第1のオペランドとして入力する。第2のオ
ペランドとして入力される値は、カウンタ・レジスタ1
05のデータ出力216またはレジスタ106のデータ
出力206のいずれかであり、マルチプレクサ117に
よって選択される。第2のオペランドをシフト量として
第1のオペランドをシフトする。シフト値に応じたシフ
ト動作は第1の実施例におけるバレルシフタ112と変
わらない。シフトが行われると、マルチプレクサ114
において、選択信号307によってバレルシフタ116
からの出力218が選択されて、データ出力215を通
じてレジスタ104に書き込まれる。
The barrel shifter 116 is dedicated to shifting the value of the register 104. The output 204 from the register 104 is input as the first operand. The value input as the second operand is the counter register 1
05 data output 216 or register 106 data output 206 and is selected by multiplexer 117. The first operand is shifted using the second operand as the shift amount. The shift operation according to the shift value is the same as that of the barrel shifter 112 in the first embodiment. When the shift is performed, the multiplexer 114
At the barrel shifter 116 in response to the selection signal 307.
Output 218 from is selected and written to register 104 through data output 215.

【0041】図2および図4を参照して、第2の実施例
における除算処理の動作を説明する。
The operation of the division process in the second embodiment will be described with reference to FIGS.

【0042】図2のS101〜S104の処理は、第1
の実施例と同様に行う。ただし、第1の実施例では、レ
ジスタ104のシフト量をカウントするためにレジスタ
105を用いていたが、第2の実施例ではカウンタ・レ
ジスタ115を用いる。S103において求められたシ
フト量は、カウンタ・レジスタ115に初期値として設
定する。
The processing of S101 to S104 in FIG.
The same procedure as in the above example is performed. However, in the first embodiment, the register 105 is used for counting the shift amount of the register 104, but in the second embodiment, the counter register 115 is used. The shift amount obtained in S103 is set as an initial value in the counter register 115.

【0043】カウンタ・レジスタ115の値がゼロ以下
であれば、選択信号309によってカウンタ・レジスタ
115のデータ出力216を選択し、バレルシフタ11
6へシフト量として入力する。これによりレジスタ10
4の値をシフトする(S105)。
If the value of the counter register 115 is less than or equal to zero, the data output 216 of the counter register 115 is selected by the selection signal 309, and the barrel shifter 11 is selected.
Input to 6 as shift amount. This allows register 10
The value of 4 is shifted (S105).

【0044】第1の実施例においては、共通の演算資源
を用いて各レジスタの値の変更を行っており、S106
からS111までの処理を順次実行している。一方、第
2の実施例においては、レジスタ103の値の減算、レ
ジスタ104の値のシフト、およびカウンタ・レジスタ
115の値の更新を、それぞれ独立に実行できる構成に
なっている。また、第2の実施例においては、S106
の減算結果が負になった場合の足し戻し処理を省略でき
る。そこで、減算処理S106において、レジスタ10
4のシフト前の値が演算器111に入力されることが保
証されていれば、S106からS111までの処理を1
サイクルで実行することができる。この処理内容を以下
に説明する。
In the first embodiment, the value of each register is changed by using the common arithmetic resource, and S106 is used.
The processes from S111 to S111 are sequentially executed. On the other hand, in the second embodiment, the subtraction of the value of the register 103, the shift of the value of the register 104, and the update of the value of the counter register 115 can be executed independently. In addition, in the second embodiment, S106.
It is possible to omit the adding back processing when the subtraction result of is negative. Therefore, in the subtraction processing S106, the register 10
If it is guaranteed that the pre-shift value of 4 is input to the arithmetic unit 111, the processing from S106 to S111 is set to 1
Can be run in cycles. The details of this processing will be described below.

【0045】レジスタ103の値からレジスタ104の
値を減算し(S106)、結果がゼロ以上であれば、デ
ータ出力211、202を通じて送られた減算結果の値
を選択してレジスタ103に書き込む。減算結果が負の
ときは、もとのレジスタ103の値を選択し、再びレジ
スタ103に書き込むので、レジスタ103の値は保存
される。そのため、レジスタ103の値を正に回復する
ための加算処理S108を行う必要がない。
The value of the register 104 is subtracted from the value of the register 103 (S106). If the result is zero or more, the value of the subtraction result sent through the data outputs 211 and 202 is selected and written in the register 103. When the result of the subtraction is negative, the original value of the register 103 is selected and written in the register 103 again, so the value of the register 103 is saved. Therefore, it is not necessary to perform the addition process S108 for recovering the value of the register 103 to be positive.

【0046】同時に、カウンタ・レジスタ115の値を
インクリメントし(S109)、レジスタ104の値を
1ビット右シフトする(S111)。マルチプレクサ1
17において、レジスタ106のデータ出力206すな
わち“1”が選択されて、バレルシフタ116へシフト
量として入力される。
At the same time, the value of the counter register 115 is incremented (S109) and the value of the register 104 is right-shifted by 1 bit (S111). Multiplexer 1
At 17, the data output 206 of the register 106, that is, “1” is selected and input to the barrel shifter 116 as a shift amount.

【0047】ループの繰り返しの終了判定については、
カウンタ・レジスタ115がゼロになったサイクルの次
のサイクルにおける処理が終った時点で処理を終了すれ
ばよいので、カウンタ・レジスタ115から出力される
ゼロフラグ217を参照して、ゼロフラグが“1”にな
った次のサイクルで、最後のループの処理と、ループか
ら抜ける分岐を同時に行う。
Regarding the determination of the end of loop iteration,
Since the processing may be ended at the time when the processing in the cycle next to the cycle in which the counter register 115 has become zero, the zero flag is set to "1" by referring to the zero flag 217 output from the counter register 115. In the next cycle, the processing of the last loop and the branch that exits the loop are performed at the same time.

【0048】[0048]

【発明の効果】以上説明したように本発明は、剰余計算
において、除数のシフト量を求めるための処理を1度に
行うことができるため、シフト量を求めるのに、被除数
と除数のビット数の差、またはビット数の差+1だけ繰
り返し処理を行う必要があった従来の方法と比べて処理
時間が短縮される。
As described above, according to the present invention, in the remainder calculation, the processing for obtaining the shift amount of the divisor can be performed at one time. Therefore, the number of bits of the dividend and the divisor are used to obtain the shift amount. Processing time is shortened as compared with the conventional method in which it is necessary to repeat the processing by the difference of 1 or the difference of the number of bits + 1.

【0049】1280×1024画素からなる画面上に
描画を行う場合には、被除数となる座標値は最大11ビ
ットであり、実際8〜10ビットの値である頻度が高い
と思われる。また、ウィンドウ・システムにおいてウィ
ンドウのバックグラウンドを塗りつぶす場合などは、4
×4、8×8画素程度の単純なパターンの繰り返しであ
ることが多く、除数となるパターンの幅・高さの値は3
〜4ビットである。
When drawing on a screen consisting of 1280 × 1024 pixels, the coordinate value as the dividend is 11 bits at maximum, and it is considered that the value of 8 to 10 bits is actually high. Also, if you want to fill the background of the window in the window system, etc.
It is often the case that a simple pattern of about × 4 or 8 × 8 pixels is repeated, and the value of the width / height of the pattern which is a divisor is 3
~ 4 bits.

【0050】被除数が455、除数が10のとき、従来
の方法では、シフト量を求める第1のループ、剰余を求
める第2のループそれぞれを6回ずつ繰り返す。第1の
ループは1回4サイクル、第2のループは1回5サイク
ル(足し戻しを行わない場合)かかるので、図6に示す
処理に対応して、実行時間は以下のようになる。
When the dividend is 455 and the divisor is 10, in the conventional method, the first loop for obtaining the shift amount and the second loop for obtaining the remainder are each repeated 6 times. Since the first loop takes 4 cycles once and the second loop takes 5 cycles once (when no add back is performed), the execution time is as follows, corresponding to the processing shown in FIG.

【0051】 ・S201〜S203 … 3サイクル ・S204〜S207(第1のループ) …4×6+2サイクル (ループを抜ける判定のために2サイクルプラスする) ・S208 … 1サイクル ・S209〜S214(第2のループ) …5×6+2+1サイクル (足し戻し処理2サイクル、ループを抜ける判定1サイクルをプラスする) 以上を合計して、63サイクルである。S201 to S203 ... 3 cycles S204 to S207 (first loop) ... 4 × 6 + 2 cycles (plus 2 cycles for exiting the loop) S208 ... 1 cycle S209 to S214 (second cycle) Loop of 5 × 6 + 2 + 1 (addition return processing 2 cycles, loop exit determination 1 cycle is added) The above is 63 cycles in total.

【0052】同様の被除数、除数で本発明の第1の実施
例の演算装置を用いた場合、ループ部分は5サイクル
(足し戻しを行わない場合)の処理が6回繰り返される
ので、図2に示す処理に対応して、以下のようになる。
When the arithmetic unit of the first embodiment of the present invention is used with the same dividend and divisor, the loop portion repeats 5 cycles of processing (when adding back is not performed) six times. The processing corresponding to the processing shown is as follows.

【0053】 ・S101〜S105 …5サイクル ・S106〜S111(ループ) …5×6+2−1サイクル (足し戻し処理を2回行うので2サイクルプラスし、最後のループはS111 を実行しないので1サイクルマイナスする) 以上合計して、36サイクルとなり、従来の実施例の処
理時間の57パーセントに減少している。
-S101 to S105 ... 5 cycles-S106 to S111 (loop) ... 5 x 6 + 2-1 cycles (2 cycles are added because the add-back processing is performed twice, and 1 cycle is negative because S111 is not executed in the last loop. In total, the number of cycles is 36 cycles, which is 57% of the processing time of the conventional example.

【0054】さらに第2の実施例の演算装置を用いた場
合には、第1の実施例におけるループ部分を1回1サイ
クルで実行できるため、6回のループ繰り返しが6サイ
クル、全体の実行時間は11サイクルとなる。従来例の
実行時間の17パーセントとなっており、大幅に実行時
間が短縮されている。
Furthermore, when the arithmetic unit of the second embodiment is used, the loop portion in the first embodiment can be executed once in one cycle, so that six loop iterations are six cycles and the total execution time is Is 11 cycles. This is 17% of the execution time of the conventional example, and the execution time is greatly reduced.

【0055】このように、剰余を求める時間が短縮され
ることにより、結果として、矩形パターンを用いた塗り
つぶし処理の時間を短縮することができる。
As described above, the time for obtaining the remainder is shortened, and as a result, the time for the filling process using the rectangular pattern can be shortened.

【0056】第1の実施例では、レジスタの値の操作
に、共通の演算器およびバレルシフタを利用している。
そのため、比較的単純なハードウェア構成で実現したい
場合に用いられる。
In the first embodiment, a common arithmetic unit and barrel shifter are used for manipulating register values.
Therefore, it is used when it is desired to realize with a relatively simple hardware configuration.

【0057】第2の実施例では、各レジスタの値の操作
のためにそれぞれ専用のハードウェアを備えている。こ
の方法は、ハードウェア量の節約よりも、スピードが重
視されるような場合に用いられる。
In the second embodiment, dedicated hardware is provided for manipulating the value of each register. This method is used when speed is more important than saving hardware.

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

【図1】本発明の第1の実施例における演算装置の構成
を示すブロック図である。
FIG. 1 is a block diagram showing a configuration of an arithmetic unit according to a first embodiment of the present invention.

【図2】第1の実施例における剰余計算の動作を示す流
れ図である。
FIG. 2 is a flowchart showing the operation of remainder calculation in the first embodiment.

【図3】第1の実施例の動作を示し、(a)は最上位有
意ビット位置検出器の出力を示す図、(b)は第1の実
施例における剰余計算の各レジスタの値の変化を示す図
である。
3A and 3B show the operation of the first embodiment, FIG. 3A is a diagram showing the output of the most significant bit position detector, and FIG. 3B is a change in the value of each register of the remainder calculation in the first embodiment. FIG.

【図4】本発明の第2の実施例における演算装置の構成
を示すブロック図である。
FIG. 4 is a block diagram showing a configuration of an arithmetic unit according to a second embodiment of the present invention.

【図5】従来例における演算装置の構成を示すブロック
図である。
FIG. 5 is a block diagram showing a configuration of an arithmetic device in a conventional example.

【図6】従来例における剰余計算の動作を示す流れ図で
ある。
FIG. 6 is a flowchart showing the operation of remainder calculation in the conventional example.

【図7】従来例における剰余計算の各レジスタの値の変
化を示す図である。
FIG. 7 is a diagram showing changes in the value of each register in the remainder calculation in the conventional example.

【図8】矩形塗りつぶし動作を示し、(a)は塗りつぶ
しパターンによる塗りつぶし結果を示し、(b)は矩形
塗りつぶしパターンを示し、(c)は矩形塗りつぶしパ
ターンのビット・イメージを示す図である。
8A and 8B are diagrams showing a rectangular filling operation, FIG. 8A shows a filling result by a filling pattern, FIG. 8B shows a rectangular filling pattern, and FIG. 8C shows a bit image of the rectangular filling pattern.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 除算の被除数を格納する第1のレジスタ
と、除数を格納する第2のレジスタと、演算器およびバ
レルシフタとを備えた演算装置において、第1のレジス
タおよび第2のレジスタのそれぞれに対応する最上位有
意ビット位置検出器を有し、前記第1のレジスタに接続
された最上位有意ビット位置検出器が出力する値と前記
第2のレジスタに接続された最上位有意ビット位置検出
器が出力する値との差を前記演算器によって算出し、そ
の結果をシフト量として、前記バレルシフタを用いて前
記第2のレジスタの値を上位方向にシフトした後に、第
1のレジスタから第2のレジスタの値を減算する処理お
よび第2のレジスタの値を下位方向に1ビットづつシフ
トする処理を繰り返すことによって、除算の剰余を求め
ることを特徴とする演算装置。
1. An arithmetic unit comprising: a first register for storing a dividend for division; a second register for storing a divisor; an arithmetic unit and a barrel shifter; each of the first register and the second register. And a value output by the most significant bit position detector connected to the first register and a most significant bit position detection connected to the second register. The difference from the value output by the calculator is calculated by the arithmetic unit, and the result is used as the shift amount to shift the value of the second register in the upper direction using the barrel shifter, and then the second register Of the division of the second register and the process of shifting the value of the second register by 1 bit in the lower direction are repeated to obtain the remainder of the division. Arithmetic unit.
JP3226721A 1991-09-06 1991-09-06 Arithmetic unit Pending JPH0567217A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3226721A JPH0567217A (en) 1991-09-06 1991-09-06 Arithmetic unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3226721A JPH0567217A (en) 1991-09-06 1991-09-06 Arithmetic unit

Publications (1)

Publication Number Publication Date
JPH0567217A true JPH0567217A (en) 1993-03-19

Family

ID=16849588

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3226721A Pending JPH0567217A (en) 1991-09-06 1991-09-06 Arithmetic unit

Country Status (1)

Country Link
JP (1) JPH0567217A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4851056A (en) * 1981-12-28 1989-07-25 Nippon Steel Corporation Process for producing a semi-processed non-oriented electrical steel sheet having a low watt loss and a high magnetic flux density
JP2011028312A (en) * 2009-07-21 2011-02-10 Fujitsu Ltd Processor, control method thereof, and arithmetic processing program

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4851056A (en) * 1981-12-28 1989-07-25 Nippon Steel Corporation Process for producing a semi-processed non-oriented electrical steel sheet having a low watt loss and a high magnetic flux density
JP2011028312A (en) * 2009-07-21 2011-02-10 Fujitsu Ltd Processor, control method thereof, and arithmetic processing program

Similar Documents

Publication Publication Date Title
US4635292A (en) Image processor
US5001662A (en) Method and apparatus for multi-gauge computation
US4675809A (en) Data processing system for floating point data having a variable length exponent part
US5883824A (en) Parallel adding and averaging circuit and method
EP0198470B1 (en) Arithmetic unit with simple overflow detection system
EP0097834A2 (en) Circuits for accessing a variable width data bus with a variable width data field
JPS5862746A (en) Divider
US4823258A (en) Index limited continuous operation vector processor
US5363322A (en) Data processor with an integer multiplication function on a fractional multiplier
KR100423893B1 (en) Partial matching partial output cache for computer arithmetic operations
JPH0850578A (en) Arithmetic and logic unit and control method
JPH03210680A (en) Curve generator
JPH0640259B2 (en) Data processing device
US5317531A (en) Apparatus for reducing the size of an arithmetic and logic unit necessary to practice non-restore division
JPH0567217A (en) Arithmetic unit
US6215504B1 (en) Line drawing using operand routing and operation selective multimedia extension unit
JPH0346024A (en) Floating point computing element
US6516332B1 (en) Floating point number data processing means
US3417236A (en) Parallel binary adder utilizing cyclic control signals
US7237000B2 (en) Speed of execution of a conditional subtract instruction and increasing the range of operands over which the instruction would be performed correctly
US6414692B1 (en) Graphics processing apparatus and system
JPH0434191B2 (en)
JP3201097B2 (en) Multiplication prescription method in multiplier
JP2605792B2 (en) Arithmetic processing unit
JP3144807B2 (en) Access frequency calculation circuit

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 19980929