CN104461447B - Shift control information generating method, circuit and shift unit based on interference networks - Google Patents
Shift control information generating method, circuit and shift unit based on interference networks Download PDFInfo
- Publication number
- CN104461447B CN104461447B CN201310429101.6A CN201310429101A CN104461447B CN 104461447 B CN104461447 B CN 104461447B CN 201310429101 A CN201310429101 A CN 201310429101A CN 104461447 B CN104461447 B CN 104461447B
- Authority
- CN
- China
- Prior art keywords
- shift
- numerical value
- information
- target
- alteration switch
- Prior art date
- Legal status (The legal status 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 status listed.)
- Expired - Fee Related
Links
Landscapes
- Small-Scale Networks (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The invention provides a kind of shift control information generating method, circuit and shift unit based on interference networks, methods described includes:According to the initial address and cyclic shift digit of data input interference networks to be shifted, displacement configured information of the data to be shifted by interference networks per one-level target widget group is calculated;The lowest order numerical value or data any value to be shifted for selecting cyclic shift digit correspond to shift control information of the displacement configured information of first order target widget group as each alteration switch pair of first order target widget group;For i-stage target widget group, according to shift mode and 1 numerical value of preceding i of circulating shift data low level, the inverted order information after multiple target displacement configured informations or multiple targets displacement configured information inverted order is selected, respectively as the shift control information of i-stage target widget group alteration switch pair.Polytype shifting function can be realized by the present invention, save resource so that shifting function is flexible, accelerates shifting processing speed.
Description
Technical field
The present invention relates to processing of circuit technical field, more particularly to shift control information generating method, device
And shift unit.
Background technology
Shifting function is the operation for needing to be frequently performed in the processing apparatus such as microprocessor, can realize the shifting of shifting function
Position device is the functional unit that the processing apparatus such as microprocessor cannot must lack.
Shifting function mainly includes ring shift left, ring shift right, the displacement of short word, arithmetic shift.Logical shift etc., existing skill
In art, shift unit is typically only capable to realize the shifting function that function is single, i.e., can only realize a type of shifting function, if desired
Polytype shifting function, it is necessary to which a variety of shift units are set so that shifting function is dumb, influences the speed of shifting processing
Degree.
The content of the invention
In view of this, the invention provides a kind of shift control information generating method, circuit and shifting based on interference networks
Position device, to solve existing shifter malfunction, the slower technical problem of shifting processing speed.
To achieve the above object, the present invention provides following technical scheme:
A kind of shift control information generating method based on interference networks, the interference networks include log2N levels are opened by N number of
The set of controls of control composition is closed, methods described includes:
Obtain the cyclic shift digit of data to be shifted, and the starting point that each bit value is inputted in the interference networks
Location, wherein, the data bit width M to be shifted is less than or equal to N, and the data to be shifted correspond to the log of interference networks2M level targets
Set of controls, include M/2 alteration switch pair per one-level target widget group, each alteration switch is to including address gaps 2m-1Two
Individual switch control, the switch control of different alteration switch centerings is different, and m represents target widget group series, M switch control address
0,1 ... M-1 is followed successively by, the interference networks do not include the alteration switch of other set of controls of the target widget group to straight-through;
Each bit value initial address is added with the cyclic shift digit, and transported with the data bit width remainder to be shifted
Calculate, complementation result and the initial address are subjected to XOR, it is corresponding per one-level target widget group to obtain each bit value
Displacement configured information, it is described displacement configured information be used for indicate whether shifted when numerical value exports through target widget group;
Select the lowest order numerical value or any bit value of the data to be shifted corresponding first of the cyclic shift digit
The displacement configured information of level target widget group, the shift control information as each alteration switch pair of first order target widget group;
M displacement configured information of i-stage target widget group is corresponded to for each numerical value of data to be shifted, works as shift mode
For ring shift left when, if the preceding i-1 numerical value of cyclic shift digit low level does not include numerical value 1, select the displacement instruction of multiple targets
Information, the shift control information as each alteration switch pair of i-stage target widget group successively is distinguished, otherwise by the multiple target
Shift configured information inverted order after inverted order information, respectively successively as i-stage target widget group each alteration switch pair displacement
Control information,
When shift mode is ring shift right, if the preceding i-1 numerical value of cyclic shift digit low level does not include numerical value 1, choosing
Select the inverted order information after the multiple target displacement configured information inverted order, respectively each friendship as i-stage target widget group successively
The shift control information of switch pair is changed, the multiple target is otherwise shifted into configured information, difference is used as i-stage target control successively
The shift control information of part group;
Wherein, i=2,3 ... log2M, each target displacement configured information correspond to initial address and the i-stage target control of numerical value
Unique one of switch control address of alteration switch centering is identical in processed group.
Preferably, the target displacement configured information includes M/2, and each target displacement configured information corresponds to rising for numerical value
Beginning, address was identical with unique one of switch control address of alteration switch centering in i-stage target control group.
Preferably, it is described when shift mode is ring shift left, if the preceding i-1 numerical value of cyclic shift digit low level does not wrap
Numerical value 1 is included, selects multiple target displacement configured informations, the respectively shifting as each alteration switch pair of i-stage target widget group successively
Position control information, otherwise it regard the inverted order information after multiple targets displacement configured information inverted order of selection, difference as i-stage successively
The shift control information of each alteration switch pair of target widget group,
When shift mode is ring shift right, if the preceding i-1 numerical value of cyclic shift digit low level does not include numerical value 1, choosing
Select the inverted order information after the multiple target displacement configured information inverted order, respectively each friendship as i-stage target widget group successively
The shift control information of switch pair is changed, the multiple target displacement configured information otherwise selected, difference is used as i-stage mesh successively
The shift control information of mark set of controls includes:
When shift mode is ring shift left, if the preceding i-1 numerical value of cyclic shift digit low level does not include numerical value 1, choosing
Initial address is selected as 0,1 ... 2i-1- 1 or initial address 2i-1、2i-1+1、…2iThe target displacement instruction letter of numerical value corresponding to -1
Breath, distinguish the shift control information as the alteration switch pair in each sub-goal set of controls in i-stage target widget group successively;It is no
The target is then shifted to the inverted order information after configured information inverted order, is used as each specific item in i-stage target widget group successively respectively
Mark the shift control information of alteration switch pair in set of controls;
When shift mode is ring shift right, if the preceding i-1 numerical value of cyclic shift digit low level includes numerical value 1, will select
Inverted order information after the target displacement configured information inverted order selected, is used as each specific item in i-stage target widget group successively respectively
Mark the shift control information of the alteration switch pair in set of controls;Otherwise the target is shifted into configured information, respectively conduct successively
In i-stage target widget group in each sub-goal set of controls alteration switch pair shift control information;
Wherein, i-stage target widget group includes M/2iIndividual sub- target widget group, it is identical that each sub-goal control includes quantity
And the continuous alteration switch pair in position.
Present invention also offers a kind of shift control information generation circuit based on interference networks, the interference networks include
log2The set of controls that N layers are made up of N number of switch control, the circuit include input interface circuit, are connected with the input interface
Displacement configured information counting circuit and with the information selection circuit that is connected of displacement configured information counting circuit;
The input interface circuit, for receiving the cyclic shift digit of data to be shifted, and the input of each bit value
Initial address in the interference networks, wherein, the data bit width M to be shifted is less than or equal to N, and the data to be shifted are corresponding
The log of interference networks2M level target widget groups, include M/2 alteration switch pair, each alteration switch per one-level target widget group
Including address gaps 2m-1Two switch controls, the switch controls of different alteration switch centerings is different;
Configured information counting circuit is shifted, for each bit value initial address to be added with the cyclic shift digit, and
With the data bit width complementation to be shifted, operation result and the initial address are subjected to XOR, obtain each digit
The corresponding displacement configured information per one-level target widget group of value, the displacement configured information instruction numerical value export through target widget group
When whether shift;
Information selection circuit, lowest order numerical value or any bit value for selecting the cyclic shift digit corresponding the
The displacement configured information of primary target set of controls, the shift control as each alteration switch pair of first order target widget group are believed
Breath;
M displacement configured information of i-stage target widget group is corresponded to for each numerical value of data to be shifted, works as shift mode
For ring shift left when, if the preceding i-1 numerical value of cyclic shift digit low level does not include numerical value 1, select the displacement instruction of multiple targets
Information, the shift control information as each alteration switch pair of i-stage target widget group successively is distinguished, otherwise by the multiple target
Shift configured information inverted order after inverted order information, respectively successively as i-stage target widget group each alteration switch pair displacement
Control information,
When shift mode is ring shift right, if the preceding i-1 numerical value of cyclic shift digit low level does not include numerical value 1, choosing
Select the inverted order information after the multiple target displacement configured information inverted order, respectively each friendship as i-stage target widget group successively
The shift control information of switch pair is changed, the multiple target is otherwise shifted into configured information, difference is used as i-stage target control successively
The shift control information of part group;
Wherein, i=2,3 ... log2M, each target displacement configured information correspond to initial address and the i-stage target control of numerical value
Unique one of switch control address of alteration switch centering is identical in processed group.
Preferably, the input interface circuit comprises at least M address input interface and shift amount input interface, described
M address input interface receives the initial address of M numerical value of data to be shifted successively, and the shift amount input interface receives
The cyclic shift digit of the data to be shifted;
The displacement configured information counting circuit comprises at least M adder and M XOR gate, wherein, the S adder
Input connect the S address input interface and the shift amount input interface respectively;The S XOR gate input difference
Connect the output end and the S address input interface of the S adder, S=1,2 ... M.
Preferably, the input interface circuit comprises at least M address input interface, shift amount input interface and electricity
Flat input interface, M address input interface receive the initial address of M numerical value of data to be shifted, the displacement respectively
Digit input interface receives the cyclic shift digit of the data to be shifted, and the level input interface is used to receive binary number
Value 1;
The displacement configured information counting circuit comprises at least M adder and M XOR gate, wherein, first addition
The input of device connects first corresponding to the shift amount input interface and the lowest order numerical value of the data to be shifted respectively
Individual address input interface;
The input of K adders connects the output end of the K-1 adder and the level input interface respectively, and K=
2、3…M;
The input of first XOR gate connects the output end of first adder and the data to be shifted respectively
Lowest order numerical value corresponding to address input interface;
K-th XOR gate input connects the output end and k-th address input interface of k-th adder respectively.
Preferably, described information selection circuit comprises at least log2M selector;
The input of first selector is connected with the shift amount input interface or any XOR gate, output end difference
Each alteration switch pair of the interference networks first aim set of controls is connected, the lowest order numerical value of shift amount is selected or appoints
The displacement configured information of the corresponding first object set of controls of one XOR gate output, is exported to each exchange of first aim set of controls
Switch pair;
The output end of the input linking objective XOR gate of i-th of selector, obtain the mesh of corresponding i-stage target widget group
Mark displacement configured information, output end connect each alteration switch pair of i-stage target widget group respectively, when shift mode is left for circulation
During shifting, if the preceding i-1 numerical value of cyclic shift digit low level does not include numerical value 1, target is shifted configured information by i-th of selector
It is sequentially output respectively and the target to each alteration switch pair, is otherwise shifted to the inverted order information after configured information inverted order respectively successively
Export to each alteration switch pair;
When shift mode is ring shift right, if the preceding i-1 numerical value of cyclic shift digit low level does not include numerical value 1, i-th
Inverted order information after target displacement configured information inverted order is sequentially output to each alteration switch pair by individual selector respectively;Otherwise
Target displacement configured information is sequentially output to each alteration switch pair respectively;
Wherein, each target XOR gate corresponds to the initial address of numerical value and unique alteration switch of i-stage target widget group
A wherein switch control address for centering is identical.
Preferably, described information selection circuit comprises at least log2M selector;
The input of first selector is connected with shift amount input interface or any XOR gate, and output end connects respectively
Each alteration switch pair of the interference networks first aim set of controls, select the lowest order numerical value or any different of shift amount
The displacement configured information of the corresponding first object set of controls of OR gate output, is exported to each alteration switch of first aim set of controls
It is right;
The input of i-th of selector connects initial address 0,1 ... 2 respectivelyi-1- 1 or initial address 2i-1、2i-1+1、…
2iTarget XOR gate corresponding to -1, output end connect the alteration switch in each sub-goal set of controls of i-stage target widget group respectively
It is right, when shift mode is ring shift left, if the preceding i-1 numerical value of cyclic shift digit low level does not include numerical value 1, select each mesh
The target shift control information of the corresponding i-stage target widget group of XOR gate output is marked, difference is used as each sub-goal control successively
The shift control information of alteration switch pair in group;Otherwise by the inverted order after each target displacement configured information inverted order of selection
Information, distinguish the shift control information as alteration switch pair in each sub-goal set of controls successively;
When shift mode is ring shift right, if the preceding i-1 numerical value of cyclic shift digit low level does not include numerical value 1, it will select
Inverted order information after the target displacement configured information inverted order selected, is used as alteration switch in each sub-goal set of controls successively respectively
To shift control information, otherwise by each target shift control information of selection, be used as successively in each sub-goal set of controls respectively
The shift control information of alteration switch pair.
Present invention also provides a kind of shift unit, including shift control information generation circuit described above and Internet
Network;
The shift control information generation circuit is used to generate the interference networks corresponding to the data to be shifted that bit wide is M
Shift control information;
The interference networks comprise at least log2The target widget group that M levels are made up of M switch control, per primary target control
Part group includes M/2 alteration switch pair, and each alteration switch is to including address gaps 2m-1Two switch controls, difference exchange
It is different to switch the switch control of centering, m expression target widget group series, M switch control address is followed successively by 0,1 ... M-1;
The interference networks first order target widget group receives data to be shifted, log2The output of M level target widgets group moves
Purpose data behind position;
Wherein, the interference networks do not include the alteration switch of other set of controls of the target widget group to straight-through.
Preferably, the M switch control is respectively alternative data selector, displacement of each alteration switch to reception
Control information inputs the control terminal of its alternative data selector included respectively;
The first input end of each alternative data selector receives input numerical value, and the second input exchanges where connecting it
The first input end to another alternative data selector is switched, output end is connected in next stage target widget group with it same
The first input end of alternative data selector at address location;
The shift control information specifically controls alternative data selector selection first input end or the second input
Numerical value is inputted to export from output end.
Understood via above-mentioned technical scheme, compared with prior art, the invention provides a kind of based on interference networks
Shift control information generating method, circuit and shift unit.Initial address of the invention according to data input interference networks to be shifted
And cyclic shift digit, calculate displacement configured information of the data to be shifted by interference networks per one-level target widget group;Choosing
Select the lowest order numerical value of cyclic shift digit or data any value to be shifted corresponds to the displacement of first order target widget group and referred to
Show shift control information of the information as each alteration switch pair of first order target widget group;For i-stage target widget group, according to
The preceding i-1 numerical value of shift mode and circulating shift data low level, select multiple target displacement configured informations or multiple mesh
Inverted order information after mark displacement configured information inverted order, believes respectively as the shift control of i-stage target widget group alteration switch pair
Breath.Each alteration switch is according to its corresponding shift control information controlling switch state, when data output interference networks to be shifted,
The purpose data of output are the data after being shifted according to cyclic shift digit.Pass through the embodiment of the present invention, it is possible to achieve a variety of
The shifting function of type, without being respectively provided with independent shift circuit for each shifting function, save part resource so that move
Bit manipulation is flexible, accelerates shifting processing speed.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing
There is the required accompanying drawing used in technology description to be briefly described, it should be apparent that, drawings in the following description are only this
The embodiment of invention, for those of ordinary skill in the art, on the premise of not paying creative work, can also basis
The accompanying drawing of offer obtains other accompanying drawings.
Fig. 1 is a kind of flow chart of shift control information generating method one embodiment based on interference networks of the present invention;
Fig. 1 a are a kind of schematic diagram of interference networks in the embodiment of the present invention;
Fig. 1 b are a kind of schematic diagram for the interference networks that ring shift left is realized in the embodiment of the present invention;
Fig. 1 c are a kind of schematic diagram for the interference networks that short word cyclic shift is realized in the embodiment of the present invention;
Fig. 2 is a kind of flow of shift control information generating method another embodiment based on interference networks of the present invention
Figure;
Fig. 3 is a kind of structural representation of shift control information generation circuit one embodiment based on interference networks of the present invention
Figure;
Fig. 4 is that a kind of structure of shift control information generation circuit another embodiment based on interference networks of the present invention is shown
It is intended to;
Fig. 5 is that a kind of structure of shift control information generation circuit another embodiment based on interference networks of the present invention is shown
It is intended to;
Fig. 6 is a kind of structural representation of one embodiment of shift unit of the present invention;
Fig. 7 is a kind of hardware structure diagram of interference networks in shift unit of the embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Site preparation describes, it is clear that described embodiment is only part of the embodiment of the present invention, rather than whole embodiments.It is based on
Embodiment in the present invention, those of ordinary skill in the art are obtained every other under the premise of creative work is not made
Embodiment, belong to the scope of protection of the invention.
One of main thought of the embodiment of the present invention can include:
According to the initial address and cyclic shift digit of data input interference networks to be shifted, data warp to be shifted is calculated
Cross displacement configured information of the interference networks per one-level target widget group;Select the lowest order numerical value of cyclic shift digit or wait to move
The displacement configured information that position data any value corresponds to first order target widget group is opened as each exchange of first order target widget group
The shift control information of pass pair;For i-stage target widget group, according to shift mode and the preceding i- of circulating shift data low level
1 numerical value, the inverted order information after multiple target displacement configured informations or multiple targets displacement configured information inverted order is selected, respectively
Shift control information as i-stage target widget group alteration switch pair.So as to which each alteration switch is according to displacement control corresponding to it
Information controlling switch state processed, when data output interference networks to be shifted, the purpose data of output are according to cyclic shift
Data after digit displacement.Pass through the embodiment of the present invention, it is possible to achieve polytype shifting function, without being shifted for each
Operation is respectively provided with independent shift circuit, saves part resource so that shifting function is flexible, accelerates shifting processing speed.
Fig. 1 is a kind of flow chart of shift control information generating method one embodiment based on interference networks of the present invention.
Interference networks are the networks being made up of multiple switch control according to certain topological structure and control mode, interference networks
Including multistage set of controls, include multiple switch control per one-level set of controls.
In circulative shift operation, the shifting function of data to be shifted, be each numerical value position of data to be shifted change
Change, such as 8 binary data to be shifted, the change in location after ring shift left 6 is:
0th, 1 ... 7 represents the numeric addresses of data to be shifted, it is known that, address 5 is arrived after the numerical value a displacements of the opening position of address 7,
Address 4 is arrived after the numerical value b displacements of the opening position of address 6.A~h is binary numeral 0 or 1 in figure, upper clear with letter in order to describe
Instead of.
Inventor realize the present invention during study find, can utilize interference networks displacement characteristic, i.e., two
The swapping data of switch control, realize the shifting function of data to be shifted.
Therefore, the embodiment of the present invention is directed to circulative shift operation, it is proposed that a kind of interference networks of structure, is N × N side
Body replaces interference networks, including log2N level set of controls, include N number of switch control per one-level set of controls, have per one-level set of controls
Have N number of input and N number of output, the address of N number of switch control of each layer set of controls can use control port numbers 0,1 ... N-1 tables
Show, wherein, N is integer, specifically equal to 2x, x=1,2,3 ....Switch control address phase at set of controls same positions at different levels
Together.
In interference networks in N number of switch control of every one-level set of controls, either switch control and its address gaps 2y-1Open
Alteration switch pair can be formed by closing control, and y is set of controls series.Alteration switch is to including two kinds of on off states:Straight-through or intersection,
It may decide that by the two values of the alteration switch pair from alteration switch to whether being replaced during output, that is, shift.
The interference networks of N × N structures provided in an embodiment of the present invention can also be split, the interconnection of every one N × N structures
Network can be made up of 2 N/2 × N/2 interference networks, and every one N/2 × N/2 interference networks are by interference networks
Continuous switch control composition, same each sub- interference networks can also continue to split in this mode.
The present invention is the interference networks using said structure, realizes the circulative shift operation of data to be shifted.It is to be shifted
When data are by not set of controls at the same level, each bit value can by shifting or not shifting, finally realize that interconnected network is defeated
The purpose data gone out are the data after data to be shifted are shifted.
The on off state of alteration switch pair is determined by the numeric shift or do not shift of each alteration switch pair, exchange is opened
The on off state of pass pair can be determined that shift control information is that " 1 " represents to intersect, i.e. exchange of values, is moved by shift control information
Position control information is that " 0 " represents straight-through, and numerical value does not exchange.The displacement of each alteration switch pair in interference networks per one-level set of controls
Control information can determine according to technical scheme provided in an embodiment of the present invention.
Fig. 1 a show a kind of schematic diagram of interference networks of the present invention, and Fig. 1 a are by taking 8 × 8 interference networks as an example, side in figure
Frame 10 can represent set of controls inputs at different levels or output numerical value respectively, with 0,1 ... 7 ground for representing switch control in set of controls at different levels
Location, as figure shows including log28=3 grades of set of controls, each group of set of controls include 8/2=3 alteration switch pair, each alteration switch
To including address gaps 2y-1Two switch controls, the switch controls of different alteration switch centerings is different.Understand first order control
Alteration switch in group to including:(0 1)、(2 3)、(4 5)、(6 7);Alteration switch in the set of controls of the second level to including:
(0 2)、(1 3)(4 6)(5 7);Alteration switch in third level set of controls to including:(0 4)、(1 5)(2 6)(3 7).Figure
Middle dotted arrow and solid arrow illustrate two kinds of possible on off states of alteration switch pair:Straight-through and intersection.8 in Fig. 1 a ×
8 interference networks can split into the sub- interference networks of two 4 × 4, as shown in two dotted line frames in figure.
It should be noted that Fig. 1 a are the schematic diagram of interference networks, the hardware configuration of switch control can use a variety of
Mode is realized, can be introduced in embodiment below.
Therefore, the interference networks based on foregoing description structure, in the present embodiment, this method can include following step
Suddenly:
Step 101:The cyclic shift digit of data to be shifted is obtained, and each bit value inputs rising for the interference networks
Beginning address.
The initial address namely the address for referring to each switch control of interference networks first order set of controls.
Wherein, the data bit width M to be shifted is less than or equal to N, and the data to be shifted correspond to the log of interference networks2M
Level target widget group, include M/2 alteration switch pair per one-level target widget group, each alteration switch is to including address gaps 2m -1Two switch controls, the switch controls of different alteration switch centerings is different, and m is target widget group series, equal to 1,2 ...
log2M.Switch control address is represented sequentially as 0,1 ... M-1.
Wherein, M can be specifically equal to N/2x, x=1,2,3 ....The now log corresponding to data to be shifted2M level target controls
Part group is the sub- interference networks that interference networks are split out.
Still by taking Fig. 1 a as an example, it is assumed that be to be used needed for the embodiment of the present invention by 3 grades of target widgets shown in M=8, Fig. 1 a
The sub- interference networks that group is formed.
When carrying out data displacement using interference networks, other controls of the target widget group are not included in interference networks
The alteration switch of group is to straight-through.
Wherein, the data to be shifted can be the partial data of source data, such as the source data that bit wide is 8, should
Data to be shifted can be low 4 in the source data, the data to be shifted of high 4 or middle continuous 4 bit value composition,
So as to which the short word cyclic shift of data can also be realized by the embodiment of the present invention.
Step 102:Each bit value initial address is added with the cyclic shift digit, and with the data bit to be shifted
Wide complementation, operation result and its initial address are subjected to XOR, it is corresponding per primary target control to obtain each bit value
The displacement configured information of part group.
The displacement configured information is used to indicate whether shift when numerical value exports through target widget group.
When each bit value of data to be shifted inputs each layer of target widget group, the numerical value of same alteration switch pair is inputted i.e.
Form one group, this group of numerical value is according to the on off state of alteration switch pair, and by transposition or transposition does not realize numerical value
Displacement.
In order to be best understood from the present invention, with reference to Fig. 1 a, now it is illustrated below:
Assuming that data to be shifted are 8 bit binary datas, that is, 3 grades of target widget groups are needed, as shown in Figure 1a, 3 grades of mesh
Include 4 pairs of alteration switches pair, the i.e. corresponding first order of initial address of each bit value in mark set of controls per one-level target widget group
Each switch control address of target widget group, i.e., 0,1,2 ... 7.Wherein, what the address of alteration switch pair can be included with it any opens
The address for closing control represents.
Assuming that cyclic shift digit is 6.Each bit value initial address is added with cyclic shift digit, and waits to move with described
The result that position data bit width complementation obtains refers to the destination address of each numerical value, that is, corresponds to last layer of target widget
Each switch control address of group.
The destination address of obtained each numerical value and its initial address are subjected to XOR, what is obtained is each numerical value
Through displacement configured information during every one-level target widget group.
As shown in the table is 8 initial addresses, and the destination address obtained after computing and corresponding each displacement refer to
Show information.
Table 1:
Initial address | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
Initial address | 000 | 001 | 010 | 011 | 100 | 101 | 110 | 111 |
Destination address | 110 | 111 | 000 | 001 | 010 | 011 | 100 | 101 |
Shift configured information | 110 | 110 | 010 | 010 | 110 | 110 | 010 | 010 |
Displacement configured information of each bit value corresponding to initial address through target widget groups at different levels is as shown in table 2 below:
Table 2:
Initial address | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
The first order | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
The second level | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
The third level | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 |
Step 103:Select lowest order numerical value or any bit value of data to be shifted of the cyclic shift digit corresponding
The displacement configured information of first order target widget group, the shift control as each alteration switch pair of first order target widget group are believed
Breath.
Displacement configured information of each bit value through target widget groups at different levels is only intended to represent the bit value from the target
Whether set of controls needs to shift when exporting, and " 0 " represents not shift, and " 1 " represents displacement.And same numerical value is in every one-level target widget
Which switch control how group to shift and be displaced to, it is necessary to the on off state of the alteration switch pair by target widget groups at different levels
To realize.
Displacement configured information represents whether need to shift when numerical value exports from target widget group, and alteration switch is to being to be used for
Whether the numerical value realized from its output is shifted over, therefore inventor has found in research process, can pass through the displacement of numerical value
Configured information determines the shift control information of alteration switch pair.
In upper table 2, the corresponding multiple displacement configured informations per one-level target widget group of data to be shifted can use numerical value
Initial address is indexed.The initial address is identical with the address of each switch control in target widget groups at different levels.
For first order target widget group, the shift control information of each alteration switch pair is equal to any bit value corresponding first
The level displacement configured information of target widget group or the lowest order numerical value of cyclic shift digit.
Each numerical value correspond to first order target widget group displacement configured information it is identical and with the lowest order of cyclic shift digit
Numerical value is identical, and as shown in table 2, the displacement configured information that each numerical value corresponds to first order target widget group is 0, cyclic shift digit
6 are expressed as 110, and its lowest order numerical value is also 0.Therefore can select the cyclic shift digit lowest order numerical value or
Any bit value corresponds to the displacement configured information of first order target widget group, as each alteration switch of first order target widget group
To shift control information.
Step 104:M displacement configured information of i-stage target widget group is corresponded to for each numerical value, if shift mode is to follow
Ring moves to left, and performs step 105, if shift mode is ring shift right, performs step 108.
Step 105:Whether do not include numerical value 1, if it is, performing if judging the preceding i-1 numerical value of cyclic shift digit low level
Step 106, if not, performing step 107.
Circulative shift operation includes the shifting function of two kinds of shift modes of ring shift left and ring shift right, i-stage target control
The mobile control information of each alteration switch pair of part group and the preceding i-1 numerical value of shift mode and shift amount low level have
Close.Wherein i=2,3 ... log2M。
Step 106:Multiple target displacement configured informations are selected, respectively exchanges open as i-stage target widget group successively respectively
The shift control information of pass pair.
Step 107:Multiple targets of selection are shifted to the inverted order information after configured information inverted order, respectively as i-stage mesh
Mark the shift control information of each alteration switch pair of set of controls.
Step 108:Whether do not include numerical value 1, if it is, performing if judging the preceding i-1 numerical value of cyclic shift digit low level
Step 109, if not, performing step 110.
Step 109:The multiple target of selection is shifted to the inverted order information after configured information inverted order, respectively as i-th
The shift control information of each alteration switch pair of level target widget group
Step 110:The multiple target of selection is shifted into configured information, respectively handed over respectively as i-stage target widget group
Change the shift control information of switch pair.
Wherein, each target displacement configured information corresponds to the initial address of numerical value and unique friendship in i-stage target widget group
The one of switch control address for changing switch centering is identical.Accordingly, target displacement can be selected from displacement configured information
Configured information.
Each target displacement configured information corresponds to the initial address and the one of switch of unique alteration switch centering of numerical value
Control address is identical, and a kind of possible implementation is:Target displacement configured information includes M/2, each target displacement instruction
The initial address of numerical value corresponding to information is controlled with the one of switch of unique alteration switch centering in i-stage target widget group respectively
Part address is identical.Namely it is each alteration switch centering of selection, with either switch control when selection target shifts configured information
The displacement configured information of numerical value corresponding to the identical initial address of address, configured information is shifted as target.
Alternatively possible situation of realizing is:Target displacement configured information includes 2i-1Individual, each target shifts configured information
The initial address of corresponding numerical value is identical with the one of switch control address of unique alteration switch centering, or with uniquely exchanging out
Close one of switch control address difference 2 of centeringi.Now, any alteration switch pair and the alteration switch are to either switch
Control address difference 2iAnother switch control where another alteration switch pair shift control information it is identical.Implement below
It can be introduced in detail in example.
After determining multiple target displacement configured informations, according to shift mode and shift amount, what can be selected is multiple
Target shifts configured information, according to address matching principle, distinguishes the shift control information as each alteration switch pair successively;Or
Multiple targets are shifted to the inverted order information after configured information inverted order, respectively as the shift control information of each alteration switch pair.Mesh
Mark displacement configured information or inverted order information and the corresponding relation of alteration switch pair, are matched according to address relationship.
For example, shift mode is ring shift left, for the 2nd grade of target widget group, selection initial address is 0,1 corresponding numerical value
Target displacement configured information a and b, when not including numerical value 1 in the preceding i-1 numerical value of the low level of shift amount, then by a and b difference
Successively as or difference 2 identical with initial addressiAddress 0,1 or address 4,5 switch control where alteration switch pair shifting
Position control information;Otherwise using inverted order the information b and a after a and b inverted orders as address it is successively respectively 0,1 or address is 4,5 to open
The shift control information of alteration switch pair where closing control.
Inverted order information refers to source information according to the information after being sorted with the opposite way of source sortord.Such as source information
For:A, b, c, d, then its inverted order information be:d、c、b、a.
In the present embodiment, multiple target displacement configured informations are assumed to be a, b, respectively as displacement of the alteration switch to A and B
Control information, i.e. a are A shift control information, and b is B shift control information.If after inverted order, the shift control that b is A is believed
Breath, a are B shift control information.
Multiple targets are shifted into configured information to open as the shift control information of each alteration switch pair, now each exchange
The shift control information of pass pair corresponds to the initial address of numerical value and the address of a wherein switch control for each alteration switch pair is identical
Or difference 2i。
Multiple targets are shifted to the inverted order information after configured information inverted order, respectively as the shift control of each alteration switch pair
Information, now after multiple shift control information inverted orders of each alteration switch pair corresponding target displacement configured information respectively with each friendship
Change switch the one of switch control of centering address it is identical or difference 2i。
After selecting each alteration switches of target widget groups at different levels to shift control information for interference networks, that is, export to each
Alteration switch pair, each alteration switch according to respective shift control information to controlling itself straight-through or intersecting, when data to be shifted
When input is to interference networks, the data from interference networks output are the data after cyclic shift.The present embodiment technical scheme branch
Ring shift left or ring shift right operation are held, and the short word circulate operation of data can also be carried out, therefore can be realized simultaneously a variety of
The shifting function of type so that operation is flexible.
Fig. 1 b are that datacycle to be shifted moves to left a kind of connection diagram of interference networks at 6 in the embodiment of the present invention,
Each square frame represents the numerical value of input or output, when data to be shifted are represented with numerical value a~h, can see by 1b in figure, each numerical value
Shifting function through target widget groups at different levels, the arrow in target widget groups at different levels are pointed to by alteration switch to according to shift control
Information determines.
First order target widget alteration switch pair(01)、(23)、(45)、(67)Shift control information be respectively 0000,
With reference to table 2, selection is displacement configured information or cyclic shift digit that any value corresponds to first order target widget group
Lowest order numerical value;
Alteration switch pair in the target widget group of the second level(02)、(13)(46)(57)Shift control information be respectively
1111, with reference to table 2, selection is that initial address shifts configured information for the target of 0,1,4,6 or 2,3,6,7 corresponding numerical value
1111, because value is 0 before preceding 2-1 of cyclic shift digit 110, not including 1, then target displacement configured information 1111 is distinguished
Alteration switch pair is used as successively(02)、(13)、(46)、(57)Shift control information
Alteration switch pair in third level set of controls(04)、(15)(26)(37)Shift control information be respectively 0011,
With reference to table 2, selection is that initial address shifts configured information 1100 for the target of 0,1,2,3 or 4,5,6,7 corresponding numerical value, by
Value is 10 before preceding 3-1 of cyclic shift digit 110, not including 1, is then made target displacement configured information 0011 successively respectively
For alteration switch pair(04)、(15)(26)(37)Shift control information.
Fig. 1 c are in the embodiment of the present invention, by a kind of connection signal of interference networks during the short word ring shift left of source data 2
Figure.Source data includes the first data to be shifted being made up of a~d and the second data to be shifted being made up of e~h in Fig. 1 c,
So as to which source data a~h short word cyclic shift can be realized by Fig. 1 c 8 × 8 interference networks.Short word cyclic shift is waited to move
Position data bit width is 4, then need to only use preceding two-stage set of controls, is led directly to so as to the alteration switch of third level set of controls to whole.
In the present embodiment, based on interconnection network architecture of the present invention, according to the input starting point of data to be shifted
Location and cyclic shift digit, the displacement configured information of data to be shifted can be calculated, according to displacement configured information, and
Corresponding relation of the configured information with alteration switch to shift control information is shifted, target can be selected from displacement configured information and moved
Position configured information, the shift control information of each alteration switch pair in interference networks is obtained accordingly.According to determined by the present embodiment
Shift control information can at least realize ring shift left and ring shift right operation based on the interference networks, and to be shifted
Data bit width is less than the bit wide of interference networks, can also realize short word circulative shift operation, polytype so as to realize
Shifting function so that shifting function is flexible, without setting single shift circuit for each shifting function, saves part money
Source, accelerate shifting processing speed.
Fig. 2 is a kind of flow of shift control information generating method another embodiment based on interference networks of the present invention
Figure.
The interference networks include log2The set of controls that N levels are made up of N number of switch control, specific structure description may refer to
Described in above-described embodiment, it will not be repeated here.
This method can include following steps:
Step 201:The cyclic shift digit of data to be shifted is obtained, and each bit value inputs the interference networks
Initial address.
Wherein, the data bit width M to be shifted is less than or equal to N, and the data to be shifted correspond to the log of interference networks2M levels
Target widget group, include M/2 alteration switch pair per one-level target widget group, each alteration switch includes address gaps 2m-1's
Two switch controls, the switch controls of different alteration switch centerings is different, and m represents target widget group series, M switch control
Location is followed successively by 0,1 ... M-1.
The interference networks do not include the alteration switches of other set of controls of the target widget group to straight-through, namely displacement control
Information processed is " 0 ".
Step 202:Each bit value initial address is added with the cyclic shift digit, and with the data bit to be shifted
Wide complementation, operation result and the initial address are subjected to XOR, it is corresponding per primary target control to obtain each bit value
The displacement configured information of part group.
Wherein, shift when configured information instruction numerical value exports through target widget group and whether shift;
Step 203:The lowest order numerical value or any bit value for selecting the cyclic shift digit correspond to first order target
The displacement configured information of set of controls, the shift control information as each alteration switch pair of first order target widget group.
The operation of step 201~step 203 is similar to the operation of above-described embodiment step 101~step 103, herein no longer
Repeat.
Step 204:M displacement configured information of i-stage target widget group is corresponded to for each numerical value, if shift mode is to follow
Ring moves to left, and performs step 205, if shift mode is ring shift right, performs step 208.
Step 205:Whether judge i-1 numerical value of cyclic shift digit low level includes 1, if it is, step 206 is performed,
If it is, perform step 207.
Step 206:Select initial address be 0,1 ... 2i-1- 1 or initial address 2i-1、2i-1+1、…2iNumber corresponding to -1
The target displacement configured information of value, respectively successively as the alteration switch in each sub-goal set of controls in i-stage target widget group
To shift control information.
Step 207:The target is shifted to the inverted order information after configured information inverted order, difference is used as i-stage target successively
In set of controls in each sub-goal set of controls alteration switch pair shift control information.
Switch control address represents with 0,1 ... M-1, the switch control per one-level target widget group aligned identical opening position
Location is identical, and as shown in Figure 1a, when M is 8,0,1 ... 7 corresponds to 3 switch controls respectively.
Initial address is the address that numerical value inputs each switch control of first order target widget group.
Inventor has found that interference networks can include M/2 per one-level target widget group under study for actioniIndividual sub- target widget
Group, each sub-goal set of controls include the continuous alteration switch pair of identical quantity and position, and in different sub-goal set of controls
Location difference 2iSwitch control where alteration switch pair shift control information it is identical.
Still by taking Fig. 1 a as an example, address can be understood for second level target widget group(0、1、2、3)Corresponding switch control
For a sub-goal set of controls, address(4、5、6、7)Corresponding switch control is a sub-goal set of controls, and 0 is corresponding with 4 switch controls
Alteration switch pair shift control information it is identical.
Therefore, when circulative shift operation is that ring shift left operates, and in the preceding i-1 numerical value of cyclic shift digit low level not
Including numerical value 1,0,1 ... 2 is selectedi-1- 1 or initial address be 2i-1、2i-1+1、…2iThe target displacement of numerical value corresponding to -1 refers to
Show information, distinguish the shift control information as the alteration switch pair matched in each sub-goal set of controls with initial address successively.
The now alteration switch centering wherein address of a switch control it is identical with the initial address of its corresponding numerical value of shift control information or
Difference 2i。
Using bit wide as 8 data instance to be shifted.
For second level target widget group, if the preceding i-1 numerical value of cyclic shift digit low level does not include 1, such as circulation moves
The preceding 2-1 numerical value of position digit 110 is 0, not including 1, selects the shifting of initial address 0,1 or the corresponding numerical value of initial address 2,3
Position configured information shifts configured information as target, wherein, the displacement instruction of numerical value corresponding to initial address 0 and initial address 4
Information is identical, initial address 1 is identical with numeric shift configured information corresponding to initial address 5, and initial address 0 and initial address
2nd, initial address 1 refers to initial address 3, initial address 4 with initial address 6, the displacement corresponding with initial address 7 of initial address 5
Show that information is identical.
Assuming that displacement configured information corresponding to initial address 0,1 or initial address 2,3 is respectively a and b, interference networks
In(0、1、2、3)One sub-goal set of controls,(4、5、6、7)For another sub-goal set of controls, then distinguish successively using a, b as address
It is 1 for 0 and address, or the first alteration switch where the switch control that address is 2 and address is 3 is to S0With the second alteration switch
To S2Shift control information, and the where address is 4 and address is 5 or address is 6 and address is 7 switch control
Three alteration switches are to S3With the 4th alteration switch to S4Shift control information.I.e. a is respectively as S0And S3Shift control letter
Breath, b is respectively as S2And S4Shift control information.
If the preceding i-1 numerical value of cyclic shift digit low level includes 1, multiple targets displacement configured information of selection is entered
Row inverted order, the displacement control using inverted order information as alteration switch pair in each sub-goal set of controls in i-stage target widget group
Information processed.With reference to upper example, b, a are used as S successively respectively0、S1And S3、S4Shift control information.I.e. b is respectively as S0And S2
Shift control information, a is respectively as S2And S4Shift control information.
Step 208:Whether do not include 1, if it is, performing step if judging the preceding i-1 numerical value of cyclic shift digit low level
209, if it is, performing step 208.
Step 209:The target is shifted to the inverted order information after configured information inverted order, distribution is used as i-stage target successively
In set of controls in each sub-goal set of controls alteration switch pair shift control information.
Step 210:The target is shifted into configured information, is used as each sub-goal in i-stage target widget group successively respectively
The shift control information of alteration switch pair in set of controls.
Inventor has found that ring shift right operates the displacement control of the alteration switch pair of target widget groups at different levels in research process
Information processed is the inverted order information of the shift control information for the alteration switch pair that ring shift left operates target widget groups at different levels, is such as circulated
When moving to left, four alteration switches are to S in identified i-stage target widget group0、S1、S2、S3Shift control information be followed successively by
A, b, c, d, then during ring shift right, four alteration switches are to S in i-stage target widget group0、S1、S2、S3Shift control information
It is followed successively by d, c, b, a.Accordingly, each alteration switch pair during ring shift right can be determined according to the operation of step 208~step 310
Shift control information.
In the present embodiment, based on interconnection network architecture of the present invention, according to the input starting point of data to be shifted
Location and cyclic shift digit, the displacement configured information of data to be shifted can be calculated, according to displacement configured information, and
Corresponding relation of the configured information with alteration switch to shift control information is shifted, target can be selected from displacement configured information and moved
Position configured information, the shift control information of each alteration switch pair in interference networks is obtained accordingly.According to determined by the present embodiment
Shift control information can at least realize ring shift left and ring shift right operation based on the interference networks, and to be shifted
Data bit width is less than the bit wide of interference networks, therefore can also realize short word circulative shift operation so that shifting function is flexible, nothing
It need to be that each shifting function sets single shift circuit, save part resource, accelerate processing speed, and shift control
The determination of information can save resource by selecting the displacement configured information of less bit to can be achieved.
For foregoing each method embodiment, in order to be briefly described, therefore it is all expressed as to a series of combination of actions, but
It is that those skilled in the art should know, the present invention is not limited by described sequence of movement, because according to the present invention, certain
A little steps can use other orders or carry out simultaneously.Secondly, those skilled in the art should also know, be retouched in specification
The embodiment stated belongs to preferred embodiment, necessary to involved action and the module not necessarily present invention.
Fig. 3 is a kind of structural representation of shift control information generation circuit one embodiment based on interference networks of the present invention
Figure, the interference networks include log2The set of controls that N layers are made up of N number of switch control.
The circuit can include:
Input interface circuit 301, the displacement configured information counting circuit 302 being connected with input interface circuit 301 and with
The information selection circuit 303 of the displacement configured information counting circuit 302 connection.
Input interface circuit 301, for receiving the cyclic shift digit of data to be shifted, and each bit value input institute
State the initial address in interference networks.
Wherein, the data bit width M to be shifted is less than or equal to N, and the data to be shifted correspond to the log of interference networks2M levels
Target widget group, include M/2 alteration switch pair per one-level target widget group, each alteration switch includes address gaps 2m-1's
Two switch controls, the switch control of different alteration switch centerings are different.Do not include the target widget group in interference networks
Alteration switch in other set of controls is to straight-through.
Configured information counting circuit 302 is shifted, for each bit value initial address to be added with the cyclic shift digit,
And with the data bit width complementation to be shifted, operation result and the initial address are subjected to XOR, obtain each
The corresponding displacement configured information per one-level target widget group of numerical value.
Wherein, whether shifted when displacement configured information instruction numerical value exports through target widget group
Information selection circuit 303, for selecting the cyclic shift digit of the reception of input interface circuit 301 most
The displacement that low level numerical value or 302 any bit value of displacement configured information counting circuit correspond to first order target widget group refers to
Show information, the shift control information as each alteration switch pair of first order target widget group;
M displacement configured information of i-stage target widget group is corresponded to for each numerical value of data to be shifted, works as shift mode
For ring shift left when, if the preceding i-1 numerical value of cyclic shift digit low level does not include numerical value 1, select the displacement instruction of multiple targets
Information, the shift control information as each alteration switch pair of i-stage target widget group successively is distinguished, otherwise by the multiple target
Shift configured information inverted order after inverted order information, respectively successively as i-stage target widget group each alteration switch pair displacement
Control information,
When shift mode is ring shift right, if the preceding i-1 numerical value of cyclic shift digit low level does not include numerical value 1, choosing
Select the inverted order information after the multiple target displacement configured information inverted order, respectively each friendship as i-stage target widget group successively
The shift control information of switch pair is changed, the multiple target is otherwise shifted into configured information, difference is used as i-stage target control successively
The shift control information of part group;
Wherein, i=2,3 ... log2M, each target displacement configured information correspond to initial address and the i-stage target control of numerical value
Unique one of switch control address of alteration switch centering is identical in processed group.
Wherein, input interface circuit 301, displacement configured information counting circuit 302 and information selection circuit 303 can have
A variety of implementations.
Referring to Fig. 4, a kind of another implementation of shift control information generation circuit based on interference networks of the present invention is shown
The schematic diagram of example, including input interface circuit, displacement configured information counting circuit and information selection circuit, in the present embodiment
In,
The input interface circuit to can less include M address input interface 401 and shift amount input interface 402, institute
The initial address that M address input interface 401 receives M numerical value of data to be shifted successively is stated, the shift amount input connects
Mouth 402 receives the cyclic shift digit of the data to be shifted.
Wherein, initial address and cyclic shift digit are represented with binary numeral.
The displacement configured information counting circuit can include M adder 403 and M XOR gate 404.
Wherein, from Fig. 4, the input of the S adder connects the S address input interface and the shifting respectively
Position digit input interface;The S XOR gate input connect respectively the S adder 403 output end and the S address input
Interface, S=1,2 ... M.
What M XOR gate output terminal exported is the displacement configured information that each bit value corresponds to target widget groups at different levels,
Including log2M displacement configured information, as M=8, when datacycle to be shifted moves to left 6, the displacement of 8 XOR gates outputs refers to
Show information as shown in upper table 2.
Information selection circuit is connected with one or more of M XOR gate XOR gate, defeated to determine shift control information
Go out to the alteration switch pair of interference networks.
Referring to Fig. 5, a kind of another implementation of shift control information generation circuit based on interference networks of the present invention is shown
The schematic diagram of example, including input interface circuit, displacement configured information meter circuit and information selection circuit, in the present embodiment:
The input interface circuit 301 can include M address input interface 501, shift amount input interface 502 and
Level input interface 503.
The M address input interface 501 receives the initial address of M numerical value of data to be shifted, the displacement position respectively
Number input interface 502 receives the cyclic shift digit of the data to be shifted, and the level input interface 503 is used for reception two and entered
Numerical value 1 processed;
The displacement configured information counting circuit 302 can include M adder 504 and M XOR gate 505.
The input of wherein first adder connects the shift amount input interface and the data to be shifted respectively
Lowest order numerical value corresponding to first address input interface;
The input of K adders connects the output end of the K-1 adder and the level input interface respectively, its
Middle K=2,3 ... M.
The input of first XOR gate connect respectively first adder output end and the data to be shifted most
Address input interface corresponding to low level numerical value;
K-th XOR gate input connects the output end and k-th address input interface of k-th adder respectively.
What M XOR gate output terminal exported is the displacement configured information that each bit value corresponds to target widget groups at different levels,
Including log2M displacement configured information, as M=8, when datacycle to be shifted moves to left 6, the displacement of 8 XOR gates outputs refers to
Show information as shown in upper table 2.
Information selection circuit can be connected with one or more XOR gates, to determine shift control information, output to interconnection
The alteration switch pair of network.
In the circuit diagram described in Fig. 3~Fig. 5, a kind of possible implementation of information selection circuit is:
As shown in Figure 4, the information selection circuit can include log2M selector 400.
The input of first selector 400 is connected with shift amount input interface 402 or any XOR gate 401, Fig. 4
In, specifically it is connected with shift amount input interface 402.
Output end connects each alteration switch pair of the interference networks first aim set of controls respectively(Not shown in figure).
First selector 400 selects the lowest order numerical value of shift amount or the corresponding first object of any XOR gate output
The displacement configured information of set of controls, export to each alteration switch pair of first aim set of controls.
The output end of the input linking objective XOR gate of i-th of selector 400, obtain corresponding i-stage target widget group
Target displacement configured information, output end connects each alteration switch pair of i-stage target widget group respectively.
Wherein, when shift mode is ring shift left, if the preceding i-1 numerical value of cyclic shift digit low level does not include numerical value
1, target displacement configured information is sequentially output to each alteration switch pair by i-th of selector 400 respectively, otherwise moves the target
Inverted order information after the configured information inverted order of position is sequentially output to each alteration switch pair respectively;
When shift mode is ring shift right, if the preceding i-1 numerical value of cyclic shift digit low level does not include numerical value 1, i-th
Inverted order information after target displacement configured information inverted order is sequentially output to each alteration switch pair by individual selector 400 respectively;
Otherwise target displacement configured information is sequentially output to each alteration switch pair respectively;
Wherein, target XOR gate includes M/2, and each target XOR gate corresponds to the initial address and i-stage target of numerical value
A wherein switch control address for unique alteration switch centering of set of controls is identical.
The alternatively possible implementation of information selection circuit is:
As shown in Figure 5, described information selection circuit can include log2M selector 500;
The input of first selector 500 can be connected with shift amount input interface 502 or any XOR gate 501,
In Fig. 5, specifically it is connected with shift amount input interface 502.
Output end connects each alteration switch pair of the interference networks first aim set of controls respectively.
Select the displacement of the lowest order numerical value of shift amount or the corresponding first object set of controls of any XOR gate output
Configured information, export to each alteration switch pair of first aim set of controls;
The input of i-th of selector connects initial address 0,1 ... 2 respectivelyi-1- 1 or initial address 2i-1、2i-1+1、…
2iTarget XOR gate corresponding to -1, output end connect the alteration switch in each sub-goal set of controls of i-stage target widget group respectively
It is right, when shift mode is ring shift left, if the preceding i-1 numerical value of cyclic shift digit low level does not include numerical value 1, select each mesh
The target shift control information of the corresponding i-stage target widget group of XOR gate output is marked, difference is used as each sub-goal control successively
The shift control information of alteration switch pair in group;Otherwise by the inverted order after each target displacement configured information inverted order of selection
Information, distinguish the shift control information as alteration switch pair in each sub-goal set of controls successively;
When shift mode is ring shift right, if the preceding i-1 numerical value of cyclic shift digit low level does not include numerical value 1, it will select
Inverted order information after the target displacement configured information inverted order selected, is used as alteration switch in each sub-goal set of controls successively respectively
To shift control information, otherwise by each target shift control information of selection, be used as successively in each sub-goal set of controls respectively
The shift control information of alteration switch pair.
Now target XOR gate includes 2i-1Individual, each target XOR gate corresponds to initial address and the i-stage target control of numerical value
In each sub-goal set of controls of part group a wherein switch control address for unique alteration switch centering it is identical or difference 2i。
Shift control information generation circuit provided in an embodiment of the present invention is by some adders and XOR gate according to certain
Structure composition, based on interconnection network architecture of the present invention, according to the input initial addresses of data to be shifted and it can follow
Ring shift amount, the displacement configured information of data to be shifted is calculated, according to displacement configured information, and displacement configured information
Corresponding relation with alteration switch to shift control information, target displacement instruction letter can be selected from displacement configured information
Breath, the shift control information of each alteration switch pair in interference networks is obtained accordingly.Can be with according to identified shift control information
The ring shift left based on the interference networks and ring shift right operation can be at least realized, and data bit width to be shifted is less than interconnection
The bit wide of network, therefore short word circulative shift operation can also be realized so that shifting function is flexible, without being grasped for each displacement
Make to set single shift circuit, save part resource, accelerate processing speed, while the determination of shift control information can be with
By selecting the displacement configured information of less bit to can be achieved, resource has been saved.
Fig. 6 is a kind of structural representation of one embodiment of shift unit of the present invention, and the shift unit can include control letter
Breath generation electricity 601 and interference networks 602.
Wherein, the concrete structure of control information generative circuit 601 may refer to shown in Fig. 3~Fig. 5.
The shift control information generation circuit 602 is used to generate the Internet corresponding to the data to be shifted that bit wide is M
The shift control information of network 602.
The interference networks comprise at least log2The target widget group that M levels are made up of M switch control, per one-level target widget
Group includes M/2 alteration switch pair, and each alteration switch is to including address gaps 2m-1Two switch controls, difference exchange open
It is different to close the switch control of centering, m expression target widget group series, M switch control address is followed successively by 0,1 ... M-1.
Wherein, the interference networks do not include the alteration switch of other set of controls of the target widget group to straight-through.
The interference networks first order target widget group receives data to be shifted, log2The output of M level target widgets group moves
Purpose data behind position.
Wherein, the switch control in the interference networks can specifically select alternative data device, each alteration switch docking
The shift control information of receipts inputs the control terminal of its alternative data selector included respectively;Each alternative data selector
Also include first input end and the second input.
The first input end of each alternative data device receives input numerical value, and the second input connects alteration switch where it
To the first input end of another alternative data device, output end is connected in next stage target widget group with it in same address location
The first input end of the alternative data selector at place;
The shift control information specifically controls alternative data selector selection first input end or the second input
Numerical value is inputted to export from output end.
So that interference networks include 3 grades of target widget groups being made up of 8 alternative data selectors as an example, as shown in fig. 7,
Show a kind of hardware structure diagram of the interference networks.
With reference to Fig. 7, alteration switch is included per one-level target widget group to S0、S1、S2、S3.Each alteration switch is to including two
Individual alternative data selector.
Each alteration switch inputs the control of its alternative data selector included to the shift control information of reception respectively
End processed.
Each alternative data selector includes first input end and the second input, as shown in fig. 7, representing first with 1
Input, the second input is represented with 0, when shift control information is " 0 ", first input end conducting, the second input is closed, and is moved
When position control information is " 1 ", first input end is closed, the conducting of the second input.
The first input end of each alternative data selector receives input numerical value, and the second input exchanges where connecting it
The first input end to another alternative data device is switched, output end is connected in next stage target widget group with it in same address
The first input end of the alternative data selector of opening position;
The shift control information specifically controls alternative data selector selection first input end or the second input
Numerical value is inputted to export from output end.
By the shift unit described in the embodiment of the present invention, it can at least realize that the ring shift left of data to be shifted, circulation are right
Move, and short word ring shift left, the shifting function of short word ring shift right, without being respectively provided with list for the shifting function of each type
Only shift circuit, part resource is saved, accelerates processing speed so that shifting function is more flexible.
In addition, the purpose data that shift unit described in the embodiment of the present invention exports pass through corresponding post processing circuitry, can be with
Realize arithmetic shift or logical shift of data to be shifted etc., thus shift unit provided by the invention can also connect it is corresponding after
Process circuit, so as to realize further types of shifting function.
Each embodiment is described by the way of progressive in this specification, what each embodiment stressed be and other
The difference of embodiment, between each embodiment identical similar portion mutually referring to.For device disclosed in embodiment
For, because it is corresponded to the method disclosed in Example, so description is fairly simple, related part is said referring to method part
It is bright.
The foregoing description of the disclosed embodiments, professional and technical personnel in the field are enable to realize or using the present invention.
A variety of modifications to these embodiments will be apparent for those skilled in the art, as defined herein
General Principle can be realized in other embodiments without departing from the spirit or scope of the present invention.Therefore, it is of the invention
The embodiments shown herein is not intended to be limited to, and is to fit to and principles disclosed herein and features of novelty phase one
The most wide scope caused.
Claims (10)
1. a kind of shift control information generating method based on interference networks, it is characterised in that the interference networks include log2N
The set of controls that level is made up of N number of switch control, methods described include:
The cyclic shift digit of data to be shifted, and the initial address that each bit value is inputted in the interference networks are obtained,
Wherein, the data bit width M to be shifted is less than or equal to N, and the data to be shifted correspond to the log of interference networks2M level target widgets
Group, include M/2 alteration switch pair per one-level target widget group, each alteration switch is to including address gaps 2m-1Two open
Control is closed, the switch control of different alteration switch centerings is different, and m represents target widget group series, and M switch control address is successively
For 0,1 ... M-1, the interference networks do not include the alteration switch of other set of controls of the target widget group to straight-through;
Each bit value initial address is added with the cyclic shift digit, and with the data bit width complementation to be shifted,
Complementation result and the initial address are subjected to XOR, obtain the corresponding shifting per one-level target widget group of each bit value
Position configured information, the displacement configured information are used to indicate whether shift when numerical value exports through target widget group;
The lowest order numerical value or any bit value of data to be shifted for selecting the cyclic shift digit correspond to first order mesh
Mark the displacement configured information of set of controls, the shift control information as each alteration switch pair of first order target widget group;
M displacement configured information of i-stage target widget group is corresponded to for each numerical value of data to be shifted, when shift mode is to follow
When ring moves to left, if the preceding i-1 numerical value of cyclic shift digit low level does not include numerical value 1, multiple target displacement configured informations are selected,
Distinguish the shift control information as each alteration switch pair of i-stage target widget group successively, otherwise shift the multiple target
Inverted order information after configured information inverted order, respectively successively as i-stage target widget group each alteration switch pair shift control
Information,
When shift mode is ring shift right, if the preceding i-1 numerical value of cyclic shift digit low level does not include numerical value 1, institute is selected
The inverted order information after multiple target displacement configured information inverted orders is stated, each exchange successively as i-stage target widget group respectively is opened
The shift control information of pass pair, otherwise shifts configured information by the multiple target, and difference is used as i-stage target widget group successively
Shift control information;
Wherein, i=2,3 ... log2M, each target displacement configured information correspond to the initial address and i-stage target control group of numerical value
In unique one of switch control address of alteration switch centering it is identical.
2. according to the method for claim 1, it is characterised in that the target displacement configured information includes M/2, each mesh
Mark displacement configured information correspond to numerical value initial address and unique alteration switch centering in i-stage target control group one of them open
It is identical to close control address.
3. according to the method for claim 1, it is characterised in that it is described when shift mode is ring shift left, if circulation moves
The preceding i-1 numerical value of position digit low level does not include numerical value 1, selects multiple target displacement configured informations, and difference is used as i-stage successively
The shift control information of each alteration switch pair of target widget group, otherwise by after multiple targets displacement configured information inverted order of selection
Inverted order information, respectively successively as i-stage target widget group each alteration switch pair shift control information,
When shift mode is ring shift right, if the preceding i-1 numerical value of cyclic shift digit low level does not include numerical value 1, institute is selected
The inverted order information after multiple target displacement configured information inverted orders is stated, each exchange successively as i-stage target widget group respectively is opened
The shift control information of pass pair, the multiple target displacement configured information otherwise selected, difference are used as i-stage target control successively
The shift control information of part group includes:
When shift mode is ring shift left, if the preceding i-1 numerical value of cyclic shift digit low level does not include numerical value 1, select
Beginning address be 0,1 ... 2i-1- 1 or initial address 2i-1、2i-1+1、…2iThe target displacement configured information of numerical value corresponding to -1, point
The not shift control information as the alteration switch pair in each sub-goal set of controls in i-stage target widget group successively;Otherwise will
Inverted order information after the target displacement configured information inverted order, is used as each sub-goal control in i-stage target widget group successively respectively
The shift control information of alteration switch pair in part group;
When shift mode is ring shift right, if the preceding i-1 numerical value of cyclic shift digit low level does not include numerical value 1, will select
The target displacement configured information inverted order after inverted order information, respectively successively be used as i-stage target widget group in each sub-goal
The shift control information of alteration switch pair in set of controls;Otherwise the target is shifted into configured information, is used as i-th successively respectively
In level target widget group in each sub-goal set of controls alteration switch pair shift control information;
Wherein, i-stage target widget group includes M/2iIndividual sub- target widget group, each sub-goal control include that quantity is identical and position
Put continuous alteration switch pair.
4. a kind of shift control information generation circuit based on interference networks, it is characterised in that the interference networks include log2N
The set of controls that layer is made up of N number of switch control, the displacement that the circuit includes input interface circuit, is connected with the input interface
Configured information counting circuit and the information selection circuit being connected with displacement configured information counting circuit;
The input interface circuit, for receiving the cyclic shift digit of data to be shifted, and described in the input of each bit value
Initial address in interference networks, wherein, the data bit width M to be shifted is less than or equal to N, and the data to be shifted are corresponding to be interconnected
The log of network2M level target widget groups, include M/2 alteration switch pair per one-level target widget group, each alteration switch includes
Address gaps 2m-1Two switch controls, the switch controls of different alteration switch centerings is different;
Shift configured information counting circuit, for each bit value initial address to be added with the cyclic shift digit, and with institute
Data bit width complementation to be shifted is stated, operation result and the initial address are subjected to XOR, obtain each bit value pair
Should be per the displacement configured information of one-level target widget group, the displacement configured information instruction numerical value is when being exported through target widget group
No displacement;
Information selection circuit, lowest order numerical value or any bit value for selecting the cyclic shift digit correspond to the first order
The displacement configured information of target widget group, the shift control information as each alteration switch pair of first order target widget group;
M displacement configured information of i-stage target widget group is corresponded to for each numerical value of data to be shifted, when shift mode is to follow
When ring moves to left, if the preceding i-1 numerical value of cyclic shift digit low level does not include numerical value 1, multiple target displacement configured informations are selected,
Distinguish the shift control information as each alteration switch pair of i-stage target widget group successively, otherwise shift the multiple target
Inverted order information after configured information inverted order, respectively successively as i-stage target widget group each alteration switch pair shift control
Information,
When shift mode is ring shift right, if the preceding i-1 numerical value of cyclic shift digit low level does not include numerical value 1, institute is selected
The inverted order information after multiple target displacement configured information inverted orders is stated, each exchange successively as i-stage target widget group respectively is opened
The shift control information of pass pair, otherwise shifts configured information by the multiple target, and difference is used as i-stage target widget group successively
Shift control information;
Wherein, i=2,3 ... log2M, each target displacement configured information correspond to the initial address and i-stage target control group of numerical value
In unique one of switch control address of alteration switch centering it is identical.
5. circuit according to claim 4, it is characterised in that the input interface circuit comprises at least M address and inputted
Interface and shift amount input interface, M address input interface receive the starting point of M numerical value of data to be shifted successively
Location, the shift amount input interface receive the cyclic shift digit of the data to be shifted;
The displacement configured information counting circuit comprises at least M adder and M XOR gate, wherein, the S adder it is defeated
Enter end and connect the S address input interface and the shift amount input interface respectively;The S XOR gate input connects respectively
The output end and the S address input interface of S adder, S=1,2 ... M.
6. circuit according to claim 4, it is characterised in that the input interface circuit comprises at least M address and inputted
Interface, shift amount input interface and level input interface, M address input interface receive data to be shifted respectively
The initial address of M numerical value, the shift amount input interface receive the cyclic shift digit of the data to be shifted, the electricity
Flat input interface is used to receive binary numeral 1;
The displacement configured information counting circuit comprises at least M adder and M XOR gate, wherein, first adder
Input connects first ground corresponding to the shift amount input interface and the lowest order numerical value of the data to be shifted respectively
Location input interface;
The input of K adders connects the output end of the K-1 adder and the level input interface respectively, K=2,
3…M;
The input of first XOR gate connect respectively first adder output end and the data to be shifted most
Address input interface corresponding to low level numerical value;
K-th XOR gate input connects the output end and k-th address input interface of k-th adder respectively.
7. according to the circuit described in any one of claim 4~6, it is characterised in that described information selection circuit comprises at least
log2M selector;
The input of first selector is connected with the shift amount input interface or any XOR gate, and output end connects respectively
Each alteration switch pair of the interference networks first aim set of controls, select the lowest order numerical value or any different of shift amount
The displacement configured information of the corresponding first object set of controls of OR gate output, is exported to each alteration switch of first aim set of controls
It is right;
The output end of the input linking objective XOR gate of i-th of selector, the target for obtaining corresponding i-stage target widget group are moved
Position configured information, output end connects each alteration switch pair of i-stage target widget group respectively, when shift mode is ring shift left
When, if the preceding i-1 numerical value of cyclic shift digit low level does not include numerical value 1, i-th of selector divides target displacement configured information
It is not sequentially output to each alteration switch pair, the inverted order information otherwise shifted the target after configured information inverted order is defeated successively respectively
Go out to each alteration switch pair;
When shift mode is ring shift right, if the preceding i-1 numerical value of cyclic shift digit low level does not include numerical value 1, i-th of choosing
Select device the inverted order information after target displacement configured information inverted order is sequentially output to each alteration switch pair respectively;Otherwise by institute
Target displacement configured information is stated to be sequentially output respectively to each alteration switch pair;
Wherein, each target XOR gate corresponds to the initial address of numerical value and unique alteration switch centering of i-stage target widget group
A wherein switch control address it is identical.
8. according to the circuit described in any one of claim 4~6, it is characterised in that described information selection circuit comprises at least
log2M selector;
The input of first selector is connected with shift amount input interface or any XOR gate, and output end connects described respectively
Each alteration switch pair of interference networks first aim set of controls, select the lowest order numerical value of shift amount or any XOR gate
The displacement configured information of the corresponding first object set of controls of output, export to each alteration switch pair of first aim set of controls;
The input of i-th of selector connects initial address 0,1 ... 2 respectivelyi-1- 1 or initial address 2i-1、2i-1+1、…2i-1
Corresponding target XOR gate, output end connect the alteration switch pair in each sub-goal set of controls of i-stage target widget group respectively, when
When shift mode is ring shift left, if the preceding i-1 numerical value of cyclic shift digit low level does not include numerical value 1, select each target different
The target shift control information of the corresponding i-stage target widget group of OR gate output, is used as in each sub-goal set of controls successively respectively
Alteration switch pair shift control information;Otherwise the inverted order after each target displacement configured information inverted order of selection is believed
Breath, distinguish the shift control information as alteration switch pair in each sub-goal set of controls successively;
When shift mode is ring shift right, if the preceding i-1 numerical value of cyclic shift digit low level does not include numerical value 1, by selection
Inverted order information after the target displacement configured information inverted order, respectively successively as alteration switch pair in each sub-goal set of controls
Shift control information, otherwise by each target shift control information of selection, it is used as in each sub-goal set of controls exchanges successively respectively
The shift control information of switch pair.
9. a kind of shift unit, it is characterised in that generate electricity including the shift control information as described in any one of claim 4~8
Road and interference networks;
The shift control information generation circuit is used for the shifting for generating the interference networks corresponding to the data to be shifted that bit wide is M
Position control information;
The interference networks comprise at least log2The target widget group that M levels are made up of M switch control, per one-level target widget group
Including M/2 alteration switch pair, each alteration switch is to including address gaps 2m-1Two switch controls, different alteration switches
The switch control of centering is different, and m represents target widget group series, and M switch control address is followed successively by 0,1 ... M-1;
The interference networks first order target widget group receives data to be shifted, log2After the output displacement of M level target widgets group
Purpose data;
Wherein, the interference networks do not include the alteration switch of other set of controls of the target widget group to straight-through.
10. shift unit according to claim 9, it is characterised in that the M switch control is respectively the choosing of alternative data
Device is selected, each alteration switch inputs the control of its alternative data selector included to the shift control information of reception respectively
End;
The first input end of each alternative data selector receives input numerical value, and the second input connects alteration switch where it
To the first input end of another alternative data selector, output end is connected in next stage target widget group with it in same address
The first input end of the alternative data selector of opening position;
The shift control information specifically controls the input of alternative data selector selection first input end or the second input
Numerical value exports from output end.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310429101.6A CN104461447B (en) | 2013-09-18 | 2013-09-18 | Shift control information generating method, circuit and shift unit based on interference networks |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310429101.6A CN104461447B (en) | 2013-09-18 | 2013-09-18 | Shift control information generating method, circuit and shift unit based on interference networks |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104461447A CN104461447A (en) | 2015-03-25 |
CN104461447B true CN104461447B (en) | 2017-12-01 |
Family
ID=52907568
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310429101.6A Expired - Fee Related CN104461447B (en) | 2013-09-18 | 2013-09-18 | Shift control information generating method, circuit and shift unit based on interference networks |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104461447B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109756231B (en) * | 2018-12-27 | 2023-01-31 | 北京思朗科技有限责任公司 | Cyclic shift processing device and method |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US3735362A (en) * | 1971-09-22 | 1973-05-22 | Ibm | Shift register interconnection system |
CN102004625A (en) * | 2010-11-30 | 2011-04-06 | 中国人民解放军国防科学技术大学 | 40-bit single instruction multiple data (SIMD) shifter |
-
2013
- 2013-09-18 CN CN201310429101.6A patent/CN104461447B/en not_active Expired - Fee Related
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US3735362A (en) * | 1971-09-22 | 1973-05-22 | Ibm | Shift register interconnection system |
CN102004625A (en) * | 2010-11-30 | 2011-04-06 | 中国人民解放军国防科学技术大学 | 40-bit single instruction multiple data (SIMD) shifter |
Non-Patent Citations (1)
Title |
---|
Research of Design Technology of Reconfigurable Shift Unit Based on Multilevel Interconnection;Su Yang 等;《Advanced Materials Research》;20120210;第466-467卷;第1065-1069页 * |
Also Published As
Publication number | Publication date |
---|---|
CN104461447A (en) | 2015-03-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109445752B (en) | A kind of system of parallel computation | |
CN105512724A (en) | Adder device, data accumulation method, and data processing device | |
CN105187050B (en) | A kind of five configurable input lut circuits | |
CN105975251B (en) | A kind of DES algorithm wheel iteration systems and alternative manner based on coarseness reconstruction structure | |
CN102945224A (en) | High-speed variable point FFT (Fast Fourier Transform) processor based on FPGA (Field-Programmable Gate Array) and processing method of high-speed variable point FFT processor | |
CN110413254A (en) | Data processor, method, chip and electronic equipment | |
CN113064852A (en) | Reconfigurable processor and configuration method | |
CN104461447B (en) | Shift control information generating method, circuit and shift unit based on interference networks | |
CN106406813B (en) | A kind of general-purpose servo control arithmetic logic unit | |
CN104504205B (en) | A kind of two-dimentional dividing method of the parallelization of symmetrical FIR algorithm and its hardware configuration | |
CN105183701A (en) | 1536-point FFT processing mode and related equipment | |
JP2008186396A (en) | Fast fourier transform device | |
JPH06314185A (en) | Variable logic and arithmetic unit | |
US5991786A (en) | Circuit and method for shifting or rotating operands of multiple size | |
CN105515761B (en) | A kind of circuit of high-speed multi-mode time cyclic shift | |
JP2007183712A (en) | Data driven information processor | |
CN212569855U (en) | Hardware implementation device for activating function | |
CN104683806B (en) | MQ arithmetic encoder high speed FPGA implementation methods based on depth flowing water | |
CN107045434A (en) | Multi-functional dedicated hardware multiplier and fpga chip in a kind of FPGA | |
CN114615069A (en) | Quartet lightweight encryption algorithm implementation device and method | |
CN106505977A (en) | A kind of stretch circuit and pulse stretching method | |
Moazzam et al. | A robust method for solving transcendental equations | |
CN103677735B (en) | A kind of data processing equipment and digital signal processor | |
Dimitrakopoulos et al. | Sorter based permutation units for media-enhanced microprocessors | |
Petagon et al. | VA-DE: Valuable ATAPE with dynamic embedding and super-pipeline scheduling on partitionable multistage interconnection networks+ |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20171201 |