Microcomputer internally having fuzzy inference exclusive-instructions

Abstract: In a microcomputer including a processor, a data memory and a controller for controlling the processor and the data memory, the data memory includes a adaptivity degree data group indicative of the adaptivity degree to the fuzzy sets, and an area for storing the result of processing. The processor includes an adaptivity degree data pointer, a result store area pointer, a conformity degree data storing register, and a processing number count register. The microcomputer internally includes a fuzzy inference exclusive-instruction, which causes to compare data in the conformity degree data storing register with data designated by the adaptivity degree data pointer, so as to select a smaller one, and to compare the selected data with data designated by the result store area pointer, so as to store a large one at the area for storing the result of processing, designated by the the result store area pointer. The above processings are repeated the number of processing in the processing number count register, while updating the result store area pointer and the adaptivity degree data group pointer.

Description: The present invention relates to a microcomputer having a fuzzy operation function. In the case of controlling some object to some set value, a fuzzy inference has been known in which, at which degree a current measured value is adaptive to a plurality of conditions is discriminated, and a controlled manipulated variable is inferred on the basis of the discrimination. Here, these conditions can have vague expression. General fuzzy inference includes a Max-Min method Here, assuming that a difference between a set value and a measured value is E, a change component during one sampling period is ΔE, and a manipulated variable at this time is ΔU, a control is performed in accordance with the following three rules: RULE 1 : If E is negative and slightly large and if ΔE ≈ 0, ΔU is positive and slightly large. RULE 2 : If E ≈ 0, and if ΔE is positive and slightly large, ΔU is negative and slightly large. RULE 3 : If E ≈ 0, and if ΔE ≈ 0, ΔU ≈ 0. Under this condition, a method for determining the manipulated variable ΔU in accordance with the Max-Min method will be described with reference to Figure 1. In all graphs shown in Figure 1, the axis of ordinates shows the adaptivity degree or degree of membership µ for the fuzzy set. This degree of membership µ is indicative of the degree by which the elements (E, ΔE, ΔU) belongs to the fuzzy set. If the elements completely belongs to the fuzzy set, µ = 1. If the elements do not belong to the fuzzy set at all, µ = 0. Graphs 3-11 and 3-23 are a fuzzy set in which E is negative and slightly large. Graphs 3-12, 3-21, 3-31, 3-32 and 3-33 are a fuzzy set in which E is almost 0, and graphs 3-13 and 3-22 are a fuzzy set in which E is positive and slightly large. In addition, the graphs 3-11, 3-12 and 3-13 indicate the conditions E and ΔE and the manipulated variable ΔU for RULE 1. The graphs 3-21, 3-22 and 3-23 indicate the conditions E and ΔE and the manipulated variable ΔU for RULE 2, and the graphs 3-31, 3-32 and 3-33 indicate the conditions E and ΔE and the manipulated variable ΔU for RULE 3. If the fuzzy set of RULE 1 is that E is negative and slightly large (Graph 3-11) and ΔE is almost 0 (Graph 3-12), ΔU should be made positive and slightly large (Graph 3-13). Here, the set "negative and slightly large" will be explained with reference to an example having numeral values (-5, -4, -3, -2, -1). By partitioning the degree of membership µ and the element by "/", the fuzzy set F can be expressed : F = (0.2/-5, 0.5/-4, 1/-3, 0.5/-2, 0.2/-1). It is a matter of course that, when the degree of membership µ is handled by a microcomputer, these values are suitably normalized into a binary code for easy controlling. The data group of the fuzzy set has a structure in which these elements are converted into an address on a memory, and the degree of membership µ of the elements is stored as data in the memory. Now, it is assumed that E=X1 and ΔE=X2 are obtained from the measured result. First, the degree of membership µ11 of RULE 1 to the difference E and the degree of membership µ12 of RULE 1 to ΔE are obtained, and a smaller one will be regarded as the conformity degree for RULE 1. Next, the fuzzy set of ΔU is made under this conformity degree (the hatched zone in Graph 3-13). Similarly, the conformity degree for RULE 2 and the conformity degree for RULE 3 are sought, and the fuzzy set of ΔU is made under the obtained conformity degrees (the hatched zone in Graphs 3-23 and 3-33). Thereafter, an OR set (Graph 3-4) for the obtained sets for ΔU (the hatched zone in Graphs 3-13, 3-23 and 3-33) is sought. This is a fuzzy set for the manipulated vartable for all RULE 1, RULE 2 and RULE 3. Furthermore, by obtaining a weight point of this set (Graph 3-4), the manipulated variable to be actually operated at this time can be obtained. If the above mentioned operation is performed in a software manner, it is necessary that the adaptivity of the rules to the difference E, the adaptivity of the rules to ΔE, and the adaptivity of the rules to ΔE are previously stored in respective addresses in the memory corresponding to E, ΔE and ΔU, and all zero is stored in a result storing area (Graph 3-4) as an initial value. Step (1) From the address corresponding to X1 and X2, the adaptivity of RULE 1 to the difference E and the adaptivity of RULE 1 to ΔE are obtained, and then, compared with each other, so as to select a smaller one as the conformity degree for RULE 1. Step (2) Data in the data group storing the adaptivity degree for Δu is compared with the conformity degree obtained in the step (1), and a smaller one is stored in a temporary register (not shown). Step (3) The value of the temporary register is compared with data stored in the result storing area (Graph 3-4), and a larger one is stored in the result storing area (Graph 3-4). Step (4) The above steps (2) and (3) are repeated in a looped processing the times corresponding to the number of data. The hatched zone in Graph 3-13 is determined by these processings. Step (5) The above steps (1) to (4) are performed for RULE 2. With this, the OR set of the hatched zone in Graph 3-13 and the hatched zone in Graph 3-23 is obtained. Step (6) Similarly, for RULE 3, the above steps (1) to (4) are performed. With this, the OR set (Graph 3-4) of the hatched zone in Graph 3-13, the hatched zone in Graph 3-23 and the hatched zone in Graph 3-33 is obtained. Step (7) For the OR set (Graph 3-4) obtained in the step (6), a weight point is calculated, so that an actual manipulated variable is obtained. In the case that the manipulated variable is sought by using the Max-Min method as mentioned above, if the processing is executed by use of only existing instructions in a software manner, a very long time has been required because of branching processings caused by the looped processings. In addition, a high speed fuzzy chip for exclusively executing the fuzzy inference has been developed, but it is very expensive. The foregoing described technique is e.g. disclosed in EP-A-0 574 713 (MOTOROLA, INC.) which is included in the state of the art pursuant to Article 54(3) and (4) EPC. In US-A-3 364 471 (BIENHOFF et al.) January 1968 a data processing apparatus and more particularly means for reducing the processing time required to compare a first block of data words with a test word or a second block is disclosed. IEEE International Conference on Fuzzy Systems (CAT. NO. 92 CH 3073-4), San Diego, CA, USA, 8-12 March 1992, 431-441 ISBN 0-7803-0236-2, Watanabe H. "RISK Approach to Design of Fuzzy Processor Architecture" discloses a design of a fuzzy information processor as an application specific processor using a quantitative approach. Accordingly, it is an object of the present invention to provide a microcomputer, which has overcome the above mentioned defect of the conventional one, and which can execute a control based on the fuzzy inference (Max-Min method) at a high speed, and can make a fussy chip inexpensive. The above and other objects of the present invention are achieved in accordance with the present invention by a microcomputer as defined in claim 1. Independent Claim 2 defines an embodiment for a plurality of rules. The above and other objects, features and advantages of the present invention will be apparent from the following description of preferred embodiments of the invention with reference to the accompanying drawings. Figure 1 is a set of graphs for illustrating the fuzzy inference; Figure 2 is a block diagram of a first embodiment of the microcomputer in accordance with the present invention; and Figure 3 is a block diagram of an essential part of a second embodiment of the microcomputer in accordance with the present invention. Referring to Figure 2, there is shown a block diagram of a first embodiment of the microcomputer in accordance with the present invention. The shown microcomputer includes a processor 100, a memory 200 and a controller 300, which are well known to persons skilled in the art as fundamental constituents of the microcomputer, and therefore, a detailed internal structure and explanation thereof will be omitted in the drawing and in the specification, and only parts relating to the present invention will be explained. As shown in Figure 2, the processor 100 includes, as registers, a result storing area pointer R1, 11, a ΔU adaptivity degree data pointer R2, 12, a conformity degree storing register R3, 13, and a processing number count register R4, 14, and the memory 200 includes an area 16 for storing data, designated by the result storing area pointer R1, and another area 15 for storing data, designated by the ΔU adaptivity degree data pointer R2. The result storing area 16 is used to finally store an OR set of sets obtained from respectively rules. This result storing area 16 is initialized to zero as an initial value. The result storing area pointer R1, 11 is a register for designating a start address of the result storing area 16. The ΔU adaptivity degree data pointer R2, 12 is a register for designating a start address of the ΔU adaptivity degree data group 15. The conformity degree storing register R3, 13 is a register for storing a previously obtained conformity degree for the rules, and the processing number count register R4, 14 is a register for setting the number of comparing operations (the number of items of data in the ΔU adaptivity degree data group) A fuzzy exclusive-instruction of the first embodiment includes the above four registers as a operand, and has an expression format as follows: MINMAX [R1], [R2], R3, R4 Now, a processing of the first embodiment will be described. First, a 16-bit data in the ΔU adaptivity degree data group designated by the ΔU adaptivity degree data pointer R2, 12, is compared with a 16-bit data in the conformity degree storing register R3, 13, and a smaller one is stored in a temporary register (not shown). The data in the temporary register is compared with a 16-bit data in the result storing area 16 designated by the result storing area pointer R1, 11, and a larger one is written back to the result storing area 16 designated by the result storing area pointer R1, 11. Then, an address in the result storing area pointer R1, 11 and the ΔU adaptivity degree data pointer R2, 12 are incremented by "2", respectively, and the number of processings stored in the processing number count register R4, 14 is decremented by "1". The above mentioned operation is repeated until the data in the processing number count register R4, 14 becomes zero. If this instruction is executed for the result storing area 16 by the number of rules, a OR set of the sets which are obtained for the respective rules can be obtained. Incidentally, the steps (2) to (4) explained in the "Description of related art" are executed with this one instruction. Incidentally, the data length was 16 bits in the embodiment mentioned above, but the data length can be easily modified to for example 8 bits or 32 bits, by changing the increment width of the result storing area pointer R1, 11 and the ΔU adaptivity degree data pointer R2, 12 and the data length of the conformity degree storing register R3, 13. Now, a second embodiment will be described with reference to Figure 3, which is a block diagram of an essential part of a second embodiment of the microcomputer in accordance with the present invention. In Figure 3, a result storing area pointer R1, 11, a processing number count register R4, 14 and a result storing area 16 are the same as corresponding ones of the first embodiment shown in Figure 2, and therefore, explanation thereof will be omitted. In the second embodiment shown in Figure 3, a ΔU adaptivity degree data group 1, 151 is a ΔU adaptivity degree data group for RULE 1. Similarly, a ΔU adaptivity degree data group 2, 152 is a ΔU adaptivity degree data group for RULE 2, and a ΔU adaptivity degree data group 3, 153 is a ΔU adaptivity degree data group for RULE 3. A ΔU adaptivity degree data pointer 1, 231 is a data pointer for designating a start address for the ΔU adaptivity degree data group 1, 151 for RULE 1. Similarly, a ΔU adaptivity degree data pointer 2, 232 is a data pointer for designating a start address for the ΔU adaptivity degree data group 2, 152 for RULE 2, and a ΔU adaptivity degree data pointer 3, 233 is a data pointer for designating a start address for the ΔU adaptivity degree data group 3, 153 for RULE 3. A conformity degree storing area 1, 241 is a conformity degree storing area for storing the previously obtained conformity degree for RULE 1. Similarly, a conformity degree storing area 2, 242 is a conformity degree storing area for storing the previously obtained conformity degree for RULE 2, and a conformity degree storing area 3, 243 is a conformity degree storing area for storing the previously obtained conformity degree for RULE 3. A ΔU adaptivity degree data pointer designating register R5, 21 is a data pointer designating register for designating an address of the ΔU adaptivity degree data pointer 1, 231, and a conformity degree storing area designating register R6, 22 is a data pointer designating register for designating an address of the conformity degree storing area 1, 241. A fuzzy exclusive-instruction of the second embodiment includes, as an operand, four registers of the result storing area pointer R1, processing number count register R4, the ΔU adaptivity degree data pointer designating register R5 and the conformity degree storing area designating register R6. The fuzzy exclusive-instruction has an expression format as follows: REPn MINMAX [R1], [R5], [R6], R4 Here, the instruction labelled "REPn" is an instruction indicating that an instruction next to the instruction "REPn" is repeated "n" times. In this case, "n" corresponds to the number of rules for the fuzzy control. In the embodiment shown in Figure 3, "n"=3. Now, a processing of the second embodiment will be described with reference to Figures 2 and 3. First, an address value in the result storing area pointer R1, 11 is stored in a first temporary register (not shown), and the number of processings stored in the processing number count register R4 14 is stored in a second temporary register (not shown). ΔU adaptivity degree data group 1, 151 is referred to by using as an address the data in the ΔU adaptivity degree data pointer 1, 231 designated by the ΔU adaptivity degree data pointer designating register R5, 21. A 16-bit data in the ΔU adaptivity degree data group group 1, 151 is compared with a 16-bit data in the conformity degree storing area 1, 241 designated by the conformity degree storing area designating register R6, 22, and a smaller one is stored in a third temporary register (not shown). The data in the third temporary register is compared with a 16-bit data in the result storing area 16 designated by the first temporary register, and a larger one is written back to the result storing area 16 designated by the first temporary register. Then, an address in the first temporary register and the ΔU adaptivity degree data pointer 1, 231 are incremented by "2", respectively, and the number of processings stored in the second temporary register is decremented by "1". The above mentioned operation is repeated until the data in the second temporary register becomes zero. Thereafter, an address in the ΔU adaptivity degree data pointer designating register R5, 21 and the conformity degree storing area designating register R6, 22 are incremented by "2", respectively, so that the ΔU adaptivity degree data pointer 2, 232 and the conformity degree storing area 2, 242 for the next rule are designated. The above operation is a processing for RULE 1. Since "REPn"(n=3) is designated, the above operation is repeated using the ΔU adaptivity degree data pointer 2, 232, the ΔU adaptivity degree data group 2, 152, and the conformity degree storing area 2, 242 for RULE 2, and also repeated using the ΔU adaptivity degree data pointer 3, 233, the ΔU adaptivity degree data group 3, 153, and the conformity degree storing area 3, 243 for RULE 3. Thus, an OR set of the sets obtained for the respective rules can obtained. Incidentally, the above mentioned operation executes the operation of the steps (2) to (6) mentioned in "Description of related art". As mentioned above, since the present invention makes it possible to execute an increased number of processings with one instruction, it is possible to avoid a memory from being pressured by a program. In addition, it is possible to reduce the number of programmed branches such as a branch caused by the loop, a branch based on the result of comparison, so that the processing speed can be increased with adding no hardware. In the case that the rule for determining one manipulated variable from two conditions as in the above mentioned embodiments is applied to twenty rules, when it was executed with only existing instructions, a processing time was about 1000µs (25MHz operation), but if the above mentioned fuzzy inference exclusive-instruction was used, the processing time was shortened to about 600µs. The invention has thus been shown and described with reference to the specific embodiments. However, it should be noted that the present invention is in no way limited to the details of the illustrated structures but changes and modifications may be made within the scope of the invention as defined by the claims.

Claims: A microcomputer including a processing means (100), a data storing means (200) and a control means (300) for controlling the processing means and the data storing means, the data storing means including a group of data (15) indicative of the degree of membership of sampled data values to a fuzzy set, and an area (16) for storing the result of processing, the microcomuter internally executing a fuzzy inference MINMAX-instruction consisting of an AND-instruction part combining at least two individual fuzzy sets to an intermediate fuzzy set (MIN-method), and an OR-instruction part combining said intermediate fuzzy set to a final fuzzy set (MAX-method), the AND-instruction part causing the processing means (100) to successively compare a sample value of the individual fuzzy set stored in an individual data group (15) of the data storage means (200) being designated by a register (12) for designating the group of data, with a sample value of a previous comparison stored in a conformity degree storing register (13) so as to select the smaller sample value as the degree of membership value of the applied AND-instruction, the OR-instruction part causing the processing means (100) to compare the smaller sample value of the intermediate fuzzy-set obtained from said AND-instruction, with data stored in the result storage area (16) designated by the content of a result store area pointer register (11) for designating the area for storing the result of processing, so as to store the larger one in the area (16) for storing the result of processing as the final fuzzy set, the execution steps being repeated according to the number of sample data values stored in a processing number count register (14), while updating the register (12) for designating the group of data and the result store area pointer register (11). A microcomputer including a processor, a data memory and a controller for controlling the processor and the data memory, the data memory including a group of data (151, 152, 153) indicative of degree of membership of sampled data values to a fuzzy set, and an area (16) for storing the result of processing, the microcomputer internally executing a fuzzy inference MINMAX-instruction consisting of an AND-instruction part combining at least two individual fuzzy sets to an intermediate fuzzy set (MIN-method), and an OR-instruction part combining said intermediate fuzzy sets to a final fuzzy set (MAX-method), the AND-instruction part causing the processor to successively compare a sample value of the individual fuzzy set stored in one of individual data groups (151, 152, 153) of the data memory, each data group being designated by one of data pointers (231, 232, 233) implemented in the processor for designating the group of data, each data pointer in return being designated by the content of a register (21) for designating the group of data, with a sample value of a previous comparison stored in one conformity degree storing area (241, 242, 243) being designated by the content of a conformity degree designating register (22), so as to select the smaller sample value as the degree of membership value of the applied AND-instruction, the OR-instruction part causing the processor to compare the smaller sample value of the intermediate fuzzy-set obtained from said AND-instruction, with data stored in the result storage area (16) designated by the content of a result store area pointer register (11) for designating the area for storing the result of processing, so as to store the larger one in the area (16) for storing the result of processing as the final fuzzy set, the execution steps being repeated according to the number of sample data values stored in a processing number count register (14), while updating the result store area pointer register (11) and one of the data pointers (231, 232, 233) for designating a group of data in order to execute one fuzzy inference exclusive-instruction; or updating the result store area pointer (11), the register (21) for designating a first pointer (231, 232, 233) for designating a first data group (151, 152, 153) in the data memory associated to this data pointer, and the conformity degree designating register (22) in order to execute the next fuzzy inference exclusive-instruction.

Inventors: ISHIMOTO SATOMI, SAKUMA HAJIME, ISHIMOTO, SATOMI, SAKUMA, HAJIME, ISHIMOTO, SATOMI, C/O NEC CORPORATION, SAKUMA, HAJIME, C/O NEC CORPORATION
Applicants: NIPPON ELECTRIC CO, NEC CORPORATION
Application year: 1993
Main classification: G06F9
IPC codes: G06F9, G06N7