1. Field of the Invention
The present invention relates to a data processing method in digital communications or digital signal processing, and more particularly, it relates to a data rearrangement method.
This application is counterpart of Japanese patent application, Serial Number 318493/2003, filed Sep. 10, 2003, the subject matter of which is incorporated herein by reference.
2. Description of the Relater Art
An interleaving process is carried out in a field of digital communications or digital signal processing. The interleaving process performs operations such as reading, writing, and transmission/reception by rearranging data divided into a plurality of groups in accordance with a specific rule.
For example, in the interleaving process at a digital signal processor (processor for processing digital signals, referred to as “DSP” hereinafter), an order of data to be processed by the DSP may be different from that of data written in a memory. Rearrangement of data used by the DSP in a processing order requires much processing time and a large memory capacity.
Among conventional methods for rearranging data, there is a method which uses an address conversion table. To simplify explanation, one-dimensional rearrangement will be described here.
As shown in
In
If the operations of S3 to S5 are repeated five times, the data stored in the addresses (0x0000) to (0x0004) before rearrangement are rearranged in accordance with the address conversion table from (0x2000) to (0x2004), and these data are stored in addresses (0x1000) to (0x1004) (
Patent Document 1: Japanese Patent Application Laid-Open No. 2001-196940
Such a conventional rearrangement method has problems that much processing is necessary and a large memory capacity is necessary.
The present invention has been made in view of the foregoing problems of the conventional data rearrangement method, and an object of the invention is to provide an efficient data rearrangement method which can reduce the number of processing operations (the number of commands) to shorten processing time, and which can be realized by a small memory capacity.
In order to achieve the object, a data rearrangement method of the present invention comprises: a) a step of storing data in a first data storage section; b) a step of storing data rearrangement information in a stack; and c) a step of reading the data stored in the first data storage section, and storing the data in a second data storage section based on the data rearrangement information stored in the stack.
According to such a method, it is possible to realize efficient data rearrangement by reducing the number of processing operations to shorten processing time and by a small memory capacity. Moreover, rearrangement can be carried out by optional rules.
The data rearrangement information may contain an address of the second data storage section. The first data storage section may be a register, and the second data storage section may be a random access memory. Results of rearrangement may be sequentially stored in a memory, or results of arithmetic operations by a DSP.
The reading and the storing may be carried out by using an address conversion table and a corresponding stack pointer. A plurality of address conversion tables and a plurality of corresponding stack pointers may be used. By subjecting storage of results of the reading, rearrangement or arithmetic operations to pipeline processing, a processing speed can be further increased.
Further inclusion of a step of calculating OR or ADD of a read address and an offset register enables rearrangement of a plurality of data rows. Especially, use of an OR operation is effective for reducing address space to be used, and use of an ADD operation is effective for meticulously using the address space.
Furthermore, a rearrangement only register can be used in place of the stack pointer. The use of the rearrangement only register enables updating of an optional pointer, and thus it is possible to carry out more efficient data rearrangement.
Next, detailed description will be made of the preferred embodiments of data rearrangement methods of the present invention with reference to the accompanying drawings. In the specification and the drawings, components having substantially similar functions will be denoted by similar reference numerals, and repeated explanation will be omitted.
(First Embodiment)
A data rearrangement method of the first embodiment includes a step of storing a specific rule in an address conversion table, and a step of sequentially reading addresses to store data for an arithmetic operation from the address conversion table by using a stack pointer. One-dimensional rearrangement will be described here in order to simplify explanation, but the invention is not limited to this rearrangement.
In
In the case of carrying out a sequential arithmetic operation by a DSP, the stack is popped up to refer to an address (0x1003) stored in an address (0x8004) indicated by the stack pointer, and data is read to be stored in the address (0x1003) of the memory 10. After completion of the data arithmetic operation by the DSP, since a stack pointer 30 has been decremented by popping-up, an address (0x8003) is indicated this time, and reference is made to an address (0x1001) to be stored here. Similarly thereafter, reference is made to the address conversion table (
First, in S10, the DSP starts an arithmetic operation, and its result is stored in the a0 register (S10). Then, in S11, the stack is popped up, and an address (0x1003) to be stored in an address (0x8004) of the address conversion table indicated by the stack pointer is set to the r0 register (S11). Then, in S12, the result of the arithmetic operation stored in the a0 register is stored in the address (0x1003) stored in the r0 register (S12). Then, in S13, determination is made as so removal of the r0 register from an address conversion table area (S13). If a result of the determination shows the removal from the area, the stack pointer is returned to an initial area. If no removal is determined, the process proceeds to a next arithmetic operation (
After the movement of the stack pointer from the address (0x8004) to an address (0x8000), an arithmetic operation is executed in an order pushed down beforehand in the stack.
As described above, by using the stack pointer, data can be written in a predetermined address by a small number of processing operations. Additionally, since optional rearrangement information can be written in the stack, optional rearrangement can be dealt with. These operations are difficult if a process is carried out only by hardware.
The storage (writing) of data has been described. However, data reading can also be realized by a similar method. In this case, the program example of
In the program example of
In the program example of
In the case of rearrangement during data reading shown in
The first embodiment has been described by way of case in which there is only one stack area. However, in the case of using a plurality of bits of rearrangement information, a plurality of stack pointers may be prepared to process a plurality of stacks. In such a case, pluralities of push commands for operating the stacks, pop commands, and mov commands to the stack pointers for “INITIALIZE STACK POINTER” are prepared.
(Second Embodiment)
A data rearrangement method of a second embodiment further comprises, in addition to those of the method of the first embodiment, a step of calculating OR or ADD of a read address and an offset register.
The offset address is disposed, a low-order bit of a rearrangement address is stored in a stack, and OR or ADD of a read address and the offset register is calculated to generate a rearrangement address. Accordingly, a plurality of data rows can be rearranged.
In this case, the “OR” calculation means an “or” calculation for each bit, and the “ADD” calculation means an addition” calculation. Selection of “OR” or “ADD” may be optionally controlled by disposing e.g., a control register.
According to the second embodiment, rearrangement of a plurality of data rows is enabled in addition to the effects provided by the first embodiment.
(Third Embodiment)
According to a data rearrangement method of a third embodiment, a rearrangement only register is used in place of the stack pointer of the first embodiment. The use of the rearrangement only register enables updating of an optional pointer, and thus it is possible to carry out more efficient data rearrangement.
First, in S30, a DSP starts an arithmetic operation, and its result is stored in the a0 register (S30). Then, in S31, an address (0x0003) to be stored in an address (0x8004) of the address conversion table indicated by an address value stored in the rearrangement only register rr is read, set to the r0 register, and the rearrangement only register rr is decremented (−1) (S31). Then, in S32, the result of the arithmetic operation stored in the a0 register is stored in the address (0x0003) stored in the r0 register (S32). Then, in S33, determination is made as so removal of the r0 register from an address conversion table area (S33). If a result of the determination shows the removal from the area, the rearrangement only register rr is returned to an initial area. If no removal is determined, the process proceeds to a next arithmetic operation (
After the contents of the rearrangement only register rr are changed from the address (0x8004) to an address (0x8000), an arithmetic operation is executed in an order prestored in the memory.
According to the third embodiment, effects similar to those of the first embodiment can be obtained. In the foregoing, the rearrangement only register rr is decremented by −1 when the data is read from the rearrangement only register rr. However, modifications can be optionally made in accordance with purposes. For example, optional + or −, module addressing etc., can be cited as modifications. For a modification, a register which supports all types of addressing disposed in a general register can be used. In the case of the module addressing, as in the case of the rearrangement only register, a register only for specifying a module width may be prepared, and necessary registers may also be prepared for other types of addressing. Thus, the use of the module addressing eliminates a necessity of periodical resetting of the pointer to enable efficient rearrangement.
(Fourth Embodiment)
According to a data rearrangement method of a fourth embodiment, data stored in an address conversion table contains byte-writing information.
According to the fourth embodiment, when rearrangement information is stored in the address conversion table, a low-order bit is set as a byte-writing control bit to enable writing in an optional place.
For example, as shown in Table 1,
Further, a byte-writing control register is disposed and, if byte-writing is permitted, low-order 2 bits of an address are supplied as byte-writing information to a memory. Remaining high-order 14 bits are supplied as addresses to the memory (see
Thus, according to the fourth embodiment, the setting of the low-order bit of the rearrangement information enables writing only in a predetermined bit. In the aforementioned example, 32 bits are divided into 8 bits. However, a way of division is not limited to this. When division is made, the number of bits of the byte-writing information may be set to a necessary number of bits. Additionally, by installing the byte-writing control register, the memory used for rearrangement can also be used for general purposes.
The preferred embodiments of the data rearrangement methods of the present invention have been described with reference to the accompanying drawings. However, the invention is not limited to the embodiments. It is apparent to those skilled in the art that various changes and modifications can be made within a scope of technical ideas specified in appended claims and, needless to say, such changes and modifications are also within the technical scope of the invention.
For example, the invention can be applied to multidimensional rearrangement.
The present invention relates to the digital processing method in digital communications or digital signal processing, and it can be applied especially to the data rearrangement method.
As described above, according to the present invention, there can be provided a data rearrangement method which can reduce the number of processing operations (the number of commands) to shorten processing time more than the conventional method, which can be realized efficiently by a small memory capacity, and which can deal with optional rearrangement rules.
Number | Date | Country | Kind |
---|---|---|---|
318493/2003 | Sep 2003 | JP | national |