WO2024045519A1 - 一种数据移位方法、系统、计算机设备及可读存储介质 - Google Patents

一种数据移位方法、系统、计算机设备及可读存储介质 Download PDF

Info

Publication number
WO2024045519A1
WO2024045519A1 PCT/CN2023/078280 CN2023078280W WO2024045519A1 WO 2024045519 A1 WO2024045519 A1 WO 2024045519A1 CN 2023078280 W CN2023078280 W CN 2023078280W WO 2024045519 A1 WO2024045519 A1 WO 2024045519A1
Authority
WO
WIPO (PCT)
Prior art keywords
shift
data
layer
column
shift layer
Prior art date
Application number
PCT/CN2023/078280
Other languages
English (en)
French (fr)
Inventor
孔令军
庞兆春
邹晓峰
林宁亚
宋琪
Original Assignee
苏州元脑智能科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 苏州元脑智能科技有限公司 filed Critical 苏州元脑智能科技有限公司
Publication of WO2024045519A1 publication Critical patent/WO2024045519A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/30007Arrangements for executing specific machine instructions to perform operations on data operands
    • G06F9/30032Movement instructions, e.g. MOVE, SHIFT, ROTATE, SHUFFLE
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/30007Arrangements for executing specific machine instructions to perform operations on data operands
    • G06F9/30029Logical and Boolean instructions, e.g. XOR, NOT
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline or look ahead
    • G06F9/3885Concurrent instruction execution, e.g. pipeline or look ahead using a plurality of independent parallel functional units
    • G06F9/3893Concurrent instruction execution, e.g. pipeline or look ahead using a plurality of independent parallel functional units controlled in tandem, e.g. multiplier-accumulator

Definitions

  • the present application relates to the field of data processing technology, and in particular to a data shifting method, system, computer equipment and non-volatile readable storage medium.
  • the vector A In the vector register of the vector processor, there is a vector A.
  • the vector A is composed of N elements. Each element represents a piece of data. If described in professional computer language, there is an array A[N].
  • some data is valid and some data is invalid according to certain rules.
  • We can use a bit to describe the valid and invalid status of each number. For example, 00010001 means that in a vector with eight numbers (N 8), the 0th (from right to left) and 4th The numbers are valid.
  • 4th From right to left
  • the vector we sometimes expect that the valid digits can be merged together for processing, that is, the vector is organized into a format with a valid state of 00000011.
  • the problem to be solved in this application is how to combine valid digits for processing, that is, given a vector of length N and whether the vector data conforms to a valid flag of a certain preset rule, after the operation, Eliminate vectors that do not conform to the rules and closely arrange the remaining data into a new vector.
  • the second prior art is a Chinese patent application with application number CN202210109599.7.
  • data management is achieved by utilizing several processing layers composed of multiple parallel processing units, and the effective data management based on each processing unit is
  • the logic is relatively simple, and each processing unit can quickly implement element shifting processing, thus improving the management efficiency of effective data.
  • N the number of processing layers
  • the gate delay is N+M, and the delay time of the entire processing array is longer.
  • this application proposes a data shifting method, system, computer equipment and non-volatile readable storage medium, which shifts the data in the shifting unit through an advance decision chain, reducing the gate delay and improving It improves the data shifting speed and solves the problems of slow data shifting speed and long delay time in the existing technology.
  • the data shifting system includes multiple parallel shifting layers, and each shifting layer includes multiple shifting layers. units, the shift units of the shift layer are connected in series, and the shift units of this shift layer are also connected to the next column of shift units of the next shift layer.
  • the method includes:
  • the shift layer receives the data to be processed and inputs the data to be processed to the corresponding shift unit for processing.
  • the corresponding shift unit includes the first shift unit of this shift layer and the first shift of the next shift layer. unit;
  • the shift unit receives the current shift layer data and the previous shift layer data, and selectively shifts the current shift layer data and the previous shift layer data based on the corresponding decision logic.
  • selectively shifting the current shift layer data and the previous shift layer data based on corresponding decision logic includes:
  • the method further includes: the Boolean operation result is a flag bit corresponding to the shift unit output data.
  • configuring the decision logic for each shift unit includes:
  • the shift unit decision logic is configured based on the current shift layer where the shift unit is located and the flag bit corresponding to the data to be processed received by the current shift layer.
  • configuring the shift unit decision logic based on the current shift layer where the shift unit is located and the flag bit corresponding to the data to be processed received by this shift layer includes:
  • the decision logic of the shift unit when configuring the decision logic of other column shift units except the first column shift unit in the shift layer, if the corresponding decision logic is not obtained based on the number of columns, the decision logic of the shift unit The decision logic is the same as the previous column of shift units.
  • performing a Boolean operation on the flag bit corresponding to the data to be processed received by the lowest shift layer includes:
  • the flag bits corresponding to the data to be processed received by the shift layer where the first column shift unit of the other shift layers except the lowest shift layer and its adjacent next shift layer are Performing Boolean operations includes: comparing the flag bits corresponding to the data to be processed received by the shift layer where the first column shift unit of other shift layers is located, and the flag bits corresponding to the data to be processed received by the adjacent next shift layer. Perform NAND operations.
  • performing combined Boolean operations on flag bits corresponding to the data to be processed based on the number of columns includes:
  • performing a combined Boolean operation on the flag bits corresponding to the data to be processed based on the column number also includes: when the corresponding decision logic is not obtained based on the column number, the decision logic of the shift unit is the same as that of the previous column shift unit. The decision logic is the same.
  • the shift unit in the last column of each shift layer outputs the Boolean operation result while outputting the final shift data.
  • the shift unit of this shift layer is also connected to the shift unit of the next column of the next shift layer, including: the output of the shift unit of this shift layer is also connected to the lower column of the next shift layer. Input to a column of shift units.
  • the shift unit is a 2-to-1 multiplexed data selector.
  • each shift layer includes 4 shift units, and the input data to be processed are Data[0], Data[1], Data[2], and Data[3] respectively, and the corresponding flag bits are Each bit is represented as T[D], T[C], T[B], T[A] respectively.
  • each The decision-making formula of the shift unit is the same, both are (ABCD)', where the ' symbol means inverting the bit;
  • the decision-making logic of the shift unit in the first column uses the formula B'+C ′+D′ makes decisions, and the second column shift unit to the fourth column shift unit uses the formula A′B′+A′C′+A′D′+B′C′+B′D′+C′D ′ to make decisions;
  • the shift units in the third row the shift units in the first column use the formula C′+D′ to make decisions, and the shift units in the second column use the formula B′C′+B′D′+C′D 'To make decisions,
  • the third column shift unit and the fourth column shift unit use the formula A'B'C'+A'B'D'+A'C'D'+B'C'D' to make decisions; for For the shift unit in the fourth row, the
  • the data shift system includes a configuration module and multiple parallel shift layers.
  • Each shift layer includes multiple shift units.
  • the shift layer The shift units are connected in series, and the shift units of this shift layer are also connected to the next column of shift units of the next shift layer, where the configuration module is configured to configure the decision-making logic of each shift unit;
  • the shift layer is configured to receive data to be processed and input the data to be processed to a corresponding shift unit for processing.
  • the corresponding shift unit includes a first shift unit of this shift layer and a first shift unit of the next shift layer. Shift unit;
  • the shift unit is configured to receive the current shift layer data and the previous shift layer data, and selectively shift the current shift layer data and the previous shift layer data based on corresponding decision logic.
  • the shift unit is further configured to: perform a Boolean operation on the current shift layer data and the previous shift layer data based on corresponding decision logic, and output the result based on the Boolean operation result. Describe the current shift layer data or the previous shift layer data.
  • the configuration module is further configured to: configure the shift unit decision based on the current shift layer where the shift unit is located and the flag bit corresponding to the data to be processed received by the current shift layer. logic.
  • the configuration module is further configured to perform a Boolean operation on the flag bit corresponding to the data to be processed received by the lowermost shift layer to configure the decision logic of the first column shift unit of the lowermost shift layer. ; Perform a Boolean operation on the flag bit corresponding to the data to be processed received by the shift layer where the first column shift unit of the other shift layers except the lowermost shift layer is located and its adjacent next shift layer To configure the decision logic of the first column shift unit of the other shift layer; obtain the column number of the shift unit in this shift layer, and move to the first column shift unit of the corresponding shift layer based on the column number.
  • the bit unit obtains the flag bit corresponding to the data to be processed included in the decision logic corresponding to the first shift unit, and performs a combined Boolean operation on the flag bit corresponding to the data to be processed based on the number of columns to configure the shift Decision logic for other column shift units in the layer except the first column shift unit.
  • FIG. 1 Another aspect of the embodiments of the present application also provides a computer device, including: at least one processor; and a memory.
  • the memory stores a computer program that can be run on the processor.
  • the computer program When the computer program is executed by the processor, the following method is implemented A step of:
  • the shift layer receives the data to be processed and inputs the data to be processed to the corresponding shift unit for processing.
  • the corresponding shift unit includes the first shift unit of this shift layer and the first shift of the next shift layer. unit;
  • the shift unit receives the current shift layer data and the previous shift layer data, and selectively shifts the current shift layer data and the previous shift layer data based on the corresponding decision logic.
  • selectively shifting the current shift layer data and the previous shift layer data based on corresponding decision logic includes:
  • the method further includes: the Boolean operation result is a flag bit corresponding to the shift unit output data.
  • configuring the decision logic for each shift unit includes:
  • the shift unit decision logic is configured based on the current shift layer where the shift unit is located and the flag bit corresponding to the data to be processed received by the current shift layer.
  • configuring the shift unit decision logic based on the current shift layer where the shift unit is located and the flag bit corresponding to the data to be processed received by this shift layer includes:
  • the decision logic of the shift unit when configuring the decision logic of other column shift units except the first column shift unit in the shift layer, if the corresponding decision logic is not obtained based on the number of columns, the decision logic of the shift unit The decision logic is the same as the previous column of shift units.
  • performing a Boolean operation on the flag bit corresponding to the data to be processed received by the lowest shift layer includes:
  • the flag bits corresponding to the data to be processed received by the shift layer where the first column shift unit of the other shift layers except the lowest shift layer and its adjacent next shift layer are Performing Boolean operations includes: comparing the flag bits corresponding to the data to be processed received by the shift layer where the first column shift unit of other shift layers is located, and the flag bits corresponding to the data to be processed received by the adjacent next shift layer. Perform NAND operations.
  • performing combined Boolean operations on flag bits corresponding to the data to be processed based on the number of columns includes:
  • the shift unit in the last column of each shift layer outputs the Boolean operation result while outputting the final shift data.
  • the shift unit of this shift layer is also connected to the next column of shift units of the next shift layer, including: the output of the shift unit of this shift layer is also connected to the next shift unit of the next shift layer. Input to a column of shift units.
  • the shift unit is a 2-to-1 multiplexed data selector.
  • the memory includes a program storage area and a data storage area, wherein the program storage area stores an operating system and an application program required for at least one function; the storage data area stores data created according to the use of the system.
  • memory includes high-speed random access memory, as well as non-volatile memory.
  • a computer non-volatile readable storage medium stores a computer program that implements the above method steps when executed by a processor.
  • This application has at least the following beneficial technical effects: by configuring the decision-making logic of each shift unit; the shift layer receives the data to be processed and inputs the data to be processed to the corresponding shift unit for processing, and the corresponding shift unit includes this The first shift unit of the shift layer and the first shift unit of the next shift layer; the shift unit receives the data of this shift layer and the data of the previous shift layer, and analyzes the data of this shift layer based on the corresponding decision logic. Selective shifting is performed with the data of the previous shift layer, which greatly reduces the gate delay and increases the speed of data shifting.
  • FIG. 1 is a schematic diagram of an embodiment of the data shifting system provided by this application.
  • FIG. 2 is a block diagram of an embodiment of the data shifting method provided by this application.
  • Figure 3 is a schematic diagram of an embodiment of shifting data to be processed based on decision logic provided by this application;
  • Figure 4 is a schematic diagram of another embodiment of the data shifting system provided by the present application.
  • FIG. 5 is a schematic structural diagram of an embodiment of the computer equipment provided by this application.
  • Figure 6 is a schematic structural diagram of an embodiment of a computer non-volatile readable storage medium provided by this application.
  • the first aspect of the embodiments of this application proposes an embodiment of a data shift method, which is applied to a data shift system.
  • the data shift system includes multiple parallel shifts. layer 10.
  • Each shift layer 10 includes a plurality of shift units 11.
  • the shift units of the shift layer 10 The bit units 11 are connected in series, and the shift units of this shift layer are also connected to the shift units of the next column of the next shift layer.
  • the data shift-based system performs the following steps:
  • the shift layer receives the data to be processed, and inputs the data to be processed into the corresponding shift unit for processing.
  • the corresponding shift unit includes the first shift unit of this shift layer and the first shift unit of the next shift layer. Shift unit;
  • the shift unit receives the current shift layer data and the previous shift layer data, and selectively shifts the current shift layer data and the previous shift layer data based on the corresponding decision logic.
  • the decision logic of each shift unit is configured. After the shift layer receives the data to be processed, it inputs the data to be processed to the corresponding shift unit. Each shift unit is based on the decision logic. The received data is processed.
  • the decision-making logic consists of flag bits corresponding to the data to be processed.
  • the shift unit is located in different rows and columns in the shift system (also called a shift array).
  • the decision-making logic includes flags. Different bits, the shift unit in the last column of each shift layer outputs the final shift data and the corresponding decision logic calculation result, that is, the flag bit.
  • the first column shift unit of the lowermost shift layer performs a NOT operation on the flag bit corresponding to the data to be processed received by the lowermost shift layer;
  • the first column shift unit of other shift layers the flag bit corresponding to the data to be processed received by the shift layer where the first column shift unit of other shift layers is located and the flag bit received by the adjacent next shift layer
  • the flag bit corresponding to the data to be processed performs NAND operation
  • FIG. 3 it is a schematic diagram of shifting data to be processed based on decision logic.
  • the input data to be processed are Data[0], Data[1], Data[2], Data[3], and each bit of the corresponding flag bit is represented as T[D ], T[C], T[B], T[A], the decision-making logic of the entire array can be converted into the logic formula shown on the right side of Figure 3.
  • each shift unit Arranged from top to bottom, taking the first row as an example, the decision-making formula of each shift unit is the same, which is (ABCD)′, that is, A′+B′+C′+D′, and the “′” symbol indicates the bit Negate. That is, for the movement decision of the first row, the four units in the first row need to make a shift decision.
  • the shift decision results of these four units are the same, both are (ABCD)′, that is, T[3]′+T [2]′+T[1]′+T[0].
  • the decision logic of the shift units of the first column is different from that of the other three columns.
  • U03 (representing the first column of this row) uses the formula B′+C′+D′ to make decisions
  • U13-U33 uses the formula A′B′+A′C′+A′D′+B′C′+B′D ′+C′D′ makes decisions.
  • the decision logic of the shift unit in the first column and the second column is different from the decision logic of the other two columns.
  • U02 (representing the first column of this row) uses the formula (CD)′, that is, C′+D′, to make decisions
  • U12 uses the formula B′C′+B′D′+C′D′ to make decisions
  • U22-U32 uses the formula A′B′C′+A′B′D′+A′C′D′+B′C′D′ for decision making.
  • the decision logic is different for each column.
  • U01 (representing the first column of this row) uses formula D' to make decisions
  • U11 uses formula C'D' to make decisions
  • U21 uses formula B'C'D' to make decisions
  • U31 uses formula A'B'C'D' decision making.
  • the decisions of all units in each layer are directly made according to the flag bits corresponding to the data.
  • the logic gate delay is 2, so the logic gate delay of the entire shift array can be reduced to M +2, greatly reduces the gate delay and increases the speed of data shifting.
  • selectively shifting the current shift layer data and the previous shift layer data based on corresponding decision logic includes:
  • each shift unit is shifted based on the corresponding decision logic, which greatly reduces the gate delay and increases the speed of data shifting.
  • the method further includes: the Boolean operation result is a flag bit corresponding to the shift unit output data.
  • configuring the decision logic for each shift unit includes:
  • the shift unit decision logic is configured based on the current shift layer where the shift unit is located and the flag bit corresponding to the data to be processed received by the current shift layer.
  • the gate delay is greatly reduced and the data shift speed is increased.
  • configuring the shift unit decision logic based on the current shift layer where the shift unit is located and the flag bit corresponding to the data to be processed received by this shift layer includes:
  • the decision logic of the shift unit when configuring the decision logic of other column shift units except the first column shift unit in the shift layer, if the corresponding decision logic is not obtained based on the number of columns, the decision logic of the shift unit The decision logic is the same as the previous column of shift units.
  • performing a Boolean operation on the flag bit corresponding to the data to be processed received by the lowest shift layer includes:
  • the flag bits corresponding to the data to be processed received by the shift layer where the first column shift unit of the other shift layers except the lowest shift layer and its adjacent next shift layer are Performing Boolean operations includes: comparing the flag bits corresponding to the data to be processed received by the shift layer where the first column shift unit of other shift layers is located, and the flag bits corresponding to the data to be processed received by the adjacent next shift layer. Perform NAND operations.
  • performing combined Boolean operations on flag bits corresponding to the data to be processed based on the number of columns includes:
  • the shift unit in the last column of each shift layer outputs the Boolean operation result while outputting the final shift data.
  • the first column of the corresponding shift layer is shifted.
  • the unit obtains the flag bits corresponding to the data to be processed included in the decision logic corresponding to the first shift unit, combines the obtained flag bits based on the number of columns, and obtains multiple addends; performs a NOT operation on the flag bits in the addends.
  • the sum and AND operations, and the OR operation on the addends greatly reduce the gate delay and increase the speed of data shifting.
  • the shift unit of this shift layer is also connected to the next column of shift units of the next shift layer, including: the output of the shift unit of this shift layer is also connected to the next shift unit of the next shift layer. Input to a column of shift units.
  • the shift unit is a 2-to-1 multiplexed data selector.
  • an embodiment of the present application also provides a data shift system 20.
  • the data shift system 20 includes a configuration module 21 and multiple parallel shifters. bit layer 22.
  • Each shift layer 22 includes a plurality of shift units 23.
  • the shift units 23 of the shift layer 22 are connected in series, and the shift units of this shift layer are also connected to the next shift layer.
  • the shift layer 22 is configured to receive the data to be processed and input the data to be processed to the corresponding shift unit 23 for processing.
  • the corresponding shift unit includes the first shift unit of this shift layer and the next shift layer. first shift unit;
  • the shift unit 23 is configured to receive the current shift layer data and the previous shift layer data, and selectively shift the current shift layer data and the previous shift layer data based on corresponding decision logic.
  • an embodiment of the present application also provides a computer device 30.
  • the computer device 30 includes a processor 310 and a memory 320.
  • the memory 320 stores There is a computer program 321 that can be run on the processor. When the processor 310 executes the program, it performs the steps of the above method.
  • the memory as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as the data migration in the embodiment of the present application.
  • Program instructions/modules corresponding to bit methods.
  • the processor executes various functional applications and data processing of the system by running non-volatile software programs, instructions and modules stored in the memory, that is, implementing the data shifting method of the above method embodiment.
  • the memory may include a program storage area and a data storage area, where the program storage area may store an operating system and an application program required for at least one function; the storage data area may store data created according to the use of the system, etc.
  • the memory may include high-speed random access memory and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device.
  • the memory optionally includes memory located remotely from the processor, and these remote memories may be connected to the local module through a network. Examples of the above-mentioned networks include but are not limited to the Internet, intranets, local area networks, mobile communication networks and combinations thereof.
  • functionality may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functionality may be stored on or transmitted over as one or more instructions or code on a computer-readable medium.
  • Computer-readable media includes computer nonvolatile storage media and communication media including any medium that facilitates transfer of a computer program from one place to another.
  • Non-volatile storage media can be any available media that can be accessed by a general purpose or special purpose computer.
  • the computer-readable medium may include RAM (Random Access Memory), ROM (Read-Only Memory), EEPROM (Electrically Erasable Programmable read only memory).
  • erasable programmable read-only memory CD-ROM (compact disc read-only memory, read-only optical disk memory) or other optical disk storage devices, magnetic disk storage devices or other magnetic storage devices, or can be used to carry or store instructions in the form or any other medium containing the required program code for the data structures and capable of being accessed by a general-purpose or special-purpose computer or a general-purpose or special-purpose processor.
  • any connection is properly termed a computer-readable medium.
  • coaxial cable, fiber optic cable, twisted pair, Digital Subscriber Line (DSL), or wireless technologies such as infrared, radio, and microwave are used to deliver software from a website, server, or other remote source.
  • disks and optical discs include compact discs (CDs), laser discs, optical discs, digital video discs (DVDs), floppy disks, and Blu-ray discs, where disks typically reproduce data magnetically, and Optical discs use lasers to optically reproduce data. Combinations of the above should also be included within the scope of computer-readable media.
  • an embodiment of the present application also provides a computer non-volatile readable storage medium 40.
  • the computer non-volatile readable storage medium 40 A computer program 410 that performs the above method when executed by the processor is stored.
  • the program can be stored in a computer non-volatile readable storage.
  • the program when executed, it may include the processes of the above-mentioned method embodiments.
  • the non-volatile storage medium of the program can be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
  • the foregoing computer program embodiments can achieve the same or similar effects as any of the corresponding foregoing method embodiments.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Logic Circuits (AREA)

Abstract

本申请公开了一种数据移位方法、系统、计算机设备及非易失性可读存储介质,应用于数据移位系统,数据移位系统包括多个并行的移位层,每个移位层包括多个移位单元,移位层的所述移位单元之间串行连接,并且本移位层的移位单元还连接到下个移位层的下一列移位单元,方法包括:配置每个移位单元的决策逻辑;移位层接收待处理数据,并将待处理数据输入到对应的移位单元进行处理,对应的移位单元包括本移位层的第一移位单元和下一移位层的第一移位单元;移位单元接收本移位层数据和上一移位层数据,并基于对应的决策逻辑对本移位层数据和上一移位层数据进行选择移位。通过本申请的方案,大大地降低了门延迟,提高了数据移位的速度。

Description

一种数据移位方法、系统、计算机设备及可读存储介质
相关申请的交叉引用
本申请要求于2022年09月01日提交中国专利局,申请号为202211064030.X,申请名称为“一种数据移位方法、系统、计算机设备及可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及数据处理技术领域,尤其涉及一种数据移位方法、系统、计算机设备及非易失性可读存储介质。
背景技术
在向量处理器的向量寄存器中,存在一个向量A,该向量A由N个元素构成,每个元素表示一个数据,若用计算机专业语言描述的话,便是存在一个数组A[N]。这个向量中,根据某些规则,有的数据是有效的,有的数据是无效的。我们可以用一个bit来描述每个数字的有效和无效状态,例如00010001,则表示在一个拥有八个数字(N=8)的向量中,其第0个(自右向左)和第4个数字是有效的。而在后续的向量处理时,我们有时会期望有效数字能够合并在一起进行处理,即将该向量整理为有效状态为00000011的样式。
因此,本申请要解决的问题是,如何进行将有效数字合并在一起进行处理,即给定一个长度为N的向量,以及该向量数据是否符合某个预设规则的有效标志,经过操作后,排除掉不符合规则的向量,并将余下的数据紧密排列为一个新向量。
现有技术一,处理该类问题通常使用标量处理器,执行标量指令。现有技术一的缺点为速度慢。
现有技术二,是申请号为CN202210109599.7的中国专利申请,该专利中,通过利用若干个由并列的多个处理单元组成的处理层实现数据管理,且各处理单元所依据的有效数据管理逻辑较为简单,每个处理单元都能快速实现元素移位处理,从而提高了有效数据的管理效率。对于上述移位方案,假设对于一个拥有N个数据的向量进行处理,而处理阵列拥有N层,那么每进行一次拒绝采样,其门延迟就是N+M,整个处理阵列的延迟时间较长。
发明内容
有鉴于此,本申请提出了一种数据移位方法、系统、计算机设备及非易失性可读存储介质,通过超前决策链对移位单元中的数据进行移位,降低了门延迟,提高了数据移位的速度,解决了现有技术中数据移位速度慢,延迟时间长的问题。
基于上述目的,本申请实施例的一方面提供了一种数据移位方法,应用于数据移位系统,数据移位系统包括多个并行的移位层,每个移位层包括多个移位单元,移位层的移位单元之间串行连接,并且本移位层的移位单元还连接到下个移位层的下一列移位单元,方法包括:
配置每个移位单元的决策逻辑;
移位层接收待处理数据,并将待处理数据输入到对应的移位单元进行处理,对应的移位单元包括本移位层的第一移位单元和下一移位层的第一移位单元;
移位单元接收本移位层数据和上一移位层数据,并基于对应的决策逻辑对本移位层数据和上一移位层数据进行选择移位。
在一些实施方式中,基于对应的决策逻辑对本移位层数据和上一移位层数据进行选择移位包括:
基于对应的决策逻辑对本移位层数据与上一移位层数据进行布尔运算,并基于布尔运算结果输出本移位层数据或上一移位层数据。
在一些实施方式中,方法还包括:布尔运算结果为移位单元输出数据对应的标志位。
在一些实施方式中,配置每个移位单元的决策逻辑包括:
基于移位单元所在的本移位层以及本移位层接收到的待处理数据对应的标志位配置移位单元决策逻辑。
在一些实施方式中,基于移位单元所在的本移位层以及本移位层接收到的待处理数据对应的标志位配置移位单元决策逻辑包括:
对最下移位层接收到的待处理数据对应的标志位进行布尔运算以配置最下移位层的第一列移位单元的决策逻辑;
对除最下移位层以外的其他移位层的第一列移位单元所在移位层及其相邻的下一移位层接收到的待处理数据对应的标志位进行布尔运算以配置其他移位层的第一列移位单元的决策逻辑;
获取移位单元在本移位层中的列数,基于列数到对应移位层的第一列移位单元获取第一移位单元对应的决策逻辑中包括的待处理数据对应的标志位,基于列数对待处理数据对应的标志位进行组合布尔运算以配置移位 层中除第一列移位单元以外的其他列移位单元的决策逻辑。
在一些实施方式中,在配置移位层中除第一列移位单元以外的其他列移位单元的决策逻辑时,若基于列数未获取到对应的决策逻辑,则移位单元的决策逻辑与上一列移位单元的决策逻辑相同。
在一些实施方式中,对最下移位层接收到的待处理数据对应的标志位进行布尔运算包括:
对最下移位层接收到的待处理数据对应的标志位进行非运算。
在一些实施方式中,对除最下移位层以外的其他移位层的第一列移位单元所在移位层及其相邻的下一移位层接收到的待处理数据对应的标志位进行布尔运算包括:对其他移位层的第一列移位单元所在移位层接收到的待处理数据对应的标志位与其相邻的下一移位层接收到的待处理数据对应的标志位进行与非运算。
在一些实施方式中,基于列数对待处理数据对应的标志位进行组合布尔运算包括:
基于列数对获取到的标志位进行组合,得到多个加数;
对加数内的标志位进行非运算和与运算,并对加数进行或运算。
在一些实施方式中,基于列数对待处理数据对应的标志位进行组合布尔运算还包括:在基于列数未获取到对应的决策逻辑的情况下,移位单元的决策逻辑与上一列移位单元的决策逻辑相同。
在一些实施方式中,每个移位层最后一列的移位单元,在输出最终移位数据的同时还输出布尔运算结果。
在一些实施方式中,本移位层的移位单元还连接到下个移位层的下一列移位单元包括:本移位层的移位单元的输出还连接到下个移位层的下一列移位单元的输入。
在一些实施方式中,移位单元为二选一多路数据选择器。
在一些实施例中,每个移位层包括4个移位单元,输入的待处理数据分别为Data[0],Data[1],Data[2],Data[3],对应的标志位的每个bit分别表示为T[D],T[C],T[B],T[A],所述数据移位系统的决策逻辑转化为:从上往下排列,第一行中每个移位单元的决策公式相同,均为(ABCD)’,其中,’符号表示对该bit取反;对于第二行的移位单元,第一列移位单元的决策逻辑使用公式B′+C′+D′进行决策,第二列移位单元至第四列移位单元使用公式A′B′+A′C′+A′D′+B′C′+B′D′+C′D′进行决策;对于第三行的移位单元,第一列移位单元使用公式C′+D′进行决策,第二列移位单元使用公式B′C′+B′D′+C′D′进行决策,第三列移位单元和第四列移位单元使用公式A′B′C′+A′B′D′+A′C′D′+B′C′D′进行决策;对于第四行的移位单元,第一列移位单元使用公式D′进行决策,第二列移位单元使用公式C′D′进行决策,第三列移位单元使用公式B′C′D′进行决策,第四列移位单元使用公式A′B′C′D′进行决策。
本申请实施例的另一方面,还提供了一种数据移位系统,数据移位系统包括配置模块以及多个并行的移位层,每个移位层包括多个移位单元,移位层的移位单元之间串行连接,并且本移位层的移位单元还连接到下个移位层的下一列移位单元,其中,配置模块配置为配置每个移位单元的决策逻辑;
移位层配置为接收待处理数据,并将待处理数据输入到对应的移位单元进行处理,对应的移位单元包括本移位层的第一移位单元和下一移位层的第一移位单元;
移位单元配置为接收本移位层数据和上一移位层数据,并基于对应的决策逻辑对本移位层数据和上一移位层数据进行选择移位。
在一些实施方式中,所述移位单元还配置为:基于对应的决策逻辑对所述本移位层数据与所述上一移位层数据进行布尔运算,并基于所述布尔运算结果输出所述本移位层数据或所述上一移位层数据。
在一些实施方式中,所述配置模块还配置为:基于所述移位单元所在的本移位层以及所述本移位层接收到的待处理数据对应的标志位配置所述移位单元决策逻辑。
在一些实施方式中,所述配置模块还配置为:对最下移位层接收到的待处理数据对应的标志位进行布尔运算以配置最下移位层的第一列移位单元的决策逻辑;对除所述最下移位层以外的其他移位层的第一列移位单元所在移位层及其相邻的下一移位层接收到的待处理数据对应的标志位进行布尔运算以配置所述其他移位层的第一列移位单元的决策逻辑;获取所述移位单元在本移位层中的列数,基于所述列数到对应移位层的第一列移位单元获取所述第一移位单元对应的决策逻辑中包括的待处理数据对应的标志位,基于所述列数对所述待处理数据对应的标志位进行组合布尔运算以配置所述移位层中除所述第一列移位单元以外的其他列移位单元的决策逻辑。
本申请实施例的又一方面,还提供了一种计算机设备,包括:至少一个处理器;以及存储器,存储器存储有可在处理器上运行的计算机程序,计算机程序由处理器执行时实现如下方法的步骤:
配置每个移位单元的决策逻辑;
移位层接收待处理数据,并将待处理数据输入到对应的移位单元进行处理,对应的移位单元包括本移位层的第一移位单元和下一移位层的第一移位单元;
移位单元接收本移位层数据和上一移位层数据,并基于对应的决策逻辑对本移位层数据和上一移位层数据进行选择移位。
在一些实施方式中,基于对应的决策逻辑对本移位层数据和上一移位层数据进行选择移位包括:
基于对应的决策逻辑对本移位层数据与上一移位层数据进行布尔运算,并基于布尔运算结果输出本移位层数据或上一移位层数据。
在一些实施方式中,方法还包括:布尔运算结果为移位单元输出数据对应的标志位。
在一些实施方式中,配置每个移位单元的决策逻辑包括:
基于移位单元所在的本移位层以及本移位层接收到的待处理数据对应的标志位配置移位单元决策逻辑。
在一些实施方式中,基于移位单元所在的本移位层以及本移位层接收到的待处理数据对应的标志位配置移位单元决策逻辑包括:
对最下移位层接收到的待处理数据对应的标志位进行布尔运算以配置最下移位层的第一列移位单元的决策逻辑;
对除最下移位层以外的其他移位层的第一列移位单元所在移位层及其相邻的下一移位层接收到的待处理数据对应的标志位进行布尔运算以配置其他移位层的第一列移位单元的决策逻辑;
获取移位单元在本移位层中的列数,基于列数到对应移位层的第一列移位单元获取第一移位单元对应的决策逻辑中包括的待处理数据对应的标志位,基于列数对待处理数据对应的标志位进行组合布尔运算以配置移位层中除第一列移位单元以外的其他列移位单元的决策逻辑。
在一些实施方式中,在配置移位层中除第一列移位单元以外的其他列移位单元的决策逻辑时,若基于列数未获取到对应的决策逻辑,则移位单元的决策逻辑与上一列移位单元的决策逻辑相同。
在一些实施方式中,对最下移位层接收到的待处理数据对应的标志位进行布尔运算包括:
对最下移位层接收到的待处理数据对应的标志位进行非运算。
在一些实施方式中,对除最下移位层以外的其他移位层的第一列移位单元所在移位层及其相邻的下一移位层接收到的待处理数据对应的标志位进行布尔运算包括:对其他移位层的第一列移位单元所在移位层接收到的待处理数据对应的标志位与其相邻的下一移位层接收到的待处理数据对应的标志位进行与非运算。
在一些实施方式中,基于列数对待处理数据对应的标志位进行组合布尔运算包括:
基于列数对获取到的标志位进行组合,得到多个加数;
对加数内的标志位进行非运算和与运算,并对加数进行或运算。
在一些实施方式中,每个移位层最后一列的移位单元,在输出最终移位数据的同时还输出布尔运算结果。
在一些实施方式中,本移位层的移位单元还连接到下个移位层的下一列移位单元包括:本移位层的移位单元的输出还连接到下个移位层的下一列移位单元的输入。
在一些实施方式中,移位单元为二选一多路数据选择器。
在一些实施例中,存储器包括存储程序区和存储数据区,其中,存储程序区存储操作系统、至少一个功能所需要的应用程序;存储数据区存储根据系统的使用所创建的数据。
在一些实施例中,存储器包括高速随机存取存储器,以及非易失性存储器。
本申请实施例的再一方面,还提供了一种计算机非易失性可读存储介质,计算机非易失性可读存储介质存储有被处理器执行时实现如上方法步骤的计算机程序。
本申请至少具有以下有益技术效果:通过配置每个移位单元的决策逻辑;移位层接收待处理数据,并将待处理数据输入到对应的移位单元进行处理,对应的移位单元包括本移位层的第一移位单元和下一移位层的第一移位单元;移位单元接收本移位层数据和上一移位层数据,并基于对应的决策逻辑对本移位层数据和上一移位层数据进行选择移位,大大地降低了门延迟,提高了数据移位的速度。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的实施例。
图1为本申请提供的数据移位系统的一实施例的示意图;
图2为本申请提供的数据移位方法的一实施例的框图;
图3为本申请提供的基于决策逻辑对待处理数据进行移位的一实施例的示意图;
图4为本申请提供的数据移位系统的又一实施例的示意图;
图5为本申请提供的计算机设备的一实施例的结构示意图;
图6为本申请提供的计算机非易失性可读存储介质的一实施例的结构示意图。
具体实施方式
为使本申请的目的、技术方案和优点更加清楚明白,以下结合具体实施例,并参照附图,对本申请实施例进一步详细说明。
需要说明的是,本申请实施例中所有使用″第一″和″第二″的表述均是为了区分两个相同名称非相同的实体或者非相同的参量,可见″第一″″第二″仅为了表述的方便,不应理解为对本申请实施例的限定,后续实施例对此不再一一说明。
基于上述目的,本申请实施例的第一个方面,提出了一种数据移位方法的实施例,应用于数据移位系统,如图1所示,数据移位系统包括多个并行的移位层10,每个移位层10包括多个移位单元11,移位层10的移 位单元11之间串行连接,并且本移位层的移位单元还连接到下个移位层的下一列移位单元。如图2所示,基于数据移位系统执行如下步骤:
S10、配置每个移位单元的决策逻辑;
S20、移位层接收待处理数据,并将待处理数据输入到对应的移位单元进行处理,对应的移位单元包括本移位层的第一移位单元和下一移位层的第一移位单元;
S30、移位单元接收本移位层数据和上一移位层数据,并基于对应的决策逻辑对本移位层数据和上一移位层数据进行选择移位。
在一可选的实施例中,配置每个移位单元的决策逻辑,移位层接收待处理数据后,将待处理数据输入到对应的移位单元,每个移位单元均基于决策逻辑对其接收到的数据进行处理,决策逻辑由待处理数据对应的标志位组成,移位单元在移位系统(也可以称为移位阵列)中所处的行与列不同,决策逻辑包括的标志位不同,在每个移位层最后一列的移位单元,输出最终移位数据与对应的决策逻辑计算结果,即标志位。
各个移位单元的决策逻辑配置如下:
最下移位层的第一列移位单元:对最下移位层接收到的待处理数据对应的标志位进行非运算;
其他移位层的第一列移位单元:对其他移位层的第一列移位单元所在移位层接收到的待处理数据对应的标志位与其相邻的下一移位层接收到的待处理数据对应的标志位进行与非运算;
每个移位层中除第一列移位单元以外的其他列移位单元:获取移位单元在本移位层中的列数,基于列数到对应移位层的第一列移位单元获取第一移位单元对应的决策逻辑中包括的待处理数据对应的标志位,基于列数对获取到的标志位进行组合,得到多个加数;对加数内的标志位进行非运算和与运算,并对加数进行或运算。此时,若基于列数未获取到对应的决策逻辑,则移位单元的决策逻辑与上一列移位单元的决策逻辑相同。
在一可选的实施例中,如图3所示,为基于决策逻辑对待处理数据进行移位的示意图。
以N=4的向量为例,输入的待处理数据分别为Data[0],Data[1],Data[2],Data[3],对应的标志位的每个bit分别表示为T[D],T[C],T[B],T[A],将整个阵列的决策逻辑可以转化为图3中右侧所示的逻辑公式。
从上往下排列,以第一行为例,每个移位单元的决策公式相同,均为(ABCD)′,即A′+B′+C′+D′,″′″符号表示对该bit取反。即对于第一行的移动决策来说,第一行四个单元需要移位决策,这四个单元的移位决策结果是一样的,都是(ABCD)′,即T[3]′+T[2]′+T[1]′+T[0]。
对于第二行的移位单元,第一列移位单元的决策逻辑与其他三列不同。U03(表示本行第一列)使用公式B′+C′+D′进行决策,U13-U33使用公式A′B′+A′C′+A′D′+B′C′+B′D′+C′D′进行决策。
对于第三行的移位单元,第一列移位单元、第二列的决策逻辑、与其他两列的决策逻辑有所不同。U02(表示本行第一列)使用公式(CD)′,即C′+D′进行决策,U12使用公式B′C′+B′D′+C′D′进行决策,U22-U32使用公式A′B′C′+A′B′D′+A′C′D′+B′C′D′进行决策。
对于第四行的移位单元,每一列的决策逻辑均不同。U01(表示本行第一列)使用公式D′进行决策,U11使用公式C′D′进行决策,U21使用公式B′C′D′进行决策,U31使用公式A′B′C′D′进行决策。
通过上述方案可以看出,无论整个移位阵列的大小如何,在获得标志位向量之后,至多两个逻辑门延迟内,就可以获得整个阵列所有移位单元的移位决策。
基于本申请实施例的超前决策链,根据数据对应的标志位,将每一层的所有单元的决策直接做出,其逻辑门延迟为2,因此整个移位阵列的逻辑门延迟可以降低至M+2,大大地降低了门延迟,提高了数据移位的速度。
在一些实施方式中,基于对应的决策逻辑对本移位层数据和上一移位层数据进行选择移位包括:
基于对应的决策逻辑对本移位层数据与上一移位层数据进行布尔运算,并基于布尔运算结果输出本移位层数据或上一移位层数据。
在一可选的实施例中,基于对应的决策逻辑对每一个移位单元进行移位,大大地降低了门延迟,提高了数据移位的速度。
在一些实施方式中,方法还包括:布尔运算结果为移位单元输出数据对应的标志位。
在一些实施方式中,配置每个移位单元的决策逻辑包括:
基于移位单元所在的本移位层以及本移位层接收到的待处理数据对应的标志位配置移位单元决策逻辑。
在一可选的实施例中,通过配置每个移位单元的决策逻辑,基于对应的决策逻辑对每一个移位单元进行移位,大大地降低了门延迟,提高了数据移位的速度。
在一些实施方式中,基于移位单元所在的本移位层以及本移位层接收到的待处理数据对应的标志位配置移位单元决策逻辑包括:
对最下移位层接收到的待处理数据对应的标志位进行布尔运算以配置最下移位层的第一列移位单元的决策逻辑;
对除最下移位层以外的其他移位层的第一列移位单元所在移位层及其相邻的下一移位层接收到的待处理数据对应的标志位进行布尔运算以配置其他移位层的第一列移位单元的决策逻辑;
获取移位单元在本移位层中的列数,基于列数到对应移位层的第一列移位单元获取第一移位单元对应的决策逻辑中包括的待处理数据对应的标志位,基于列数对待处理数据对应的标志位进行组合布尔运算以配置移位层中除第一列移位单元以外的其他列移位单元的决策逻辑。
在一些实施方式中,在配置移位层中除第一列移位单元以外的其他列移位单元的决策逻辑时,若基于列数未获取到对应的决策逻辑,则移位单元的决策逻辑与上一列移位单元的决策逻辑相同。
在一些实施方式中,对最下移位层接收到的待处理数据对应的标志位进行布尔运算包括:
对最下移位层接收到的待处理数据对应的标志位进行非运算。
在一些实施方式中,对除最下移位层以外的其他移位层的第一列移位单元所在移位层及其相邻的下一移位层接收到的待处理数据对应的标志位进行布尔运算包括:对其他移位层的第一列移位单元所在移位层接收到的待处理数据对应的标志位与其相邻的下一移位层接收到的待处理数据对应的标志位进行与非运算。
在一些实施方式中,基于列数对待处理数据对应的标志位进行组合布尔运算包括:
基于列数对获取到的标志位进行组合,得到多个加数;
对加数内的标志位进行非运算和与运算,并对加数进行或运算。
在一些实施方式中,每个移位层最后一列的移位单元,在输出最终移位数据的同时还输出布尔运算结果。
在一可选的实施例中,通过对各个移位单元配置不同的决策逻辑,即,对于最下移位层的第一列移位单元:对最下移位层接收到的待处理数据对应的标志位进行非运算;对于其他移位层的第一列移位单元:对其他移位层的第一列移位单元所在移位层接收到的待处理数据对应的标志位与其相邻的下一移位层接收到的待处理数据对应的标志位进行与非运算;对于每个移位层中除第一列移位单元以外的其他列移位单元:获取移位单元在本移位层中的列数,若基于列数未获取到对应的决策逻辑,则移位单元的决策逻辑与上一列移位单元的决策逻辑相同,基于列数到对应移位层的第一列移位单元获取第一移位单元对应的决策逻辑中包括的待处理数据对应的标志位,基于列数对获取到的标志位进行组合,得到多个加数;对加数内的标志位进行非运算和与运算,并对加数进行或运算,大大地降低了门延迟,提高了数据移位的速度。
在一些实施方式中,本移位层的移位单元还连接到下个移位层的下一列移位单元包括:本移位层的移位单元的输出还连接到下个移位层的下一列移位单元的输入。
在一些实施方式中,移位单元为二选一多路数据选择器。
基于同一发明构思,根据本申请的另一个方面,如图4所示,本申请的实施例还提供了一种数据移位系统20,数据移位系统20包括配置模块21以及多个并行的移位层22,每个移位层22包括多个移位单元23,移位层22的移位单元23之间串行连接,并且本移位层的移位单元还连接到下个移位层的下一列移位单元,其中,配置模块21配置为配置每个移位单元23的决策逻辑;
移位层22配置为接收待处理数据,并将待处理数据输入到对应的移位单元23进行处理,对应的移位单元包括本移位层的第一移位单元和下一移位层的第一移位单元;
移位单元23配置为接收本移位层数据和上一移位层数据,并基于对应的决策逻辑对本移位层数据和上一移位层数据进行选择移位。
基于同一发明构思,根据本申请的另一个方面,如图5所示,本申请的实施例还提供了一种计算机设备30,在该计算机设备30中包括处理器310以及存储器320,存储器320存储有可在处理器上运行的计算机程序321,处理器310执行程序时执行如上的方法的步骤。
其中,存储器作为一种非易失性计算机非易失性可读存储介质,可用于存储非易失性软件程序、非易失性计算机可执行程序以及模块,如本申请实施例中的数据移位方法对应的程序指令/模块。处理器通过运行存储在存储器中的非易失性软件程序、指令以及模块,从而执行系统的各种功能应用以及数据处理,即实现上述方法实施例的数据移位方法。
存储器可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据系统的使用所创建的数据等。此外,存储器可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他非易失性固态存储器件。在一些实施例中,存储器可选包括相对于处理器远程设置的存储器,这些远程存储器可以通过网络连接至本地模块。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
在一个或多个示例性设计中,功能可以在硬件、软件、固件或其任意组合中实现。如果在软件中实现,则可以将功能作为一个或多个指令或代码存储在计算机可读介质上或通过计算机可读介质来传送。计算机可读介质包括计算机非易失性存储介质和通信介质,该通信介质包括有助于将计算机程序从一个位置传送到另一个位置的任何介质。非易失性存储介质可以是能够被通用或专用计算机访问的任何可用介质。作为例子而非限制性的,该计算机可读介质可以包括RAM(Random Access Memory,随机存取存储器)、ROM(Read-Only Memory,只读存储器)、EEPROM(Electrically Erasable Programmable read only memory,带电可擦可编程只读存储器)、CD-ROM(compact disc read-only memory,只读光盘存储器)或其它光盘存储设备、磁盘存储设备或其它磁性存储设备,或者是可以用于携带或存储形式为指令或数据结构的所需程序代码并且能够被通用或专用计算机或者通用或专用处理器访问的任何其它介质。此外,任何连接都可以适当地称为计算机可读介质。例如, 如果使用同轴线缆、光纤线缆、双绞线、数字用户线路(DSL,Digital Subscriber Line)或诸如红外线、无线电和微波的无线技术来从网站、服务器或其它远程源发送软件,则上述同轴线缆、光纤线缆、双绞线、DSL或诸如红外线、无线电和微波的无线技术均包括在介质的定义。如这里所使用的,磁盘和光盘包括压缩盘(CD,Compact Disc)、激光盘、光盘、数字多功能盘(DVD,Digital Video Disc)、软盘、蓝光盘,其中磁盘通常磁性地再现数据,而光盘利用激光光学地再现数据。上述内容的组合也应当包括在计算机可读介质的范围内。
基于同一发明构思,根据本申请的另一个方面,如图6所示,本申请的实施例还提供了一种计算机非易失性可读存储介质40,计算机非易失性可读存储介质40存储有被处理器执行时执行如上方法的计算机程序410。
最后需要说明的是,本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关硬件来完成,程序可存储于一计算机非易失性可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,程序的非易失性存储介质可为磁碟、光盘、只读存储记忆体(ROM)或随机存储记忆体(RAM)等。上述计算机程序的实施例,可以达到与之对应的前述任意方法实施例相同或者相类似的效果。
本领域技术人员还将明白的是,结合这里的公开所描述的各种示例性逻辑块、模块、电路和算法步骤可以被实现为电子硬件、计算机软件或两者的组合。为了清楚地说明硬件和软件的这种可互换性,已经就各种示意性组件、方块、模块、电路和步骤的功能对其进行了一般性的描述。这种功能是被实现为软件还是被实现为硬件取决于具体应用以及施加给整个系统的设计约束。本领域技术人员可以针对每种具体应用以各种方式来实现的功能,但是这种实现决定不应被解释为导致脱离本申请实施例公开的范围。
以上是本申请公开的示例性实施例,但是应当注意,在不背离权利要求限定的本申请实施例公开的范围的前提下,可以进行多种改变和修改。根据这里描述的公开实施例的方法权利要求的功能、步骤和/或动作不需以任何特定顺序执行。上述本申请实施例公开实施例序号仅仅为了描述,不代表实施例的优劣。此外,尽管本申请实施例公开的元素可以以个体形式描述或要求,但除非明确限制为单数,也可以理解为多个。
应当理解的是,在本文中使用的,除非上下文清楚地支持例外情况,单数形式″一个″旨在也包括复数形式。还应当理解的是,在本文中使用的″和/或″是指包括一个或者一个以上相关联地列出的项目的任意和所有可能组合。
所属领域的普通技术人员应当理解:以上任何实施例的讨论仅为示例性的,并非旨在暗示本申请实施例公开的范围(包括权利要求)被限于这些例子;在本申请实施例的思路下,以上实施例或者不同实施例中的技术特征之间也可以进行组合,并存在如上的本申请实施例的不同方面的许多其它变化,为了简明它们没有在细节中提供。因此,凡在本申请实施例的精神和原则之内,所做的任何省略、修改、等同替换、改进等,均应包括在本申请实施例的保护范围之内。

Claims (20)

  1. 一种数据移位方法,其特征在于,应用于数据移位系统,所述数据移位系统包括多个并行的移位层,每个移位层包括多个移位单元,所述移位层的所述移位单元之间串行连接,并且本移位层的移位单元还连接到下个移位层的下一列移位单元,所述方法包括:
    配置每个所述移位单元的决策逻辑;
    所述移位层接收待处理数据,并将所述待处理数据输入到对应的移位单元进行处理,所述对应的移位单元包括本移位层的第一移位单元和下一移位层的第一移位单元;
    所述移位单元接收本移位层数据和上一移位层数据,并基于对应的决策逻辑对所述本移位层数据和所述上一移位层数据进行选择移位。
  2. 根据权利要求1所述的方法,其特征在于,基于对应的决策逻辑对所述本移位层数据和所述上一移位层数据进行选择移位包括:
    基于对应的决策逻辑对所述本移位层数据与所述上一移位层数据进行布尔运算,并基于所述布尔运算结果输出所述本移位层数据或所述上一移位层数据。
  3. 根据权利要求2所述的方法,其特征在于,还包括:所述布尔运算结果为所述移位单元输出数据对应的标志位。
  4. 根据权利要求1所述的方法,其特征在于,配置每个所述移位单元的决策逻辑包括:
    基于所述移位单元所在的本移位层以及所述本移位层接收到的待处理数据对应的标志位配置所述移位单元决策逻辑。
  5. 根据权利要求4所述的方法,其特征在于,基于所述移位单元所在的本移位层以及所述本移位层接收到的待处理数据对应的标志位配置所述移位单元决策逻辑包括:
    对最下移位层接收到的待处理数据对应的标志位进行布尔运算以配置最下移位层的第一列移位单元的决策逻辑;
    对除所述最下移位层以外的其他移位层的第一列移位单元所在移位层及其相邻的下一移位层接收到的待处理数据对应的标志位进行布尔运算以配置所述其他移位层的第一列移位单元的决策逻辑;
    获取所述移位单元在本移位层中的列数,基于所述列数到对应移位层的第一列移位单元获取所述第一移位单元对应的决策逻辑中包括的待处理数据对应的标志位,基于所述列数对所述待处理数据对应的标志位进行组合布尔运算以配置所述移位层中除所述第一列移位单元以外的其他列移位单元的决策逻辑。
  6. 根据权利要求5所述的方法,其特征在于,在配置所述移位层中除所述第一列移位单元以外的其他列移位单元的决策逻辑时,若基于所述列数未获取到对应的决策逻辑,则所述移位单元的决策逻辑与上一列移位单元的决策逻辑相同。
  7. 根据权利要求5所述的方法,其特征在于,对最下移位层接收到的待处理数据对应的标志位进行布尔运算包括:
    对所述最下移位层接收到的待处理数据对应的标志位进行非运算。
  8. 根据权利要求5所述的方法,其特征在于,对除所述最下移位层以外的其他移位层的第一列移位单元所在移位层及其相邻的下一移位层接收到的待处理数据对应的标志位进行布尔运算包括:对所述其他移位层的第一列移位单元所在移位层接收到的待处理数据对应的标志位与其相邻的下一移位层接收到的待处理数据对应的标志位进行与非运算。
  9. 根据权利要求5所述的方法,其特征在于,基于所述列数对所述待处理数据对应的标志位进行组合布尔运算包括:
    基于所述列数对获取到的标志位进行组合,得到多个加数;
    对所述加数内的标志位进行非运算和与运算,并对所述加数进行或运算。
  10. 根据权利要求5所述的方法,其特征在于,基于所述列数对所述待处理数据对应的标志位进行组合布尔运算还包括:
    在基于列数未获取到对应的决策逻辑的情况下,移位单元的决策逻辑与上一列移位单元的决策逻辑相同。
  11. 根据权利要求2所述的方法,其特征在于,每个所述移位层最后一列的移位单元,在输出最终移位数据的同时还输出布尔运算结果。
  12. 根据权利要求1所述的方法,其特征在于,本移位层的移位单元还连接到下个移位层的下一列移位单元包括:所述本移位层的所述移位单元的输出还连接到所述下个移位层的下一列移位单元的输入。
  13. 根据权利要求1所述的方法,其特征在于,所述移位单元为二选一多路数据选择器。
  14. 根据权利要求1所述的方法,其特征在于,每个移位层包括4个移位单元,输入的待处理数据分别为Data[0],Data[1],Data[2],Data[3],对应的标志位的每个bit分别表示为T[D],T[C],T[B],T[A],所述数据移位系统的决策逻辑转化为:
    从上往下排列,第一行中每个移位单元的决策公式相同,均为(ABCD)’,其中,’符号表示对该bit取反;
    对于第二行的移位单元,第一列移位单元的决策逻辑使用公式B′+C′+D′进行决策,第二列移位单元至第四列移位单元使用公式A′B′+A′C′+A′D′+B′C′+B′D′+C′D′进行决策;
    对于第三行的移位单元,第一列移位单元使用公式C′+D′进行决策,第二列移位单元使用公式B′C′+B′D′+C′D′进行决策,第三列移位单元和第四列移位单元使用公式A′B′C′+A′B′D′+A′C′D′+B′C′D′进行决策;
    对于第四行的移位单元,第一列移位单元使用公式D′进行决策,第二列移位单元使用公式C′D′进行决策,第三列移位单元使用公式B′C′D′进行决策,第四列移位单元使用公式A′B′C′D′进行决策。
  15. 一种数据移位系统,其特征在于,所述数据移位系统包括配置模块以及多个并行的移位层,每个移位层包括多个移位单元,所述移位层的所述移位单元之间串行连接,并且本移位层的移位单元还连接到下个移位层的下一列移位单元,其中,所述配置模块配置为配置每个所述移位单元的决策逻辑;
    所述移位层配置为接收待处理数据,并将所述待处理数据输入到对应的移位单元进行处理,所述对应的移位单元包括本移位层的第一移位单元和下一移位层的第一移位单元;
    所述移位单元配置为接收本移位层数据和上一移位层数据,并基于对应的决策逻辑对所述本移位层数据和所述上一移位层数据进行选择移位。
  16. 根据权利要求15所述的系统,其特征在于,所述移位单元还配置为:
    基于对应的决策逻辑对所述本移位层数据与所述上一移位层数据进行布尔运算,并基于所述布尔运算结果输出所述本移位层数据或所述上一移位层数据。
  17. 根据权利要求15所述的系统,其特征在于,所述配置模块还配置为:
    基于所述移位单元所在的本移位层以及所述本移位层接收到的待处理数据对应的标志位配置所述移位单元决策逻辑。
  18. 根据权利要求17所述的系统,其特征在于,所述配置模块还配置为:
    对最下移位层接收到的待处理数据对应的标志位进行布尔运算以配置最下移位层的第一列移位单元的决策逻辑;
    对除所述最下移位层以外的其他移位层的第一列移位单元所在移位层及其相邻的下一移位层接收到的待处理数据对应的标志位进行布尔运算以配置所述其他移位层的第一列移位单元的决策逻辑;
    获取所述移位单元在本移位层中的列数,基于所述列数到对应移位层的第一列移位单元获取所述第一移位单元对应的决策逻辑中包括的待处理数据对应的标志位,基于所述列数对所述待处理数据对应的标志位进行组合布尔运算以配置所述移位层中除所述第一列移位单元以外的其他列移位单元的决策逻辑。
  19. 一种计算机设备,包括:
    至少一个处理器;以及
    存储器,所述存储器存储有可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时执行如权利要求1至14任意一项所述的方法的步骤。
  20. 一种计算机非易失性可读存储介质,所述计算机非易失性可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时执行如权利要求1至14任意一项所述的方法的步骤。
PCT/CN2023/078280 2022-09-01 2023-02-24 一种数据移位方法、系统、计算机设备及可读存储介质 WO2024045519A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211064030.X 2022-09-01
CN202211064030.XA CN115145639B (zh) 2022-09-01 2022-09-01 一种数据移位方法、系统、计算机设备及可读存储介质

Publications (1)

Publication Number Publication Date
WO2024045519A1 true WO2024045519A1 (zh) 2024-03-07

Family

ID=83415810

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/078280 WO2024045519A1 (zh) 2022-09-01 2023-02-24 一种数据移位方法、系统、计算机设备及可读存储介质

Country Status (2)

Country Link
CN (1) CN115145639B (zh)
WO (1) WO2024045519A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115145639B (zh) * 2022-09-01 2023-01-24 苏州浪潮智能科技有限公司 一种数据移位方法、系统、计算机设备及可读存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170206085A1 (en) * 2016-01-14 2017-07-20 International Business Machines Corporation Programmable linear feedback shift register
CN114097037A (zh) * 2019-05-16 2022-02-25 艾克斯安耐杰克有限公司 可移位存储器和操作可移位存储器的方法
CN114116013A (zh) * 2022-01-29 2022-03-01 苏州浪潮智能科技有限公司 一种数据处理方法、装置、电子设备及存储介质
CN115145639A (zh) * 2022-09-01 2022-10-04 苏州浪潮智能科技有限公司 一种数据移位方法、系统、计算机设备及可读存储介质

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114154623A (zh) * 2021-12-07 2022-03-08 广州小鹏自动驾驶科技有限公司 基于卷积神经网络的数据移位处理方法、装置及设备
CN114265625A (zh) * 2021-12-31 2022-04-01 上海阵量智能科技有限公司 数据循环移位装置、方法、芯片、计算机设备及存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170206085A1 (en) * 2016-01-14 2017-07-20 International Business Machines Corporation Programmable linear feedback shift register
CN114097037A (zh) * 2019-05-16 2022-02-25 艾克斯安耐杰克有限公司 可移位存储器和操作可移位存储器的方法
CN114116013A (zh) * 2022-01-29 2022-03-01 苏州浪潮智能科技有限公司 一种数据处理方法、装置、电子设备及存储介质
CN115145639A (zh) * 2022-09-01 2022-10-04 苏州浪潮智能科技有限公司 一种数据移位方法、系统、计算机设备及可读存储介质

Also Published As

Publication number Publication date
CN115145639A (zh) 2022-10-04
CN115145639B (zh) 2023-01-24

Similar Documents

Publication Publication Date Title
US11301213B2 (en) Reduced latency multiplier circuitry for very large numbers
US9342462B2 (en) Systems and methods for implementing low-latency lookup circuits using sparse hash functions
WO2024045519A1 (zh) 一种数据移位方法、系统、计算机设备及可读存储介质
US10318242B2 (en) Memristor-based multipliers using memristors-as-drivers (MAD) gates
US11662979B2 (en) Adder circuitry for very large integers
US20230333815A1 (en) Concurrent multi-bit adder
JPH10232765A (ja) 演算装置の演算方法、記憶媒体及び演算装置
JP4328487B2 (ja) 組合せ回路、暗号回路、その生成方法及びプログラム
Gemmeke et al. Implementation of scalable power and area efficient high-throughput Viterbi decoders
US11580055B2 (en) Devices for time division multiplexing of state machine engine signals
US6715066B1 (en) System and method for arranging bits of a data word in accordance with a mask
EP0467524B1 (en) Lookahead adder
CN110837354B (zh) 基于三值逻辑运算器的msd并行加法器及其构造方法
US11275713B2 (en) Bit-serial linear algebra processor
US4882698A (en) Cell based ALU with tree structured carry, inverting logic and balanced loading
US8385340B1 (en) Pipeline of a packet processor programmed to concurrently perform operations
US5192882A (en) Synchronization circuit for parallel processing
WO2020212016A1 (en) Low depth aes sbox architecture for area-constraint hardware
Roy Breakup Algorithm for Switching Circuit Simplifications
US11010159B2 (en) Bit processing involving bit-level permutation instructions or operations
US5327579A (en) Scanning systems using tree structures
EP4250186A1 (en) Qram architecture quantum circuit construction method and apparatus, and quantum address data analysis method and apparatus
US20220222044A1 (en) Multiplication-and-accumulation circuits and processing-in-memory devices having the same
US8443102B1 (en) Pipeline of a packet processor programmed to extract packet fields
JP7495933B2 (ja) ソート方法、装置、電子デバイス及びコンピュータプログラム

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23858562

Country of ref document: EP

Kind code of ref document: A1