Abstract:
An operation unit has operation circuits (aL, aH), temporary registers (xL, yL, xH, yH) arranged just before the operation circuits, registers (R1, R2, R3, R4) arranged if required, and data buses (d1L, d2L, d1H, d2H) for transferring data among the operation circuits, temporary registers, and registers. Data to be processed are divided, are transferred to the operation circuits through the data buses, and are simultaneously and independently processed by the operation circuits. When a result of the preceding operation affects the following operation, data except the result of the preceding operation are transferred from the registers to the temporary registers before starting the operations. These techniques shorten a processing time.

Description:
BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     The present invention relates to a high-speed operation unit, and particularly, to an operation unit applicable to a high-speed microprocessor. 
     2. Description of the Prior Art 
     FIG. 1 shows a conventional operation unit that processes 16-bit data at the maximum. The operation unit has a 16-bit operation circuit 103 and temporary registers x101 and y102 directly connected to the data input of the operation circuit 103, to temporarily hold data to be processed. The temporary registers x101 and y102 are connected to 16-bit data buses d1 and d2. The output of the operation circuit 103 is connected to any one of the data buses d1 and d2. For the sake of explanation, the operation unit shown in FIG. 1 has 8-bit registers R1, R2, R3, and R4. The registers R1 and R2 are paired to form a 16-bit register R12, and the registers R3 and R4 are paired to form a 16-bit register R34. The data bus d1 is divided into a lower 8-bit bus d1L and a higher 8-bit bus d1H, and the data bus d2 is divided into a lower 8-bit bus d2L and a higher 8-bit bus d2H. Each of the registers R1 to R4 is connected to all of the 8-bit buses d1L, d2L, d1H, and d2H. During an 8-bit operation, the registers R1 to R4 are connected to the lower 8-bit buses d1L and d2L, and &#34;0&#34; is given to the higher 8-bit buses d1H and d2H when reading the contents of the registers. 
     A 16-bit operation processed by the operation unit shown in FIG. 1 will be explained with reference to a timing chart shown in FIG. 2. In FIG. 2, &#34;r1&#34; to &#34;r4&#34; are the contents of registers R1 to R4, respectively. And &#34;r12&#34; and &#34;r34&#34; indicate the contents of register pairs R12 and R34, respectively. For example, the contents of the register pair R12, in which the register R1 holds higher 8 bits and the register R2 holds lower 8 bits, are added to the contents of the register pair R34, in which the register R3 holds higher 8 bits and the register R4 holds lower 8 bits, and a result of the operation is written to the register pair R12. Namely, R12+R34→R12. In the first state, the contents of the register pair R12 are transferred to the data bus d1. Namely, the contents of the register R1 are transferred to the higher 8-bit bus d1H, and the contents of the register R2 are transferred to the lower 8-bit bus d1L. At the same time, the contents of the register pair R34 are transferred to the data bus d2. Namely, the contents of the register R3 are transferred to the higher 8-bit bus d2H, and the contents of the register R4 are transferred to the lower 8-bit bus d2L. Thereafter, the contents of the register pair R12 on the data bus d1 are written to the temporary register x101, and the contents of the register pair R34 on the data bus d2 are written to the temporary register y102. In response to an operation control signal f, an addition instruction is given to the operation circuit 103, and &#34;0&#34; is given to a carry input Cin. Then, the operation circuit 103 calculates x+y. 
     In the second state, the operation circuit 103 provides the data bus d1 with a result of the operation. Namely, the operation circuit 103 provides the higher 8-bit bus d1H with higher 8 bits of the result, and the lower 8-bit bus d1L with lower 8 bits of the result. The result on the data bus d1 is written to the register pair R12. In FIG. 2, &#34;carry&#34; indicates a carry caused by adding the contents of the registers R2 and R4. 
     An 8-bit operation processed by the operation unit of FIG. 1 will be explained with reference to a timing chart of FIG. 3. For example, the contents of the register R1 are added to the contents of the register R2, and a result of the operation is written to the register R1. Further, the contents of the register R4 are subtracted from the contents of the register R3, and a result of the operation is written to the register R3. Although these operations are 8-bit operations, the operation unit shown in FIG. 1 processes them as 16-bit operations one by one. Namely, the operation of R1+R2→R1 is firstly processed, and then, the operation of R3-R4→R3 is processed. In the first state, the contents of the registers R1 and R2 are transferred to the data buses d1L and d2L, respectively. At this time, the data buses d1H and d2H receive &#34;0.&#34; The data on the data buses are transferred to the temporary registers x101 and y102, respectively. In response to the operation control signal f, an addition instruction is given to the operation circuit 103, and &#34;0&#34; is given to the carry input Cin. Then, the operation circuit 103 calculates x+y. In the second state, the operation circuit 103 provides the data bus d1L with a result of the calculation, which is stored in the register R1. In the third state, the contents of the registers R3 and R4 are transferred to the data buses d1L and d2L, respectively, and &#34;0&#34; is given to the data buses d1H and d2H. The data on the data buses d1 and d2 are written to the temporary registers x101 and y102. In response to the operation control signal f, a subtraction instruction is given to the operation circuit 103, and &#34;0&#34; is given to the carry input Cin. Then, the operation circuit 103 calculates x-y. In the fourth state, the operation circuit 103 provides the data bus d1L with a result of the operation, which is written to the register R3. In this way, the conventional operation unit must handle 8-bit operations as 16-bit operations, to idle the higher 8 bits of the operation circuit 103. Since the conventional operation unit must execute 8-bit operations one by one, it needs four states in the case of the above example. 
     Another operation of the operation unit shown in FIG. 1 that uses a result of the preceding operation will be explained with reference to a timing chart shown in FIG. 4. For example, the contents of the register R1 are added to the contents of the register R2, and a result of the operation is written in the register R1. Thereafter, the new contents of the register R1 are subtracted from the contents of the register R3, and the difference is written to the register R3. The operation unit shown in FIG. 1 must process these operations as 16-bit operations, so that the contents of the register R3 will not be written to the temporary registers x101 or y102 before the first operation of R1+R2→R1 is completed. Accordingly, the process of R3-R1→R3 is carried out only after the completion of the process R1+R2→R1. In the first state, the contents of the registers R1 and R2 are transferred to the data buses d1L and d2L, respectively, and &#34;0&#34; is given to the data buses d1H and d2H. The data on the data buses d1 and d2 are written to the temporary registers x101 and y102, respectively. In response to the operation control signal f, an addition instruction is given to the operation circuit 103, and &#34;0&#34; is given to the carry input Cin. Then, the operation circuit 103 calculates x+y. In the second state, the operation circuit 103 provides the data bus d1L with a result of the operation, i.e., the sum of the contents of the registers R1 and R2, which is written to the register R1. In the third state, the contents of the registers R3 and R1 are transferred to the data buses d1L and d2L, respectively, and &#34;0&#34; is given to the data buses d1H and d2H. The data on the data buses d1 and d2 are written to the temporary registers x101 and y102, respectively. In response to the operation control signal f, a subtraction instruction is given to the operation circuit 103, and &#34;0&#34; is given to the carry input Cin. Then, the operation circuit 103 calculates x-y. In the fourth state, the operation circuit 103 provides the data bus d1L with a result of the operation, i.e., a difference between the contents of the registers R3 and R1, which is written to the register R3. 
     In this way, the conventional operation unit processes 8-bit operations one by one although it is a 16-bit operation unit, and requires four states in the case of the above example. Namely, it processes an 8-bit binary operation only after the completion of the preceding 8-bit binary operation. Since the conventional operation unit is incapable of simultaneously processing a plurality of operations, it involves a lone processing time. 
     SUMMARY OF THE INVENTION 
     An object of the present invention is to provide an operation unit that is capable of simultaneously processing a plurality of operations, to shorten a processing time. 
     In order to accomplish the object, the present invention provides an operation unit shown in FIG. 5. This operation unit handles data of &#34;m&#34; bits at the maximum and &#34;n&#34; bits at the minimum. The operation unit has n-bit operation circuits (1, 2, or more generally, 1, 2, 3, . . . k), first hold means such as temporary registers (3, 4, 5, 6, . . . ), transfer units (7), second hold means such as registers (R1, R2, R3, R4, . . . ), and data buses (d1L, d1H, d2L, d2H, or more generally, d1 1 , d1 2 , d1 3 , . . . d1 k , d2 1 , d2 2 , d2 3 , . . . , d2 k ). The operation circuits are independent of one another. The first hold means are arranged just before the respective operation circuits, to temporarily hold n-bit data to be given to the respective operation circuits. Each of the transfer units transfers a carry from the preceding operation circuit to the following operation circuit. The second hold means hold data. The data buses are paths for transmitting data among the operation circuits, the first and second hold means. 
     When processing data of &#34;n&#34; bits or greater, the second hold means provide the operation circuits with n-bit data, and the operation circuits simultaneously process the data. When required, a lower one of the operation circuits provides the following processor with a carry. In this way, the operation circuits are independently and simultaneously operated to process data of &#34;m&#34; bits or smaller. Alternatively, the operation circuits are sequentially operated such that a result of operation of one operation circuit is given to the next operation circuit. If a given operation requires a result of the preceding operation, data except the result of the preceding operation are transferred to the first hold means in advance. 
     Other and further objects and features of this invention will become obvious upon an understanding of the illustrative embodiments about to be described in connection with the accompanying drawings or will be indicated in the appended claims, and various advantages not referred to herein will occur to one skilled in the art upon employing of the invention in practice. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 shows an operation unit according to a prior art; 
     FIGS. 2 to 4 are timing charts showing the operations of the prior art; 
     FIG. 5 shows an operation unit according to an embodiment of the present invention; and 
     FIGS. 6 to 8 are timing charts showing the operations of the embodiment of the present invention. 
    
    
     DETAILED DESCRIPTION OF THE EMBODIMENTS 
     Various embodiments of the invention will be described with reference to the accompanying drawings. It is to be noted that the same or similar reference numerals are applied to the same or similar parts and elements throughout the drawings, and the description of the same or similar parts and elements will be omitted or simplified. 
     FIG. 5 shows an operation unit according to an embodiment of the present invention. The operation unit has 8bit operation circuits all and aH2. Temporary registers xL3 and yL4 are directly connected to the data input of the operation circuit all, and temporary registers xH5 and yH6 are directly connected to the data input of the operation circuit aH2, to temporarily hold data to be processed. A selector 7 transfers a carry from the operation circuit all to the operation circuit aH2. Data buses d1L, d2L, d1H, and d2H are paths for transferring data among the operation circuits all and aH2 and temporary registers xL3, yL4, xH5, yH6. For the sake of explanation, the operation unit shown in FIG. 5 has 8-bit registers R1, R2, R3, and R4 for holding operation data and operation result data. The registers R1 to R4 may be other storage elements. The operation circuits aL1 and aH2 handle 8-bit data, so that a maximum data width to be handled by the operation unit is 116 bits. The operation circuits aL1 and aH2 process operations according to operation control signals fL and fH, respectively. During an 8-bit operation, the operation circuits all and aH2 independently operate, and during a 16-bit operation, they cooperate with each other with the operation circuit aL1 handling lower bits and the operation circuit aH2 handling higher 8 bits. At this time, the carry output of the operation circuit aL1 is connected to the carry input of the operation circuit aH2. 
     The temporary registers xL3 and yL4 handle each lower 8 bits and are connected to the data buses d1L and d2L, respectively. The temporary registers xH5 and yH6 handle each higher 8 bits and are connected to the data buses d1H and d2H, respectively. In response to the operation control signal fL, the operation circuit aL1 processes an operation on data in the temporary registers xL3 and yL4, and provides a result of the operation. In response to the operation control signal fH, the operation circuit aH2 processes an operation on data in the temporary registers xH5 and yH6, and provides a result of the operation. The registers R1 and R2 are paired into a 16-bit register R12, and the registers R3 and R4 are paired into a 16-bit register R34. The registers R1 to R4 are connected to any one of the data buses d1L, d2L, d1H, and d2H. During a 16-bit operation, the registers R1 and R3 are connected to the data bus d1H or d2H, and the registers R2 and R4 are connected to the data bus d1L or d2L. Data are transferred to the temporary registers xL3, yL4, xH5, and yH6, and an operation result is provided in a later state. The register pairs R12 and R34 are connected to the data inputs of the temporary registers xL3, yL4, xH5, and yH6, as well as to the data outputs of the operation circuits aL1 and aH2 through the 16-bit data buses d1 and d2. The 16-bit data bus d1 is divided into the lower 8-bit bus d1L and the higher 8-bit bus d1H, and the 16-bit data bus d2 is divided into the lower 8-bit bus d2L and the higher 8-bit bus d2H. The data output of the operation circuit aL1 is connected to the data bus d1L or d2L, and the data output of the operation circuit aH2 is connected to the data bus d1H or d2H. The selector 7 selects a carry output CoutL of the operation circuit aL1 or a carry input FCinH according to an operation control signal g, and provides the operation circuit aH2 with a carry input CinH. 
     A 16-bit operation of the operation unit of the embodiment will be explained with reference to a timing chart shown in FIG. 6. This figure corresponds to FIG. 2 of the prior art. For example, the contents of the register pair R12 are added to the contents of the register pair R34, and a result of the operation is written to the register pair R12. In FIG. 6, &#34;r12&#34; and &#34;r34&#34; indicate the contents of the register pairs R12 and R34, respectively. In the first state, the contents of the register pair R12 are transferred to the data bus d1, and the contents of the register pairs R34 are transferred to the data bus d2. The contents of the register R2 on the data bus d1L are written to the temporary register xL3, the contents of the register R1 on the data bus d1H are written to the temporary register xH5, the contents of the register R4 on the data bus d2L are written to the temporary register yL4, and the contents of the register R3 on the data bus d2H are written to the temporary register yH6. In response to the operation control signals fL and fH, an addition instruction is given to each of the operation circuits aL1 and aH2. In response to the operation control signal g, the carry output CoutL of the operation circuit aL1 is connected to the carry input CinH of the operation circuit aH2. The carry input CinL of the operation circuit aL1 receives &#34;0.&#34; The operation circuit aL1 calculates xL+yL and provides the carry output CoutL, and the operation circuit aH2 calculates xH+yH+CinH. In the second state, the operation circuit aL1 provides the data bus d1L with a result of the operation, which is written to the register R2, and the operation circuit aH2 provides the data bus d1H with a result of the operation, which is written to the register R1. In this way, the embodiment of the present invention completes the 16-bit operation shown in FIG. 6 in two states similar to the prior art of FIG. 2, so that there is no difference between the processing speeds of the present invention and the prior art in connection with the 16-bit operation. 
     Eight-bit operations of the present invention will be explained with reference to a timing chart shown in FIG. 7. For example, similar to the prior art of FIG. 3, the contents of the register R1 are added to the contents of the register R2, and a result of the operation is written to the registers R1. At the same time, the contents of the register R4 are subtracted from the contents of the register R3, and a result of the operation is written to the register R3. In the first state, the contents of the registers R1 to R4 are transferred to the data buses d1L, d2L, d1H, and d2H, respectively, and are written to the temporary registers xL3, yL4, xH5, and yH6, respectively. In response to the operation control signal fL, an addition instruction is given to the operation circuit aL1, and &#34;0&#34; is given to the carry input CinL of the operation circuit aL1. At the same time, in response to the operation control signal fH, a subtraction instruction is given to the operation circuit aH2. In response to the operation signal g, the carry input FCinH is connected to the carry input CinH of the operation circuit aH2, and &#34;0&#34; is given to the carry input FCinH. Then, the operation circuit aL1 calculates xL+yL, and the operation circuit aH2 calculates xH-yH. In the second state, the operation circuits aL1 and aH2 provide the data buses d1L and d1H with results of the operations, respectively, which are written to the registers R1 and R3, respectively. In this way, the present invention simultaneously carries out the two 8-bit operations in two steps. On the other hand, the prior art of FIG. 1 needs four states to process the same operations, as shown in FIG. 3. This is because the prior art must process 8-bit operations as 16-bit operations, to waste the higher 8 bits of the operation circuit 103. Namely, the prior art must process 8-bit operations one by one. Consequently, the present invention is capable of processing 8-bit operations speedier than the prior art. 
     Another operation of the present invention will be explained with reference to a timing chart shown in FIG. 8. This operation corresponds to the operation shown in FIG. 4 of the prior art. Namely, an operation is processed on a result of the preceding operation. In this case, the present invention does not simultaneously process these operations, and therefore, processes the operations in two steps with the first step involving first and second states and the second step involving the second state and the third state. For example, the contents of the register R1 are added to the contents of the R2, and a result of the operation is written to the register R1. Then, the new contents of the register R1 are subtracted from the contents of the register R3, and the difference is written to the register R3. In the first state, the contents of the registers R1 to R3 are transferred to the data buses d1L, d2L, and d1H, respectively, and are written to the temporary registers xL3, yL4, and xH5, respectively. In response to the operation control signal fL, an addition instruction is given to the operation circuit aL1, and &#34;0&#34; is given to the carry input CinL of the operation circuit aL1. Then, the operation circuit aL1 calculates xL+yL. In the second state, the operation circuit aL1 provides the data bus d2L with a result of the operation, i.e., the sum of the contents of the registers R1 and R2. The sum is written to the register R1 as well as to the temporary register yH6. In response to the operation control signal fH, a subtraction instruction is given to the operation circuit aH2. In response to the operation control signal g, the carry input FCinH is connected to the carry input CinH of the operation circuit aH2, and &#34;0&#34; is given to the carry input FCinH. Then, the operation circuit aH2 calculates xH-yH. In the third state, the operation circuit aH2 provides the data bus d2H with the difference between the contents of the register R3 and the new contents of the register R1, which is written to the register R3. Unlike the prior art of FIG. 4 that processes these 8-bit operations one by one in four states, the present invention of FIG. 8 finishes the same operations in three states. This is because the present invention writes, in the first state, part of data that is needed in the next state to the temporary register. It is possible, according to the present invention, to write the partial data, i.e., the contents of the register R3 in the above example to the temporary register in the second state. In addition, the present invention writes a result of an operation to one of the registers as well as to one of the temporary registers. These are the reasons why the present invention is capable of reducing the number of processing states by one compared with the prior art. Namely, the present invention is capable of shortening a processing time by one to two states when continuously processing 8-bit operations. The operation unit according to the present invention, therefore, is appropriate for technical fields that need a high processing speed. 
     Various modifications will become possible for those skilled in the art after receiving the teachings of the present disclosure without departing from the scope thereof.