JP2908231B2 - Vector arithmetic unit - Google Patents

Vector arithmetic unit

Info

Publication number
JP2908231B2
JP2908231B2 JP6059530A JP5953094A JP2908231B2 JP 2908231 B2 JP2908231 B2 JP 2908231B2 JP 6059530 A JP6059530 A JP 6059530A JP 5953094 A JP5953094 A JP 5953094A JP 2908231 B2 JP2908231 B2 JP 2908231B2
Authority
JP
Japan
Prior art keywords
bit
data
bits
output
input
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP6059530A
Other languages
Japanese (ja)
Other versions
JPH07271765A (en
Inventor
徹 三井
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Computertechno Ltd
Original Assignee
NEC Computertechno Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Computertechno Ltd filed Critical NEC Computertechno Ltd
Priority to JP6059530A priority Critical patent/JP2908231B2/en
Publication of JPH07271765A publication Critical patent/JPH07271765A/en
Application granted granted Critical
Publication of JP2908231B2 publication Critical patent/JP2908231B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Complex Calculations (AREA)

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】本発明は、コンピュータ装置に関
し、特に、コンピュータ装置に含まれるベクトル演算装
置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a computer device, and more particularly, to a vector operation device included in a computer device.

【0002】[0002]

【従来の技術】従来、ベクトルレジスタの各ワード毎に
対応しベクトルデータの演算有効または演算無効を判別
するマスクデータに対して、前記マスクデータの先頭か
ら有効ベクトル長で指定されるビット数の各ビットの値
が“1”であるビットの数を数える演算を行う演算装置
は、マスクデータを先頭ビットから1ビットずつ加算カ
ウンタを用いて有効ベクトル長で指定された値だけ累積
加算処理を行い演算結果を算出している。
2. Description of the Related Art Conventionally, mask data corresponding to each word of a vector register for determining whether the operation of vector data is valid or invalid is defined by the number of bits specified by the effective vector length from the head of the mask data. An arithmetic unit that performs an operation of counting the number of bits whose bit values are “1” performs an arithmetic operation by performing an accumulative addition process on the mask data by a value specified by an effective vector length using an addition counter one bit at a time from the first bit. The result is calculated.

【0003】[0003]

【発明が解決しようとする課題】上述した従来のベクト
ル演算装置では、マスクデータを先頭ビットから1ビッ
トずつ加算カウンタを用いて有効ベクトル長で指定され
た値だけ累積加算処理を行い演算結果を算出していたこ
とから演算処理が低速であるという欠点がある。
In the above-described conventional vector operation device, the mask data is subjected to an accumulative addition process by a value specified by an effective vector length by using an addition counter one bit at a time from the first bit to calculate an operation result. Therefore, there is a disadvantage that the arithmetic processing is slow.

【0004】[0004]

【課題を解決するための手段】本発明のベクトル演算装
置は、ベクトルレジスタと、前記ベクトルレジスタのワ
ード数に対応したベクトルデータの演算有効または演算
無効を判別するマスクデータを出力するマスクレジスタ
と、前記マスクレジスタより出力されるマスクデータの
全ビットに対して先頭ビットから有効ベクトル長で指定
された値のビットまでのマスクデータはそのまま出力
し、有効ベクトル長で指定された値のビットから最大有
効長ビットまでのマスクデータは“0”に差し替え出力
する有効ビット判別部と、該有効ビット判別部から出力
された有効ビット判別済みのすべてのマスクデータに対
して値が“1”であるビットの数を計算するビット
“1”カウント演算部とを具備することを特徴とする。
According to the present invention, there is provided a vector operation device, comprising: a vector register; a mask register for outputting mask data for determining whether the operation of vector data corresponding to the number of words of the vector register is valid or invalid; With respect to all the bits of the mask data output from the mask register, the mask data from the first bit to the bit of the value specified by the effective vector length is output as it is, and from the bit of the value specified by the effective vector length to the maximum effective bit A valid bit discriminator that replaces mask data up to long bits with “0” and outputs the mask data having a value “1” with respect to all mask data for which valid bit discrimination has been output from the valid bit discriminator. A bit "1" count operation unit for calculating a number.

【0005】[0005]

【実施例】次に、本発明について図面を参照して説明す
る。
Next, the present invention will be described with reference to the drawings.

【0006】図1および図3は本発明の第1の実施例を
示す構成図および動作説明図である。
FIGS. 1 and 3 are a configuration diagram and an operation explanatory diagram showing a first embodiment of the present invention.

【0007】マスクレジスタ01が9ビットの時の演算動
作について説明する。ベクトルレジスタに格納されてい
るベクトルデータの有効無効を判別するマスクデータを
格納するマスクレジスタ01は、そのすべてのマスクデー
タをマスクレジスタ出力データ02,03,04,05,06,07,08,0
9,10として有効ビット判別部11内のビット差し替え回路
23へ出力する。
The operation when the mask register 01 has 9 bits will be described. The mask register 01 for storing mask data for determining validity / invalidity of the vector data stored in the vector register is a mask register output data 02, 03, 04, 05, 06, 07, 08, 0
Bit replacement circuit in effective bit discriminator 11 as 9,10
Output to 23.

【0008】また有効ビット判別部11内のビットパタン
生成回路13は、マスクレジスタ01と同一のビット幅で、
マスクレジスタ01の0番目のビットから有効ベクトル長
12の値の番号のビットまでは“1”を、有効ベクトル長
12の値の番号のビットより以降のビットに対して“0”
を生成し、ビットパタン生成回路出力14,15,16,17,18,1
9,20,21,22としてビット差し替え回路23へ出力する。
The bit pattern generation circuit 13 in the valid bit discrimination section 11 has the same bit width as the mask register 01,
Effective vector length from bit 0 of mask register 01
"1" up to the bit of the value of 12 and the effective vector length
"0" for bits following the bit with the value of 12
And outputs the bit pattern generation circuit outputs 14, 15, 16, 17, 18, and 1.
Output to the bit replacement circuit 23 as 9,20,21,22.

【0009】ビット差し替え回路23は、入力されたビッ
トパタン生成回路出力14,15,16,17,18,19,20,21,22の各
ビットの値が“0”となっているビットはマスクレジス
タ出力データ02,03,04,05,06,07,08,09,10の同一のビッ
ト番号のビットの値を“0”に差し替え、ビットパタン
生成回路出力14,15,16,17,18,19,20,21,22の各ビットの
値が“1”となっているビットに対してはマスクレジス
タ出力データ02,03,04,05,06,07,08,09,10の値を差し替
えずビット差し替え回路出力データ24,25,26,27,28,29,
30,31,32として、ビットの値が“1”であるビットの数
を計算するビット“1”カウント演算部33へ出力する。
The bit replacement circuit 23 masks the bits of the input bit pattern generation circuit outputs 14, 15, 16, 17, 18, 19, 20, 21, and 22 in which the value of each bit is "0". The value of the bit having the same bit number of the register output data 02, 03, 04, 05, 06, 07, 08, 09, 10 is replaced with “0”, and the bit pattern generation circuit output 14, 15, 16, 17, 18 , 19,20,21,22, the value of the mask register output data 02,03,04,05,06,07,08,09,10 is set to the bit whose value is "1". Bit replacement circuit output data without replacement 24, 25, 26, 27, 28, 29,
As 30, 30, 32, it outputs to the bit “1” count operation unit 33 which calculates the number of bits whose bit value is “1”.

【0010】ビット“1”カウント演算部33の第1演算
器群43では、9ビットのビット差し替え回路出力データ
24,25,26,27,28,29,30,31,32を各3ビットに3分割し、
ビット差し替え回路出力データ24,25を2入力データと
しビット差し替え回路出力データ26をキャリィデータと
し1ビット全加算器34へ入力し、ビット差し替え回路出
力データ27,28を2入力データとしビット差し替え回路
出力データ29をキャリィデータとして1ビット全加算器
35へ入力し、ビット差し替え回路出力データ30,31を2
入力データとしてビット差し替え回路出力データ32をキ
ャリィデータとして1ビット全加算器36へ入力する。3
ビットに分割されたビット差し替え回路出力データ24〜
32によって1ビット全加算器34,35,36は10進数で2の
重みを持つキャリィ出力データ37,38,39と、10進数で
1の重みを持つサム出力データ40,41,42を出力する。第
2演算器群46では共に10進数で2の重みを持つキャリ
ィ出力データ37,38,39の内のデータ37,38を2入力デー
タとしキャリィ出力データ39をキャリィデータとして1
ビット全加算器44へ入力し、同様に共に10進数で1の
重みを持つキャリィ出力データ40,41,42の内のデータ4
0,41を2入力データとしキャリィ出力データ42をキャリ
ィデータとして1ビット全加算器45へ入力する。これよ
り1ビット全加算器44は、10進数で4の重みを持つキ
ャリィ出力データ47と、10進数で2の重みを持つサム
出力データ49とを出力し、1ビット全加算器45は、10
進数で2の重みを持つキャリィ出力データ48と、10進
数で1の重みを持つサム出力データを得る。ここで、1
ビット全加算器45より出力されたサム出力データを10
進数で1の重みを持つビットが1ビットのみであること
から演算結果ビット3出力データ50として出力する。第
3演算器群59では10進数で2の重みを持つデータビッ
トがキャリィ出力データ48およびサム出力データ49の2
ビットであることから、キャリィ出力データ48およびサ
ム出力データ49を2入力データとし“0”信号入力51を
キャリィデータとして1ビット全加算器52へ入力する。
キャリィ出力データ48とサム出力データ49の1ビット全
加算器加算結果として10進数で4の重みを持つキャ
リィ出力データ53を加算器53が出力し、サム出力データ
を10進数で2の重みを持つビットが1ビットのみであ
ることから演算結果ビット2出力データ54として出力す
る。同様にして10進数で4の重みを持つデータビット
がキャリィ出力データ47およびキャリィ出力データ53の
2ビットであることから、キャリィ出力データ47および
キャリィ出力データ53を2入力データとし“0”信号入
力55をキャリィデータとし1ビット全加算器56へ入力す
る。キャリィ出力データ47とキャリィ出力データ53の1
ビット加算器加算結果としてキャリィ出力データを10
進数で8の重みを持つビットが1ビットのみであること
から演算結果ビット0出力データ57として加算器56が出
力し、サム出力データを10進数で4の重みを持つビッ
トが1ビットのみであることから演算結果ビット1出力
データ58として出力する。出力である演算結果ビット0
出力結果57および演算結果ビット1出力データ58および
演算結果ビット2出力データ54および演算結果ビット3
出力データ50を各ビット番号順に並べた演算結果61が各
ビットの値が“1”であるビットの数を数える演算の演
算結果である。
In the first operation unit group 43 of the bit "1" count operation unit 33, the 9-bit bit replacement circuit output data
24,25,26,27,28,29,30,31,32 is divided into 3 bits each,
The bit replacement circuit output data 24 and 25 are used as two input data, the bit replacement circuit output data 26 is used as carry data and input to the 1-bit full adder 34, and the bit replacement circuit output data 27 and 28 are used as two input data and output from the bit replacement circuit. 1-bit full adder using data 29 as carry data
35, and output the bit replacement circuit output data 30, 31 to 2
The bit replacement circuit output data 32 is input as input data to the 1-bit full adder 36 as carry data. 3
Bit replacement circuit outputs the data 24 to which is divided into bits
By means of 32, the 1-bit full adders 34, 35, 36 output carry output data 37, 38, 39 having a decimal weight of 2 and sum output data 40, 41, 42 having a decimal weight of 1. . In the second computing unit group 46, the data 37, 38 of the carry output data 37, 38, 39 having a weight of 2 in decimal notation are used as two input data, and the carry output data 39 is used as the carry data.
The data is input to the bit full adder 44, and similarly, the data 4 of the carry output data 40, 41, and 42, both of which have decimal weights of 1
0 and 41 are input to the 1-bit full adder 45 as carry data and carry output data 42 as carry data. Thus, the 1-bit full adder 44 outputs carry output data 47 having a decimal weight of 4 and sum output data 49 having a decimal weight of 2, and the 1-bit full adder 45 has a 10-bit weight.
Carry output data 48 having a weight of 2 in decimal and sum output data having a weight of 1 in decimal are obtained. Where 1
Sum output data output from bit full adder 45 is
Since there is only one bit having a weight of 1 in the base number, it is output as the operation result bit 3 output data 50. In the third arithmetic unit group 59, the data bits having a weight of 2 in decimal are the carry output data 48 and the sum output data 49.
The carry output data 48 and the sum output data 49 are input to the 1-bit full adder 52 as carry data, and the "0" signal input 51 is carried as carry data.
The adder 53 outputs the carry output data 53 having a weight of 4 in decimal as an addition result of the 1-bit full adder of the carry output data 48 and the sum output data 49, and the sum output data is weighted by 2 in decimal. Since it has only one bit, it is output as operation result bit 2 output data 54. Similarly, since the data bits having a decimal weight of 4 are two bits of the carry output data 47 and the carry output data 53, the carry output data 47 and the carry output data 53 are set as two input data and the "0" signal is input. 55 is used as carry data and input to the 1-bit full adder 56. 1 of carry output data 47 and carry output data 53
Carry output data is 10 as the bit adder addition result.
Since only one bit has a weight of 8 in decimal, the adder 56 outputs the result bit 0 as output data 57, and the sum output data is only one bit having a weight of 4 in decimal. For this reason, it is output as the operation result bit 1 output data 58. Operation result bit 0 that is output
Output result 57 and operation result bit 1 output data 58 and operation result bit 2 output data 54 and operation result bit 3
An operation result 61 obtained by arranging the output data 50 in the order of each bit number is an operation result of an operation for counting the number of bits whose value of each bit is “1”.

【0011】次に図3を用いてマスクレジスタ01の値が
“101110101”で、有効ベクトル長12の値が8
すなわち2進数で“1000”のときのこの実施例の動
作イメージを示す。
Next, referring to FIG. 3, the value of the mask register 01 is "101110101" and the value of the effective vector length 12 is 8
That is, an operation image of this embodiment when the binary number is "1000" is shown.

【0012】有効ベクトル長12よりビットパタン生成回
路出力データとして“111111110”が出力され
る。
[0012] "111111110" is output as the bit pattern generation circuit output data from the effective vector length of 12.

【0013】マスクレジスタ出力データとして“101
110101”が出力される。
"101" is output as mask register output data.
110101 "is output.

【0014】ビット差し替え回路は、ビットパタン生成
回路出力データで値が“0”であるビットに対応したマ
スクレジスタ出力データのビットを“0”に差し替え
“101110100”をビット差し替え回路出力デー
タとして各3ビットに分割して1ビット全加算器34,35,
36へ出力する。
The bit replacement circuit replaces the bit of the mask register output data corresponding to the bit whose value is "0" in the bit pattern generation circuit output data with "0", and sets "101110100" as the bit replacement circuit output data. Divided into 1-bit full adders 34, 35,
Output to 36.

【0015】各1ビット全加算器34,35,36は、入力され
た各3ビットのデータの演算を行い結果として1ビット
全加算器34ではキャリィ出力“1”、サム出力“0”を
出力し、1ビット全加算器35ではキャリィ出力“1”、
サム出力“0”を出力し、1ビット全加算器36ではキャ
リィ出力“0”、サム出力“1”を出力する。
Each of the 1-bit full adders 34, 35 and 36 performs an operation on the input 3-bit data, and as a result, the 1-bit full adder 34 outputs a carry output "1" and a sum output "0". In the 1-bit full adder 35, the carry output “1”,
The sum output "0" is output, and the 1-bit full adder 36 outputs the carry output "0" and the sum output "1".

【0016】1ビット全加算器44は、入力された各3ビ
ットのデータよりキャリィ出力“1”、サム出力“0”
を出力する。同様に1ビット全加算器45では、入力より
キャリィ出力“0”、サム出力“1”を出力する。
The 1-bit full adder 44 outputs a carry output "1" and a sum output "0" based on the input 3-bit data.
Is output. Similarly, the 1-bit full adder 45 outputs a carry output “0” and a sum output “1” from the input.

【0017】1ビット全加算器52は、1ビット全加算器
44のサム出力“0”と1ビット全加算器45のキャリィ出
力“0”と“0”信号よりキャリィ出力“0”、サム出
力“0”を出力する。
The 1-bit full adder 52 is a 1-bit full adder
The carry output “0” and the sum output “0” are output from the sum output “0” of the 44 and the carry output “0” of the 1-bit full adder 45 and the “0” signal.

【0018】1ビット全加算器56は、1ビット全加算器
44のキャリィ出力“1”と1ビット全加算器52のキャリ
ィ出力“0”と“0”信号よりキャリィ出力“0”、サ
ム出力“1”を出力する。
The 1-bit full adder 56 is a 1-bit full adder
The carry output "0" and the sum output "1" are output from the carry output "1" of the 44 and the carry output "0" and the "0" signal of the 1-bit full adder 52.

【0019】1ビット全加算器56のキャリィ出力および
サム出力、1ビット全加算器52のサム出力、1ビット全
加算器45のサム出力をビットの重み順に整列させると演
算結果として2進数" 0101”即ち10進数で“5”
を得る。これは、ビット差し替え回路出力のビット
“1”の数である。
When the carry output and the sum output of the 1-bit full adder 56 and the sum output of the 1-bit full adder 52 and the sum output of the 1-bit full adder 45 are arranged in the order of bit weight, a binary number "0101" is obtained as an operation result. ", Ie" 5 "in decimal
Get. This is the number of bits “1” of the output of the bit replacement circuit.

【0020】以上説明した第1の実施例では、すべての
マスクデータに対する有効ビット判別動作と、あるビッ
ト幅を持った有効ビット判別済み入力データを任意のビ
ット幅に等分割しそれぞれの等分割データの各ビットの
値が“1”であるビットの数を算出する複数の演算器を
持ち、前記演算器より出力として得られる演算結果に対
する同等の重みを持ったビットを別々にそれぞれ等分割
しそれぞれの等分割データの各ビットの値が“1”であ
るビットの数を出力する複数の演算器に入力していくと
いう処理を階層的に行うことにより、従来の有効ベクト
ル長で指定された値だけ加算カウンタを用いて累積加算
を行う演算処理より高速に演算処理を行うことができ
る。
In the first embodiment described above, the operation of determining the valid bits for all the mask data, and dividing the input data having a certain bit width for which the valid bits have been determined into equal bit widths and dividing them into equal bit Has a plurality of arithmetic units for calculating the number of bits in which the value of each bit is "1". Bits having the same weight for the arithmetic result obtained as an output from the arithmetic unit are separately divided into equal parts, respectively. By inputting the number of bits in which the value of each bit of the equal-divided data is “1” to a plurality of arithmetic units that output the number of bits, so that the value specified by the conventional effective vector length is obtained. Thus, the arithmetic processing can be performed at a higher speed than the arithmetic processing of performing the cumulative addition using the addition counter.

【0021】図2および図4は本発明の第2の実施例を
示す構成図および動作説明図である。
FIGS. 2 and 4 are a configuration diagram and an operation explanatory diagram showing a second embodiment of the present invention.

【0022】マスクレジスタ01が9ビットの時の演算動
作について説明する。ただし、第1の実施例の同一部分
の説明は省略する。ベクトルレジスタに格納されている
ベクトルデータの有効無効を判別するマスクデータの格
納レジスタであるマスクレジスタ01のすべてのマスクデ
ータをマスクレジスタ出力データ02,03,04,05,06,07,0
8,09,10として有効ビット判別部11内のビット差し替え
回路23へ出力する。
The operation when the mask register 01 has 9 bits will be described. However, description of the same parts in the first embodiment is omitted. All mask data of the mask register 01, which is a register for storing mask data for determining whether the vector data stored in the vector register is valid or invalid, is output to the mask register output data 02, 03, 04, 05, 06, 07, 0.
The values are output to the bit replacement circuit 23 in the valid bit determination unit 11 as 8,09,10.

【0023】また有効ビット判別部11内のビットパタン
生成回路13では、マスクレジスタ01と同一のビット幅
で、マスクレジスタ01の0番目のビットから有効ベクト
ル長12の値の番号のビットまでは“1”を、有効ベクト
ル長12の値の番号のビットより以降のビットに対して
“0”を生成し、ビットパタン生成回路出力14,15,16,1
7,18,19,20,21,22としてビット差し替え回路23へ出力す
る。
In the bit pattern generation circuit 13 in the valid bit discriminating unit 11, the bit width of the mask register 01 from the 0th bit to the bit of the value of the effective vector length 12 is the same as that of the mask register 01. 1 ”is generated, and“ 0 ”is generated for bits subsequent to the bit of the value number of the effective vector length 12, and the bit pattern generation circuit outputs 14, 15, 16, 1
The bits are output to the bit replacement circuit 23 as 7, 18, 19, 20, 21, and 22.

【0024】ビット差し替え回路23では、入力されたビ
ットパタン生成回路出力14,15,16,17,18,19,20,21,22の
各ビットの値が“0”となっているビットはマスクレジ
スタ出力データ02,03,04,05,06,07,08,09,10の同一のビ
ット番号のビットの値を“0”に差し替え、ビットパタ
ン生成回路出力14,15,16,17,18,19,20,21,22の各ビット
の値が“1”となっているビットに対してはマスクレジ
スタ出力データ02,03,04,05,06,07,08,09,10の値を差し
替えずビット差し替え回路出力データ24,25,26,27,28,2
9,30,31,32としてビットの値が“1”であるビットの数
を計算するビット“1”カウント演算部33へ出力する。
In the bit replacement circuit 23, the bits of the input bit pattern generation circuit outputs 14, 15, 16, 17, 18, 19, 20, 21, and 22 whose values are “0” are masked. The value of the bit having the same bit number of the register output data 02, 03, 04, 05, 06, 07, 08, 09, 10 is replaced with “0”, and the bit pattern generation circuit output 14, 15, 16, 17, 18 , 19,20,21,22, the value of the mask register output data 02,03,04,05,06,07,08,09,10 is set to the bit whose value is "1". Bit replacement circuit output data without replacement 24, 25, 26, 27, 28, 2
The value is output to the bit “1” count operation unit 33 for calculating the number of bits whose bit value is “1” as 9, 30, 31, and 32.

【0025】ビット“1”カウント演算部33の第1演算
器群43では、9ビットのビット差し替え回路出力データ
24,25,26,27,28,29,30,31,32を各3ビットに3分割し、
ビット差し替え回路出力データ24,25を2入力データと
してビット差し替え回路出力データ26をキャリィデータ
として1ビット全加算器34へ入力し、ビット差し替え回
路出力データ27,28を2入力データとしてビット差し替
え回路出力データ29をキャリィデータとして1ビット全
加算器35へ入力し、ビット差し替え回路出力データ30,3
1を2入力データとしてビット差し替え回路出力データ3
2をキャリィデータとして1ビット全加算器36へ入力す
る。3ビット分割されたビット差し替え回路出力データ
24〜32によって1ビット全加算器34,35,36は10進数で
2の重みを持つキャリィ出力データ37,37,39と、10進
数で1の重みを持つサム出力データ40,41,42を出力す
る。第2演算器群46では共に10進数で2の重みを持つ
キャリィ出力データ37,38,39の内37,38を2入力データ
としてキャリィ出力データ39をキャリィデータとして1
ビット全加算器44へ入力し、同様に共に10進数で1の
重みを持つキャリィ出力データ40,41,42の内40,41を2
入力データとしてキャリィ出力データ42をキャリィデー
タとして1ビット全加算器45へ入力する。これより1ビ
ット全加算器44は10進数で4の重みを持つキャリィ出
力データ47と、10進数で2の重みを持つサム出力デー
タ49を出力し、1ビット全加算器45は10進数で2の重
みを持つキャリィ出力データ48と、10進数で1の重み
を持つサム出力データを出力する。ここで、》1ビット
全加算器45より出力されたサム出力データを、10進数
で1の重みを持つビットが1ビットのみであることから
演算結果ビット3出力データ50として出力する。ここ
で、1ビット全加算器44からの出力である10進数で4
の重みを持つキャリィ出力データ47と10進数で2の重
みを持つサム出力データ49とをビットの重み順に整列し
2ビットの2進数とし、1ビット全加算器45からの出力
である10進数で2の重みを持つキャリィ出力データ48
を1ビットの2進数として2入力加算器60へ入力する。
2入力加算器60より出力される3ビットの出力データは
演算結果の上位3ビットであることから演算結果ビット
0出力データ56、演算結果ビット1出力データ57、演算
結果ビット2出力データ53を出力する。出力である演算
結果ビット0出力データ56および演算結果ビット1出力
データ57および演算結果ビット2出力データ53および演
算結果ビット3出力データ50を各ビット番号順に並べた
演算結果61が各ビットの値が“1”であるビットの数を
数える演算の演算結果である。
In the first operation unit group 43 of the bit "1" count operation unit 33, the 9-bit bit replacement circuit output data
24,25,26,27,28,29,30,31,32 is divided into 3 bits each,
The bit replacement circuit output data 24 and 25 are used as two input data, the bit replacement circuit output data 26 is input as carry data to the 1-bit full adder 34, and the bit replacement circuit output data 27 and 28 are used as two input data and the bit replacement circuit output. Data 29 is input as carry data to 1-bit full adder 35, and bit replacement circuit output data 30, 3
Bit replacement circuit output data 3 with 1 as 2 input data
2 is input to the 1-bit full adder 36 as carry data. Bit replacement circuit output data divided into 3 bits
The 24-bit to 32-bit 1-bit full adders 34, 35, 36 convert the carry output data 37, 37, 39 having a decimal weight of 2 and the sum output data 40, 41, 42 having a decimal weight of 1 to Output. In the second computing unit group 46, the carry output data 37, 38, and 39 of the carry output data 37, 38, and 39 each having a weight of 2 in decimal are set as two input data, and the carry output data 39 is set as 1 as the carry data.
It is input to the bit full adder 44, and similarly, 40,41 of the carry output data 40,41,42 having a weight of 1 in decimal notation are both converted into 2 bits.
The carry output data 42 is input as input data to the 1-bit full adder 45 as carry data. Thus, the 1-bit full adder 44 outputs carry output data 47 having a decimal weight of 4 and sum output data 49 having a decimal weight of 2, and the 1-bit full adder 45 has a decimal number of 2. And carry output data 48 having a weight of 1 and sum output data having a weight of 1 in decimal. Here, the sum output data output from the one-bit full adder 45 is calculated because the number of bits having a decimal weight of 1 is only one bit.
, And outputs the result bit 3 as output data 50. Here, 4 in decimal notation which is the output from the 1-bit full adder 44
The carry output data 47 having a weight of 2 and the sum output data 49 having a weight of 2 as a decimal number are arranged in the order of bit weights to form a 2-bit binary number, which is a decimal number output from the 1-bit full adder 45. Carry output data 48 with weight of 2
Is input to a two-input adder 60 as a 1-bit binary number.
Since the 3-bit output data output from the 2-input adder 60 is the upper 3 bits of the operation result, the operation result bit 0 output data 56, the operation result bit 1 output data 57, and the operation result bit 2 output data 53 are output. I do. The operation result 61 obtained by arranging the operation result bit 0 output data 56, the operation result bit 1 output data 57, the operation result bit 2 output data 53, and the operation result bit 3 output data 50, which are outputs, in the order of each bit number has the value of each bit. This is an operation result of an operation for counting the number of bits that are “1”.

【0026】次に図4を用いてマスクレジスタ01の値が
“101110101”で、有効ベクトル長12の値が8
すなわち2進数で“1000”のときの第2の実施例の
動作イメージを示す。ただし、第1の実施例の同一部分
についての説明は省略する。
Next, referring to FIG. 4, the value of the mask register 01 is "101110101" and the value of the effective vector length 12 is 8
That is, an operation image of the second embodiment when the binary number is "1000" is shown. However, description of the same parts in the first embodiment is omitted.

【0027】2入力加算器60は1ビット全加算器44の出
力“10”と、1ビット全加算器45のキャリィ出力
“0”の2入力データより結果“010”を出力する。
The two-input adder 60 outputs a result "010" from two input data of the output "10" of the one-bit full adder 44 and the carry output "0" of the one-bit full adder 45.

【0028】2入力加算器60の出力3ビットと1ビット
全加算器45のサム出力をビットの重み順に整列させると
演算結果として2進数“0101”即ち10進数で
“5”を得る。これは、ビット差し替え回路出力のビッ
ト“1”の数である。
When the three bits output from the two-input adder 60 and the sum output from the one-bit full adder 45 are arranged in the order of bit weight, a binary number "0101", that is, "5" is obtained as a decimal number as an operation result. This is the number of bits “1” of the output of the bit replacement circuit.

【0029】以上説明した第2の実施例では、すべての
マスクデータに対する有効ビット判別動作と、あるビッ
ト幅を持った有効ビット判別済み入力データを任意のビ
ット幅に等分割しそれぞれの等分割データの各ビットの
値が“1”であるビットの数を算出する複数の演算器を
持ち、前記演算器より出力として得られる演算結果に対
する同等の重みを持ったビットを別々にそれぞれ等分割
しそれぞれの等分割データの各ビットの値が“1”であ
るビットの数を出力する複数の演算器に入力していくと
いう処理を階層的に行い、演算器出力で演算結果に対し
て上位の重みを持つビットが各2ビットずつとなった階
層で各ビットの重み順にビットを整列させ加算器に入力
し、加算器からの出力結果を各2ビットずつの上位の重
みを持つビットの演算結果として出力することにより、
従来の有効ベクトル長で指定された値だけ加算カウンタ
を用いて累積加算を行う演算処理より高速に演算処理を
行うことができる。
In the second embodiment described above, the valid bit discriminating operation for all the mask data, and the valid bit discriminated input data having a certain bit width are equally divided into an arbitrary bit width and Has a plurality of arithmetic units for calculating the number of bits in which the value of each bit is "1". Bits having the same weight for the arithmetic result obtained as an output from the arithmetic unit are separately divided into equal parts, respectively. The process of inputting the number of bits in which the value of each bit of the equal-divided data is "1" to a plurality of arithmetic units is hierarchically performed. Are arranged in the order of the weight of each bit in a hierarchy in which each bit having 2 bits is input to the adder, and the output result from the adder is compared with the bit having the higher weight of 2 bits each. By outputting the calculated result,
The arithmetic processing can be performed at a higher speed than the conventional arithmetic processing of performing the cumulative addition using the addition counter using only the value specified by the effective vector length.

【0030】[0030]

【発明の効果】以上説明したように、本発明は、マスク
レジスタより出力されるマスクデータの全ビットに対し
て先頭ビットから有効ベクトル長で指定された値のビッ
トまでのマスクデータはそのまま出力し有効ベクトル長
で指定された値のビットから最大有効長ビットまでのマ
スクデータは“0" に差し替え出力する有効ビット判別
部と、有効ビット判別部から出力された有効ビット判別
済みのすべてのマスクデータに対してビットの値が
“1”であるビットの数を計算する演算器を用いること
により、マスクデータ中で先頭から有効クトル長で指定
されるビット数までの内ビットの値が“1”であるビッ
トの数を数える演算を高速に処理することができるとい
う効果を奏する。
As described above, according to the present invention, the mask data from the first bit to the bit of the value specified by the effective vector length is output as it is for all the bits of the mask data output from the mask register. The mask data from the bit of the value specified by the effective vector length to the maximum effective length bit is replaced with “0”, and the valid bit discriminator that outputs the mask data, and all the mask data that has been outputted from the valid bit discriminator and whose valid bit has been discriminated By using an arithmetic unit that calculates the number of bits whose bit value is “1”, the value of the bits from the head to the number of bits specified by the effective vector length in the mask data is “1”. This has the effect that the operation for counting the number of bits can be processed at high speed.

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

【図1】本発明の第1の実施例のブロック図である。FIG. 1 is a block diagram of a first embodiment of the present invention.

【図2】本発明の第2の実施例のブロック図である。FIG. 2 is a block diagram of a second embodiment of the present invention.

【図3】本発明の第1の実施例の演算を説明するイメー
ジ図である。
FIG. 3 is an image diagram illustrating a calculation according to the first embodiment of the present invention.

【図4】本発明の第2の実施例の演算を説明するイメー
ジ図である。
FIG. 4 is an image diagram illustrating a calculation according to a second embodiment of the present invention.

【符号の説明】[Explanation of symbols]

01 マスクレジスタ 02〜10 マスクレジスタ出力データ 11 有効ビット判別部 12 有効ベクトル長 13 ビットパタン生成回路 14〜22 ビットパタン生成回路出力データ 23 ビット差し替え回路 24〜32 ビット差し替え回路出力データ 33 ビット“1”カウント演算部 34〜36 1ビット全加算器 37〜39 キャリィ出力データ 40〜42 サム出力データ 43 第1演算器群 44〜45 1ビット全加算器 46 第2演算器群 47〜48 キャリィ出力データ 49 サム出力データ 50 演算結果ビット3出力データ 51 “0”信号入力 52 1ビット全加算器 53 キャリィ出力データ 54 演算結果ビット2出力データ 55 “0”信号入力 56 1ビット全加算器 57 演算結果ビット0出力データ 58 演算結果ビット1出力データ 59 第2演算器群 60 2入力加算器 61 演算結果 01 mask register 02-10 mask register output data 11 valid bit discriminator 12 effective vector length 13 bit pattern generation circuit 14-22 bit pattern generation circuit output data 23 bit replacement circuit 24-32 bit replacement circuit output data 33 bits "1" Count operation unit 34-36 1-bit full adder 37-39 Carry output data 40-42 Sum output data 43 First operation unit group 44-45 1-bit full adder 46 Second operation unit group 47-48 Carry output data 49 Sum output data 50 Operation result bit 3 output data 51 “0” signal input 52 1-bit full adder 53 Carry output data 54 Operation result bit 2 output data 55 “0” signal input 56 1-bit full adder 57 Operation result bit 0 Output data 58 Operation result bit Output data 59 second arithmetic unit group 60 2-input adder 61 operation results

Claims (3)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 ベクトルレジスタと、前記ベクトルレジ
スタのワード数に対応したベクトルデータの演算有効ま
たは演算無効を判別するマスクデータを出力するマスク
レジスタと、前記マスクレジスタより出力されるマスク
データの全ビットに対して先頭ビットから有効ベクトル
長で指定された値のビットまでのマスクデータはそのま
ま出力し、有効ベクトル長で指定された値のビットから
最大有効長ビットまでのマスクデータは“0”に差し替
え出力する有効ビット判別部と、該有効ビット判別部か
ら出力された有効ビット判別済みのすべてのマスクデー
タに対して値が“1”であるビットの数を計算するビッ
ト“1”カウント演算部とを具備することを特徴とする
ベクトル演算装置。
1. A vector register, a mask register for outputting mask data for determining whether the operation of vector data corresponding to the number of words of the vector register is valid or invalid, and all bits of the mask data output from the mask register The mask data from the first bit to the bit of the value specified by the effective vector length is output as it is, and the mask data from the bit of the value specified by the effective vector length to the maximum effective length bit is replaced with “0”. A valid bit discriminator for outputting, and a bit “1” count calculator for calculating the number of bits having a value of “1” for all the mask data for which valid bit discrimination has been output from the valid bit discriminator; A vector operation device comprising:
【請求項2】 るビット幅を持った入力データを任意
のビット幅に等分割して入力されそれぞれの入力データ
の各ビットの値が“1”であるビットの数を算出する複
数の加算演算器を有する第1演算器群と、該第1演算器
群より出力として得られる演算結果データで同等の重み
を持ったビットを別々にそれぞれ等分割して入力され該
等分割データの各ビットの値が“1”であるビットの数
を出力する第2演算器群と、該第2演算器群の演算結果
に対して同等の重みを持ったビットが1ビットのみとな
るまで該第2演算器群を階層的に構成することにより
、前記階層的に構成された前記第2演算器の前記出力
データを各ビットの重み順にビットを整列し演算結果と
して出力する処理を行う前記ビット“1”カウント演算
部とを具備することを特徴とする請求項1記載のベクト
ル演算装置。
Wherein the input data with the Oh Ru bit width by equally dividing an arbitrary bit width input multiple addition of calculating the number of bits the value of each bit is "1" the respective input data A first operation unit group having an operation unit, and bits each having the same weight in the operation result data obtained as an output from the first operation unit group, which are separately divided and input, and each bit of the equal division data is input. And a second operation unit group that outputs the number of bits whose value is “1”, and the second operation unit group until the number of bits having the same weight for the operation result of the second operation unit group becomes only one bit. By constructing the arithmetic unit group hierarchically
, Characterized by comprising said bit "1" count calculating unit that performs processing for outputting the output data of said hierarchically structured second arithmetic unit as ordered calculation result bit to the weight order of each bit The vector operation device according to claim 1, wherein
【請求項3】 前記ビット“1”カウント演算部が、あ
るビット幅を持った入力データを任意のビット幅に等分
割し入力されそれぞれの入力データの各ビットの値が
“1”であるビットの数を算出する複数の加算演算器を
有する第1演算器群と、該第1演算器群より出力として
得られる演算結果データで同等の重みを持ったビットを
別々にそれぞれ等分割して入力され該等分割データの各
ビットの値が“1”であるビットの数を出力する第2演
算器群と、該第2演算器群の演算結果に対して同等の重
みを持ったビットが各2ビット以下となるまで該第2の
演算器群を階層的に構成し、該第2演算器群より出力さ
れる演算結果に対して同等の重みを持ったビットをそれ
ぞれの重み順に整列して入力され演算結果を出力する処
理を行う2入力加算器とを具備することを特徴とする請
求項1記載のベクトル演算装置。
3. The bit "1" count operation unit divides input data having a certain bit width into equal bit widths and inputs the same, and the bit value of each bit of each input data is "1". And a first arithmetic unit group having a plurality of addition arithmetic units for calculating the number of bits, and bits having the same weight in the operation result data obtained as an output from the first arithmetic unit group are separately divided into equal parts and input. A second arithmetic unit group that outputs the number of bits in which the value of each bit of the equally divided data is “1”, and a bit having the same weight as the arithmetic result of the second arithmetic unit group are The second arithmetic unit group is hierarchically configured until the number of bits becomes 2 bits or less, and bits having the same weight for the operation result output from the second arithmetic unit group are arranged in the order of their respective weights. A two-input adder that performs a process of inputting and outputting a calculation result 2. The vector operation device according to claim 1, comprising:
JP6059530A 1994-03-29 1994-03-29 Vector arithmetic unit Expired - Fee Related JP2908231B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP6059530A JP2908231B2 (en) 1994-03-29 1994-03-29 Vector arithmetic unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP6059530A JP2908231B2 (en) 1994-03-29 1994-03-29 Vector arithmetic unit

Publications (2)

Publication Number Publication Date
JPH07271765A JPH07271765A (en) 1995-10-20
JP2908231B2 true JP2908231B2 (en) 1999-06-21

Family

ID=13115926

Family Applications (1)

Application Number Title Priority Date Filing Date
JP6059530A Expired - Fee Related JP2908231B2 (en) 1994-03-29 1994-03-29 Vector arithmetic unit

Country Status (1)

Country Link
JP (1) JP2908231B2 (en)

Also Published As

Publication number Publication date
JPH07271765A (en) 1995-10-20

Similar Documents

Publication Publication Date Title
US5500812A (en) Multiplication circuit having rounding function
JP3244506B2 (en) Small multiplier
EP0328063B1 (en) Absolute value calculating circuit having a single adder
CN111936965A (en) Random rounding logic
US5734599A (en) Performing a population count using multiplication
KR970006408B1 (en) Method and apparatus for automatically designing logic circuitand multiplier
JP2908231B2 (en) Vector arithmetic unit
KR100627993B1 (en) Three input split-adder
US4118786A (en) Integrated binary-BCD look-ahead adder
US6151616A (en) Method and circuit for detecting overflow in operand multiplication
JPH0464091B2 (en)
US7051062B2 (en) Apparatus and method for adding multiple-bit binary-strings
US5903484A (en) Tree circuit
GB2127187A (en) Circuits for operating on N- digit operands
JPH056263A (en) Adder and absolute value calculation circuit using the adder
US6631393B1 (en) Method and apparatus for speculative addition using a limited carry
JP2710412B2 (en) Multiplication / division circuit
JP3482102B2 (en) Absolute distance calculation circuit
RU205198U1 (en) A PARAMETRIZABLE SINGLE-STROKE BINARY MULTIPLIER WITH A FIXED DOT IN A DIRECT AND AUXILIARY CODE
RU2753184C1 (en) Parametrizable single-stroke binary multiplier with fixed dot in direct and auxiliary code
US6748411B1 (en) Hierarchical carry-select multiple-input split adder
JPS6227864A (en) Totalizing circuit
KR950015180B1 (en) High speed adder
JPH0580973A (en) Normalizing/rounding device
JPH09190338A (en) Elimination of mathematical overflow flag generation delay for arithmetic and logic unit

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 19990223

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

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

Free format text: PAYMENT UNTIL: 20080402

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20090402

Year of fee payment: 10

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

Free format text: PAYMENT UNTIL: 20100402

Year of fee payment: 11

LAPS Cancellation because of no payment of annual fees