Abstract:
An improved apparatus for processing a repeatedly performed arithmetic operation for a digital signal processor and a method thereof which are capable of pushing and popping values related to a repeat block to a register having a stack structure by providing a stack structure for processing a repeat block, this enabling a nested loop. The apparatus includes a register stack unit including a PASR register stack for pushing or popping a value to the PASR register, a PAER register stack for pushing or popping a value to the PAER register, and a BRCR register stack for pushing or popping a value to the BRCR register stack, a first comparison unit for judging whether a currently performed step is the end of the repeat block, and decreasing the value stored in the BRCR register by &#34;1&#34; when a desired condition is satisfied as a result of the judgement, otherwise, increasing the address value stored in the program counter by &#34;1&#34;, and a second comparison unit for judging whether an externally inputted instruction corresponds to a state of the repeat block, outputting a control code based on the judged result to three stacks, respectively, and outputting the control code to the multiplexer in accordance with a control code from the first comparison unit, wherein said first comparison unit is enabled by receiving an externally inputted instruction through the second comparison unit.

Description:
BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     The present invention relates to an apparatus for processing a repeatedly performed arithmetic operation for digital signal processor (DSP) and a method thereof, and in particular to an improved apparatus for processing a repeatedly performed arithmetic operation for digital signal processor and a method thereof which are capable of significantly reducing a processing time of digital signal processor and effectively operating the digital signal processing by providing a plurality of registers each having a stack structure for storing values corresponding to a repeat block and pushing and popping the values stored in each register in order to process a repeat block which occurs during an arithmetic operation when repeatedly processing an arithmetic operation in the digital signal processor. 
     2. Description of the Conventional Art 
     Generally, the digital signal processor (DSP) is applicably used for a video, sound, speech signal processing apparatus for processing the signals in real time. In the digital signal processor (DSP), a processing speed thereof is considered as one of the most important factors in determining the performance of the DSP. 
     The programmer codes an algorithm used for an application with repect to a video, sound, speech, etc. into an assembly language which is provided by a corresponding DSP and an application is implemented by performing the coded language with respect to a corresponding DSP. 
     In the algorithm based on the assembly language, many arithmetic operations are repeatedly performed. Such repeatedly performed arithmetic operations are generally processed by one instruction. 
     There is one method which is recited herein as a conventional art which is disclosed in &#34;a user&#39;s guide of TMX320C2x series and TMX320C5x series&#34; published by TEXAS INSTRUMENT CO. According to the above-described article, the TEXAS INSTRUMENT CO. uses a TMX320C2x series and TMX320C5x series as a digital signal processor (DSP). 
     The block having a repeatedly performed arithmetic operation is called a repeat block. In the DSP of the TI Co., it is impossible to concurrently implement multiple repeat blocks. Therefore, if a programmer wishes to use multiple repeat blocks, the following technique is needed. 
     When there are provided a plurality of repeat blocks, in order to process an internal repeat block contained in an external repeat block, one instruction and three memory mapped registers should be used. A programmer loads the values which are inputted into and outputted from the registers to a predetermined load portion before the repeat block is performed. When the last instruction is performed, the programmer reads a corresponding value from the load portion and then corrects a corresponding register. 
     Here, a PASR register indicating a start address of a repeat block, a PAER register indicating an end address of a repeat block, and a BRCR register indicating the number of repeats are used. In addition, &#34;RPTB&#34; instruction is used as a block repeat instruction. The RPTB instruction is programmed such that a corresponding value is loaded to the PASR and PAER registers, and the BRCR register receives a corresponding value before the RPTB instruction is started. 
     FIG. 1 illustrates a program of a conventional method for processing an arithmetic operation which is repeatedly performed in the DSP. This method is used by TEXAS INSTRUMENT CO. There are provided two repeat blocks which are an internal repeat block and an external repeat block. 
     The SPLK, SMMR and LMMR are instructions for storing or loading a predetermined value, and RPTB is a block repeat instruction for repeatedly performing several instructions. LAC is an instruction for loading a corresponding value to an accumulator (not shown), SUB is an instruction for decreasing the value loaded into the accumulator by &#34;1&#34;, and BC is a conditional branch. 
     In addition, BRCR, PASR and PAER are memory mapped registers. Among these registers, BRCR register stores the number of repeats therein, PASR register stores a start address of a block therein, and PAER register stores an end address of a block therein. TEMP1, TEMP2 and TEMP3 are temporary registers. 
     The operation of the conventional apparatus will now be explained with reference to FIGS. 1 and 2. 
     At the 0th address, NUM1 which is the number of repeats of an external repeat block is stored into the BRCR register. At the 1st address, an end address END --  BLOCK1 of the external repeat block is stored into the PAER register. At the 2nd address, the start address STARTBLK of the external repeat block is stored into the PASR register. 
     At each of the 4th through 9th addresses, a predetermined instruction (not shown) is performed. 
     Next, at the 15th through 20th addresses, the internal repeat blocks are performed. Since the BRCR, PASR and PAER registers are continuously used in the internal repeat block, the values stored into the BRCR, PASR and PAER registers at the 10th through 12nd addresses are stored into the temporary registers TEMP1, TEMP2 and TEMP3, respectively. 
     Next, the arithmetic operation of the internal repeat block is performed. 
     At the 15th address, NUM2 is the number of repeats of the internal repeat block. Here, NUM2 is stored into the BRCR register. By the RPTB instruction which is performed at the 16th address, the start address of th internal repeat block is stored into the PASR register, and the end address END --  BLOCK2 of the repeat block is stored into the PAER register. 
     At the 17th through 19th addresses, when the internal repeat block is performed once, NUM2 is reduced by &#34;1&#34;, and the internal repeat block is repeatedly performed until NUM2 becomes 0(zero). 
     When NUM2 becomes 0 and then the arithmetic operation is finished in the internal repeat block, at the 21st and 23rd addresses, the values loaded in the temporary registers TEMP1, TEMP2 and TEMP3 are again stored into the registers BRCR, PASR, and PAER, respectively. 
     At the 24th through 29th addresses, a predetermined instruction is performed, and at the 30th address, the value stored into the BRCR register is loaded into the accumulator. At the 31st address, the value loaded into the accumulator is decreased by &#34;1&#34;. 
     At the 32nd address, the value loaded into the accumulator is judged to be a non-equal zero. As a result of the judgement, if the condition is satisfied, the address is jumped to the address of STARTBLK. Otherwise, the external block, namely, the entire program is terminated. 
     FIG. 2 illustrates a DSP hardware apparatus which is implemented based on the program of FIG. 1. In the drawings, reference numeral 1 denotes a BRAF register which indicates a start of a repeat block, 2 denotes a PASR register which loads the start address of the repeat block, 3 denotes a PAER register which loads the end address of the repeat block, 4 denotes a BRCR register which loads the number of repeats of the repeat block, 5 denotes a program counter (PC), 6 denotes a comparison unit, and 7 denotes a multiplexer which determines the value of the program counter 5 and the next value of the program counter 5 based on the value loaded into the PASR register 2, respectively. 
     The operation of the internal repeat block of FIG. 1 will now be explained. 
     When a control code ss which indicates a start of the system is inputted from the BRAF register 1, an address corresponding to the instruction which is currently performed is inputted from the comparison unit 6 to the program counter 5, and the value END --  BLOCK is inputted from the PAER register 3. 
     The comparison unit 6 reduces the value stored in the BRCR register 4 by 1. If the thusly reduced value is not &#34;0&#34;, the values are compared whether the value inputted from the program counter 5 is identical with the value END --  BLOCK1, and then the control code cs concerning thereto is outputted to the multiplexer 7. The multiplexer 7 receives the value of STARTBLK from the PASR register 2 and the output value from the program counter 5. The multiplexer 7 selects one value between two values and outputs to the program counter 5. 
     The above-described routine is repeatedly performed until the value stored in the BRCR register 4 becomes &#34;0&#34;. 
     In the conventional method of processing an arithmetic operation which is repeatedly performed in the DSP, when the internal repeat blocks and the external repeat blocks are concurrently used, an additional process is needed for processing an arithmetic operation with respect to multiple repeat blocks. 
     In order to process an arithmetic operation with respect to the multiple repeat blocks, three temporary registers are additionally used. Therefore, the instructions SMMR and LMMR which are related to the temporary registers should be processed. In addition, the LAC, SUB and conditional branch which are instructions for repeatedly performing the external repeat block should be used. 
     In addition, since a nested loop is used in a computer program language such as C, Pascal, etc., an additional process for processing an arithmetic operation with respect to the multiple repeat blocks is not needed. However, in the above-described technique, since the nested loop can not be used, the time required to process the instructions related to the multiple repeat blocks is overloaded. 
     Furthermore, as the number of repeats of the repeat block is increased, the time overload is more increased. Therefore, the processing performance of the DSP is decreased. 
     SUMMARY OF THE INVENTION 
     Accordingly, it is an object of the present invention to provide an apparatus for processing a repeatedly performed arithmetic operation for a digital signal processor and a method thereof which overcome the aforementioned problem encountered in the conventional art. 
     It is another object of the present invention to provide an improved apparatus for processing a repeatedly performed arithmetic operation for a digital signal processor and a method thereof which are capable of pushing and popping values related to a repeat block to a register having a stack structure by providing a stack structure for processing a repeat block, this enabling a nested loop. 
     To achieve the above objects, there is provided an apparatus for processing a repeatedly performed arithmetic operation for a digital signal processor (DSP) which includes a register stack unit including a PASR register stack for pushing or popping a value to the PASR register, a PAER register stack for pushing or popping a value to the PAER register, and a BRCR register stack for pushing or popping a value to the BRCR register stack, a first comparison unit for judging whether a currently performed step is the end of the repeat block, and decreasing the value stored in the BRCR register by &#34;1&#34; when a desired condition is satisfied as a result of the judgement, otherwise, increasing the address value stored in the program counter by &#34;1&#34;, and a second comparison unit for judging whether an externally inputted instruction corresponds to a state of the repeat block, outputting a control code based on the judged result to three stacks, respectively, and outputting the control code to the multiplexer in accordance with a control code from the first comparison unit, wherein said first comparison unit is enabled by receiving an externally inputted instruction through the second comparison unit. 
     To achieve the above objects, there is provided a method for performing a repeatedly performed arithmetic operation for a digital signal processor which includes the steps of a first step for pushing a start address value of the pre-set repeat block to a PASR register stack when an externally inputted instruction corresponds to a state of a predetermined repeat block, pushing an end address value of the repeat block to the PAER register, and pushing the number of repeats of the pre-set repeat block to the BRCR register stack, and a second step for popping values stored in the PASR register stack, the PAER register stack, and the BRCR register stack, respectively, when the currently performed repeat block is judged to performed the number of repeats stored in the BRCR register, otherwise, repeating the repeat block, wherein said first and second steps each include a substep for increasing an address by increasing a value of the program counter by &#34;1&#34;. 
     Additional advantages, objects and features of the invention will become more apparent from the description which follows. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     The present invention will become more fully understood from the detailed description given hereinbelow and the accompanying drawings which are given by way of illustration only, and thus are not limitative of the present invention, and wherein: 
     FIG. 1 is a diagram illustrating a program of a conventional method for processing an arithmetic operation which is repeatedly performed in a digital signal processor; 
     FIG. 2 is a block diagram illustrating a digital signal processor (DSP) hardware which is implemented by a program of FIG. 1; 
     FIG. 3 is a diagram illustrating a program of a method for processing an arithmetic operation which is repeatedly performed in a digital signal processor according to the present invention; 
     FIG. 4 is a diagram illustrating the structure of a stack of each register based on the program shown in FIG. 3 according to the present invention; 
     FIG. 5 is a block diagram illustrating an apparatus for processing an arithmetic operation which is repeatedly performed in a digital signal processor (DSP) according to the present invention; 
     FIG. 6 is a detailed diagram illustrating the apparatus of FIG. 4 according to the present invention; and 
     FIG. 7 is a flow chart of an operation of FIG. 3 according to the present invention. 
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
     FIG. 3 illustrates a program of a method for processing an arithmetic operation which is repeatedly performed in a digital signal processor according to the present invention. As shown therein, an internal repeat block is defined from the 5th address to th 10th address, SPLK is an instruction for loading a predetermined value, RPTB is a block repeat instruction for repeatedly performing several instructions, NUM1 is the number of repeats of an external repeat block, NUM2 is the number of repeats of the internal repeat block, END --  BLOCK1 is an end address of the external repeat block, and END --  BLOCK2 is an end address of the internal repeat block. 
     The operation of the program will now be explained with reference to FIG. 4 which illustrates the structure of a stack of each register. 
     At the 0th address, NUM1 is pushed to the BRCR register stack. At the 1st address, the RPTB instruction is performed. Therefore, the start address of the external repeat block is pushed to the PASR register stack, and the end address END --  BLOCK1 of the external repeat block is pushed to the PASR register stack. At this time, as shown in FIG. 4, &#34;2&#34; is pushed to the PASR register stack, and &#34;15&#34; is pushed to the PAER register stack, and NUM1 is pushed to the top of the BRCR register stack. 
     At each of the 2nd through 4th addresses, a predetermined instruction (not shown) is performed. 
     At the 5th address, NUM2 is pushed to the BRCR register stack, and at the 6th address, the start address of the internal repeat block is pushed to the PASR register stack, and the end address END --  BLOCK2 of the internal repeat block is pushed to the PAER register. At this time, &#34;7&#34; is pushed to the PASR register stack, &#34;10&#34; is pushed to the top of the PAER register stack, and NUM2 is pushed to the top of the BRCR register stack. 
     At each of the 7th through 9th address, a predetermined instruction (not shown) is performed. When the internal repeat block is performed once, NUM2 is reduced by &#34;1&#34;, and the internal repeat block is repeatedly performed until NUM2 becomes &#34;0&#34;. 
     When NUM2 becomes &#34;0&#34; and the arithmetic operation is finished in the internal repeat block, the values of the top stored in each register stack are popped, and at the 11st address, the values stored in each register are shown in FIG. 4. 
     At the 11st through 14th addresses, a predetermined instruction (not shown) is performed. Thereafter, the external repeat block is performed. When the external repeat block is performed once, the value of NUM2 stored in the BRCR register is reduced by &#34;1&#34;, and at the 15th address, the value is jumped to the address of END --  BLOCK1. 
     The above-described arithmetic operation is repeatedly performed until the value of NUM1 stored in the BRCR register becomes &#34;0&#34;. When the value of NUM1 becomes &#34;0&#34;, the external repeat block, namely, the entire program is finished. 
     FIG. 5 illustrates an apparatus for processing an arithmetic operation which is repeatedly performed in a digital signal processor (DSP) according to the present invention. As shown therein, identically to FIG. 2, reference numeral 1 denotes a BRAF register, 2 denotes a PASR register, 3 denotes a PAER register, 4 denotes a BRCR register, 5 denotes a program counter 5, and 7 denotes a multiplexer. 
     In addition, reference numeral 20 denotes a PASR stack for pushing or popping a predetermined value to the PASR register 2, 30 denotes a PAER stack for pushing or popping a predetermined value to the PAER register 3, and 40 denotes a BRCR stack for pushing or popping a predetermined value to the BRCR register 4. 
     The first comparison unit 6 compares the address value stored in the program counter 5 with the address value stored in the PAER register 3, and outputs a control code so that in accordance with the resultant value of the comparison, the value stored in the BRCR register 4 is reduced by &#34;1&#34;, and the value stored in the program counter 5 is increased by &#34;1&#34;. 
     The second comparison unit 60 receives an instruction and outputs a control code for determining a pushing and popping operation of the stacks and outputs two control codes cs1 and cs2 to the multiplexer 7 in accordance with the control code from the first comparison unit 6. Here, the control code cs1 is a control code which passes through the value stored in the PASR register 2, and the control code cs2 is a control code which passes through the value of the program counter 5 which value is increased by &#34;1&#34;. 
     FIG. 6 illustrates the apparatus of FIG. 4 according to the present invention. As shown therein, the first comparison unit 6 includes a first comparator 61 for comparing an address value stored in the program counter 5 with an address value stored in the PAER register 3, outputting a code T61 when two address values are identical as a result of the comparison, and outputting a code F61 when the same are not identical, and a first subtracter 62 for reducing the address value stored in the BRCR register 4 by &#34;1&#34; in accordance with the code T61 and outputting the reduced value to the second comparison unit 60. 
     The second comparison unit 60 includes a SPLK instruction recognizer 600 for outputting a code T600 when the instruction inputted is a SPLK instruction for loading the number of repeats of the repeat block, otherwise, outputting a code F600, a BRCR stack PUSH instruction unit 609 for receiving the code T600 and generating a control code c609 by which the BRCR stack 40 performs a pushing operation, an RPTB instruction recognizer 601 for receiving the code F600, and outputting a code T601 when the instruction inputted is a RPTB instruction which indicates the repeat block, otherwise, outputting a code F601, a stack push unit 602 for receiving the code T601 and generating a control code C602 by which the PAER stack 30 performs a pushing operation and the value of the BRAF register is increased by &#34;1&#34;, a second comparator 603 for receiving the code F601 judged whether the value loaded in the BRAF register 1 is &#34;0&#34;, outputting a code F603 to the first comparator 61 of the first comparison unit 6 when the value is not &#34;0&#34;, and outputting a code T603 when the value is &#34;0&#34;, a third comparator 605 for judging whether the output value from the first subtracter 62 of the first comparison unit 6 is &#34;0&#34;, outputting a code T605 when the output value is &#34;0&#34; as a result of the judgement, and outputting a code F605 when the output value is not &#34;0&#34; as a result of the judgement, a controller 606 for receiving the code F605 and outputting the control code cs1 to the multiplexer 7 so that the value from the program counter 5 is substituted with the value stored in the PASR register 2, a stack pop instruction unit 607 for receiving the code T605 and generating a control code by which the PASR stack 20, the PAER stack 30, the BRCR stack 40 perform the popping operation, a second adder 608 for receiving the code c602, increasing the value stored in the BRAF register 1 by &#34;1&#34;, receiving the code T605, and decreasing the value stored in the BRAF register 1 by &#34;1&#34;, and a first multiplexer controller 604 for receiving the codes c609, c602, T603, F61 and T605 and outputting the control code to the multiplexer 7 in order to increase the value of the program counter by &#34;1&#34;. 
     FIG. 7 is a flow chart of an operation of FIG. 3 according to the present invention. 
     The operation of the apparatus for processing an arithmetic operation which is repeatedly performed in the DSP according to the present invention with reference to the accompanying drawings. 
     When the program is activated, the BRAF register 1 and the program counter 5 are set to &#34;0&#34;. 
     At the 0th address, an SPLK instruction is inputted into the SPLK instruction recognizer of the second comparison unit 60. The SPLK instruction recognizer 600 outputs the code T602, and the BRCR stack PUSH unit 609 outputs a control code c609 to the BRCR stack 40 in accordance with the control code T602. The BRCR stack 40 pushes &#34;NUM1&#34; which indicates the number of repeats of the external repeat block to the BRCR register 4. On addition, the first multiplexer controller 604 outputs a control code CS2 in accordance with the control code c609, and the multiplexer 7 inputs the value which is increased by the program counter by &#34;1&#34; to the program counter 5. Therefore, &#34;1&#34; is currently stored in the program counter 5 in Steps S0, S1 and S2 shown in FIG. 7. 
     Whenever the instructions are performed one by one, the values stored in the program counter 5 is increased by &#34;1&#34;. In Step S2, the address is increased by &#34;1&#34;. When the external or internal repeat block is repeated, the second multiplexer controller 606 outputs a control code CS1. This operation will be described later when describing the 10th and 15th addresses. 
     At the 1st address, when the RPTB instruction is inputted, the SPLK instruction recognizer 600 outputs a control code F600, and the RPTB instruction recognizer 601 outputs a control code T601. The stack push unit 602 outputs a control code C602 in accordance with the control code T601, and the PASR stack 20 pushes &#34;2&#34; which is a start address of the external repeat block to the PASR register 2, and the PAER stack 30 pushes the END --  BLOCK1 &#34;15&#34; which is an end address of the external repeat block to the PAER register 3. In addition, the second adder 608 is driven in accordance with the control code C602, and the value stored in the BRAF register 1 is increased by &#34;1&#34; in Steps S0, s3, S4 and S2. 
     As shown in FIG. 4, &#34;2&#34; is pushed into the PASR register, &#34;15&#34; is pushed into the PAER register, and &#34;NUM1&#34; is pushed into the BRCR register. 
     When a predetermined instruction is inputted from the 2nd address, since the instruction is not RPTB, the RPTB instruction recognizer 601 outputs a control code F601, and the second comparator 603 is enabled by the control code F601, and checks whether the value loaded into the BRAF register 1 is &#34;0&#34;. At this time, since &#34;1&#34; is loaded into the BRAF register 1, the second comparator 603 outputs a code F603. The first comparator 61 of the first comparison unit 6 receives the code F603 and compares the thusly received code with the values stored in the program counter 5 and the PAER register 3. As a result of the comparison, when the two values are not identical, the first comparator 61 outputs a code F61. The value of the program counter 5 is increased by the first multiplexer 604 by &#34;1&#34; in Steps S0, S3, S5, S6 and S2. 
     At the 3rd and 4th addresses, the routine performed at the 2nd address is performed in steps S0, S3, S5, S6 and S2. 
     When an SPLK instruction is inputted from the 5th address, the arithmetic operation is performed identically at the time when the SPLK instruction is inputted from the 0th address. The BRCR stack 40 pushes &#34;NUM2&#34;, which indicates the number of repeats of the internal repeat block, to the BRCR register 4 in accordance with the control code c609 from the BRCR register stack 40 in Steps S0, S1, and S2 shown in FIG. 7. 
     At the 6th address, when an RPTB instruction is inputted, the arithmetic operation is performed identically at the time when the RPTB instruction is inputted from the 1st address. The value &#34;7&#34; is a start address of the internal repeat block that is pushed into the PASR register 2, and END --  BLOCK2 &#34;10&#34; which is an end address of the internal repeat block is pushed into the PAER register 3. In addition, the second adder 608 is activated in accordance with the control code C602, and the value of &#34;1&#34; stored in the BRAF register 1 is increased by &#34;1&#34; in Steps S0, S3, S4 and S2. 
     As shown in FIG. 4, &#34;7&#34; is pushed into the PASR register, &#34;10&#34; is pushed into the PAER register, and &#34;NUM2&#34; is pushed into the BRCR register. 
     At the 7th address, when a predetermined instruction is inputted, the arithmetic operation is performed identically at the time when a predetermined instruction is inputted from the 2nd address. At this time, since &#34;2&#34; is loaded into the BRAF register 1, the second comparator 603 outputs a code F603, and the first comparator 61 compares the values compared in the program counter 5 and the PAER register 3. As a result of the comparison, if two values are not identical, the second comparator 603 outputs a code F61 in Steps S0, S3, S5, S6 and S2. 
     At the 8th and 9th addresses, the arithmetic operation is performed identically to the 7th address. 
     At the 10th address, since the value stored in the PAER register 3 and the value counted by the program counter 5 are identically &#34;10&#34;, the first comparator 61 outputs a code T61, and the first subtracter 62 subtracts &#34;1&#34; from the value of &#34;NUM2&#34; stored in the BRCR register 4. The third comparator 605 checks whether the value of &#34;NUM2-1&#34; is &#34;0&#34; as a result of the subtraction. If the value is not &#34;0&#34;, the third comparator 605 outputs the code F605 to the second multiplexer controller 606. The second multiplexer controller 606 outputs a control code CS1 such that the multiplexer 7 outputs the value of &#34;7&#34; stored in the PASR register 2 to the program counter 5. The above-described operation denotes that the internal repeat block is repeated again in Steps S0, S3, S5, S6, S7, S8 and S10. 
     When the internal repeat block is repeatedly performed as many as the number of &#34;NUM2&#34; stored in the BRCR register, at the 10th address, since the value of &#34;NUM2-1&#34; inputted into the third comparator 605 becomes &#34;0&#34;, the third comparator 605 outputs a code T605, and the stack POP instruction unit 607 outputs a control code C607. The BRCR stack 40 pops the value of &#34;NUM2&#34; stored in the BRCR register 4 in accordance with the control code C607, and the PASR stack 20 pops &#34;7&#34; stored in the PASR register 2, and the PAER stack 30 pops &#34;10&#34; stored in the PAER register 3 in Steps S0, S3, S5, S6, S7, S8, S9 and S2. 
     As shown in FIG. 4, at this time, &#34;2&#34; is stored in the PASR register, &#34;15&#34; is stored in the PAER register, and &#34;NUM1&#34; is stored in the BRCR register. 
     At the 11st address, the arithmetic operation is performed identically to the second address. 
     At the 15th address, since the value of &#34;END --  BLOCK1&#34; stored in the PAER register 3 and the value counted by the program counter 5 are &#34;15&#34;, the first comparator 61 outputs a code T61, and the first subtracter 62 subtracts &#34;1&#34; from the value of &#34;NUM1&#34; stored in the BRCR register 4. The third comparator 605 checks whether the value of &#34;NUM1-1&#34; is &#34;0&#34;. As a result of the subtraction, if the value is not &#34;0&#34;, the third comparator 605 outputs the code F605 to the second multiplexer controller 606. Therefore, the value of &#34;2&#34; stored in the PASR register 2 is stored into the program counter 5. 
     When the external repeat block including the internal repeat block is performed as many as the number of &#34;NUM1&#34;, at the 15th address, since the value of &#34;NUM1-1&#34; inputted into the third comparator 605 is &#34;0&#34;, the third comparator 605 outputs a code T605, and the stack POP instruction unit 607 outputs a control code C607. Therefore, the BRCR stack 40 pops the value of &#34;NUM1&#34; stored in the BRCR register 4 in accordance with the control code C607, and the PASR stack 20 pops &#34;2&#34; stored in the PASR register 2, and the PAER stack 30 pops &#34;15&#34; stored in the PAER register 3. 
     Therefore, the operation with respect to the entire repeat block is finished. 
     As described above, in the present invention, since the stack structure is used, the number of repeat blocks is determined based on the size of the stack. Therefore, it is possible to add a predetermined number of repeat blocks by simply changing the size of the stack without using an instruction for processing an arithmetic operation with respect to the multiple repeat blocks. 
     In addition, compared to the conventional apparatus in which the SMMR and LMMR instructions related with the temporary register must be processed, and the LAC and SUB and conditional branch which is an instruction for repeatedly performing the external block must be used, in the present invention, since such instruction is not used, the time required for performing such instructions is decreased. 
     Therefore, it is possible to more easily program. In addition, since the instruction is not performed, the program execution time is decreased, and the processing speed of the DSP is enhanced. 
     Although the preferred embodiment of the present invention has been disclosed for illustrative purposes, those skilled in the art will appreciate that various modifications, additions and substitutions are possible, without departing from the scope and spirit of the invention as recited in the accompanying claims.