Method and device for converting binary data into multi-valued data, computer equipment and readable storage medium
By determining the encoding circuit and building a logical mapping table, binary data is converted into multivalued data, which solves the problem of complexity of traditional methods, improves data processing efficiency and flexibility, and is suitable for multiple binary conversions.
Patent Information
- Application Number
- CN202411169160.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2024-12-03
AI Technical Summary
The traditional method of converting binary data into multivalued data is complex, which limits the efficiency and flexibility of data processing and is difficult to meet the needs of multiple digital systems.
By obtaining the binary data to be processed and the target binary number, determining the encoding circuit, using multiple power supplies to divide the voltage levels and constructing a logical mapping table, converting the binary data into multi-valued data, and realizing the mapping of the target binary number.
It simplifies the data conversion process, improves data processing efficiency, is suitable for a variety of plasma conversion requirements, ensuring conversion accuracy and reliability.
Smart Images

Figure CN119070827A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a method, device, computer equipment and readable storage medium for converting binary data into multi-valued data. Background Art
[0002] With the rapid development of information technology, data processing and conversion technology has become increasingly important. In many application scenarios, it is necessary to convert binary data (i.e., binary data, usually represented as 0 and 1) into multi-valued data to meet the requirements of a specific number system. Traditional data conversion methods may involve complex algorithms and calculation processes, which to some extent limits the efficiency and flexibility of data processing. Summary of the invention
[0003] The object of the present invention is to provide a method, device, computer equipment and readable storage medium for converting binary data into multi-valued data.
[0004] In a first aspect, an embodiment of the present invention provides a method for converting binary data into multi-valued data, comprising:
[0005] Obtain the binary data to be processed and the target base number to be converted;
[0006] Determine the encoding circuit according to the target base number;
[0007] Inputting the binary data to be processed into the encoding circuit to obtain a mapping result of the encoding circuit for the binary data to be processed;
[0008] According to the mapping result, it is determined that the binary value to be processed is converted into multi-valued data of the target base number.
[0009] In a possible implementation manner, determining the encoding circuit according to the target base number includes:
[0010] Get preset multi-power supply;
[0011] Dividing the power supply voltage of the preset multiple power supplies according to the target base number to obtain multiple voltage levels, each of the voltage levels corresponds to a value in the multi-valued data corresponding to the target base number;
[0012] Constructing a logical mapping table, wherein the logical mapping table includes a mapping relationship between binary data and multi-valued data;
[0013] The encoding circuit is constructed according to the logic mapping table.
[0014] In a possible implementation manner, the step of inputting the binary data to be processed into the encoding circuit to obtain a mapping result of the encoding circuit for the binary data to be processed includes:
[0015] Inputting the binary data to be processed into the encoding circuit;
[0016] Determining, according to the logic mapping table, the multi-valued data to be processed corresponding to the binary data to be processed;
[0017] A mapping result of the binary data to be processed is determined according to the multi-valued data to be processed and the corresponding relationship between the voltage level and the multi-valued data.
[0018] In a possible implementation manner, determining the mapping result of the binary data to be processed according to the multi-valued data to be processed in combination with the corresponding relationship between the voltage level and the multi-valued data includes:
[0019] According to the multi-valued data to be processed and the corresponding relationship between the voltage level and the multi-valued data, the voltage level corresponding to each binary digit included in the binary data to be processed is obtained;
[0020] According to the voltage level corresponding to each binary digit, the mapping result of determining the binary data to be processed is obtained.
[0021] In a possible implementation, the method further includes:
[0022] Acquire the binary data to be processed and the multi-valued data of the target number;
[0023] Verifying whether the conversion relationship between the binary data to be processed and the multi-valued data of the target base number is correct;
[0024] If yes, retaining the encoding circuit;
[0025] If not, an error prompt is issued, and the error prompt is used as feedback data of the encoding circuit.
[0026] In a possible implementation, the method further includes:
[0027] The logic mapping table and the power supply voltage division method of the multiple power supplies are adjusted according to the feedback data.
[0028] In a possible implementation, the method further includes:
[0029] Acquire performance data of converting the binary data to be processed into the multi-valued data, wherein the performance data includes a conversion speed and a conversion accuracy rate;
[0030] When the performance data meets a preset performance threshold, the encoding circuit is marked as a qualified encoding circuit.
[0031] In a second aspect, an embodiment of the present invention provides a device for converting binary data into multi-valued data, comprising:
[0032] An acquisition module is used to acquire binary data to be processed and a target base number to be converted; and a coding circuit is determined according to the target base number;
[0033] The conversion module is used to input the binary data to be processed into the encoding circuit to obtain the mapping result of the encoding circuit for the binary data to be processed; according to the mapping result, determine the multi-valued data of the target base number converted from the binary data to be processed.
[0034] In a third aspect, an embodiment of the present invention provides a computer device, comprising a processor and a non-volatile memory storing computer instructions, wherein when the computer instructions are executed by the processor, the computer device executes the method described in at least one possible implementation of the first aspect.
[0035] In a fourth aspect, an embodiment of the present invention provides a readable storage medium, wherein the readable storage medium includes a computer program, and when the computer program is executed, the computer device where the readable storage medium is located is controlled to execute the method described in at least one possible implementation manner of the first aspect.
[0036] Compared with the prior art, the beneficial effects provided by the present invention include: using a method, device, computer equipment and readable storage medium disclosed in the present invention to convert binary data into multi-valued data, by obtaining the binary data to be processed and the target base number. Then, the encoding circuit is customized according to the target base number. By inputting the binary data into this circuit, a mapping result is obtained, and then the binary data is accurately converted into the multi-valued data of the target base. Such a design simplifies the conversion process, improves the data processing efficiency, and is suitable for a variety of base conversion requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only illustrate certain embodiments of the present invention and should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can also be obtained based on these drawings without creative work.
[0038] Figure 1 A schematic flow chart of the steps of a method for converting binary data into multi-valued data provided by an embodiment of the present invention;
[0039] Figure 2A schematic diagram of an interface of a multi-valued logic circuit provided by an embodiment of the present invention;
[0040] Figure 3 A conceptual schematic diagram of multiple power supplies provided by an embodiment of the present invention;
[0041] Figure 4 A schematic diagram of a circuit for selecting and generating a quaternary 1-bit by dividing multiple power supplies provided in an embodiment of the present invention;
[0042] Figure 5 A schematic block diagram of the structure of an apparatus for converting binary data into multi-valued data provided by an embodiment of the present invention;
[0043] Figure 6 A schematic block diagram of the structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0045] The specific implementation modes of the present invention are described in detail below in conjunction with the accompanying drawings.
[0046] In order to solve the technical problems in the aforementioned background technology, Figure 1 This is a flow chart of a method for converting binary data into multi-valued data provided by an embodiment of the present disclosure. The method for converting binary data into multi-valued data is introduced in detail below.
[0047] Step S201, obtaining binary data to be processed and a target base number to be converted;
[0048] Step S202, determining a coding circuit according to the target base number;
[0049] Step S203, inputting the binary data to be processed into the encoding circuit to obtain a mapping result of the encoding circuit for the binary data to be processed;
[0050] Step S204: Determine, based on the mapping result, the conversion of the binary value to be processed into multi-valued data of the target base number.
[0051] In an embodiment of the present invention, illustratively, the server first receives a set of binary data to be processed, such as a string of binary numbers "1011001". At the same time, the server also receives the target base number to be converted into these binary data, such as quaternary (also known as four-valued logic or a number system with a base of 4). Based on the received target base number (quaternary in this case), the data processing unit of the server determines a suitable encoding circuit. This encoding circuit is designed to be able to convert the input binary data into quaternary data. For example, this circuit may implement a specific algorithm that can map continuous binary bit combinations to corresponding quaternary numbers. The server inputs the previously obtained binary data "1011001" into the determined encoding circuit. The encoding circuit converts this set of binary data into the corresponding quaternary representation through its built-in mapping logic. For example, the binary "1011001" may first be divided into three groups: "101", "100" and "1" (assuming that this is a grouping based on the mapping rules of the circuit), and then these three groups of binary numbers are mapped to the quaternary "11", "20" and "1" respectively. Finally, the server combines them into a complete quaternary number based on the mapping results output by the encoding circuit. In this example, the binary data "1011001" is converted into the quaternary data "11201". This converted quaternary data is the multi-valued representation of the original binary data, which can be used for subsequent data processing or storage operations. Through the above steps, the server successfully converts the binary data into multi-valued data, which may improve the efficiency of data storage or the ability of data processing.
[0052] In the embodiment of the present invention, the aforementioned step S202 may be implemented through the following example execution.
[0053] Get preset multi-power supply;
[0054] Dividing the power supply voltage of the preset multiple power supplies according to the target base number to obtain multiple voltage levels, each of the voltage levels corresponds to a value in the multi-valued data corresponding to the target base number;
[0055] Constructing a logical mapping table, wherein the logical mapping table includes a mapping relationship between binary data and multi-valued data;
[0056] The encoding circuit is constructed according to the logic mapping table.
[0057] In an embodiment of the present invention, illustratively, the server first obtains a preset multi-power supply device, which can provide multiple power supply voltages. For example, this multi-power supply device may have the ability to provide any voltage value in the range of 0-10V. Next, the server divides the power supply voltage range according to the target base number (such as quaternary) to be converted. Taking quaternary as an example, the server may divide the voltage range of 0-10V into four voltage levels, such as 0-2.5V, 2.5-5V, 5-7.5V and 7.5-10V, and each voltage level corresponds to a value in quaternary (0, 1, 2, 3). The server will then construct a logical mapping table, which details the mapping relationship between binary data and multi-valued data (quaternary data in this example). For example, the logic mapping table may specify that binary "00" is mapped to quaternary "0" (corresponding to a voltage level of 0-2.5V), "01" is mapped to "1" (2.5-5V), "10" is mapped to "2" (5-7.5V), and "11" is mapped to "3" (7.5-10V). Finally, the server will build an encoding circuit based on this logic mapping table. This circuit is designed to receive binary input and convert it to the corresponding voltage level output according to the logic mapping table, thereby realizing binary to quaternary conversion. For example, when the circuit receives the binary input "10", it will output the voltage range (5-7.5V) corresponding to the quaternary "2" according to the logic mapping table. Through this detailed scenario example, you can see how the server determines an encoding circuit based on the target base number (such as quaternary), which can convert binary data into multi-value data (quaternary data) and express it in the form of voltage levels. This method may be used in practical applications to improve data transmission efficiency, increase data storage density, or implement more complex logical operations.
[0058] In the embodiment of the present invention, the aforementioned step S203 may be implemented through the following example execution.
[0059] Inputting the binary data to be processed into the encoding circuit;
[0060] Determining, according to the logic mapping table, the multi-valued data to be processed corresponding to the binary data to be processed;
[0061] A mapping result of the binary data to be processed is determined according to the multi-valued data to be processed and the corresponding relationship between the voltage level and the multi-valued data.
[0062] In an embodiment of the present invention, exemplarily, the server first inputs the binary data to be processed, such as the binary sequence "101101", into the encoding circuit previously constructed according to the logic mapping table. After receiving the binary sequence "101101", the encoding circuit will perform data conversion according to the pre-constructed logic mapping table. Taking the previous example, the logic mapping table stipulates that: "00" is mapped to the quaternary "0", "01" is mapped to "1", "10" is mapped to "2", and "11" is mapped to "3". Therefore, the binary sequence "101101" will be converted into the corresponding quaternary sequence. Specifically, "10" is mapped to "2", "11" is mapped to "3", and "01" is mapped to "1", so the converted quaternary sequence is "231". Next, the encoding circuit will further map the converted quaternary sequence "231" to a specific voltage level according to the correspondence between the voltage level and the quaternary value. According to the previous division, 0-2.5V corresponds to "0", 2.5-5V corresponds to "1", 5-7.5V corresponds to "2", and 7.5-10V corresponds to "3". Therefore, "2" is mapped to the voltage level of 5-7.5V, "3" is mapped to the voltage level of 7.5-10V, and "1" is mapped to the voltage level of 2.5-5V. In the end, the mapping result of the binary sequence "101101" is a combination of a series of voltage levels, specifically 5-7.5V, 7.5-10V, and 2.5-5V. Through this mapping process, the server successfully converts binary data into multi-valued data with different voltage levels. This conversion may have practical application value in certain specific hardware or communication systems, such as for signal transmission or data processing scenarios.
[0063] In the embodiment of the present invention, the mapping result of the binary data to be processed is determined according to the multi-valued data to be processed in combination with the corresponding relationship between the voltage level and the multi-valued data, which can be implemented through the following examples.
[0064] According to the multi-valued data to be processed and the corresponding relationship between the voltage level and the multi-valued data, the voltage level corresponding to each binary digit included in the binary data to be processed is obtained;
[0065] According to the voltage level corresponding to each binary digit, the mapping result of determining the binary data to be processed is obtained.
[0066] In the embodiment of the present invention, illustratively, the server has converted the binary data to be processed (e.g., the binary sequence "101101") into corresponding multi-value data (in the example of the embodiment of the present invention, the quaternary sequence "231") through the encoding circuit. Next, the server will determine the voltage level corresponding to each quaternary digit (converted from two binary digits) according to the previously defined correspondence between the voltage level and the quaternary value. According to the previous division, the correspondence between the voltage level and the quaternary value is as follows: 0-2.5V corresponds to the quaternary "0";
[0067] 2.5-5V corresponds to quaternary "1";
[0068] 5-7.5V corresponds to quaternary "2";
[0069] 7.5-10V corresponds to quaternary "3";
[0070] For the quaternary sequence "231", the server will perform the following mapping:
[0071] "2" maps to a voltage level of 5-7.5V;
[0072] "3" maps to a voltage level of 7.5-10V;
[0073] "1" is mapped to a voltage level of 2.5-5V;
[0074] Therefore, the voltage levels corresponding to each two bits in the binary sequence "101101" are 5-7.5V, 7.5-10V, and 2.5-5V respectively.
[0075] Based on the voltage level corresponding to each binary digit (actually each combination of two binary digits) obtained in the previous step, the server can now determine the mapping result of the binary data to be processed. In this example, the mapping result is a series of voltage level combinations, namely 5-7.5V, 7.5-10V and 2.5-5V.
[0076] This mapping result can be regarded as the representation of binary data "101101" at the physical level (such as voltage signal), which may be used for data transmission or processing in certain specific electronic systems. In this way, the server can convert abstract binary data into signals with actual physical meaning, thereby realizing the physical layer representation and application of data.
[0077] In an embodiment of the present invention, the method further includes:
[0078] Acquire the binary data to be processed and the multi-valued data of the target number;
[0079] Verifying whether the conversion relationship between the binary data to be processed and the multi-valued data of the target base number is correct;
[0080] If yes, retaining the encoding circuit;
[0081] If not, an error prompt is issued, and the error prompt is used as feedback data of the encoding circuit.
[0082] In the embodiment of the present invention, exemplarily, after completing the conversion of binary data to multi-valued data, the server will obtain the binary data to be processed before the conversion (for example, the binary sequence "101101") and the multi-valued data of the target base number after the conversion (in the example of the embodiment of the present invention, the corresponding voltage level sequence: 5-7.5V, 7.5-10V, 2.5-5V). Next, the server will perform a verification step to ensure the correctness of the conversion relationship. The server may use a built-in verification mechanism or algorithm to compare the binary data to be processed and the multi-valued data after the conversion. For example, the server can reversely verify whether the converted voltage level sequence can be correctly restored to the original binary sequence based on the corresponding relationship between the logic mapping table and the voltage level. If the verification result shows that the conversion relationship is correct, that is, the converted multi-valued data can accurately reflect the original binary data to be processed, then the server will retain the currently used encoding circuit for subsequent continued use. If the verification result is incorrect, that is, the converted multi-valued data is inconsistent with the original binary data to be processed, then the server will issue an error prompt. This error prompt may be a detailed report that points out the specific problem in the conversion process. At the same time, the server will also send this error prompt as feedback data to the encoding circuit so that the circuit can be adjusted or optimized later. Through this verification and feedback mechanism, the server can ensure the accuracy and reliability of the conversion process from binary data to multi-valued data, thereby improving the quality and efficiency of data processing.
[0083] In the embodiments of the present invention, the following implementation modes are also provided.
[0084] The logic mapping table and the power supply voltage division method of the multiple power supplies are adjusted according to the feedback data.
[0085] In an embodiment of the present invention, exemplarily, in the previous steps, if the server finds that there is an error in the conversion relationship during the verification process and has issued an error prompt as feedback data of the encoding circuit, then next, the server will use these feedback data to make corresponding adjustments.
[0086] Specifically, the server will first analyze the error information in the feedback data to determine which part of the conversion has a problem. If the problem lies in the logical mapping table, such as a binary combination being incorrectly mapped to an incorrect multi-valued data, the server will correct the incorrect mapping relationship in the logical mapping table.
[0087] For example, suppose during the verification process it is found that the binary combination "11" is incorrectly mapped to the quaternary "2" instead of the correct "3", then the server will correct the mapping value corresponding to "11" to "3" in the logical mapping table.
[0088] On the other hand, if the problem lies in the way the power supply voltage is divided, such as the range of a certain voltage level is set unreasonably, resulting in some multi-value data not being accurately represented, then the server will adjust the power supply voltage division method of multiple power supplies.
[0089] For example, suppose that during the verification process, it is found that the voltage level range of 7.5-10V is too large, causing some voltage values in this range to be mistakenly identified as the same multi-value data. To solve this problem, the server may subdivide this voltage level range into smaller intervals, such as 7.5-8.75V and 8.75-10V, to ensure that each voltage value can be accurately mapped to a unique multi-value data.
[0090] Through this adjustment method, the server can continuously optimize the logic mapping table and the division method of the power supply voltage, thereby improving the accuracy and reliability of the conversion from binary data to multi-valued data.
[0091] In the embodiments of the present invention, the following implementation modes are also provided.
[0092] Acquire performance data of converting the binary data to be processed into the multi-valued data, wherein the performance data includes a conversion speed and a conversion accuracy rate;
[0093] When the performance data meets a preset performance threshold, the encoding circuit is marked as a qualified encoding circuit.
[0094] In the embodiment of the present invention, illustratively, when the server performs the conversion from binary data to multi-valued data, it will simultaneously collect and record relevant performance data, which mainly include conversion speed and conversion accuracy.
[0095] For example, the server processes a data set containing 1 million binary data points and converts it into corresponding multi-value data (such as quaternary data). During this process, the server records the total time spent on the conversion operation to calculate the average conversion speed, such as how many data points can be converted per second. At the same time, the server also compares the data before and after the conversion, and evaluates the accuracy of the conversion by comparing the original binary data and the converted multi-value data, that is, the proportion of correctly converted data points to the total data points.
[0096] After the server collects the performance data, it compares it with the preset performance thresholds. These thresholds are set according to actual application requirements and system resources, such as the conversion speed must not be less than 100,000 data points per second and the conversion accuracy must not be less than 99.99%.
[0097] If the server finds that its performance data reaches or exceeds these preset thresholds, such as a conversion rate of 120,000 data points per second and a conversion accuracy of 99.995%, it will mark the currently used encoding circuit as a qualified encoding circuit. This means that this encoding circuit meets the system requirements in terms of performance and accuracy and can be used for subsequent data processing tasks.
[0098] If the performance data does not reach the preset threshold, the server may take corresponding optimization measures, such as adjusting the power supply voltage division method, improving the logic mapping table, or optimizing the design of the encoding circuit to improve its conversion speed and accuracy. Through this continuous monitoring and optimization process, the server can ensure that the encoding circuit used is always in the best working condition.
[0099] In order to more clearly describe the solution provided by the embodiment of the present application, another more complete implementation is provided below.
[0100] When the multi-valued operation results are to be connected to the logic circuit and storage circuit of the previous binary data, a conversion interface between n-valued and binary data is required. Please refer to Figure 2 , Figure 2 A schematic diagram of the interface of the multi-valued logic circuit provided by the embodiment of the present invention. An encoder for converting binary data into multi-valued data and a decoder for converting multi-valued data into binary data are required. As a multi-valued method, a multi-power supply method is used to divide the voltage, and the intermediate potential is used as a value in the multi-valued data. Please refer to Figure 3 , Figure 3A conceptual diagram of multiple power supplies provided for an embodiment of the present invention. Wherein: m indicates how many voltages the multiple power supply voltage is divided into; n indicates the number of voltages; n / m indicates n divided by m; (n / m)VDD indicates n divided by m and then multiplied by VDD; for example, the voltage from GND (0V) to VDD (4V) is divided into 4, that is, m=4. Then: the first (n=1) voltage is (1 / 4)*4=1V; the second (n=2) voltage is (2 / 4)*4=2V; the third (n=3) voltage is (3 / 4)*4=3V; the fourth (n=4) voltage is (4 / 4)*4=4V=VDD; plus GND (0V) is 5 voltages, representing a 5-base system.
[0101] The following describes how to encode binary data and convert it into multi-valued data.
[0102] For example, for the method of converting a binary number into a quaternary number, please refer to Table 1.
[0103] Table 1
[0104]
[0105] The 256 binary data in Table 1 above are represented by 8 bits, and the quaternary number can be represented by only 4 bits. When converting a binary number to a quaternary number, the general method is to first convert it into a decimal number, and then convert it into a quaternary number. Binary number-decimal number-quaternary number. For example: 11011 (binary number)-27 (decimal number)-123 (quaternary number). In this way, the binary "0", "1" are converted into the quaternary "0", "1", "2", "3". In the encoding circuit, there is a circuit for selecting the n divided voltages generated by multiple power supplies. The selection is made as follows. Please refer to Table 2 in combination.
[0106] Table 2
[0107] Quaternary data Select Voltage 0 VDD*0 / 3(GND) 1 VDD*1 / 3 2 VDD*2 / 3 3 VDD*3 / 3
[0108] Please refer to Figure 4 , Figure 4 A schematic diagram of a circuit for selecting and generating a quaternary 1-bit by dividing multiple power supplies provided in an embodiment of the present invention; in this way, a voltage is selected and the converted voltage is used as quaternary data in a multi-valued logic circuit and a memory.
[0109] When converting binary to quaternary (octal and hexadecimal are the same), there is a simple method, which is to use 2 bits of binary data to directly generate the selection signal, as shown in Table 3.
[0110] Table 3
[0111] Binary 2bit SEL0 SEL1 SEL2 SEL3 00 1 0 0 0 01 0 1 0 0 10 0 0 1 0 11 0 0 0 1
[0112] In this way, there is no need to first convert the binary data into decimal data and then convert the decimal data into N-base data.
[0113] Please refer to Figure 5 , Figure 5 An apparatus 110 for converting binary data into multi-valued data provided by an embodiment of the present invention includes:
[0114] The acquisition module 1101 acquires the binary data to be processed and the target base number to be converted; and determines the encoding circuit according to the target base number;
[0115] The conversion module 1102 is used to input the binary data to be processed into the encoding circuit to obtain the mapping result of the encoding circuit for the binary data to be processed; and determine the multi-valued data of the target base number to be converted from the binary data to be processed according to the mapping result.
[0116] It should be noted that the implementation principle of the device 110 for converting binary data into multi-valued data can refer to the implementation principle of the method for converting binary data into multi-valued data, which will not be repeated here. It should be understood that the division of the modules of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into a physical entity, or physically separated. And these modules can all be implemented in the form of software calling through processing elements; they can also be fully implemented in the form of hardware; some modules can also be implemented in the form of software calling through processing elements, and some modules can be implemented in the form of hardware. For example, the device 110 for converting binary data into multi-valued data can be a separately established processing element, or it can be integrated in a chip of the above device. In addition, it can also be stored in the memory of the above device in the form of program code, and called and executed by a processing element of the above device. The function of the device 110 for converting binary data into multi-valued data. The implementation of other modules is similar. In addition, all or part of these modules can be integrated together, or they can be implemented independently. The processing element described here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in a processor element or an instruction in software form.
[0117] For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more microprocessors (digital signal processors, DSP), or one or more field programmable gate arrays (FPGA), etc. For another example, when a module above is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0118] The embodiment of the present invention provides a computer device 100, which includes a processor and a non-volatile memory storing computer instructions. When the computer instructions are executed by the processor, the computer device 100 executes the aforementioned device 110 for converting binary data into multi-valued data. Figure 6 As shown, Figure 6 The computer device 100 provided in the embodiment of the present invention is a block diagram of the structure of the computer device 100. The computer device 100 includes a device 110 for converting binary data into multi-valued data, a memory 111, a processor 112 and a communication unit 113.
[0119] In order to realize data transmission or interaction, the memory 111, the processor 112 and the communication unit 113 are electrically connected to each other directly or indirectly. For example, the electrical connection between these components can be realized through one or more communication buses or signal lines. The device 110 for converting binary data into multi-valued data includes at least one software function module that can be stored in the memory 111 in the form of software or firmware or solidified in the operating system (OS) of the computer device 100. The processor 112 is used to execute the device 110 for converting binary data stored in the memory 111 into multi-valued data, such as the software function module and computer program included in the device 110 for converting binary data into multi-valued data.
[0120] An embodiment of the present invention provides a readable storage medium, which includes a computer program. When the computer program is executed, the computer device where the readable storage medium is located is controlled to execute the aforementioned method of converting binary data into multi-valued data.
[0121] For illustrative purposes, the foregoing description is made with reference to specific embodiments. However, the above illustrative discussion is not intended to be exhaustive or to limit the present disclosure to the precise form disclosed. Numerous modifications and variations are possible in accordance with the above teachings. These embodiments are selected and described in order to best illustrate the principles of the present disclosure and its practical application, so that those skilled in the art can best utilize the present disclosure and utilize various embodiments with different modifications to suit the intended specific application.
Claims
1. A method for converting binary data into multi-valued data, characterized in that: include: Obtain the binary data to be processed and the target base number to be converted; Determine the encoding circuit according to the target base number; Inputting the binary data to be processed into the encoding circuit to obtain a mapping result of the encoding circuit for the binary data to be processed; According to the mapping result, it is determined that the binary value to be processed is converted into multi-valued data of the target base number.
2. The method according to claim 1, characterized in that The step of determining a coding circuit according to the target base number comprises: Get preset multi-power supply; Dividing the power supply voltage of the preset multiple power supplies according to the target base number to obtain multiple voltage levels, each of the voltage levels corresponds to a value in the multi-valued data corresponding to the target base number; Constructing a logical mapping table, wherein the logical mapping table includes a mapping relationship between binary data and multi-valued data; The encoding circuit is constructed according to the logic mapping table.
3. The method according to claim 2, characterized in that The step of inputting the binary data to be processed into the encoding circuit to obtain a mapping result of the encoding circuit for the binary data to be processed includes: Inputting the binary data to be processed into the encoding circuit; Determining, according to the logic mapping table, the multi-valued data to be processed corresponding to the binary data to be processed; A mapping result of the binary data to be processed is determined according to the multi-valued data to be processed and the corresponding relationship between the voltage level and the multi-valued data.
4. The method according to claim 3, characterized in that The determining the mapping result of the binary data to be processed according to the multi-valued data to be processed in combination with the corresponding relationship between the voltage level and the multi-valued data includes: According to the multi-valued data to be processed and the corresponding relationship between the voltage level and the multi-valued data, the voltage level corresponding to each binary digit included in the binary data to be processed is obtained; According to the voltage level corresponding to each binary digit, the mapping result of determining the binary data to be processed is obtained.
5. The method according to claim 4, characterized in that The method further comprises: Acquire the binary data to be processed and the multi-valued data of the target number; Verifying whether the conversion relationship between the binary data to be processed and the multi-valued data of the target base number is correct; If yes, retaining the encoding circuit; If not, an error prompt is issued, and the error prompt is used as feedback data of the encoding circuit.
6. The method according to claim 5, characterized in that The method further comprises: The logic mapping table and the power supply voltage division method of the multiple power supplies are adjusted according to the feedback data.
7. The method according to claim 1, characterized in that The method further comprises: Acquire performance data of converting the binary data to be processed into the multi-valued data, wherein the performance data includes a conversion speed and a conversion accuracy rate; When the performance data meets a preset performance threshold, the encoding circuit is marked as a qualified encoding circuit.
8. A device for converting binary data into multi-valued data, characterized in that: include: An acquisition module is used to obtain the binary data to be processed and the target base number to be converted; Determine the encoding circuit according to the target base number; The conversion module is used to input the binary data to be processed into the encoding circuit to obtain the mapping result of the encoding circuit for the binary data to be processed; according to the mapping result, determine the multi-valued data of the target base number converted from the binary data to be processed.
9. A computer device, characterized in that: The computer device comprises a processor and a non-volatile memory storing computer instructions. When the computer instructions are executed by the processor, the computer device executes the method according to any one of claims 1 to 7.
10. A readable storage medium, characterized in that: The readable storage medium includes a computer program, and when the computer program is executed, the computer device where the readable storage medium is located is controlled to execute the method according to any one of claims 1 to 7.
