Digital signal processor processing multi-point conditional branch operations in a pipeline mode

Abstract: A digital signal processor of a simple circuit configuration capable of implementing arithmetic processes and interruption processes efficiently in a reduced number of steps at a high processing speed. The digital signal processor comprises instruction execution pipeline stages including a stage in which data is read from a data memory and the data is applied to an arithmetic unit; an arithmetic unit for the execution stage, including a barrel shifter, a multiplier and an arithmetic and logic unit, a normalizing barrel shifter, a round-off/accumulation adder, internal data memories and a DMA transfer bus for a write/accumulation stage, an address generating unit capable of parallel and two-dimensional generation of two inputs one output data memory addresses and a DMA control unit for controlling the two-dimensional data transfer through a DMA bus between the internal data memories and an external data memory for an instruction execution stage.

Description: BACKGROUND OF THE INVENTION Field of the Invention The present invention relates to a digital signal processor capable of efficiently carrying out the arithmetic or interruption processing mainly of successive signals and a high speed through a small number of steps. Description of the Prior Art EP-A-O 142 912 representing the closest prior art from which the invention proceeds discloses an apparatus for predicting the condition code of a condition-code-setting instruction by comparing operands in a data processing system. An operand comparator includes one or more half-adders to predict carry-outs at an early time. The comparator is used in a data processing system which is operative in response to instructions having operation codes for specifying operations to be executed. The instructions also have operand fields for identifying operands to be utilized in connection with executing the instructions. An exemplary conventional digital signal processor will be described hereinafter. Fig. 1 is a schematic block diagram showing the constitution of the digital signal processor (DSSP1) mainly for voice signal processing, published in the preprint No. S10-1 for the Denshi Tsushin Gakkai Tsushin Bumon Zenkoku Taikai Symposium, 1986. Referring to Fig. 1, the DSSP1 comprises a program counter (PC) 61 for holding instruction execution addresses (hereinafter referred to as "instruction addresses"), an instruction memory 62 for storing instruction words, a decoder 63 for decoding instruction words, a program bus 64 for transferring decoded control data, a data memory 65 for storing data, a data bus 66 for transferring main data, a bus interface register (hereinafter abbreviated to "BIR") 67 for interconnecting the program bus 64 and the data bus 66, a processing circuit (hereinafter referred to as "EU") 68 which performs arithmetical operations, a register (flag register) 69 having a flip-flop for holding the status of the results of arithmetical operations, namely, a flag, an adder which adds 1 (one) to an input, a switching circuit 71, and a condition decision unit 72. The operation of such processor will be described hereinafter with reference to Fig. 1. Generally, the signal processor has a pipeline construction to improve the processing speed. This exemplary digital signal processor has a three-stage pipeline construction. An ordinary processor decodes and executes an instruction word, and then decodes and executes the next instruction word. A processor of a pipeline construction decodes the succeeding instruction word during the execution of the preceding instruction word. Accordingly, the processing speed of the processor of a pipeline system is higher than that of the ordinary processor. However, since advanced decoding is useless in executing instruction words including many jump instructions such as conditional branch instructions, the processing speed of the processor of a pipeline system is reduced in executing such instruction words. A pipeline processing mode will be described hereinafter. In the first stage of the pipeline, an instruction word 62A stored in the instruction memory 62 at an instruction address specified by an instruction address 70A provided by the PC 61 is read and is applied to the decoder 63. In the second stage of the pipeline, a control signal produced by the decoder 63 by decoding the instruction word 62A is provided on the program bus 64 and a necessary control code is given to the BIR 67 via the program bus 64. In the third stage of the pipeline, the control signal controls operations such as reading data 65A on the data bus 66 from the data memory 65, writing data provided on the data bus 66 in the data memory 65, and processing the data by the EU 68. The EU 68 provides a flag 68B indicating the status of the result 68A of operation after processing the data. Generally, the flag 68B is a sign flag, a zero flag, an overflow flag or a carry flag. The sign flag is a logical value "0" when the result 68A of operation is positive, and is a logical value "1" when the result 68A of operation is negative. The zero flag is a logical value "0" when the result 68A of operation is zero, and is a logical value "1" when the result 68A of operation is not zero. The overflow flag is a logical value "1" when overflow occurs in the result 68A of operation, and is a logical value "0" when overflow does not occur in the result 68A of operation. The carry flag is a logical value "1" when carry or digit borrow occurs in the result 68A, and is a logical value "0" in cases other than carry and digit borrow. The flag 68B is applied to and held by the flag register 69 until a new flag 68B is applied to the flag register 69 after the EU 68 has executed the next operation. Ordinarily, an instruction word following an instruction word which has been executed is stored in an address greater by "1" than the instruction address 61A in which the executed instruction word was stored, when the executed instruction word does not specify a branch operation. Accordingly, in the first stage of the pipeline, the instruction address 70A provided by the PC 61 is incremented by "1" by the adder 70 to make an address 71A greater than the instruction address 70A by "1". If the instruction decoded by the decoder 3 does not specify a branch operation, a control signal is applied to the switching circuit 71 to select the address 71A which is greater than the instruction address 70A by "1", and the logical value of a branch completion signal 72A becomes "0", and the address 71A obtained by adding "1" to the instruction address 70A is given to the PC 61. The operation when the instruction word decoded in the second stage of the pipeline is a conditional branch instruction will be described hereinafter. A conditional branch instruction is an instruction to specify executing an instruction word in a branched address specified by the instruction when the specified branch condition is met or to specify executing an instruction word in the next address. When the conditional branch instruction is decoded, a flag 69A held by the flag register 69 is read and is applied to a condition decision unit 72. The condition decision unit 72 decides whether or not the branch condition 64A specified by the instruction is met. When the branch condition 64A is met, the logical value of a branch signal 72A becomes "1", the switching circuit 71 selects the branched address 643 specified by an instruction, and then the branched address 64B is given to the PC 61. When the branch condition 64A is not met, the logical value of the branch signal 72A becomes "0", the switching circuit 71 selects the address 71A greater than the instruction address 70A by "1", and then the address 71A is given to the PC 61. Operation of the processor in a case where only information indicating whether or not A = B (A and B are input data) is met is required will be described by way of example with reference to Fig. 2. In the conventional processor, such information can be stored only in the data memory, and hence the following operation is performed. First data A 0 and B 0 are compared. When the data A 0 is equal to the data B 0 , the value of a predetermined address TS(0) in the data memory is made "1". When the data A 0 is not equal to the data B 0 , the value of the address TS(0) is made "0". Then, data A 1 and B 1 are compared and the result of the comparison is written at an address TS(1). The result of comparison of data A 2 and B 2 is written at an address TS(2). Fig. 3 shows the sequence of operations of the PC 61, the decoder 3 and the EU 8 for processes shown in Fig. 2. As shown in Fig. 3, in a machine cycle (hereinafter abbreviated to "M.C.") T, the PC 61 provided an instruction address N, and an instruction specifying the comparison of the data A 0 and B 0 is read from the address N in M.C. T+1. Then, the EU 8 calculates the difference between the data A 0 and B 0 . A zero flag is provided in a M.C. T+2, and the zero flag is set at the start of a M.C. T+3. That is, when a conditional branch instruction is given, the condition decision unit 12 tests the zero flag and decides a branched address in the M.C. T+3. Accordingly, to forbid the advanced decoding operation of the decoder 3, a NOP (no-operation) instruction is stored at an address N+1. When the logical value of the zero flag is "1", a conditional branch instruction is stored at an address N+2. That is, when A 0 = B 0 , a load instruction stored at an address N+3 (an instruction specifying storing the result of decision in the data memory 65) is executed in a M.C. T+5 as shown in Fig. 3(a), and then the address TS(0) is set for "1". When A 0 ≠ B 0 , the load instruction at the address N+3 is replaced with a NOP instruction to branch the program to an address M as shown in Fig. 3(b), a load instruction at the address M is executed in a M.C. T+6 to made the value of the address TS(0) "0". After the completion of the operation following the decision A 0 ≠ B 0 , an unconditional branch instruction stored at an address M+1 is executed. Accordingly, the PC 61 provides an instruction address N+4 in a M.C. T+7, which is delayed by three machine cycles from the machine cycle where the instruction address N+4 is provided when A 0 = B 0 . Thus, to set the result of comparison of the data A 0 and B 0 in the address TS(C) seven instruction steps, and four or seven machine cycles are necessary. After all, twenty-one (21 = 7 x 3) instruction steps and twelve machine cycles at the minimum and twenty-one machine cycles at the maximum are necessary to complete the process shown in Fig. 2. Since the conventional signal processor of the foregoing signal processing system operates in the foregoing mode and the information can be stored only in the data memory, a comparison instruction or the like must be executed and instruction words for two kinds of processes must be produced according to the status of a flag by using a conditional branch instruction in executing the process as shown in Fig. 2, namely, a conditional instruction process for a conditional test instruction to obtain information only as to whether or not the result of operation meets a predetermined condition, and hence the number of instruction steps is increased, execution time varies greatly depending on the result of decision and the processing efficiency is deteriorated. Another mode of operation of the conventional processor shown in Fig. 1 will be described hereinafter. Generally, a signal processor has a pipeline construction to improve the processing speed. This processor has a three-stage pipeline construction. An ordinary processor decodes and executes an instruction word, and then decodes and executes the next instruction word, while the processor of a pipeline system decodes a succeeding instruction word during the execution of the preceding instruction word. Accordingly, the processing speed of the processor of a pipeline system is higher than that of the ordinary processor. However, since advanced decoding is useless in executing instruction words including many jump instructions such as conditional branch instructions, the processing speed is reduced. The pipeline processing mode will be described hereinafter. In the first stage of the pipeline, an instruction word 62A stored at an address specified by an instruction address 70A provided by the PC 61 is read from the instruction memory 62 and then the instruction word 62A is given to the decoder 63. In the second stage of the pipeline, a control signal produced by the decoder 63 by decoding the instruction word 62A is provided on the program bus 64 and a necessary control code is given to the BIR 67 via the program bus 64. In the third stage of the pipeline, the control signal controls operations such as reading data 65A on the data bus 66 from the data memory 65, writing data provided on the data bus 66 in the data memory 65, and processing the data by the EU 68. The EU 68 provides a flag 68B indicating the status of the result 68A of operation after processing the data. Generally, the flag 68B is a sign flag, a zero flag, an overflow flag or a carry flag. The sign flag is a logical value "0" when the result 68A of operation is positive, and is a logical value "1" when the result 68A of operation is negative. The zero flag is a logical value "0" when the result 68A of operation is zero, and is a logical value "1" when the result 68A of operation is not zero. The overflow flag is a logical value "1" when overflow occurs in the result 68A of operation, and is a logical value "0" when overflow does not occur in the result 68A of operation. The carry flag is a logical value "1" when carry or digit borrow occurs in the result 68A, and is a logical value "0" in cases other than carry and digit borrow. The flag 68B is applied to and held by the flag register 69 until a new flag 68B is applied to the flag register 69 after the EU 68 has executed the next operation. Ordinarily, an instruction word following an instruction word which has been executed is stored in an address greater by "1" than the instruction address 70A in which the executed instruction word was stored, when the executed instruction word does not specify a branch operation. Accordingly, in the first stage of the pipeline, the instruction address 70A provided by the PC 61 is incremented by "1" by the adder 70 to make an address 71A greater than the instruction address 70A by "1". If the instruction decoded by the decoder 3 does not specify a branch operation, a control signal is applied to the switching circuit 71 to select the address 71A which is greater than the instruction address 70A by "1", and the logical value of a branch completion signal 72A becomes "0" and the address 71A obtained by adding "1" to the instruction address 70A is given to the PC 61. The operation when the instruction word decoded in the second stage of the pipeline is a conditional branch instruction will be described hereinafter. A conditional branch instruction is an instruction to branch the program to a branched address specified by an instruction when a branch condition specified by an instruction is met and not to branch the program when the branch condition is not met. First a flag 69A held in the flag register 69 is read and is given to the condition decision unit 72 when a conditional branch instruction is decoded. Then, the condition decision unit 72 decides whether or not a branch condition 64A specified by an instruction is met. When the branch condition 64A is met, the logical value of a branch signal 72A becomes "1", the switching circuit 71 selects a branched address 64B specified by an instruction, and then the branched address 64B is given to the PC 61. On the other hand, when the branch condition 64A is not met, the logical value of the branch signal 72A becomes "0". Then, the switching circuit 71 selects an address 71A greater than the instruction address 70A by "1", and then the address 71A is given to the PC 61. Generally, when a processor having a pipeline construction executes a branch operation the operation is delayed by the pipeline. For example, suppose that a conditional branch instruction stored in the instruction memory 62 at an address N in a M.C. T. Then, the PC 61 provides an instruction address N+1 to read an instruction stored at an address N+1 while a decision is being made in a M.C. T+1. When the branch condition 64A is met, an instruction word stored at the address N+1 in the decoder is invalidated and is replaced with a NOP instruction. When the branch condition 64A is not met, the instruction word stored at the address N+1 is decoded and executed. Suppose that the processor executes conditional branch operations, for example, conditional branch operations according to a program having branch conditions A and B of different priority as shown in Fig. 4 and 5, in which a process X is executed when the branch condition A is met, a process Y is executed when the branch condition A is not met and the branch condition B is met, and a process Z is executed when both the branch conditions A and B are not met. A conditional branch instruction A specifying branching the program to an address A for the process X when the branch condition A is met is stored in the address N, a conditional branch instruction B specifying branching the program to an address B for the process Y when the branch condition B is met is stored in the address N+1, and an unconditional branch instruction C specifying branching the program to an address C for the process Z is stored in the address N+2. When the address N is provided by the PC 61 in a M.C. T, the conditional branch instruction A is decoded and executed in a M.C. T+1. When the branch condition A is met, the PC 61 provides the branched address A in a M.C. T+2, and the instruction at the address N+1 in the decoder is replaced with a NOP instruction. When the branch condition A is not met, the PC 61 provides the address N+2 and the conditional branch instruction B is decoded and executed. When the branch condition B is met, the PC 61 provides the branched address B in a M.C. T+3, and the instruction at the address N+2 of the decoder is replaced with a NOP instruction. When the branch condition B is not met, the PC 61 provides the address N+3 and the unconditional branch instruction C is decoded and executed. Such a conditional branch instruction is able to specify merely binary decisions. Therefore, multipoint branch operation requires many machine cycles. According to the signal processing system of the conventional processor, many conditional branch instructions need to be executed to accomplish a multipoint conditional branch process. Thus, the conventional signal processor of a signal processing system has problems that the number of instruction steps is increased the execution time is extended uselessly and the processing speed is reduced. Furthermore, since those problems prevent the effective use of the instruction memory, reduction in the processing efficiency is remarkable particularly in the image signal processing field in which a large quantity of data need to be operated at a high speed and multipoint conditional branch processes need to be executed on the basis of the operation. SUMMARY OF THE INVENTION It is an object of the present invention to provide a digital signal processor of a signal processing system capable of performing a conditional test instruction process or the like in a reduced number of steps and capable of performing a conditional test instruction process in a fixed execution time regardless of the result of the conditional test instruction process. In order to achieve the above object, there is provided, according to a first aspect of the present invention, a method for processing a pipeline signal in a digital signal processor, comprising the steps of: storing a plurality of instruction words specifying various internal operations; storing operands; executing an operation specified by the instruction word to process the operands given thereto, and to provide the result of operation and the status of the result of operation; controlling the operations specified by the instruction words in a pipeline mode, wherein the execution on an instruction indicated by an instruction word comprises an instruction fetch phase, an instruction decode phase and an execution phase, the status of operation from said execution unit being stored after execution of said instruction word; deciding whether or not the flagged status of the result of the execution step meets a predetermined condition code specified by a conditional branch instruction; and selecting a branched instruction addres specified by said conditional branch instruction word in accordance with the result of decision; characterized by the further step of deciding whether or not the status of the result of the execution step meets a predetermined condition code specified by a conditional test instruction during which a result of operation is subjected to a test to decide whether or not the result of operation meets a predetermined condition; and sequentially holding the results of successive decision provided by the decision step. According to a second aspect of the present invention, there is also provided a digital signal processor, comprising: an instruction memory previously storing instruction words specifying various internal operations; a data memory for storing operands; an execution unit connected to a data bus separate from the program bus, for executing an operation specified by the instruction word to process the operands given thereto through the data bus and providing the result of operation and the status of the result of operation; an instruction execution control unit connected to the instruction memory by a program bus and capable of controlling the operations specified by the instruction words in pipeline mode, wherein the execution of an instruction indicated by an instruction word comprises an instruction fetch phase, an instruction decode phase and an execution phase, the status of operation from said execution unit being stored in said data memory after execution of said instruction word; a first conditional decision unit for deciding whether or not the flagged status of the result of the execution unit meets a predetermined condition code specified by a conditional branch instruction; and switching means for selecting a branched instruction address specified by said conditional branch instruction word in accordance with the result of decision; characterized by a second conditional decision unit for deciding whether or not the status of the result of the execution unit meets a predetermined condition code specified by a conditional test instruction during which a result of operation is subjected to a test to decide whether or not the result of operation meets a predetermined condition; and a shift register for sequentially holding the results of successive decision provided by said second conditional decision unit. Further advantageous embodiments of the invention are defined in the dependent claims. BRIEF DESCRIPTION OF THE DRAWINGS Fig. 1 is a block dragram showing the constitution of an example of a conventional digital signal processor; Fig. 2 is a flow chart of assistance in explaining a mode of executing successive decision instructions; Fig. 3 is a time chart of assistance in explaining the respective operations of the components of the digital signal processor of Fig. 1 in performing processes; Fig. 4 is a flow chart of assistance in explaining a conditional multipoint branch process to be performed by a third example of a conventional digital signal processor; Fig. 5 is a time chart cf assistance in explaining the execution of a conditional branch instruction by the conventional digital signal processor of Fig. 4; Fig. 6 is a block diagram of the whole structure of a digital signal processor including an embodiment of the present invention; Fig. 7 is a block diagram of an arithmetic unit incorporated into the digital signal processor of Fig. 6; Fig. 8 is a block diagram of an embodiment of the present invention; Fig. 9 is a flow chart showing steps of operation for executing a conditional test Instruction according to the present invention; Fig. 10 is a time chart of assistance in explaining the respective operations of the components of the digital signal processor of Fig. 8 in executing a conditional test instruction; Fig. 11 is a diagram of assistance in explaining the operation of a test register; Fig. 12 is a diagram of assistance in explaining binary tree search; DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS A preferred embodiment of the present invention will be described hereinafter wIth reference to the accompanying drawings. Referring to Fig. 6 showing a digital signal processor, there are shown an external bus 200 connecting the digital signal processor to an external extension microinstruction memory, an internal writable instruction memory (WCS) 201, a sequence control unit 202 which receives a microinstruction read through the external program bus 200 or from the WCS 201 and performs predetermined control operation in an instruction execution pipeline, an address generating unit 203 which generates 2-input 1-output addresses in parallel for data memories, three internal data buses 204 each having a width of twenty-four bits, for the parallel transfer of the 2-input 1-output data, an external bus 211 connected to an external extension data memory, an external data memory (I/F) 205 for selectively connecting one of the three internal data buses 204 to the external data bus 211, an arithmetic unit 206 which performs predetermined operations, connected to the three internal data buses 204, an internal data memory (M0) 207 having one read port and one read/write port and connected to the internal data buses 204, an internal data memory (M1) 208 similar to the M0 207, connected to the internal data buses 204, a DMA control unit 209 individually provided with an external data memory address generator and an internal data memory address generator, a DMA bus 210 for DMA transfer between the external data bus 211 and M0 207 and M1 208, a reset terminal 212 through which an external reset signal is applied to the sequence control unit 202, and an interrupt terminal 213 to which an external interrupt control signal is applied. Referring to Fig. 7 showing the constitution of the arithmetic unit 206 of Fig. 6, there are shown an X-bus 220 for transferring operand data among the three internal data buses 204, a Y-bus 221 for transferring operand data among the three internal data buses 204, a Z-bus 222 for transferring output data among the three internal data buses 204, a barrel shifter (B-SFT) 223 having a word length of twenty-four bits, for shifting or rotating input data by a predetermined number of bits in one machine cycle, an arithmetic and logic unit (ALU) 224 having a word length of twenty-four bits which performs a predetermined arithmetic and logical operation or absolute difference calculation in one machine cycle, a multiplier (MPY) 225 which performs multiplication of twenty-four bits and provides the result of forty-seven bits of multiplication in one machine cycle, a data pipeline register (DPR0) 226 which holds the output difference of the ALU 224 temporarily and applies the output difference to the square input port of the MPY 225 to calculate a square difference, a multiplexer 227 which selects either the 24-bit output of the B-SFT 223 or the 24-bit output of the ALU 224, and applies the selected output to a data pipeline register (DPR1) 229 for temporarily holding the output of the multiplexer 227, a data pipeline register (DPR2) 228 for temporarily holding the 47-bit output of the MPY 225, a normalizing barrel shifter (N-SFT) 230 which selectively receives either the 24-bit data provided by the DPR1 229 or the 47-bit data provided by the DPR2 228, operates the received data for predetermined digit adjustment in half the machine cycle to provide a 24-bit data, a 24-bit output 231 of the N-SFT 230, a working register (Wr) 235 of 24-bit x 8-word constitution, a 24-bit accumulation output 232 of the Wr 235, an adder (AU) 233 for accumulation and round-off, a 24-bit output 234 of the AU 233, a flag output 236 of the ALU 224, a flag check circuit 237 for the conditional test of the flag output 236, a conditional test shift register (tcsr) 238 of 24 x 1 bits for sequentially storing the 1-bit outputs of the flag check circuit 237, namely, the results of decisions of the flag check circuit 237, and a 1-bit carrier 239 which provides the highest bit shifted out when the N-SFT 230 provides a shift instruction for shifting in the LSB direction, namely, right shift. Referring to Fig. 8 showing a preferred embodiment of the present invention, there are shown a conditional decision unit 313 which decides on instruction whether or not a condition is met, a condition code 328 specified by a conditional test instruction, a result 324 of decision, and a test register 314 which holds the result 324 of decision. Fig. 9 is a flow chart showing steps of operation of the digital signal processor. The operation of the digital signal processor for executing a conditional test instruction will be described hereinafter with reference to Figs. 8 and 9. The conditional test instruction is read from an instruction memory 62, a decoder 63 decodes the conditional test instruction, and an EU 68 performs subtraction for two operands specified by the instruction. These operations are the same as the conventional operations on a comparison instruction. After the subtraction, the EU 68 gives a flag 68B to a condition decision unit 313, where the flag 68B is compared with a condition code 328. When the flag 68B meets the condition code 328, the logical value of the result 324 of decision is "1" and, when not, "0". The result 324 of decision of one bit is stored in a test register 314, i.e., a shift register of n bits. Then, the present content of the test register 314 is shifted by one bit toward the most significant bit (hereinafter abbreviated to "MSB") and the result 314 of decision is placed at the last significant bit (hereinafter abbreviated to "LSB") and the previous content of the MSB is deleted. The operation of the digital signal processor in performing the process of Fig. 2 will be described with reference to Fig. 10. In the process of Fig. 2, a logical value "1" is set when two operands are equal to each other. Therefore, the condition code 328 specified by a conditional test instruction is "zero flag = 0". In the M.C. T+2, the EU 63 performs subtraction to obtain the difference between A 0 and B 0 , and provides a flag 68B. The flag 68B, likewise the flag mentioned in the foregoing description of the conventional digital signal processor, is a sign flag, a zero flag, an overflow flag or a carry flag. The conditional decision unit 313 compares the flag 68B and the condition code 328, i.e., "zero flag = 0", specified by the instruction. When the input zero flag is "0", the test condition is met. Then, logical value of the result 324 of decision is "1" and the LSB of the test register 314 is set for "1". When the input zero flag is "1", the test condition is not met. Consequently, the logical value of the result 324 of decision is "0", and then the LSB of the test register 314 is set for "0". On the other hand, in setting the result of decision in the test register, the content of the test register 314 is shifted by one bit toward the MSB as shown in Fig. 11, and a new result of decision is placed at the LSB. Thus, the result of decision 324 with A 1 and B 1 , and the result of decision 324 with A 2 and B 2 are set in the test register 314 respectively in a M.C. T+3 and a M.C. T+4, and the result of decisions on the three successive conditional test instructions are set in the test register 314 at the end of the M.C. T+4. Thus, this embodiment accomplishes the process in three instruction steps, whereas it has been necessary for the conventional digital signal processor to accomplish the same process in twenty-one instruction steps, the process is performed only in three machine cycles, and the results of decisions need not be held in the data memory, which enables the effective use of the data memory. The operation of the digital signal processor for binary tree search will be described hereinafter. Binary tree search is a retrieval algorithm to retrieve one output data y x most analogous to an input data X, among 2 n output data cf an output data group Y, and to obtain the index code attached to the output data y x . The operation of the digital signal processor for binary tree search will be described with reference to an output data group Y including 2 n output data as shown in Fig. 12 will be described hereinafter. In the first stage, when an input data X is given, the input data X and a data y are compared through subtraction, a branch "0" Is selected when X is smaller than y, and a branch "1" is selected when X is greater than y. In the second stage, the input data X and a data y 0 are compared, a branch "0" is selected when X is smaller than y 0 and a branch "1" is selected when X is greater than y 0 , when the branch "0" is selected in the first stage. The input data X and a data y 1 are compared and the like selection is made when the branch "1" is selected in the first stage. Accordingly, a data y x most approximate to the input data X can be selected from 2 n pieces of data through n times of comparison by comparing data and selecting data along the branches from the first stage to the nth stage. An index code is represented by the history, namely, branch numbers, of selection to obtain the data y x . Operation for binary tree search using a binary tree having 2 3 pieces of data will be described by way of example. First stage: When an input data X is given, X and y are compared and a branch "0" is selected when X is smaller than y. Second stage: The data X and Y 0 are compared and a branch "1" is selected when X is greater than Y 0 . Third stage: The data X and Y 01 are compared and a branch "0" is selected when X is smaller than Y 01 to select Y 010 . Thus, a data most approximate to the input data X is y 010 and the index code is "010". Thus, the digital signal processor executes conditional test instructions specifying the difference between the input data X and the data Y i at each node as a test condition. When a condition code "sign flag = "1" is specified as a condition code, "0" is stored in the test register 314 when a branch "0" is selected, and "1" is stored in the test register 314 when a branch "1" is selected, in accordance with the foregoing rule. Thus, in this embodiment, the content of the test register 314 is an index code, which can easily be generated through the foregoing procedure. As apparent from the foregoing description, the digital signal processor in the embodiment of the present invention has a special register for holding the result of decision as to whether or not a condition code specified by an instruction is met. Therefore, a process to be performed on the basis of a plurality of results of conditional decision can be accomplished at a high processing speed by using a comparatively small number of instruction steps, which improves the processing efficiency of the digital signal processor.

Claims: A method for processing a pipeline signal in a digital signal processor, comprising the steps of: storing a plurality of instruction words (62A) specifying various internal operations; storing operands; executing an operation specified by the instruction word (62A) to process the operands given thereto, and to provide the result (68A) of operation and the status of the result of operation; controlling the operations specified by the instruction words in a pipeline mode, wherein the execution of an instruction indicated by an instruction word comprises an instruction fetch phase, an instruction decode phase and an execution phase, the status of operation from said execution unit (68) being stored after execution of said instruction word; deciding whether or not the flagged status (69A) of the result of the execution step meets a predetermined condition code (64A) specified by a conditional branch instruction; and selecting a branched instruction address (64B) specified by said conditional branch instruction word in accordance with the result (72A) of decision; characterized by the further step of deciding whether or not the status of the result of the execution step meets a predetermined condition code (328) specified by a conditional test instruction during which a result of operation is subjected to a test to decide whether or not the result of operation meets a predetermined condition; and sequentially holding in a shift register the results (324) of successive decision provided by the decision step. The method according to claim 1, wherein, in setting the result (324) of decision in a shift register (314), the content of the shift register (314) is shifted by one bit towards the MSB and a new result (324) of decision is placed at the LSB. The method according to claim 1 or 2, wherein a plurality of the results (324) obtained by executing said operation a plurality of times and held in a shift register (314) in said result holding step are used as a search history code in a tree search. The method according to claim 1 or 2, wherein a plurality of the results (324) obtained by executing said operation a plurality of times and held in a shift register (314) in said result holding step are used for combinational branch operation. A digital signal processor, comprising: an instruction memory (62) previously storing instruction words (62A) specifying various internal operations; a data memory (65) for storing operands; an execution unit (68) connected to a data bus (66) separate from the program bus (64), for executing an operation specified by the instruction word (62A) to process the operands given thereto through the data bus (66) and providing the result (68A) of operation and the status of the result of operation; an instruction execution control unit connected to the instruction memory (62) by a program bus (64) and capable of controlling the operations specified by the instruction words in a pipeline mode, wherein the execution of an instruction indicated by an instruction word (62A) comprises an instruction fetch phase, an instruction decode phase and an execution phase, the status of operation from said execution unit (68) being stored in said data memory (65) after execution of said instruction word; a first conditional decision unit (72) for deciding whether or not the flagged status (69A) of the result of the execution unit (68B) meets a predetermined condition code (64A) specified by a conditional branch instruction; and switching means (71) for selecting a branched instruction address (64B) specified by said conditional branch instruction word in accordance with the result (72A) of decision; characterized by a second conditional decision unit (313) for deciding whether or not the status of the result (68A) of the execution unit (68) meets a predetermined condition code (328) specified by a conditional test instruction during which a result of operation is subjected to a test to decide whether or not the result of operation meets a predetermined condition; and a shift register (314) for sequentially holding the results (324) of successive decision provided by said second conditional decision unit (313). The digital signal processor according to claim 5, wherein the shift register (314) is adapted such that, in setting the result (324) of decision in the shift register (314), the content of the shift register (314) is shifted by one bit towards the MSB and a new result (324) of decision is placed at the LSB. The digital signal processor according to claim 5 or 6, wherein said shift register (314) is connected to said data bus (66), and a plurality of test results (324) obtained through a plurality of repetitions of said conditional test instruction and stored in said shift register (314) are used as search history code for tree search. The digital signal processor according to claim 5 or 6, wherein said shift register (314) is connected to said program bus (64), and the plurality of test results (324) obtained through a plurality of times of repetitions of said conditional test instruction and stored in said shift register (314) are used for combinational branch operation.

Inventors: KAMEYAMA MASATOSHI, KAMIZAWA KOH, KATOH YOSHIAKI, KINJO NAOTO, MURAKAMI TOKUMICHI, OHIRA HIDEO, KAMEYAMA, MASATOSHI, KAMIZAWA, KOH, KATOH, YOSHIAKI, KINJO, NAOTO, MURAKAMI, TOKUMICHI, OHIRA, HIDEO, KAMEYAMA, MASATOSHI, C/O MITSUBISHI DENKI K.K., KAMIZAWA, KOH, C/O MITSUBISHI DENKI K.K., Katoh, Yoshiaki, c/o MITSUBISHI DENKI K.K., KINJO, NAOTO, C/O MITSUBISHI DENKI K.K., MURAKAMI, TOKUMICHI, C/O MITSUBISHI DENKI K.K., OHIRA, HIDEO, C/O MITSUBISHI DENKI K.K.
Applicants: MITSUBISHI ELECTRIC CORP, MITSUBISHI DENKI KABUSHIKI KAISHA
Application year: 1988
Main classification: G06F9
IPC codes: G06F9, G06F13, G06F15