Global truth table generation method and device for digital circuit

By generating and traversing the global expression tree, the leaf node signal combination of the digital circuit is calculated, which solves the problem of low calculation efficiency of the truth table in digital circuit simulation and improves the simulation speed and resource utilization.

CN117540670BActive Publication Date: 2024-09-20SHANGHAI XINSIWEI INFORMATION TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202310456476.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-25
Publication Date
2024-09-20
Estimated Expiration
2043-04-25

AI Technical Summary

Technical Problem

The existing technology is inefficient when calculating the truth table of a Boolean function in digital circuit simulation, resulting in slow simulation speed and waste of system resources.

Method used

By obtaining the Boolean function of the target digital circuit, a global expression tree is generated, the target value of the root node is determined, the expression tree is traversed based on the logical relationship, the signal combination of the leaf nodes is deduced, and a global truth table is generated.

Benefits of technology

It achieves fast and accurate acquisition of the global truth table of digital circuits, improves the calculation efficiency of Boolean functions, and reduces simulation time and system resource consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117540670B
    Figure CN117540670B
Patent Text Reader

Abstract

The present disclosure relates to a method and device for generating a global truth table for a digital circuit. The method includes: obtaining one or more Boolean functions corresponding to a target digital circuit; generating a global expression tree corresponding to the target digital circuit through the one or more Boolean functions; determining a target value of a root node of the global expression tree; traversing the global expression tree based on the target value; inferring a signal combination of multiple leaf nodes in the global expression tree based on a logical relationship during the traversal of the global expression tree; generating a global truth table for the target digital circuit through the signal combination of the multiple leaf nodes. The method and device for generating a global truth table for a digital circuit involved in the present application can quickly and accurately obtain the global truth tables of multiple Boolean functions corresponding to the digital circuit, thereby accelerating the calculation efficiency of the Boolean functions in the digital circuit, improving the simulation speed, and saving system resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of digital circuits, and in particular to a method and device for generating a global truth table for a digital circuit. Background Art

[0002] A digital circuit is a circuit that uses digital signals to perform arithmetic and logical operations on digital quantities. It is called a digital circuit or digital system. Because it has the functions of logical operation and logic processing, it is also called a digital logic circuit. Logic gates are the basic units of digital logic circuits. Digital circuits can be divided into two categories: combinational logic circuits and sequential logic circuits.

[0003] Digital circuits are based on binary digital logic, and their working signals are discrete digital signals. Therefore, there are a large number of Boolean functions represented by Boolean logic in a digital circuit, which are particularly important components of digital circuits.

[0004] EDA simulators can simulate the functional behavior of circuits without building actual circuits (a process that can be cumbersome and expensive), so they are very useful tools. Before building the actual circuit, simulating and verifying the design can greatly improve design efficiency. This is because designers can observe and study the behavior of the circuit in advance before building the circuit, without having to pay time and economic costs for the physical implementation of the circuit. Especially for integrated circuits, the electronic processes such as photomasks required to physically implement the circuit are expensive, and the high complexity of integrated circuits is difficult to implement on breadboards, so it is difficult to study the behavior of the circuit using traditional methods. Therefore, almost all integrated circuit designs rely on simulation. The most famous analog simulation is SPICE, and the most famous digital circuit simulators are based on Verilog or VHDL.

[0005] Obviously, it is necessary to calculate a large number of Boolean functions for simulating digital circuits. If the value of the Boolean function is obtained through a truth table, it is necessary to calculate a large number of truth tables of the Boolean function. There are many Boolean functions, and the amount of calculation is also relatively large.

[0006] The above information disclosed in the Background section is only for enhancement of understanding of the background of the present application and therefore it may contain information that does not constitute the prior art that is already known to a person of ordinary skill in the art. Summary of the invention

[0007] In view of this, the present application provides a global truth table generation method and device for digital circuits, which can quickly and accurately obtain the global truth tables of multiple Boolean functions corresponding to the digital circuit, thereby speeding up the calculation efficiency of Boolean functions in the digital circuit, improving the simulation speed, and saving system resources.

[0008] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.

[0009] According to one aspect of the present application, a method for generating a global truth table for a digital circuit is proposed, the method comprising: obtaining one or more Boolean functions corresponding to a target digital circuit; generating a global expression tree corresponding to the target digital circuit through the one or more Boolean functions; determining a target value of a root node of the global expression tree; traversing the global expression tree based on the target value; inferring signal combinations of multiple leaf nodes in the global expression tree based on logical relationships during the traversal of the global expression tree; and generating a global truth table for the target digital circuit through the signal combinations of the multiple leaf nodes.

[0010] In an exemplary embodiment of the present application, it also includes: obtaining signal values ​​of multiple input signals; inputting the multiple input signals into ports corresponding to the target digital circuit; and obtaining simulation output results of the digital circuit through the multiple input signals and the global truth table.

[0011] In an exemplary embodiment of the present application, generating a global expression tree corresponding to the target digital circuit through the one or more Boolean functions includes: parsing the one or more Boolean functions to generate one or more expression trees; associating the one or more expression trees to generate the global expression tree corresponding to the target digital circuit.

[0012] In an exemplary embodiment of the present application, the one or more expression trees are associated to generate the global expression tree corresponding to the target digital circuit, including: extracting the root nodes and leaf nodes of the one or more expression trees; associating the one or more expression trees based on the correspondence between the root nodes and the leaf nodes; and generating the global expression tree corresponding to the target digital circuit according to the association result.

[0013] In an exemplary embodiment of the present application, traversing the global expression tree based on the target value includes: taking the target value as the numerical value corresponding to the root node of the global expression tree; and traversing the global expression tree by a breadth-first search algorithm.

[0014] In an exemplary embodiment of the present application, in the process of traversing a global expression tree, signal combinations of multiple leaf nodes in the global expression tree are inferred based on logical relationships, including: in the process of traversing the global expression tree, obtaining the value of the root node; inferring the signal combination of the lower-level nodes according to the value of the root node and its corresponding operation type; traversing the signal combinations of the lower-level nodes one by one until the signal combination of the bottom-level leaf nodes is generated.

[0015] In an exemplary embodiment of the present application, the signal combinations of lower-level nodes are traversed one by one until the signal combination of the bottom-level leaf node is generated, including: obtaining the current node in the process of traversing the lower-level nodes one by one; when the current node is not a leaf node, extracting the values ​​in the signal combination corresponding to the current node one by one; and inferring the signal combination of the lower-level nodes according to the value of the current node and its corresponding operation type.

[0016] In an exemplary embodiment of the present application, a global truth table of the target digital circuit is generated by signal combinations of the multiple leaf nodes, including: extracting signal combinations corresponding to bottom-level leaf nodes in the global expression tree; expanding signal combinations corresponding to non-bottom-level leaf nodes; and generating a global truth table of the target digital circuit by signal combinations corresponding to bottom-level leaf nodes and expanded non-bottom-level leaf nodes.

[0017] In an exemplary embodiment of the present application, the signal combination corresponding to the non-bottom-level leaf node is expanded, including: each value in the signal combination corresponding to the non-bottom-level leaf node is expanded one by one according to the number of layers corresponding to the non-bottom-level leaf node.

[0018] In an exemplary embodiment of the present application, a global truth table of the target digital circuit is generated by a combination of signals corresponding to bottom-level leaf nodes and expanded non-bottom-level leaf nodes, including: generating an index value table by a combination of signals corresponding to bottom-level leaf nodes and expanded non-bottom-level leaf nodes; and eliminating repeated sequences in the index value table to generate a global truth table of the target digital circuit.

[0019] According to one aspect of the present application, a global truth table generating device for a digital circuit is proposed, the device comprising: a function module, used to obtain one or more Boolean functions corresponding to a target digital circuit; an expression tree module, used to generate a global expression tree corresponding to the target digital circuit through the one or more Boolean functions; a target value module, used to determine a target value of a root node of the global expression tree; a traversal module, used to traverse the global expression tree based on the target value; an inference module, used to infer the values ​​of multiple leaf nodes in the global expression tree based on logical relationships during the traversal of the global expression tree; and a truth table module, used to generate a global truth table of the target digital circuit through the values ​​of the multiple leaf nodes.

[0020] According to one aspect of the present application, an electronic device is proposed, which includes: one or more processors; a storage device for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the method as described above.

[0021] According to one aspect of the present application, a computer-readable medium is provided, on which a computer program is stored. When the program is executed by a processor, the method described above is implemented.

[0022] According to the global truth table generation method and device for digital circuits of the present application, by obtaining one or more Boolean functions corresponding to the target digital circuit; generating a global expression tree corresponding to the target digital circuit through the one or more Boolean functions; determining the target value of the root node of the global expression tree; traversing the global expression tree based on the target value; inferring the signal combination of multiple leaf nodes in the global expression tree based on logical relationships in the process of traversing the global expression tree; and generating the global truth table of the target digital circuit through the signal combination of the multiple leaf nodes, the global truth table of the corresponding multiple Boolean functions of the digital circuit can be quickly and accurately obtained, thereby accelerating the calculation efficiency of the Boolean functions in the digital circuit, improving the simulation speed, and saving system resources.

[0023] It should be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The above and other objects, features and advantages of the present application will become more apparent by describing in detail the exemplary embodiments thereof with reference to the accompanying drawings. The accompanying drawings described below are only some embodiments of the present application, and it is clear to a person skilled in the art that other accompanying drawings can be obtained from these accompanying drawings without creative effort.

[0025] Figure 1 The present invention is a flowchart of a method for generating a global truth table for a digital circuit according to an exemplary embodiment.

[0026] Figure 2 The present invention is a flowchart of a method for generating a global truth table for a digital circuit according to an exemplary embodiment.

[0027] Figure 3 The present invention is a flowchart of a method for generating a global truth table for a digital circuit according to another exemplary embodiment.

[0028] Figure 4 is a schematic diagram showing a method for generating a global truth table for a digital circuit according to another exemplary embodiment.

[0029] Figure 5 The present invention is a flowchart of a method for generating a global truth table for a digital circuit according to another exemplary embodiment.

[0030] Figure 6is a schematic diagram showing a method for generating a global truth table for a digital circuit according to another exemplary embodiment.

[0031] Figure 7 is a schematic diagram showing a method for generating a global truth table for a digital circuit according to another exemplary embodiment.

[0032] Figure 8 The invention is a block diagram showing a device for generating a global truth table for a digital circuit according to an exemplary embodiment.

[0033] Fig. 9 It is a block diagram of an electronic device according to an exemplary embodiment.

[0034] Fig.10 It is a block diagram of a computer-readable medium according to an exemplary embodiment. DETAILED DESCRIPTION

[0035] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this application will be comprehensive and complete and will fully convey the concepts of the example embodiments to those skilled in the art. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted.

[0036] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.

[0037] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0038] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0039] It should be understood that although the terms first, second, third, etc. may be used herein to describe various components, these components should not be limited by these terms. These terms are used to distinguish one component from another component. Therefore, the first component discussed below can be referred to as the second component without departing from the teachings of the concepts of the present application. As used herein, the term "and / or" includes any one of the associated listed items and all combinations of one or more.

[0040] Those skilled in the art will appreciate that the drawings are merely schematic diagrams of example embodiments, and the modules or processes in the drawings are not necessarily necessary for implementing the present application, and therefore cannot be used to limit the scope of protection of the present application.

[0041] The technical abbreviations involved in this application are explained as follows:

[0042] Boolean function: describes how to determine a Boolean output based on some logical calculation of Boolean inputs. They play a fundamental role in problems in complexity theory and in chip design for digital computers.

[0043] Boolean logic: Boolean logic is a logical algebraic system named after the British mathematician George Boole. The main Boolean logic operators are logical AND (and), logical OR (or), logical NOT (not), and logical XOR (xor).

[0044] Truth table: A table that represents all possible states between input and output of a logic event.

[0045] Binary tree: It is a set of n finite elements. The set is either empty or consists of an element called the root and two disjoint binary trees called the left subtree and the right subtree. It is an ordered tree. When the set is empty, the binary tree is called an empty binary tree. In a binary tree, an element is also called a node.

[0046] Expression tree: The leaf nodes of an expression tree are operands, and the other nodes are operators. Assuming that all operators are binary operators, a binary tree is formed. We can recursively calculate the values ​​of the left and right subtrees to get the value of the entire expression tree.

[0047] Breadth-first search (BFS) is one of the simplest graph search algorithms. It is also known as BFS. It is a blind search method that aims to systematically expand and check all nodes in the graph to find the result. In other words, it does not consider the possible location of the result and thoroughly searches the entire graph until the result is found.

[0048] Traversal refers to visiting each node in a tree (or graph) in turn along a search route.

[0049] Verilog HDL: It is a hardware description language that describes the structure and behavior of digital system hardware in text form. It can be used to represent logic circuit diagrams, logic expressions, and the logic functions performed by digital logic systems. Verilog HDL and VHDL are the two most popular hardware description languages ​​in the world.

[0050] Bit (BIT, Binary digit), a computer term, is a unit of information volume, which is a transliteration of the English word BIT. It is also a bit in a binary number, a unit of measurement for information volume, and the smallest unit of information volume.

[0051] The truth table is the basis of digital circuit simulation calculation. For the calculation of the truth table, the simple way is to obtain a set of permutations and combinations based on the input, and then input these combinations one by one to obtain the output, and then you can get the truth table. However, according to the algorithm of permutations and combinations, the number of permutations and combinations increases exponentially with the increase of input. Calculating the combinations one by one also requires a lot of calculation.

[0052] After research, the inventor of this case found that in a digital circuit, assuming that there are n input signals, when only considering that the input value of each input signal of the Boolean function is 0 or 1, there are 2n combinations of all permutations in the truth table. When the signal value of the input signal is 0, 1, x, and z, there are 4n permutations and combinations of the truth table. The size of the truth table grows exponentially with the number of input combinations. In the prior art, the amount of computation required for truth table simulation is relatively large when the truth table is obtained through permutations and combinations.

[0053] In view of the technical bottlenecks in the prior art, the present application proposes a global truth table generation method for digital circuits, which can speed up the calculation time of the truth table. The content of the present application is described in detail below in conjunction with specific embodiments.

[0054] Figure 1 The flowchart of a method for generating a global truth table for a digital circuit according to an exemplary embodiment is shown. The method 10 for generating a global truth table for a digital circuit includes at least steps S102 to S108.

[0055] like Figure 1 As shown, in S102, one or more Boolean functions corresponding to the target digital circuit are obtained. The circuit information of the target digital circuit can be read in, and the Boolean function to be simulated is obtained from the circuit information. The mapping relationship between the input and output of each Boolean function will not change during the simulation.

[0056] In S104, a global expression tree corresponding to the target digital circuit is generated by using the one or more Boolean functions. The one or more Boolean functions are parsed to generate one or more expression trees; and the one or more expression trees are associated to generate the global expression tree corresponding to the target digital circuit.

[0057] More specifically, the root nodes and leaf nodes of the one or more expression trees may be extracted; the one or more expression trees may be associated based on the corresponding relationship between the root nodes and the leaf nodes; and the global expression tree corresponding to the target digital circuit may be generated according to the association result.

[0058] In one example, the Boolean function corresponding to a digital circuit is as follows:

[0059] f=((a&b)|c)&d.

[0060] The expression tree corresponding to this Boolean function can be Figure 2 shown.

[0061] In S106, the target value of the root node of the global expression tree is determined. The root node is the output value f of the Boolean function, for example, f has two possible values: 1 or 0. According to the steps in the following text, the truth table of the Boolean function when f=1 and the truth table of the Boolean function when f=0 can be established respectively.

[0062] In S108, the global expression tree is traversed based on the target value. The target value can be used as the value corresponding to the root node of the global expression tree; and the global expression tree is traversed using a breadth-first search algorithm.

[0063] You can first set f=0 and traverse the global expression tree based on the root node being 0.

[0064] In S110, in the process of traversing the global expression tree, the signal combinations of multiple leaf nodes in the global expression tree are calculated based on the logical relationship. In the process of traversing the global expression tree, the value of the root node can be obtained; the signal combination of the lower nodes can be calculated according to the value of the root node and the corresponding operation type; the signal combination of the lower nodes is traversed one by one until the signal combination of the bottom leaf node is generated.

[0065] The content of "inferring signal combinations of multiple leaf nodes in the global expression tree based on logical relationships during traversal of the global expression tree" will be Figure 3 The corresponding embodiments are described in detail.

[0066] In S112, a global truth table of the target digital circuit is generated by combining the signals of the plurality of leaf nodes. The signal combinations corresponding to the bottom leaf nodes in the global expression tree may be extracted; the signal combinations corresponding to the non-bottom leaf nodes may be expanded; and the global truth table of the target digital circuit may be generated by combining the signals corresponding to the bottom leaf nodes and the expanded non-bottom leaf nodes.

[0067] The content of "generating the global truth table of the target digital circuit by combining the signals of the multiple leaf nodes" will be in Figure 4 The corresponding embodiments are described in detail.

[0068] According to the global truth table generation method for digital circuits of the present application, by obtaining one or more Boolean functions corresponding to the target digital circuit; generating a global expression tree corresponding to the target digital circuit through the one or more Boolean functions; determining the target value of the root node of the global expression tree; traversing the global expression tree based on the target value; in the process of traversing the global expression tree, inferring the signal combination of multiple leaf nodes in the global expression tree based on logical relationships; and generating the global truth table of the target digital circuit through the signal combination of the multiple leaf nodes, the global truth table of the corresponding multiple Boolean functions of the digital circuit can be quickly and accurately obtained, thereby accelerating the calculation efficiency of the Boolean functions in the digital circuit, improving the simulation speed, and saving system resources.

[0069] It should be clearly understood that the present application describes how to form and use specific examples, but the principles of the present application are not limited to any details of these examples. On the contrary, based on the teaching of the content disclosed in the present application, these principles can be applied to many other embodiments.

[0070] Figure 3 The present invention is a flowchart of a method for generating a global truth table for a digital circuit according to another exemplary embodiment. Figure 3 The process 30 shown is for Figure 1 The process shown includes a detailed description of S110 "inferring signal combinations of multiple leaf nodes in the global expression tree based on logical relationships during traversal of the global expression tree".

[0071] like Figure 3 As shown, in S302, in the process of traversing the global expression tree, the value of the root node is obtained. It can be assumed that the root node is 0.

[0072] In S304, the signal combination of the lower layer nodes is calculated according to the value of the root node and its corresponding operation type.

[0073] The truth table of basic logic gates comes from the IEEE Standard for HardwareDescription Language can generate the truth table corresponding to the Boolean function through the truth table of the basic logic gate. The truth table of the basic logic gate can be as follows Figure 4 shown.

[0074] according to Figure 4 In the logic gate truth table, all input combinations can be listed in a reverse manner, and then arranged to generate signal combinations for the lower-level nodes.

[0075] For a truth table whose target output is 0, that is, whose root node is 0, when the logic operation is determined, its input combination is determined. For example, if the output of the AND gate is 0, there are three possibilities. They can be:

[0076] 0=0&0;

[0077] 0=1&0;

[0078] 0=0&1;

[0079] The input combinations are 0, 1, 0 for one input and 0, 0, 1 for the other input. The OR gate is also reversed in a similar way.

[0080] The above is a reverse signal combination based on the output value of the root node being 1, 0, and the input value range being 0, 1. It is understandable that the method in the present application can also be used in digital circuit calculations where the input signal ranges from 0, 1, x, and z. When the input signal ranges from 0, 1, x, and z, there are more possible combinations obtained by reverse deduction.

[0081] In S306, in the process of traversing the lower layer nodes one by one, the current node is obtained.

[0082] In S308, when the current node is not a leaf node, the values ​​in the signal combination corresponding to the current node are extracted one by one.

[0083] In the process of traversing layer by layer, each node encountered is regarded as a new "root node". For example, if the signal combination of the current node is "0, 1, 0", 0 can be extracted as the target output value of the node currently being calculated, and the possible value combinations of the lower-level nodes can be calculated backwards; then 1 can be extracted as the target output value of the node currently being calculated, and the possible value combinations of the lower-level nodes can be calculated backwards; finally, 0 can be extracted as the target output value of the node currently being calculated, and the possible value combinations of the lower-level nodes can be calculated backwards.

[0084] In S310, the signal combination of the lower layer nodes is calculated according to the value of the current node and its corresponding operation type. After three calculations, all possible combinations of the lower layer nodes are obtained. The calculation results can be shown as Figure 5 shown.

[0085] According to the value to be obtained and the operation type of this node, a set of corresponding input combinations can be obtained. This input combination is the output value of its child nodes. Traverse downward in sequence until the leaf node. The values ​​of all leaf nodes are the input of this Boolean function.

[0086] Figure 6 The present invention is a flowchart of a method for generating a global truth table for a digital circuit according to another exemplary embodiment. Figure 6 The process 60 shown is for Figure 2 A detailed description of S112 "generating a global truth table of the target digital circuit by combining signals of the multiple leaf nodes" in the process shown.

[0087] like Figure 6 As shown, in S602, the signal combination corresponding to the bottom leaf node in the global expression tree is extracted. As in the above embodiment, all the inferred signal combinations in the leaf nodes can be extracted. The specific signal combination is as follows Figure 5 shown.

[0088] In S604, the signal combination corresponding to the non-bottom leaf node is expanded. Each value in the signal combination corresponding to the non-bottom leaf node can be expanded one by one according to the number of layers corresponding to the non-bottom leaf node.

[0089] In order to generate the global truth table described later, all leaf node combinations can be padded to the same value. For example, the number of elements in the upper layer can be padded to the same number as the number in the lower layer. The padding method is very simple. Each value is repeated to the power of 3 offset. The offset is the difference in levels.

[0090] In one embodiment, as shown in the Boolean function above, the tree has 3(n-1) elements for all input values ​​at each level, 3 at the second level, 9 at the third level, and 27 at the fourth level. Except for the leaf nodes at the fourth level, each value in the leaf nodes at each level is repeated 3(n-1) times.

[0091] The value of each leaf node after expansion is as follows Figure 7 shown.

[0092] In S606, a global truth table of the target digital circuit is generated by combining the signals corresponding to the bottom leaf nodes and the expanded non-bottom leaf nodes. An index value table is generated by combining the signals corresponding to the bottom leaf nodes and the expanded non-bottom leaf nodes; and repeated sequences in the index value table are removed to generate a global truth table of the target digital circuit.

[0093] Will Figure 8The obtained index value table is subjected to a deduplication operation to obtain a global truth table corresponding to the digital circuit.

[0094] In one embodiment, the signal values ​​of multiple input signals can be obtained; the multiple input signals are input to the ports corresponding to the target digital circuit; and the simulation output result of the digital circuit is obtained through the multiple input signals and the global truth table. In actual use, the simulation output value of the digital circuit can be obtained by searching the global truth table.

[0095] Those skilled in the art will appreciate that all or part of the steps for implementing the above embodiments are implemented as a computer program executed by a CPU. When the computer program is executed by the CPU, the above functions defined by the above method provided in the present application are executed. The program may be stored in a computer-readable storage medium, which may be a read-only memory, a disk, or an optical disk, etc.

[0096] In addition, it should be noted that the above figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present application, and are not intended to be limiting. It is easy to understand that the processes shown in the above figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0097] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0098] Figure 8 FIG. 1 is a block diagram of a global truth table generating device for a digital circuit according to an exemplary embodiment. Figure 8 As shown, the global truth table generating device 80 for digital circuits includes: a function module 802 , an expression tree module 804 , a target value module 806 , a traversal module 808 , a calculation module 810 , and a truth table module 812 .

[0099] The function module 802 is used to obtain one or more corresponding Boolean functions of the target digital circuit;

[0100] The expression tree module 804 is used to generate a global expression tree corresponding to the target digital circuit through the one or more Boolean functions; the expression tree module 804 is also used to parse the one or more Boolean functions to generate one or more expression trees; and the one or more expression trees are associated to generate the global expression tree corresponding to the target digital circuit.

[0101] The target value module 806 is used to determine the target value of the root node of the global expression tree;

[0102] The traversal module 808 is used to traverse the global expression tree based on the target value; the traversal module 808 is also used to use the target value as the numerical value corresponding to the root node of the global expression tree; and traverse the global expression tree through a breadth-first search algorithm.

[0103] The inference module 810 is used to infer the signal combination of multiple leaf nodes in the global expression tree based on logical relationships during the process of traversing the global expression tree; the inference module 810 is also used to obtain the value of the root node during the process of traversing the global expression tree; infer the signal combination of the lower-level nodes according to the value of the root node and its corresponding operation type; and traverse the signal combination of the lower-level nodes one by one until the signal combination of the bottom-level leaf node is generated.

[0104] The truth table module 812 is used to generate a global truth table of the target digital circuit through the signal combination of the multiple leaf nodes. The truth table module 812 is also used to extract the signal combination corresponding to the bottom leaf nodes in the global expression tree; expand the signal combination corresponding to the non-bottom leaf nodes; and generate the global truth table of the target digital circuit through the signal combination corresponding to the bottom leaf nodes and the expanded non-bottom leaf nodes.

[0105] According to the global truth table generating device for digital circuits of the present application, by obtaining one or more Boolean functions corresponding to the target digital circuit; generating a global expression tree corresponding to the target digital circuit through the one or more Boolean functions; determining a target value of a root node of the global expression tree; traversing the global expression tree based on the target value; inferring signal combinations of multiple leaf nodes in the global expression tree based on logical relationships during the traversal of the global expression tree; and generating a global truth table of the target digital circuit through the signal combinations of the multiple leaf nodes, the global truth table of the corresponding multiple Boolean functions of the digital circuit can be quickly and accurately obtained, thereby accelerating the calculation efficiency of Boolean functions in digital circuits, improving simulation speed, and saving system resources.

[0106] Fig. 9 It is a block diagram of an electronic device according to an exemplary embodiment.

[0107] Refer to the following Fig. 9 hereinafter describes an electronic device 900 according to this embodiment of the present application. Fig. 9 The electronic device 900 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0108] like Fig. 9As shown, the electronic device 900 is in the form of a general computing device. The components of the electronic device 900 may include, but are not limited to: at least one processing unit 910, at least one storage unit 920, a bus 930 connecting different system components (including the storage unit 920 and the processing unit 910), a display unit 940, etc.

[0109] The storage unit stores a program code, which can be executed by the processing unit 910, so that the processing unit 910 performs the steps described in this specification according to various exemplary embodiments of the present application. For example, the processing unit 910 can perform the following steps: Figure 1 , Figure 2 , Figure 6 Follow the steps shown in .

[0110] The storage unit 920 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 9201 and / or a cache memory unit 9202 , and may further include a read-only memory unit (ROM) 9203 .

[0111] The storage unit 920 may also include a program / utility 9204 having a set (at least one) of program modules 9205, such program modules 9205 including but not limited to: an operating system, one or more application programs, other program modules and program data, each of which or some combination may include the implementation of a network environment.

[0112] Bus 930 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0113] The electronic device 900 may also communicate with one or more external devices 900' (e.g., keyboards, pointing devices, Bluetooth devices, etc.) to enable a user to communicate with the electronic device 900, and / or any device (e.g., routers, modems, etc.) that the electronic device 900 can communicate with one or more other computing devices. Such communication may be performed through an input / output (I / O) interface 950. In addition, the electronic device 900 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 960. The network adapter 960 may communicate with other modules of the electronic device 900 through a bus 930. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 900, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0114] Through the above description of the implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by combining software with necessary hardware. Fig.10 As shown, the technical solution according to the implementation mode of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a server, or a network device, etc.) to execute the above method according to the implementation mode of the present application.

[0115] The software product may be any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, a system, device or component of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0116] The computer readable storage medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by an instruction execution system, an apparatus, or a device or used in combination with it. The program code contained on the readable storage medium may be transmitted with any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.

[0117] Program code for performing the operations of the present application may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).

[0118] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by a device, the computer-readable medium implements the following functions: obtaining one or more Boolean functions corresponding to the target digital circuit; generating a global expression tree corresponding to the target digital circuit through the one or more Boolean functions; determining the target value of the root node of the global expression tree; traversing the global expression tree based on the target value; inferring the signal combination of multiple leaf nodes in the global expression tree based on logical relationships in the process of traversing the global expression tree; generating a global truth table of the target digital circuit through the signal combination of the multiple leaf nodes.

[0119] Those skilled in the art will appreciate that the above modules can be distributed in the device according to the description of the embodiment, or can be changed accordingly and only used in one or more devices different from the embodiment. The modules of the above embodiments can be combined into one module, or further divided into multiple sub-modules.

[0120] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the embodiment of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the embodiment of the present application.

[0121] The exemplary embodiments of the present application are specifically shown and described above. It should be understood that the present application is not limited to the detailed structures, configurations or implementations described herein; on the contrary, the present application is intended to cover various modifications and equivalent configurations included in the spirit and scope of the appended claims.

Claims

1. A method for generating a global truth table for a digital circuit, characterized in that: include: obtaining one or more corresponding Boolean functions of the target digital circuit; Generate a global expression tree corresponding to the target digital circuit by using the one or more Boolean functions; Determine the target value of the root node of the global expression tree; Traversing the global expression tree based on the target value; In the process of traversing the global expression tree, signal combinations of multiple leaf nodes in the global expression tree are inferred based on logical relationships; The global truth table of the target digital circuit is generated by the signal combination of the multiple leaf nodes, including: extracting the signal combination corresponding to the bottom-level leaf nodes in the global expression tree; expanding the signal combination corresponding to the non-bottom-level leaf nodes; and generating the global truth table of the target digital circuit by the signal combination corresponding to the bottom-level leaf nodes and the expanded non-bottom-level leaf nodes.

2. The method for generating a global truth table according to claim 1, wherein: Also includes: Get the signal values ​​of multiple input signals; Inputting the multiple input signals to ports corresponding to the target digital circuit; A simulation output result of the digital circuit is obtained through the multiple input signals and the global truth table.

3. The method for generating a global truth table according to claim 1, wherein: Generating a global expression tree corresponding to the target digital circuit by using the one or more Boolean functions includes: Parsing the one or more Boolean functions to generate one or more expression trees; The one or more expression trees are associated to generate the global expression tree corresponding to the target digital circuit.

4. The method for generating a global truth table according to claim 3, wherein: Associating the one or more expression trees to generate the global expression tree corresponding to the target digital circuit includes: Extracting root nodes and leaf nodes of the one or more expression trees; Associating the one or more expression trees based on the corresponding relationship between the root node and the leaf nodes; The global expression tree corresponding to the target digital circuit is generated according to the association result.

5. The method for generating a global truth table according to claim 1, wherein: Traversing the global expression tree based on the target value includes: Taking the target value as the value corresponding to the root node of the global expression tree; The global expression tree is traversed by a breadth-first search algorithm.

6. The method for generating a global truth table according to claim 1, wherein: In the process of traversing the global expression tree, signal combinations of multiple leaf nodes in the global expression tree are inferred based on logical relationships, including: In the process of traversing the global expression tree, get the value of the root node; Calculating the signal combination of the lower nodes according to the value of the root node and its corresponding operation type; The signal combinations of the lower-level nodes are traversed one by one until the signal combination of the bottom-level leaf node is generated.

7. The method for generating a global truth table according to claim 6, wherein: The signal combinations of the lower-level nodes are traversed one by one until the signal combination of the bottom-level leaf nodes is generated, including: In the process of traversing the lower-level nodes one by one, obtain the current node; When the current node is not a leaf node, extracting values ​​in the signal combination corresponding to the current node one by one; The signal combination of the lower-level nodes is calculated according to the value of the current node and its corresponding operation type.

8. The method for generating a global truth table according to claim 1, wherein: The signal combination corresponding to the non-bottom-level leaf nodes is expanded to include: Each value in the signal combination corresponding to the non-bottom-level leaf node is expanded one by one according to the number of layers corresponding to the non-bottom-level leaf node.

9. The method for generating a global truth table according to claim 1, wherein: Generate a global truth table of the target digital circuit by combining signals corresponding to the bottom leaf nodes and the expanded non-bottom leaf nodes, including: Generate an index value table by combining the signals corresponding to the bottom leaf nodes and the expanded non-bottom leaf nodes; Repetitive sequences in the index value table are eliminated to generate a global truth table of the target digital circuit.

10. A global truth table generating device for a digital circuit, characterized in that: include: A function module, used to obtain one or more corresponding Boolean functions of the target digital circuit; An expression tree module, used for generating a global expression tree corresponding to the target digital circuit through the one or more Boolean functions; A target value module, used to determine the target value of the root node of the global expression tree; A traversal module, used for traversing the global expression tree based on the target value; A calculation module, used for calculating signal combinations of multiple leaf nodes in the global expression tree based on logical relationships during traversal of the global expression tree; A truth table module is used to generate a global truth table of the target digital circuit through signal combinations of the multiple leaf nodes, including: extracting signal combinations corresponding to bottom-level leaf nodes in the global expression tree; expanding signal combinations corresponding to non-bottom-level leaf nodes; and generating a global truth table of the target digital circuit through signal combinations corresponding to bottom-level leaf nodes and expanded non-bottom-level leaf nodes.

Citation Information

Patent Citations

  • Predicate expression tree analysis method and device and medium

    CN112230928A

  • Multi-core polarization code fast serial cancellation list decoding method

    CN114978196A

  • Automatic function generation method and system based on truth table

    CN115329949A

  • Signal path automatic extraction method, system and device and storage medium

    CN115455900A

  • Logic truth table acquisition method and device, electronic equipment and storage medium

    CN115982095A