Patent Publication Number: US-4928238-A

Title: Scalar data arithmetic control system for vector arithmetic processor

Description:
BACKGROUND OF THE INVENTION 
     The present invention relates to a scalar data arithmetic control system for a vector arithmetic processor in a data processing system. 
     FIG. 1 is a block diagram showing a conventional vector arithmetic processor in relation to a central processing unit (to be referred to as a CPU hereinafter). In FIG. 1, the vector arithmetic processor 100 includes an instruction register 6, a register file 4, an arithmetic unit 10, and a control unit 90. In operation an operand pointer is set based on the content of a vector instruction when the vector instruction is set in an instruction register 6 by the CPU and the vector arithmetic processor 100 initiates execution of the vector instruction. After the CPU 60 sets the instruction in the instruction register 6, an operand for performing the first cycle of the instruction is loaded. When the last operand is loaded, the CPU 60 loads the operand using a microinstruction for setting an operand counter. When the vector arithmetic processor 100 detects that the operand counter has been set, the operand is used to initiate an arithmetic operation. 
     When the designation for the vector arithmetic processor 100 is completed, the CPU 60 designates initiation of the second cycle. Even if the operand is a scalar operand, the same operand as in the first cycle is loaded. Upon completion of operand loading, the operand counter is set. 
     Even if a scalar operand is used, the same data is loaded every cycle. The difference between the scalar and vector operands is designated by a software instruction, and the CPU 60 determines the difference by detecting a designation bit 
     In the conventional vector arithmetic processor described above, the CPU must load the same operand in the vector arithmetic processor every vector instruction cycle, the number of steps in the microprogram is increased. The vector arithmetic processor must wait until the operand is input thereto. As a result, an operation speed cannot be increased. 
     SUMMARY OF THE INVENTION 
     It is an object of the present invention to provide a scalar data arithmetic control system for a vector arithmetic processor wherein the conventional drawbacks described above can be eliminated and the operation speed can be increased although the arrangement is simple. 
     A scalar data arithmetic control system for a vector arithmetic processor according to the present invention comprises, in the vector arithmetic processor capable of performing arithmetic operations independently of a CPU under the control of the CPU, a register file for storing an operand when a vector instruction sent from the CPU is executed, an operand pointer register for storing address data for the operand stored in the register file, an operand counter which is incremented when the operand is loaded in the register file and decremented when the vector instruction is executed, and a scalar control register for storing a value representing whether the operand is a scalar or vector operand. The value of the scalar control register is detected as a value for a scalar arithmetic operation, and the same value as that of the first cycle is used in the operand pointer register in the second and subsequent cycles so as to perform scalar arithmetic operations. The CPU does not load the operand in the register file but sets only the operand counter. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a block diagram showing a conventional scalar data arithmetic control system; and 
     FIG. 2 is a block diagram showing a scalar data arithmetic control system according to an embodiment of the present invention. 
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT 
     A preferred embodiment of the present invention will be described in detail with reference to the accompanying drawing. 
     FIG. 2 is a block diagram showing an embodiment of the present invention. 
     In a vector arithmetic processor 200, a scalar control register 1 is connected to a CPU 60 and stores a signal representing whether the operand is a scalar or vector operand. The scalar control register 1 comprises an operand register 11 for storing a 1-bit first operand and an operand register 12 for storing a 1-bit second operand. Outputs from the operand registers 11 and 12 are controlled by operand selectors 20 and 30, respectively. A pointer register 2 is connected to the output of the operand selector 20 and stores first operand address data for a register file 4. A pointer register 3 stores second operand address data for the register file 4. The register file 4 stores operand data supplied from the CPU 60 through a bus 106 and stores the processed results from an arithmetic unit 10. In this embodiment, the register file 4 comprises a 16-word register file and comprises two pairs of 4-word register file areas (BF at addresses 8 HEX  (where HEX is the hexadecimal notation) to B HEX  and BF&#39; at addresses C HEX  to F HEX ) for storing operand data from the CPU 60. The register file areas BF and BF&#39; are switched by a flip-flop 50 which is inverted at the initiation of instruction execution and are alternately used. Therefore, the CPU 60 can send the next operand in the register file 4 while the current operand is being executed. 
     The vector arithmetic processor 200 comprises an operand counter 9 set in response to a control signal from the CPU 60. An output from the vector arithmetic processor 200 is coupled to the arithmetic unit 10. 
     Outputs from the pointer registers 2 and 3 and the selectors 20 and 30 are coupled to an address selector 40. A register file address register 5 is coupled to an output from the address selector 40 and supplies an address signal to the register file 4. The output terminal of the address register 5 is connected to one input terminal of the address selector 40. An instruction register 6 stores an instruction code and the necessary operand control data, both of which are supplied from the CPU 60, and supplies the instruction code as an address signal to an instruction decoder 7. The instruction decoder 7 comprises a RAM and stores data required for instruction execution. The operand control data of the instruction register 6 is output to an operand pointer generator 8. Two outputs from the operand point generator 8 are supplied to the first input terminals of the operand selectors 20 and 30, respectively. Outputs from the pointer registers 2 and 3 are coupled to the second input terminals of the operand selectors 20 and 30, respectively. Due to the above mentioned electrical connections, the operand pointer generator 8 receives an output from the instruction register 6 and an output from the instruction decoder 7 and generates the first and second operand address data for the register file 4. 
     The operand selectors 20 and 30 respectively receive outputs from the operand pointer generator 8 through signal lines 101 and 102 when the value of the scalar control register 1 represents a vector arithmetic operation (i.e., logic &#34;0&#34;). In this case, outputs of the operand selectors 20 and 30 appear on signal lines 103 and 104, respectively. The operand selectors 20 and 30 select first and second operand pointers stored in the operand pointer registers 2 and 3 when the value of the scalar control register 1 represents a scalar arithmetic operation (i.e., logic &#34;1&#34;). 
     The address selector 40 outputs the values selected by the operand selectors 20 and 30 to the register file address register 5. 
     An arithmetic operation will be described in which two operand data are received from the CPU 60 and are added to each other, and a sum Xi is repeatedly supplied to the CPU 60: 
     
         Xi←Ai+Bi (i=1 to n)                                   (1) 
    
     where Ai is the first operand and Bi is the second operand. 
     Assume that the first operand Ai is a scalar operand and the second operand Bi is a vector operand. 
     A vector addition instruction is set in the instruction register 6 under the control of the CPU 60. At this time, the scalar control register 1 is set at logic &#34;0&#34;, which indicates that the operand is the vector operand. The values of the signal lines 101 and 102 appear on the signal lines 103 and 104, respectively. The operand data storage area BF of the register file 4 is selected (the value of the register switching flip-flop is &#34;0&#34;). The address data of the first operand Ai on the signal line 101 is set as &#34;8&#34; HEX  in the register file area BF by the instruction register 6 and the instruction decoder. The address data of the second operand Bi on the signal line 102 is set as &#34;A&#34; HEX . When the first cycle of the present instruction is initiated, the vector arithmetic processor 200 sets the above address data in the pointer registers 2 and 3. 
     After the CPU 60 sets the instruction, data of the first operand Ai and data of the second operand Bi are loaded by the CPU 60 through the bus 106 at addresses &#34;8&#34; HEX  and &#34;A&#34; HEX  of the register file 4, respectively. Upon completion of loading, the operand counter 9 is incremented by one. 
     When the vector arithmetic processor 200 detects that the operand counter 9 has been set, the vector arithmetic processor 200 initiates an addition using the two operands set in the register file 4. At the same time, the operand counter 9 is decremented by one. Meanwhile, the CPU 60 determines whether the operand is a scalar or vector operand. If the first operand Ai is a scalar operand, the bit of the operand register 11 in the scalar control register 1 is set at logic &#34;1&#34;. Therefore, the value of the pointer register 2, i.e., the output from the selector 20, is output to the signal line 103. 
     When the CPU 60 designates initiation of the second cycle of the vector instruction, the flip-flop 50 is inverted to logic &#34;1&#34;, and the register file area BF&#39; out of the areas BF and BF&#39; in the register file 4 is selected. The first operand signal line 101 is set to a value corresponding to address &#34;C&#34; HEX  of the register file 4, and the second operand signal line 102 is set to a value corresponding to address &#34;E&#34; HEX  of the register file 4. 
     However, since the register 11 of the scalar control register 1 is set at logic &#34;1&#34;, the signal line 103 is set to a value corresponding to &#34;8&#34; HEX . At the time of initiation of the second cycle, values &#34;8&#34; HEX  and &#34;E&#34; HEX  are respectively set in the pointer registers 2 and 3. Since the operand Ai is scalar data, the CPU 60 uses the data of the first cycle for the operand Ai in the second cycle. The CPU 60 loads only the data of the second cycle for the second operand Bi at address &#34;E&#34; HEX  of the register file 4 through the bus 106. The operand counter 9 is incremented by one. 
     After the vector arithmetic processor 200 detects that the operand counter 9 has been set, the vector arithmetic processor 200 uses the data of the first operand of the first cycle stored at address &#34;8&#34; HEX  of the register file 4 and the data of the second operand Bi sent in the second cycle and stored at address &#34;E&#34; HEX  and adds these data. Upon completion of this addition, the operand counter 9 is decremented by one. In the third cycle, the pointer register 2 is set to &#34;8&#34; HEX  and the pointer register 3 is set to &#34;A&#34; HEX . Only the data of the second operand Bi is sent, and the same arithmetic operation as described above is performed. 
     An arithmetic operation is performed according to relation (1) in which both the first and second operands Ai and Bi are scalar operands. 
     In the first cycle, the value &#34;8&#34; HEX  is set in the pointer register 2, and the value &#34;A&#34; HEX  is set in the pointer register 3. Data of the first and second operands Ai and Bi are loaded in the register file 4. Since both the operands are scalar operands, both bits of the scalar control register 1 are set at logic &#34;1&#34;. The output from the pointer register 2 appears on the signal line 103, and the output from the pointer register 3 appears on the signal line 104. 
     In the second cycle, the operand data need not be sent. The CPU 60 sets only the operand counter 9. When the vector arithmetic processor 200 detects that the operand counter 9 has been set, the processor 200 adds data at addresses &#34;8&#34; HEX  and &#34;A&#34; HEX  of the register file 4. 
     In the third and subsequent cycles, the operand data is not loaded, and only the operand counter is set. 
     According to the present invention as described above, the operand is recognized as a scalar operand and the same operand data is repeatedly used to reduce the number of execution steps of the vector instruction, thereby increasing the arithmetic operation speed.