A method for replacing data segments based on logical shifting

CN116822421BActive Publication Date: 2026-09-18NORTHWESTERN POLYTECHNICAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310184293.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-01
Publication Date
2026-09-18
Estimated Expiration
2043-03-01

AI Technical Summary

Technical Problem

但是采用该设计方法不仅需要列举大量的情况,以msb,lsb各5bit为例,共计列举32x16种情况,在每种情况中对特定的msb到lsb字段进行赋值,这样需要采用大多选器,会占据大量的面积同时不利于高频设计,在高速时序电路中,无法满足高频的要求

Benefits of technology

本发明基于逻辑移位的数据段替换方法,通过将初始数据1中的低width段[width-1:0]搬移到初始数据2的第msb位至lsb位,初始数据2中的msb以及lsb为初始数据1输入的参数,假如初始数据1为(0x12345678),初始数据2的初始值为0x10101010,初始数据1输入msb为15,lsb为7,则初始数据2最终输出为0x10105610,该过程只需将初始数据1中的56搬移到初始数据2中,同时不改变初始数据2中其他的值。由此可见,本发明可以解决穷举带来的大多选面积开销问题,满足在高速时序电路中在不影响原有字段的情况下,对其中某一指定字段进行替换或者清除操作。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116822421B_ABST
    Figure CN116822421B_ABST
Patent Text Reader

Abstract

This invention provides a data segment replacement method based on logical shifting, belonging to the field of integrated circuit design and manufacturing. Specifically, it includes the following steps: expanding initial data 2 to 64 bits to obtain data 3, and storing initial data 2 in the high 32 bits of data 3; logically shifting data 3 right by 1sb bits to obtain data 4; truncating the low 32 bits of data 4 and concatenating it with initial data 1 to obtain data 5, where initial data 1 is in the high 32 bits of data 5, and the low 32 bits of truncated data 4 are in the low 32 bits of data 5; logically shifting data 5 right by width+1 bits to obtain data 6; truncating the low 32 bits of data 6 to obtain data 7; expanding initial data 2 to 64 bits to obtain data 8, where initial data 2 is in the low 32 bits of data 8; logically shifting data 8 left to obtain data 9; truncating the high 32 bits of data 9 and concatenating it with data 7 to obtain data 10; logically shifting data 10 right to obtain data 11; truncating the low 32 bits of data 11 to obtain the target output result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of integrated circuit design and manufacturing, and specifically relates to a data segment replacement method based on logic shifting. Background Technology

[0002] In some fields, it is necessary to perform a large number of replacement or clearing operations on a certain continuous data segment in a data segment without affecting the other fields. Traditional cyclic shift can also replace or clear certain specified fields while retaining the original fields, but it needs to be completed over multiple cycles.

[0003] For example, in hardware circuit design, RTL language cannot assign values ​​to specific parameter segments when describing circuits. For instance, `assign B[msb:lsb] = A[width-1:0]`, where `msb` and `lsb` are external inputs to the module, and `width = msb - lsb`, is not recognized by the system and cannot describe the specific circuit. Therefore, it is necessary to exhaustively list all possible combinations of `msb` and `lsb` to complete the design. However, this design method requires listing a large number of cases. Taking 5 bits for each of `msb` and `lsb` as an example, a total of 32x16 cases need to be listed. In each case, a specific `msb` to `lsb` field needs to be assigned a value. This requires a multi-selector, which occupies a large area and is not conducive to high-frequency design. In high-speed sequential circuits, it cannot meet the high-frequency requirements. Summary of the Invention

[0004] To overcome the shortcomings of the existing technology, the present invention provides a data segment replacement method based on logical shifting.

[0005] To achieve the above objectives, the present invention provides the following technical solution: A data segment replacement method based on logical shifting, which replaces the [width-1:0] bits in initial data 1 with the [msb:lsb] bits in initial data 2, specifically includes the following steps: The initial data 2 is expanded to 64 bits to obtain data 3, and the initial data 2 is stored in the high 32 bits of the data 3; The data 3 is logically right-shifted by 1sb bits to obtain data 4; Extract the lower 32 bits of the data 4 and concatenate it with the initial data 1 to obtain data 5. The initial data 1 is in the higher 32 bits of the data 5, and the lower 32 bits of the extracted data 4 are in the lower 32 bits of the data 5. The data 5 is logically shifted right by width bits to obtain data 6; The lower 32 bits of data 6 are extracted to obtain data 7; The initial data 2 is expanded to 64 bits to obtain data 8, and the initial data 2 is in the lower 32 bits of data 8; The data 8 is logically shifted left to obtain data 9; Extract the high 32 bits of data 9 and concatenate them with data 7 to obtain data 10; Logically shift the data 10 to the right to obtain the data 11; The target output result is obtained by extracting the lower 32 bits of the data 11.

[0006] Preferably, the width of the data segment to be replaced in the initial data 2 is width = msb - lsb, where msb is the high-order bit of the replaced data segment and lsb is the low-order bit of the replaced data segment.

[0007] Preferably, the data 8 is logically shifted left by 31-msb bits to obtain data 9.

[0008] Preferably, the data 10 is logically right-shifted by 31-msb bits to obtain data 11.

[0009] Preferably, the data 7 is located in the lower 32 bits of the data 10.

[0010] The data segment replacement method based on logical shifting provided by this invention has the following beneficial effects: This invention relates to a data segment replacement method based on logical shifting. It moves the lower width segment [width-1:0] from initial data 1 to the msb to lsb bits of initial data 2. The msb and lsb in initial data 2 are parameters input to initial data 1. For example, if initial data 1 is (0x12345678), the initial value of initial data 2 is 0x10101010, the input msb of initial data 1 is 15, and the lsb is 7, then the final output of initial data 2 is 0x10105610. This process only requires moving 56 from initial data 1 to initial data 2 without changing other values ​​in initial data 2. Therefore, this invention can solve the area overhead problem caused by exhaustive search, satisfying the requirement in high-speed sequential circuits to replace or clear a specific field without affecting existing fields. Attached Figure Description

[0011] To more clearly illustrate the embodiments and design schemes of the present invention, the accompanying drawings required for this embodiment will be briefly described below. The drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0012] Figure 1 This is a schematic diagram of a data segment replacement method based on logical shifting according to an embodiment of the present invention. Detailed Implementation

[0013] To enable those skilled in the art to better understand and implement the technical solutions of the present invention, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. The following embodiments are only used to more clearly illustrate the technical solutions of the present invention and should not be construed as limiting the scope of protection of the present invention.

[0014] In the description of this invention, it should be understood that the terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," "axial," "radial," and "circumferential" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing the technical solution of this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.

[0015] Furthermore, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. In the description of this invention, it should be noted that, unless otherwise explicitly specified or limited, the terms "connected" or "linked" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances. In the description of this invention, unless otherwise stated, "a plurality of" means two or more, which will not be elaborated further here.

[0016] Example This invention provides a data segment replacement method based on logical shifting. In hardware circuit design, it is sometimes necessary to shift the low-width segment of 32-bit data A (0x12345678) to bits msb to lsb in data B. For example, the low-width segment [width-1:0] in initial data 1 is shifted to bits msb to lsb in initial data 2. The width of the data segment to be replaced in initial data 2 is width = msb - lsb, where msb is the high-order bit of the replaced data segment and lsb is the low-order bit of the replaced data segment. Specifically, the [width-1:0] bits in initial data 1 are replaced with the [msb:lsb] bits in initial data 2. The process includes the following steps: Step 1: Expand the initial data 2 to 64 bits to obtain data 3, and store the initial data 2 in the high 32 bits of data 3; Step 2: Logically right-shift data 3 by 1sb bits to obtain data 4; Step 3: Extract the lower 32 bits of data 4 and concatenate them with the initial data 1 to obtain data 5. The initial data 1 is in the higher 32 bits of data 5, and the lower 32 bits of the extracted data 4 are in the lower 32 bits of data 5. Step 4: Logically shift data 5 to the right by width bits to obtain data 6; Step 5: Extract the lower 32 bits of data 6 to obtain data 7; Step 6: Extend the initial data 2 to 64 bits to obtain data 8. The initial data 2 is in the lower 32 bits of data 8. Step 7: Logically shift data 8 left by (31-msb) to obtain data 9; Step 8: Extract the high 32 bits of data 9 and concatenate them with data 7 to obtain data 10. Data 7 is located in the low 32 bits of data 10. Step 9: Logically right-shift data 10 by (31-msb) to obtain data 11; Step 10: Extract the lower 32 bits of data 11 to obtain the target output result.

[0017] As described above, by moving the lower width segment [width-1:0] in initial data 1 to the msb to lsb bits of initial data 2, where the msb and lsb in initial data 2 are the parameters input to initial data 1, for example, if initial data 1 is (0x12345678), the initial value of initial data 2 is 0x10101010, the input msb of initial data 1 is 15, and the lsb is 7, then the final output of initial data 2 is 0x10105610. This process only requires moving 56 from initial data 1 to initial data 2 without changing other values ​​in initial data 2. Therefore, this invention can solve the area overhead problem caused by exhaustive search, satisfying the requirement to replace or clear a specific field in high-speed sequential circuits without affecting the original fields.

[0018] The above-described embodiments are merely preferred embodiments of the present invention, and the scope of protection of the present invention is not limited thereto. Any simple changes or equivalent substitutions of the technical solutions that can be obviously obtained by those skilled in the art within the scope of the technology disclosed in the present invention shall fall within the scope of protection of the present invention.

Claims

1. A data segment replacement method based on logical shifting, characterized in that, Replace the [width-1:0] bit in initial data 1 with the [msb:lsb] bit in initial data 2, specifically including the following steps: The initial data 2 is expanded to 64 bits to obtain data 3, and the initial data 2 is stored in the high 32 bits of the data 3; The data 3 is logically right-shifted by 1sb bits to obtain data 4; Extract the lower 32 bits of the data 4 and concatenate it with the initial data 1 to obtain data 5. The initial data 1 is in the higher 32 bits of the data 5, and the lower 32 bits of the extracted data 4 are in the lower 32 bits of the data 5. The data 5 is logically shifted right by width bits to obtain data 6; The lower 32 bits of data 6 are extracted to obtain data 7; The initial data 2 is expanded to 64 bits to obtain data 8, and the initial data 2 is in the lower 32 bits of data 8; The data 8 is logically shifted left to obtain data 9; Extract the high 32 bits of data 9 and concatenate them with data 7 to obtain data 10; Logically shift the data 10 to the right to obtain the data 11; The target output result is obtained by extracting the lower 32 bits of the data 11.

2. The data segment replacement method based on logical shifting according to claim 1, characterized in that, The width of the data segment to be replaced by the initial data 2 is width = msb - lsb, where msb is the high-order bit of the replaced data segment and lsb is the low-order bit of the replaced data segment.

3. The data segment replacement method based on logical shifting according to claim 1, characterized in that, The data 8 is logically shifted left by 31-msb bits to obtain data 9.

4. The data segment replacement method based on logical shifting according to claim 1, characterized in that, The data 10 is logically shifted right by 31-msb bits to obtain data 11.

5. The data segment replacement method based on logical shift according to claim 1, characterized in that, The data 7 is located in the lower 32 bits of the data 10.

Citation Information

Patent Citations

  • Backward conversion device and method of residue number system with bases of [2<n-1>,2<n+1>,2<n>] and [2<n-1>,2<n+1>,2<2n+1>]

    CN102184159A

  • High-frequency switching power converter real-time simulation method based on FPGA

    CN110516276A