WO2016082362A1 - Method, device and apparatus for converting data bit width - Google Patents

Method, device and apparatus for converting data bit width Download PDF

Info

Publication number
WO2016082362A1
WO2016082362A1 PCT/CN2015/073508 CN2015073508W WO2016082362A1 WO 2016082362 A1 WO2016082362 A1 WO 2016082362A1 CN 2015073508 W CN2015073508 W CN 2015073508W WO 2016082362 A1 WO2016082362 A1 WO 2016082362A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
output
cache
multiplexer
cached
Prior art date
Application number
PCT/CN2015/073508
Other languages
French (fr)
Chinese (zh)
Inventor
姬明春
谢小龙
吕安新
杨敏华
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2016082362A1 publication Critical patent/WO2016082362A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units

Definitions

  • the present invention relates to the field of data processing technologies, and in particular, to a data bit width conversion method, apparatus, and device.
  • the commonly used data bit width conversion method is to perform bit width conversion directly through a multi-way selector (MUX) and shift logic.
  • MUX multi-way selector
  • the branch of the multiplexer in the commonly used data bit width conversion method will increase sharply, and the data shift logic is very complicated, making the logic of its design complicated.
  • the degree of improvement is greatly reduced, which seriously degrades the system performance, making it a bottleneck of the entire system and failing to meet the processing performance required by the system.
  • the main purpose of the embodiments of the present invention is to solve the technical problem of logical complexity and low frequency of data bit width conversion.
  • a data bit width conversion method provided by an embodiment of the present invention includes the following steps:
  • the corresponding cached data is read out from the cache, and based on the common divisor relationship between the set number of the cache and the preset number of output data, the read data is selected by the output multiplexer to obtain a preset quantity. Output data.
  • the set number of the cache is f*e
  • the preset number of output data is g*e
  • e is a common divisor between the set number of the cache and the preset number of output data, based on the cache setting.
  • the common divisor relationship between the quantity and the preset number of output data, the read data is selected by the output multiplexer, and the preset number of output data is obtained:
  • the cache is divided into f groups, each group includes e caches, and the g group cache is selected from the f group cache by the output multiplexer, and the g*e data cached in the selected g group cache is obtained.
  • the step of selecting input data by using at least one input multiplexer to obtain data that needs to be cached includes:
  • the step of writing the data to be cached into the set number of caches comprises:
  • e is the greatest common divisor between the set number of buffers and the preset number of output data.
  • the output multiplexer is: a multiplexer after the number of branches eliminates a common divisor between the set number of buffers and the preset number of output data.
  • a data bit width conversion device includes:
  • the obtaining module is configured to: select at least one level of the input multiplexer to obtain the data to be cached;
  • Writing a module configured to: write data to be cached into a set number of caches, wherein there is a common divisor relationship between the set number of caches and the preset number of output data;
  • the selection module is configured to: read the corresponding cached data from the cache, and perform the readout data through the output multiplexer based on a common divisor relationship between the set number of the cache and the preset number of output data. Select to get a preset amount of output data.
  • the set number of the cache is f*e
  • the preset number of output data is g*e
  • the selection module is set to:
  • the cache is divided into f groups, each group includes e caches, and the g group cache is selected from the f group cache by the output multiplexer, and the g*e data cached in the selected g group cache is obtained.
  • the obtaining module is further configured to:
  • the writing module is further configured to:
  • e is the greatest common divisor between the set number of buffers and the preset number of output data.
  • the output multiplexer is: a multiplexer after the number of branches eliminates a common divisor between the set number of buffers and the preset number of output data.
  • a data bit width conversion device comprising:
  • At least one level input multiplexer configured to select input data to obtain data to be cached
  • a buffer including a plurality of cache units, configured to cache data
  • the output multiplexer is configured to: select the cached data based on a common divisor relationship between the set number of buffers and the preset number of output data, and obtain a preset number of output data.
  • the number of cache units is f*e
  • the preset number of output data is g*e
  • the output multiplexer is set to:
  • the cache unit is divided into f groups, each group includes e cache units, and the g group cache unit is selected from the f group cache units, and the g*e data cached in the selected g group cache unit is obtained.
  • the device further includes a register configured to:
  • e is the greatest common divisor between the set number of buffers and the preset number of output data.
  • a computer readable storage medium storing program instructions that, when executed, implement the methods described above.
  • a data bit width conversion method and apparatus selects input data by at least one level input multiplexer, and writes the selected data into a set number of caches, wherein the cache setting The fixed amount is set to a common value relationship with the preset number of output data, so that when the data in the buffer is read and selected by the output multiplexer, the output is multiplexed.
  • the number of branches of the selector can eliminate the common divisor between the set number of buffers and the preset number of output data, thereby greatly reducing the number of branches of the output multiplexer, and greatly simplifying the logic of the output multiplexer. Increased frequency to meet the processing performance required by the system.
  • FIG. 1 is a schematic flow chart of an embodiment of a data bit width conversion method according to the present invention.
  • FIG. 2 is a schematic diagram of functional modules of an embodiment of a data bit width conversion device according to the present invention.
  • FIG. 3 is a schematic structural diagram of an embodiment of a data bit width conversion device according to the present invention.
  • the invention provides a data bit width conversion method.
  • FIG. 1 is a schematic flowchart diagram of an embodiment of a data bit width conversion method according to the present invention.
  • the data bit width conversion method comprises:
  • Step S10 selecting input data by using at least one level input multiplexer, and acquiring data that needs to be cached;
  • the input data is selected by at least one input multi-way selector (MUX), wherein when the input data is selected by the multi-stage input multiplexer, Select consecutive times to get the data that needs to be cached.
  • MUX input multi-way selector
  • a register is inserted between each stage in the multi-stage input multiplexer, and the intermediate data generated during the selection process between the input multiplexers of each stage is stored through the inserted register, thus, compared to only passing
  • the first-stage multiplexer selects the input data, selects the multi-stage input multiplexer, and inserts the register to store the intermediate data between the stages to cut the complex logic, which greatly simplifies the logic.
  • the input system is used to select the system frequency.
  • Step S20 writing the data to be cached into a set number of caches, wherein there is a common divisor relationship between the set number of buffers and the preset number of output data;
  • the data to be cached is written into the set number of caches, and the set number of the cache is set to the preset number of output data according to the preset number of final output data required by the system.
  • There is a common divisor relationship between the set number of buffers and the preset number of output data so that when the data is selected by the output multiplexer, the number of branches of the output multiplexer can be The common divisor between the set number of buffers and the preset number of output data is eliminated, thereby greatly reducing the number of branches of the output multiplexer and simplifying the logic.
  • the data to be cached may be sequentially written into the set number of caches according to the pointer, wherein the set number of caches may form a cache group.
  • Step S30 reading corresponding cached data from the cache, and selecting, according to a common divisor relationship between the set number of the cache and the preset number of output data, selecting the read data by the output multiplexer to obtain A preset amount of output data.
  • the corresponding cached data is read out from the set number of caches of the cache group, and the read data is selected by the output multiplexer to obtain the converted preset number of output data.
  • the output multiplexer eliminates the set number of the cache and the preset of the output data, because the number of branches in the cache group is in a common number relationship with the preset number of output data. A multiplexer after the number of conventions between the numbers.
  • each cache block contains e caches, and correspondingly, the preset number of output data is g*e, Where e is the common divisor between the set number f*e of the cache and the preset number g*e of the output data, and the number of branches of the output multiplexer can eliminate the common divisor e, that is, only from the cache group Among the f cache blocks, g cache blocks are selected, wherein each cache block contains e caches, and the valid data buffered in the g cache blocks is a preset number of output data, thereby realizing conversion of output data.
  • the number of output data required by the system is selected from all the caches of the cache group by the multiplexer.
  • the number of branches of the output multiplexer is greatly reduced, and the output multiplexer is greatly simplified.
  • Logic which increases the frequency.
  • the input data is selected by at least one level input multiplexer, and the selected data is written into the set number of buffers, wherein the set number of buffers is set to be the preset number of output data.
  • a common number relationship such that when the data in the buffer is read and selected by the output multiplexer, the number of branches of the output multiplexer can eliminate the set number and output of the cache.
  • the common divisor between the preset numbers of data so that the number of branches of the output multiplexer is greatly reduced, the logic of the output multiplexer is greatly simplified, the frequency is increased, and the processing performance required by the system is satisfied.
  • step S20 when the data to be cached is written into the set number of caches, only the valid data in the data to be cached is written into the set number of caches, which will need to be cached.
  • the invalid data in the data is eliminated, so that the system cache space can be saved, the system cache space can be wasted to store invalid data, and the subsequent selection of the output data by the output multiplexer in the read cache data can be prevented.
  • Obtaining invalid data that is, ensuring that the final output data is valid data, improving the utilization of system bandwidth, and further improving the frequency and system performance.
  • the common divisor between the set number of buffers and the preset number of output data is the greatest common divisor, and the cache is set according to a preset number of final output data required by the system.
  • the common divisor between the set number of the set buffer and the preset number of output data is the greatest common divisor, so that the number of branches of the output multiplexer is eliminated by the set number of the cache and the output data.
  • the minimum common divisor between the preset numbers is the least, which maximizes the logic simplification of the output multiplexer, maximizes the frequency, and satisfies the system's required frequency and processing performance even when the input data is large.
  • the invention also provides a data bit width conversion device.
  • FIG. 2 is a schematic diagram of functional blocks of an embodiment of a data bit width conversion device according to the present invention.
  • the data bit width conversion device comprises:
  • the obtaining module 01 is configured to select input data by using at least one input multiplexer to obtain data that needs to be cached;
  • the input data is selected by at least one input multi-way selector (MUX), wherein when the input data is selected by the multi-stage input multiplexer, Select consecutive times to get the data that needs to be cached.
  • MUX input multi-way selector
  • a register is inserted between the multi-stage input multiplexers, and the intermediate data generated during the selection process between the input multiplexers of each level is stored through the inserted register, thus, compared with only one level Road selection
  • the selector selects the input data, selects the multi-stage input multiplexer, and inserts the register to store the intermediate data between the stages to cut the complex logic, greatly simplifying the logic and selecting the input data. Increased system frequency.
  • the writing module 02 is configured to write the data to be cached into the set number of buffers, wherein there is a common divisor relationship between the set number of buffers and the preset number of output data;
  • the data to be cached is written into the set number of caches, and the set number of the cache is set to the preset number of output data according to the preset number of final output data required by the system.
  • There is a common divisor relationship between the set number of buffers and the preset number of output data so that when the data is selected by the output multiplexer, the number of branches of the output multiplexer can be The common divisor between the set number of buffers and the preset number of output data is eliminated, thereby greatly reducing the number of branches of the output multiplexer and simplifying the logic.
  • the data to be cached may be sequentially written into the set number of caches according to the pointer, wherein the set number of caches may form a cache group.
  • the selecting module 03 is configured to read the corresponding cached data from the cache, and perform the readout data through the output multiplexer based on the common divisor relationship between the set number of the cache and the preset number of the output data. Select to get a preset amount of output data.
  • the corresponding cached data is read out from the set number of caches of the cache group, and the read data is selected by the output multiplexer to obtain the converted preset number of output data.
  • the output multiplexer eliminates the set number of the cache and the preset of the output data, because the number of branches in the cache group is in a common number relationship with the preset number of output data. A multiplexer after the number of conventions between the numbers.
  • each cache block contains e caches, and correspondingly, the preset number of output data is g*e, Where e is the common divisor between the set number f*e of the cache and the preset number g*e of the output data, and the number of branches of the output multiplexer can eliminate the common divisor e, that is, only from the cache group Among the f cache blocks, g cache blocks are selected, wherein each cache block contains e caches, and the valid data buffered in the g cache blocks is a preset number of output data, thereby realizing conversion of output data.
  • the number of branches of the output multiplexer in this embodiment is greatly reduced, which greatly simplifies the output multiplexer. Logic, which increases the frequency.
  • the input data is selected by at least one level input multiplexer, and the selected data is written into the set number of buffers, wherein the set number of buffers is set to be the preset number of output data.
  • a common number relationship such that when the data in the buffer is read and selected by the output multiplexer, the number of branches of the output multiplexer can eliminate the set number of buffers and the preset number of output data.
  • the common divisor thus greatly reduces the number of branches of the output multiplexer, greatly simplifies the logic of the output multiplexer, improves the frequency, and satisfies the processing performance required by the system.
  • the writing module 02 is further configured to: when writing the data to be cached into the set number of caches, only write valid data in the data to be cached into the set number of caches, Invalid data culling in the data that needs to be cached, thus saving the system's cache space, avoiding wasting system cache space to store invalid data, and preventing subsequent selection by the output multiplexer in the read cache data.
  • the invalid data is obtained, that is, the output data finally obtained is guaranteed to be valid data, which improves the utilization of the system bandwidth and improves the frequency and system performance.
  • the common divisor between the set number of buffers and the preset number of output data is the greatest common divisor, and when the set number of caches is set according to a preset number of final output data required by the system, The common divisor between the set number of settings of the cache and the preset number of output data is the greatest common divisor, so that the number of branches of the output multiplexer is between the set number of the erase buffer and the preset number of output data. The least commonality is minimized, which maximizes the logic simplification of the output multiplexer and maximizes the frequency. Even when the input data is large, the system can meet the required frequency and processing performance.
  • the data bit width conversion device includes:
  • At least one level input multiplexer configured to select input data to obtain data to be cached
  • a buffer including a plurality of cache units, configured to cache data
  • the output multiplexer is configured to: select the cached data based on a common divisor relationship between the set number of buffers and the preset number of output data, and obtain a preset number of output data.
  • the number of cache units is f*e
  • the preset number of output data is g*e
  • the output multiplexer can be set to:
  • the cache unit is divided into f groups, each group includes e cache units, and the g group cache unit is selected from the f group cache units, and the g*e data cached in the selected g group cache unit is obtained.
  • the data bit width conversion device may further include a register configured to:
  • e can be the greatest common divisor between the set number of buffers and the preset number of output data.
  • all or part of the steps of the above embodiments may also be implemented by using an integrated circuit. These steps may be separately fabricated into individual integrated circuit modules, or multiple modules or steps may be fabricated into a single integrated circuit module. achieve.
  • the devices/function modules/functional units in the above embodiments may be implemented by a general-purpose computing device, which may be centralized on a single computing device or distributed over a network of multiple computing devices.
  • each device/function module/functional unit in the above embodiment When each device/function module/functional unit in the above embodiment is implemented in the form of a software function module and sold or used as a stand-alone product, it can be stored in a computer readable storage medium.
  • the above mentioned computer readable storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
  • the data in the buffer is read out and is output through the output multiplexer.
  • the number of branches of the output multiplexer can eliminate the common divisor between the set number of buffers and the preset number of output data, thereby greatly reducing the number of branches of the output multiplexer, and making the output multiplexer
  • the logic is greatly simplified, the frequency is increased, and the processing performance required by the system is met.

Abstract

A method, device and apparatus for converting the data bit width. The method comprises the following steps: selecting input data through at least one level of input multiplexer and obtaining the data needed to be cached; writing the data needed to be cached into a preset number of caches, wherein there is a common divisor relationship between the preset number of the caches and the preset number of the output data; reading the corresponding cached data from the caches, and selecting the read data through the output multiplexer on the basis of the common divisor relationship between the preset number of the caches and the preset number of the output data, and obtaining the preset number of output data.

Description

数据位宽转换方法、装置和设备Data bit width conversion method, device and device 技术领域Technical field
本发明涉及数据处理技术领域,尤其涉及一种数据位宽转换方法、装置和设备。The present invention relates to the field of data processing technologies, and in particular, to a data bit width conversion method, apparatus, and device.
背景技术Background technique
在数字逻辑设计领域,对数据产品的处理带宽要求越来越高,因此,对系统的数据位宽、时钟频率、带宽利用率等技术指标的要求也更高。为了在系统中数据位宽较大时,能保证系统处理时钟频率也较高,并且为了尽量降低系统处理逻辑的复杂度,通常需要将输入可变或固定数量的数据转换为特定的固定位宽。因此,数据位宽转换已经成为系统中的重要步骤。In the field of digital logic design, the processing bandwidth requirements of data products are getting higher and higher. Therefore, the requirements for technical parameters such as data bit width, clock frequency and bandwidth utilization of the system are also higher. In order to ensure that the system processing clock frequency is also high in the data bit width in the system, and in order to minimize the complexity of the system processing logic, it is usually necessary to convert the input variable or fixed amount of data into a specific fixed bit width. . Therefore, data bit width conversion has become an important step in the system.
目前,常用的数据位宽转换方法是直接通过多路选择器(MUX)和移位逻辑来完成位宽转换。在数据位宽越来越大、频率越来越高的情况下,常用的数据位宽转换方法中多路选择器的分支会急剧增多,且数据移位逻辑非常复杂,使其设计的逻辑复杂度大幅提升,严重降低系统性能,使其成为整个系统的瓶颈,无法达到系统要求的处理性能。Currently, the commonly used data bit width conversion method is to perform bit width conversion directly through a multi-way selector (MUX) and shift logic. In the case of increasing data bit width and higher frequency, the branch of the multiplexer in the commonly used data bit width conversion method will increase sharply, and the data shift logic is very complicated, making the logic of its design complicated. The degree of improvement is greatly reduced, which seriously degrades the system performance, making it a bottleneck of the entire system and failing to meet the processing performance required by the system.
上述内容仅用于辅助理解本发明的技术方案,并不代表承认上述内容是现有技术。The above content is only used to assist in understanding the technical solutions of the present invention, and does not constitute an admission that the above is prior art.
发明内容Summary of the invention
本发明实施例的主要目的在于解决数据位宽转换的逻辑复杂、频率较低的技术问题。The main purpose of the embodiments of the present invention is to solve the technical problem of logical complexity and low frequency of data bit width conversion.
为实现上述目的,本发明实施例提供的一种数据位宽转换方法,所述方法包括以下步骤:To achieve the above objective, a data bit width conversion method provided by an embodiment of the present invention includes the following steps:
通过至少一级输入多路选择器对输入数据进行选择,获取需要缓存的数据;Selecting input data through at least one level input multiplexer to obtain data that needs to be cached;
将需要缓存的数据写入设定数量的缓存中,其中,缓存的设定数量与输出数据的预设数量之间存在公约数关系; Writing the data to be cached into a set number of buffers, wherein there is a common divisor relationship between the set number of buffers and the preset number of output data;
从缓存中读出对应的缓存的数据,并基于缓存的设定数量与输出数据的预设数量之间的公约数关系,通过输出多路选择器对读出的数据进行选择,获取预设数量的输出数据。The corresponding cached data is read out from the cache, and based on the common divisor relationship between the set number of the cache and the preset number of output data, the read data is selected by the output multiplexer to obtain a preset quantity. Output data.
可选地,缓存的设定数量为f*e,输出数据的预设数量为g*e,e为缓存的设定数量与输出数据的预设数量之间的公约数,基于缓存的设定数量与输出数据的预设数量之间的公约数关系,通过输出多路选择器对读出的数据进行选择,获取预设数量的输出数据包括:Optionally, the set number of the cache is f*e, the preset number of output data is g*e, and e is a common divisor between the set number of the cache and the preset number of output data, based on the cache setting. The common divisor relationship between the quantity and the preset number of output data, the read data is selected by the output multiplexer, and the preset number of output data is obtained:
将缓存分为f组,每组包括e个缓存,通过输出多路选择器从f组缓存中选出g组缓存,获取选出的g组缓存中缓存的g*e个数据。The cache is divided into f groups, each group includes e caches, and the g group cache is selected from the f group cache by the output multiplexer, and the g*e data cached in the selected g group cache is obtained.
可选地,所述通过至少一级输入多路选择器对输入数据进行选择,获取需要缓存的数据的步骤包括:Optionally, the step of selecting input data by using at least one input multiplexer to obtain data that needs to be cached includes:
当通过多级输入多路选择器对输入数据进行选择时,通过寄存器在多级输入多路选择器之间存储中间数据。When the input data is selected by the multi-stage input multiplexer, intermediate data is stored between the multi-stage input multiplexers through the registers.
可选地,所述将需要缓存的数据写入设定数量的缓存中的步骤包括:Optionally, the step of writing the data to be cached into the set number of caches comprises:
将需要缓存的数据中的有效数据写入设定数量的缓存中。Write valid data from the data that needs to be cached to a set number of caches.
可选地,e为缓存的设定数量与输出数据的预设数量之间最大公约数。Optionally, e is the greatest common divisor between the set number of buffers and the preset number of output data.
可选地,所述输出多路选择器为:分支数量消去了缓存的设定数量与输出数据的预设数量之间的公约数后的多路选择器。Optionally, the output multiplexer is: a multiplexer after the number of branches eliminates a common divisor between the set number of buffers and the preset number of output data.
一种数据位宽转换装置,包括:A data bit width conversion device includes:
获取模块,设置为:通过至少一级输入多路选择器对输入数据进行选择,获取需要缓存的数据;The obtaining module is configured to: select at least one level of the input multiplexer to obtain the data to be cached;
写入模块,设置为:将需要缓存的数据写入设定数量的缓存中,其中,缓存的设定数量与输出数据的预设数量之间存在公约数关系;以及Writing a module, configured to: write data to be cached into a set number of caches, wherein there is a common divisor relationship between the set number of caches and the preset number of output data;
选择模块,设置为:从缓存中读出对应的缓存的数据,并基于缓存的设定数量与输出数据的预设数量之间的公约数关系,通过输出多路选择器对读出的数据进行选择,获取预设数量的输出数据。The selection module is configured to: read the corresponding cached data from the cache, and perform the readout data through the output multiplexer based on a common divisor relationship between the set number of the cache and the preset number of output data. Select to get a preset amount of output data.
可选地,缓存的设定数量为f*e,输出数据的预设数量为g*e,所述选择模块是设置为:Optionally, the set number of the cache is f*e, the preset number of output data is g*e, and the selection module is set to:
将缓存分为f组,每组包括e个缓存,通过输出多路选择器从f组缓存中选出g组缓存,获取选出的g组缓存中缓存的g*e个数据。 The cache is divided into f groups, each group includes e caches, and the g group cache is selected from the f group cache by the output multiplexer, and the g*e data cached in the selected g group cache is obtained.
可选地,所述获取模块还设置为:Optionally, the obtaining module is further configured to:
当通过多级输入多路选择器对输入数据进行选择时,通过寄存器在多级输入多路选择器之间存储中间数据。When the input data is selected by the multi-stage input multiplexer, intermediate data is stored between the multi-stage input multiplexers through the registers.
可选地,所述写入模块还设置为:Optionally, the writing module is further configured to:
将需要缓存的数据中的有效数据写入设定数量的缓存中。Write valid data from the data that needs to be cached to a set number of caches.
可选地,e为缓存的设定数量与输出数据的预设数量之间的最大公约数。Optionally, e is the greatest common divisor between the set number of buffers and the preset number of output data.
可选地,所述输出多路选择器为:分支数量消去了缓存的设定数量与输出数据的预设数量之间的公约数后的多路选择器。Optionally, the output multiplexer is: a multiplexer after the number of branches eliminates a common divisor between the set number of buffers and the preset number of output data.
一种数据位宽转换设备,包括:A data bit width conversion device comprising:
至少一级输入多路选择器,其设置为对输入数据进行选择,获取需要缓存的数据;At least one level input multiplexer, configured to select input data to obtain data to be cached;
缓存器,包括多个缓存单元,设置为缓存数据;以及a buffer, including a plurality of cache units, configured to cache data;
输出多路选择器,设置为:基于缓存的设定数量与输出数据的预设数量之间的公约数关系对缓存的数据进行选择,获取预设数量的输出数据。The output multiplexer is configured to: select the cached data based on a common divisor relationship between the set number of buffers and the preset number of output data, and obtain a preset number of output data.
可选地,缓存单元的数量为f*e,输出数据的预设数量为g*e,所述输出多路选择器是设置为:Optionally, the number of cache units is f*e, the preset number of output data is g*e, and the output multiplexer is set to:
将缓存单元分为f组,每组包括e个缓存单元,从f组缓存单元中选出g组缓存单元,获取选出的g组缓存单元中缓存的g*e个数据。The cache unit is divided into f groups, each group includes e cache units, and the g group cache unit is selected from the f group cache units, and the g*e data cached in the selected g group cache unit is obtained.
可选地,所述设备还包括寄存器,其设置为:Optionally, the device further includes a register configured to:
当通过多级输入多路选择器对输入数据进行选择时,在多级输入多路选择器之间存储中间数据。When the input data is selected by the multi-stage input multiplexer, intermediate data is stored between the multi-stage input multiplexers.
可选地,e为缓存的设定数量与输出数据的预设数量之间的最大公约数。Optionally, e is the greatest common divisor between the set number of buffers and the preset number of output data.
一种计算机可读存储介质,存储有程序指令,当该程序指令被执行时可实现上面所述的方法。A computer readable storage medium storing program instructions that, when executed, implement the methods described above.
本发明实施例提出的一种数据位宽转换方法及装置,通过至少一级输入多路选择器对输入数据进行选择,并将选择的数据写入设定数量的缓存中,其中,缓存的设定数量设置为与输出数据的预设数量之间成公约数关系,这样,在读出缓存中的数据并通过输出多路选择器对其进行选择时,输出多路 选择器的分支数可消去缓存的设定数量与输出数据的预设数量之间的公约数,从而使输出多路选择器的分支数大大减少,使输出多路选择器的逻辑得到大幅简化,提升了频率,满足系统要求的处理性能。A data bit width conversion method and apparatus according to an embodiment of the present invention selects input data by at least one level input multiplexer, and writes the selected data into a set number of caches, wherein the cache setting The fixed amount is set to a common value relationship with the preset number of output data, so that when the data in the buffer is read and selected by the output multiplexer, the output is multiplexed. The number of branches of the selector can eliminate the common divisor between the set number of buffers and the preset number of output data, thereby greatly reducing the number of branches of the output multiplexer, and greatly simplifying the logic of the output multiplexer. Increased frequency to meet the processing performance required by the system.
附图概述BRIEF abstract
图1为本发明数据位宽转换方法一实施例的流程示意图;1 is a schematic flow chart of an embodiment of a data bit width conversion method according to the present invention;
图2为本发明数据位宽转换装置一实施例的功能模块示意图;2 is a schematic diagram of functional modules of an embodiment of a data bit width conversion device according to the present invention;
图3为本发明数据位宽转换设备一实施例的结构示意图。FIG. 3 is a schematic structural diagram of an embodiment of a data bit width conversion device according to the present invention.
本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The implementation, functional features, and advantages of the present invention will be further described in conjunction with the embodiments.
本发明的较佳实施方式Preferred embodiment of the invention
应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。It is understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
本发明提供一种数据位宽转换方法。The invention provides a data bit width conversion method.
参照图1,图1为本发明数据位宽转换方法一实施例的流程示意图。Referring to FIG. 1, FIG. 1 is a schematic flowchart diagram of an embodiment of a data bit width conversion method according to the present invention.
在一实施例中,该数据位宽转换方法包括:In an embodiment, the data bit width conversion method comprises:
步骤S10,通过至少一级输入多路选择器对输入数据进行选择,获取需要缓存的数据;Step S10, selecting input data by using at least one level input multiplexer, and acquiring data that needs to be cached;
本实施例中,当判断有数据输入时,通过至少一级输入多路选择器(MUX)对输入数据进行选择,其中,当通过多级输入多路选择器对输入数据进行选择时,通过多次连续选择,获取需要缓存的数据。并且,在多级输入多路选择器中各级之间插入寄存器,通过插入的寄存器来存储各级输入多路选择器之间在进行选择过程中产生的中间数据,这样,相比于仅通过一级多路选择器对输入数据进行选择,通过多级输入多路选择器进行选择并在各级之间插入寄存器存储中间数据的方式对复杂逻辑进行了切割,极大地简化了逻辑,在对输入数据进行选择中提升了系统频率。In this embodiment, when it is determined that there is data input, the input data is selected by at least one input multi-way selector (MUX), wherein when the input data is selected by the multi-stage input multiplexer, Select consecutive times to get the data that needs to be cached. Moreover, a register is inserted between each stage in the multi-stage input multiplexer, and the intermediate data generated during the selection process between the input multiplexers of each stage is stored through the inserted register, thus, compared to only passing The first-stage multiplexer selects the input data, selects the multi-stage input multiplexer, and inserts the register to store the intermediate data between the stages to cut the complex logic, which greatly simplifies the logic. The input system is used to select the system frequency.
步骤S20,将需要缓存的数据写入设定数量的缓存中,其中,缓存的设定数量与输出数据的预设数量之间存在公约数关系; Step S20, writing the data to be cached into a set number of caches, wherein there is a common divisor relationship between the set number of buffers and the preset number of output data;
选择获取需要缓存的数据后,将需要缓存的数据写入设定数量的缓存中,根据系统所需的最终输出数据的预设数量,将缓存的设定数量设置为与输出数据的预设数量之间成公约数关系,即缓存的设定数量与输出数据的预设数量之间存在公约数,以在后续通过输出多路选择器对数据进行选择时,输出多路选择器的分支数可消去缓存的设定数量与输出数据的预设数量之间的公约数,从而使输出多路选择器的分支数大大减少,简化逻辑。可根据指针将需要缓存的数据依次写入设置好的设定数量的缓存中,其中,设定数量的缓存可组成一缓存组。After selecting the data to be cached, the data to be cached is written into the set number of caches, and the set number of the cache is set to the preset number of output data according to the preset number of final output data required by the system. There is a common divisor relationship between the set number of buffers and the preset number of output data, so that when the data is selected by the output multiplexer, the number of branches of the output multiplexer can be The common divisor between the set number of buffers and the preset number of output data is eliminated, thereby greatly reducing the number of branches of the output multiplexer and simplifying the logic. The data to be cached may be sequentially written into the set number of caches according to the pointer, wherein the set number of caches may form a cache group.
步骤S30,从缓存中读出对应的缓存的数据,并基于缓存的设定数量与输出数据的预设数量之间的公约数关系,通过输出多路选择器对读出的数据进行选择,获取预设数量的输出数据。Step S30, reading corresponding cached data from the cache, and selecting, according to a common divisor relationship between the set number of the cache and the preset number of output data, selecting the read data by the output multiplexer to obtain A preset amount of output data.
从缓存组的设定数量的缓存中读出对应的缓存的数据,并通过输出多路选择器对读出的数据进行选择,获取转换后的预设数量的输出数据。其中,由于缓存组中缓存的设定数量与输出数据的预设数量之间成公约数关系,因此,所述输出多路选择器为分支数量消去了缓存的设定数量与输出数据的预设数量之间的公约数后的多路选择器。The corresponding cached data is read out from the set number of caches of the cache group, and the read data is selected by the output multiplexer to obtain the converted preset number of output data. The output multiplexer eliminates the set number of the cache and the preset of the output data, because the number of branches in the cache group is in a common number relationship with the preset number of output data. A multiplexer after the number of conventions between the numbers.
例如若缓存组中缓存的设定数量为f*e,其中,f代表缓存组中的缓存块,每一缓存块中包含e个缓存,对应的,输出数据的预设数量为g*e,其中,e即为缓存的设定数量f*e与输出数据的预设数量g*e之间的公约数,则输出多路选择器的分支数量可消去公约数e,即只需从缓存组中f个缓存块中选择g个缓存块,其中,每一缓存块中包含e个缓存,g个缓存块中缓存的有效数据即为预设数量的输出数据,从而实现输出数据的转换。相比相关技术的直接由多路选择器从缓存组的所有缓存中选择系统需要数量的输出数据,本实施例中输出多路选择器的分支数大大减少,大幅简化了输出多路选择器的逻辑,从而提升了频率。For example, if the number of caches in the cache group is f*e, where f represents a cache block in the cache group, each cache block contains e caches, and correspondingly, the preset number of output data is g*e, Where e is the common divisor between the set number f*e of the cache and the preset number g*e of the output data, and the number of branches of the output multiplexer can eliminate the common divisor e, that is, only from the cache group Among the f cache blocks, g cache blocks are selected, wherein each cache block contains e caches, and the valid data buffered in the g cache blocks is a preset number of output data, thereby realizing conversion of output data. Compared with the related art, the number of output data required by the system is selected from all the caches of the cache group by the multiplexer. In this embodiment, the number of branches of the output multiplexer is greatly reduced, and the output multiplexer is greatly simplified. Logic, which increases the frequency.
本实施例通过至少一级输入多路选择器对输入数据进行选择,并将选择的数据写入设定数量的缓存中,其中,缓存的设定数量设置为与输出数据的预设数量之间成公约数关系,这样,在读出缓存中的数据并通过输出多路选择器对其进行选择时,输出多路选择器的分支数可消去缓存的设定数量与输 出数据的预设数量之间的公约数,从而使输出多路选择器的分支数大大减少,使输出多路选择器的逻辑得到大幅简化,提升了频率,满足系统要求的处理性能。In this embodiment, the input data is selected by at least one level input multiplexer, and the selected data is written into the set number of buffers, wherein the set number of buffers is set to be the preset number of output data. A common number relationship, such that when the data in the buffer is read and selected by the output multiplexer, the number of branches of the output multiplexer can eliminate the set number and output of the cache. The common divisor between the preset numbers of data, so that the number of branches of the output multiplexer is greatly reduced, the logic of the output multiplexer is greatly simplified, the frequency is increased, and the processing performance required by the system is satisfied.
在其他实施例中,在上述步骤S20中,将需要缓存的数据写入设定数量的缓存中时,只将需要缓存的数据中的有效数据写入设定数量的缓存中,将需要缓存的数据中的无效数据剔除,这样,既能节约系统的缓存空间,避免浪费系统的缓存空间来存储无效数据,还能防止后续通过输出多路选择器在读出的缓存数据中选择获取输出数据时,获取到无效数据,即保证最终获取的输出数据均为有效数据,提高了系统带宽的利用率,进一步地提升了频率及系统性能。In other embodiments, in the above step S20, when the data to be cached is written into the set number of caches, only the valid data in the data to be cached is written into the set number of caches, which will need to be cached. The invalid data in the data is eliminated, so that the system cache space can be saved, the system cache space can be wasted to store invalid data, and the subsequent selection of the output data by the output multiplexer in the read cache data can be prevented. Obtaining invalid data, that is, ensuring that the final output data is valid data, improving the utilization of system bandwidth, and further improving the frequency and system performance.
在其他实施例中,在上述步骤S20中,缓存的设定数量与输出数据的预设数量之间的公约数为最大公约数,在根据系统所需的最终输出数据的预设数量来设置缓存的设定数量时,设置缓存的设定数量与输出数据的预设数量之间的公约数为最大公约数,这样,输出多路选择器的分支数量在消去缓存的设定数量与输出数据的预设数量之间的最大公约数后最少,使得输出多路选择器的逻辑简化达到最大,最大限度的提升了频率,即使在输入数据较多时,仍然能满足系统要求的频率及处理性能。In other embodiments, in the above step S20, the common divisor between the set number of buffers and the preset number of output data is the greatest common divisor, and the cache is set according to a preset number of final output data required by the system. When the number is set, the common divisor between the set number of the set buffer and the preset number of output data is the greatest common divisor, so that the number of branches of the output multiplexer is eliminated by the set number of the cache and the output data. The minimum common divisor between the preset numbers is the least, which maximizes the logic simplification of the output multiplexer, maximizes the frequency, and satisfies the system's required frequency and processing performance even when the input data is large.
本发明还提供一种数据位宽转换装置。The invention also provides a data bit width conversion device.
参照图2,图2为本发明数据位宽转换装置一实施例的功能模块示意图。Referring to FIG. 2, FIG. 2 is a schematic diagram of functional blocks of an embodiment of a data bit width conversion device according to the present invention.
在一实施例中,该数据位宽转换装置包括:In an embodiment, the data bit width conversion device comprises:
获取模块01,设置为通过至少一级输入多路选择器对输入数据进行选择,获取需要缓存的数据;The obtaining module 01 is configured to select input data by using at least one input multiplexer to obtain data that needs to be cached;
本实施例中,当判断有数据输入时,通过至少一级输入多路选择器(MUX)对输入数据进行选择,其中,当通过多级输入多路选择器对输入数据进行选择时,通过多次连续选择,获取需要缓存的数据。并且,在多级输入多路选择器之间插入寄存器,通过插入的寄存器来存储各级输入多路选择器之间在进行选择过程中产生的中间数据,这样,相比于仅通过一级多路选 择器对输入数据进行选择,通过多级输入多路选择器进行选择并在各级之间插入寄存器存储中间数据的方式对复杂逻辑进行了切割,极大地简化了逻辑,在对输入数据进行选择中提升了系统频率。In this embodiment, when it is determined that there is data input, the input data is selected by at least one input multi-way selector (MUX), wherein when the input data is selected by the multi-stage input multiplexer, Select consecutive times to get the data that needs to be cached. Moreover, a register is inserted between the multi-stage input multiplexers, and the intermediate data generated during the selection process between the input multiplexers of each level is stored through the inserted register, thus, compared with only one level Road selection The selector selects the input data, selects the multi-stage input multiplexer, and inserts the register to store the intermediate data between the stages to cut the complex logic, greatly simplifying the logic and selecting the input data. Increased system frequency.
写入模块02,设置为将需要缓存的数据写入设定数量的缓存中,其中,缓存的设定数量与输出数据的预设数量之间存在公约数关系;The writing module 02 is configured to write the data to be cached into the set number of buffers, wherein there is a common divisor relationship between the set number of buffers and the preset number of output data;
选择获取需要缓存的数据后,将需要缓存的数据写入设定数量的缓存中,根据系统所需的最终输出数据的预设数量,将缓存的设定数量设置为与输出数据的预设数量之间成公约数关系,即缓存的设定数量与输出数据的预设数量之间存在公约数,以在后续通过输出多路选择器对数据进行选择时,输出多路选择器的分支数可消去缓存的设定数量与输出数据的预设数量之间的公约数,从而使输出多路选择器的分支数大大减少,简化逻辑。可根据指针将需要缓存的数据依次写入设置好的设定数量的缓存中,其中,设定数量的缓存可组成一缓存组。After selecting the data to be cached, the data to be cached is written into the set number of caches, and the set number of the cache is set to the preset number of output data according to the preset number of final output data required by the system. There is a common divisor relationship between the set number of buffers and the preset number of output data, so that when the data is selected by the output multiplexer, the number of branches of the output multiplexer can be The common divisor between the set number of buffers and the preset number of output data is eliminated, thereby greatly reducing the number of branches of the output multiplexer and simplifying the logic. The data to be cached may be sequentially written into the set number of caches according to the pointer, wherein the set number of caches may form a cache group.
选择模块03,设置为从缓存中读出对应的缓存的数据,并基于缓存的设定数量与输出数据的预设数量之间的公约数关系,通过输出多路选择器对读出的数据进行选择,获取预设数量的输出数据。The selecting module 03 is configured to read the corresponding cached data from the cache, and perform the readout data through the output multiplexer based on the common divisor relationship between the set number of the cache and the preset number of the output data. Select to get a preset amount of output data.
从缓存组的设定数量的缓存中读出对应的缓存的数据,并通过输出多路选择器对读出的数据进行选择,获取转换后的预设数量的输出数据。其中,由于缓存组中缓存的设定数量与输出数据的预设数量之间成公约数关系,因此,所述输出多路选择器为分支数量消去了缓存的设定数量与输出数据的预设数量之间的公约数后的多路选择器。The corresponding cached data is read out from the set number of caches of the cache group, and the read data is selected by the output multiplexer to obtain the converted preset number of output data. The output multiplexer eliminates the set number of the cache and the preset of the output data, because the number of branches in the cache group is in a common number relationship with the preset number of output data. A multiplexer after the number of conventions between the numbers.
例如若缓存组中缓存的设定数量为f*e,其中,f代表缓存组中的缓存块,每一缓存块中包含e个缓存,对应的,输出数据的预设数量为g*e,其中,e即为缓存的设定数量f*e与输出数据的预设数量g*e之间的公约数,则输出多路选择器的分支数量可消去公约数e,即只需从缓存组中f个缓存块中选择g个缓存块,其中,每一缓存块中包含e个缓存,g个缓存块中缓存的有效数据即为预设数量的输出数据,从而实现输出数据的转换。相比现有的直接由多路选择器从缓存组的所有缓存中选择系统需要数量的输出数据,本实施例中输出多路选择器的分支数大大减少,大幅简化了输出多路选择器的逻辑,从而提升了频率。 For example, if the number of caches in the cache group is f*e, where f represents a cache block in the cache group, each cache block contains e caches, and correspondingly, the preset number of output data is g*e, Where e is the common divisor between the set number f*e of the cache and the preset number g*e of the output data, and the number of branches of the output multiplexer can eliminate the common divisor e, that is, only from the cache group Among the f cache blocks, g cache blocks are selected, wherein each cache block contains e caches, and the valid data buffered in the g cache blocks is a preset number of output data, thereby realizing conversion of output data. Compared with the existing multiplexer directly selecting the required amount of output data from all the caches of the cache group, the number of branches of the output multiplexer in this embodiment is greatly reduced, which greatly simplifies the output multiplexer. Logic, which increases the frequency.
本实施例通过至少一级输入多路选择器对输入数据进行选择,并将选择的数据写入设定数量的缓存中,其中,缓存的设定数量设置为与输出数据的预设数量之间成公约数关系,这样,在读出缓存中的数据并通过输出多路选择器对其进行选择时,输出多路选择器的分支数可消去缓存的设定数量与输出数据的预设数量之间的公约数,从而使输出多路选择器的分支数大大减少,使输出多路选择器的逻辑得到大幅简化,提升了频率,满足系统要求的处理性能。In this embodiment, the input data is selected by at least one level input multiplexer, and the selected data is written into the set number of buffers, wherein the set number of buffers is set to be the preset number of output data. A common number relationship, such that when the data in the buffer is read and selected by the output multiplexer, the number of branches of the output multiplexer can eliminate the set number of buffers and the preset number of output data. The common divisor thus greatly reduces the number of branches of the output multiplexer, greatly simplifies the logic of the output multiplexer, improves the frequency, and satisfies the processing performance required by the system.
在其他实施例中,上述写入模块02还设置为,将需要缓存的数据写入设定数量的缓存中时,只将需要缓存的数据中的有效数据写入设定数量的缓存中,将需要缓存的数据中的无效数据剔除,这样,既能节约系统的缓存空间,避免浪费系统的缓存空间来存储无效数据,还能防止后续通过输出多路选择器在读出的缓存数据中选择获取输出数据时,获取到无效数据,即保证最终获取的输出数据均为有效数据,提高了系统带宽的利用率,地提升了频率及系统性能。In other embodiments, the writing module 02 is further configured to: when writing the data to be cached into the set number of caches, only write valid data in the data to be cached into the set number of caches, Invalid data culling in the data that needs to be cached, thus saving the system's cache space, avoiding wasting system cache space to store invalid data, and preventing subsequent selection by the output multiplexer in the read cache data. When the data is output, the invalid data is obtained, that is, the output data finally obtained is guaranteed to be valid data, which improves the utilization of the system bandwidth and improves the frequency and system performance.
在其他实施例中,缓存的设定数量与输出数据的预设数量之间的公约数为最大公约数,在根据系统所需的最终输出数据的预设数量来设置缓存的设定数量时,设置缓存的设定数量与输出数据的预设数量之间的公约数为最大公约数,这样,输出多路选择器的分支数量在消去缓存的设定数量与输出数据的预设数量之间的最大公约数后最少,使得输出多路选择器的逻辑简化达到最大,最大限度的提升了频率,即使在输入数据较多时,仍然能满足系统要求的频率及处理性能。In other embodiments, the common divisor between the set number of buffers and the preset number of output data is the greatest common divisor, and when the set number of caches is set according to a preset number of final output data required by the system, The common divisor between the set number of settings of the cache and the preset number of output data is the greatest common divisor, so that the number of branches of the output multiplexer is between the set number of the erase buffer and the preset number of output data. The least commonality is minimized, which maximizes the logic simplification of the output multiplexer and maximizes the frequency. Even when the input data is large, the system can meet the required frequency and processing performance.
图3为本发明数据位宽转换设备一实施例的结构示意图,该数据位宽转换设备,包括:3 is a schematic structural diagram of an embodiment of a data bit width conversion device according to the present invention. The data bit width conversion device includes:
至少一级输入多路选择器,其设置为对输入数据进行选择,获取需要缓存的数据;At least one level input multiplexer, configured to select input data to obtain data to be cached;
缓存器,包括多个缓存单元,设置为缓存数据;以及 a buffer, including a plurality of cache units, configured to cache data;
输出多路选择器,设置为:基于缓存的设定数量与输出数据的预设数量之间的公约数关系对缓存的数据进行选择,获取预设数量的输出数据。The output multiplexer is configured to: select the cached data based on a common divisor relationship between the set number of buffers and the preset number of output data, and obtain a preset number of output data.
其中,缓存单元的数量为f*e,输出数据的预设数量为g*e,所述输出多路选择器可以是设置为:The number of cache units is f*e, the preset number of output data is g*e, and the output multiplexer can be set to:
将缓存单元分为f组,每组包括e个缓存单元,从f组缓存单元中选出g组缓存单元,获取选出的g组缓存单元中缓存的g*e个数据。The cache unit is divided into f groups, each group includes e cache units, and the g group cache unit is selected from the f group cache units, and the g*e data cached in the selected g group cache unit is obtained.
该数据位宽转换设备还可以包括寄存器,其设置为:The data bit width conversion device may further include a register configured to:
当通过多级输入多路选择器对输入数据进行选择时,在多级输入多路选择器之间存储中间数据。When the input data is selected by the multi-stage input multiplexer, intermediate data is stored between the multi-stage input multiplexers.
其中,e可以为缓存的设定数量与输出数据的预设数量之间的最大公约数。Where e can be the greatest common divisor between the set number of buffers and the preset number of output data.
以上仅为本发明的优选实施例,并非因此限制本发明的专利范围。The above are only preferred embodiments of the present invention and are not intended to limit the scope of the invention.
本领域普通技术人员可以理解上述实施例的全部或部分步骤可以使用计算机程序流程来实现,所述计算机程序可以存储于一计算机可读存储介质中,所述计算机程序在相应的硬件平台上(如系统、设备、装置、器件等)执行,在执行时,包括方法实施例的步骤之一或其组合。One of ordinary skill in the art will appreciate that all or a portion of the steps of the above-described embodiments can be implemented using a computer program flow, which can be stored in a computer readable storage medium, such as on a corresponding hardware platform (eg, The system, device, device, device, etc. are executed, and when executed, include one or a combination of the steps of the method embodiments.
可选地,上述实施例的全部或部分步骤也可以使用集成电路来实现,这些步骤可以被分别制作成一个个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。Alternatively, all or part of the steps of the above embodiments may also be implemented by using an integrated circuit. These steps may be separately fabricated into individual integrated circuit modules, or multiple modules or steps may be fabricated into a single integrated circuit module. achieve.
上述实施例中的各装置/功能模块/功能单元可以采用通用的计算装置来实现,它们可以集中在单个的计算装置上,也可以分布在多个计算装置所组成的网络上。The devices/function modules/functional units in the above embodiments may be implemented by a general-purpose computing device, which may be centralized on a single computing device or distributed over a network of multiple computing devices.
上述实施例中的各装置/功能模块/功能单元以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。上述提到的计算机可读取存储介质可以是只读存储器,磁盘或光盘等。When each device/function module/functional unit in the above embodiment is implemented in the form of a software function module and sold or used as a stand-alone product, it can be stored in a computer readable storage medium. The above mentioned computer readable storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
工业实用性Industrial applicability
本发明实施例中,在读出缓存中的数据并通过输出多路选择器对其进行 选择时,输出多路选择器的分支数可消去缓存的设定数量与输出数据的预设数量之间的公约数,从而使输出多路选择器的分支数大大减少,使输出多路选择器的逻辑得到大幅简化,提升了频率,满足系统要求的处理性能。 In the embodiment of the present invention, the data in the buffer is read out and is output through the output multiplexer. When selected, the number of branches of the output multiplexer can eliminate the common divisor between the set number of buffers and the preset number of output data, thereby greatly reducing the number of branches of the output multiplexer, and making the output multiplexer The logic is greatly simplified, the frequency is increased, and the processing performance required by the system is met.

Claims (17)

  1. 一种数据位宽转换方法,包括以下步骤:A data bit width conversion method includes the following steps:
    通过至少一级输入多路选择器对输入数据进行选择,获取需要缓存的数据;Selecting input data through at least one level input multiplexer to obtain data that needs to be cached;
    将需要缓存的数据写入设定数量的缓存中,其中,缓存的设定数量与输出数据的预设数量之间存在公约数关系;Writing the data to be cached into a set number of buffers, wherein there is a common divisor relationship between the set number of buffers and the preset number of output data;
    从缓存中读出对应的缓存的数据,并基于缓存的设定数量与输出数据的预设数量之间的公约数关系,通过输出多路选择器对读出的数据进行选择,获取预设数量的输出数据。The corresponding cached data is read out from the cache, and based on the common divisor relationship between the set number of the cache and the preset number of output data, the read data is selected by the output multiplexer to obtain a preset quantity. Output data.
  2. 如权利要求1所述的数据位宽转换方法,其中,缓存的设定数量为f*e,输出数据的预设数量为g*e,e为缓存的设定数量与输出数据的预设数量之间的公约数,基于缓存的设定数量与输出数据的预设数量之间的公约数关系,通过输出多路选择器对读出的数据进行选择,获取预设数量的输出数据包括:The data bit width conversion method according to claim 1, wherein the set number of buffers is f*e, the preset number of output data is g*e, and e is a set number of buffers and a preset number of output data. The common divisor is based on the common divisor relationship between the set number of buffers and the preset number of output data, and the read data is selected by the output multiplexer to obtain a preset number of output data including:
    将缓存分为f组,每组包括e个缓存,通过输出多路选择器从f组缓存中选出g组缓存,获取选出的g组缓存中缓存的g*e个数据。The cache is divided into f groups, each group includes e caches, and the g group cache is selected from the f group cache by the output multiplexer, and the g*e data cached in the selected g group cache is obtained.
  3. 如权利要求1所述的数据位宽转换方法,其中,所述通过至少一级输入多路选择器对输入数据进行选择,获取需要缓存的数据的步骤包括:The data bit width conversion method according to claim 1, wherein said step of selecting input data by at least one-stage input multiplexer to obtain data to be cached comprises:
    当通过多级输入多路选择器对输入数据进行选择时,通过寄存器在多级输入多路选择器之间存储中间数据。When the input data is selected by the multi-stage input multiplexer, intermediate data is stored between the multi-stage input multiplexers through the registers.
  4. 如权利要求1所述的数据位宽转换方法,其中,所述将需要缓存的数据写入设定数量的缓存中的步骤包括:The data bit width conversion method according to claim 1, wherein said step of writing data to be cached into a set number of buffers comprises:
    将需要缓存的数据中的有效数据写入设定数量的缓存中。Write valid data from the data that needs to be cached to a set number of caches.
  5. 如权利要求2所述的数据位宽转换方法,其中,e为缓存的设定数量与输出数据的预设数量之间最大公约数。The data bit width conversion method according to claim 2, wherein e is a greatest common divisor between the set number of buffers and the preset number of output data.
  6. 如权利要求1至5中任意一项所述的数据位宽转换方法,其中,所述 输出多路选择器为:分支数量消去了缓存的设定数量与输出数据的预设数量之间的公约数后的多路选择器。The data bit width conversion method according to any one of claims 1 to 5, wherein said The output multiplexer is a multiplexer after the number of branches eliminates the common divisor between the set number of buffers and the preset number of output data.
  7. 一种数据位宽转换装置,包括:A data bit width conversion device includes:
    获取模块,设置为:通过至少一级输入多路选择器对输入数据进行选择,获取需要缓存的数据;The obtaining module is configured to: select at least one level of the input multiplexer to obtain the data to be cached;
    写入模块,设置为:将需要缓存的数据写入设定数量的缓存中,其中,缓存的设定数量与输出数据的预设数量之间存在公约数关系;以及Writing a module, configured to: write data to be cached into a set number of caches, wherein there is a common divisor relationship between the set number of caches and the preset number of output data;
    选择模块,设置为:从缓存中读出对应的缓存的数据,并基于缓存的设定数量与输出数据的预设数量之间的公约数关系,通过输出多路选择器对读出的数据进行选择,获取预设数量的输出数据。The selection module is configured to: read the corresponding cached data from the cache, and perform the readout data through the output multiplexer based on a common divisor relationship between the set number of the cache and the preset number of output data. Select to get a preset amount of output data.
  8. 如权利要求7所述的装置,其中,缓存的设定数量为f*e,输出数据的预设数量为g*e,所述选择模块是设置为:The apparatus according to claim 7, wherein the set number of buffers is f*e, the preset number of output data is g*e, and the selection module is set to:
    将缓存分为f组,每组包括e个缓存,通过输出多路选择器从f组缓存中选出g组缓存,获取选出的g组缓存中缓存的g*e个数据。The cache is divided into f groups, each group includes e caches, and the g group cache is selected from the f group cache by the output multiplexer, and the g*e data cached in the selected g group cache is obtained.
  9. 如权利要求7所述的装置,其中,所述获取模块还设置为:The apparatus of claim 7, wherein the obtaining module is further configured to:
    当通过多级输入多路选择器对输入数据进行选择时,通过寄存器在多级输入多路选择器之间存储中间数据。When the input data is selected by the multi-stage input multiplexer, intermediate data is stored between the multi-stage input multiplexers through the registers.
  10. 如权利要求7所述的装置,其中,所述写入模块还设置为:The apparatus of claim 7 wherein said writing module is further configured to:
    将需要缓存的数据中的有效数据写入设定数量的缓存中。Write valid data from the data that needs to be cached to a set number of caches.
  11. 如权利要求8所述的装置,其中,e为缓存的设定数量与输出数据的预设数量之间的最大公约数。The apparatus of claim 8 wherein e is a greatest common divisor between the set number of buffers and the preset number of output data.
  12. 如权利要求7至11中任意一项所述的装置,其中,所述输出多路选择器为:分支数量消去了缓存的设定数量与输出数据的预设数量之间的公约数后的多路选择器。 The apparatus according to any one of claims 7 to 11, wherein the output multiplexer is such that the number of branches eliminates a common divisor between the set number of buffers and the preset number of output data Road selector.
  13. 一种数据位宽转换设备,包括:A data bit width conversion device comprising:
    至少一级输入多路选择器,其设置为对输入数据进行选择,获取需要缓存的数据;At least one level input multiplexer, configured to select input data to obtain data to be cached;
    缓存器,包括多个缓存单元,设置为缓存数据;以及a buffer, including a plurality of cache units, configured to cache data;
    输出多路选择器,设置为:基于缓存的设定数量与输出数据的预设数量之间的公约数关系对缓存的数据进行选择,获取预设数量的输出数据。The output multiplexer is configured to: select the cached data based on a common divisor relationship between the set number of buffers and the preset number of output data, and obtain a preset number of output data.
  14. 如权利要求13所述的设备,其中,缓存单元的数量为f*e,输出数据的预设数量为g*e,所述输出多路选择器是设置为:The apparatus of claim 13, wherein the number of cache units is f*e, the preset number of output data is g*e, and the output multiplexer is set to:
    将缓存单元分为f组,每组包括e个缓存单元,从f组缓存单元中选出g组缓存单元,获取选出的g组缓存单元中缓存的g*e个数据。The cache unit is divided into f groups, each group includes e cache units, and the g group cache unit is selected from the f group cache units, and the g*e data cached in the selected g group cache unit is obtained.
  15. 如权利要求13所述的设备,还包括寄存器,其设置为:The apparatus of claim 13 further comprising a register configured to:
    当通过多级输入多路选择器对输入数据进行选择时,在多级输入多路选择器之间存储中间数据。When the input data is selected by the multi-stage input multiplexer, intermediate data is stored between the multi-stage input multiplexers.
  16. 如权利要求14所述的装置,其中,e为缓存的设定数量与输出数据的预设数量之间的最大公约数。The apparatus of claim 14, wherein e is a greatest common divisor between the set number of buffers and the preset number of output data.
  17. 一种计算机可读存储介质,存储有程序指令,当该程序指令被执行时可实现权利要求1-6任一项所述的方法。 A computer readable storage medium storing program instructions that, when executed, can implement the method of any of claims 1-6.
PCT/CN2015/073508 2014-11-25 2015-03-02 Method, device and apparatus for converting data bit width WO2016082362A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410692358.5A CN105607888A (en) 2014-11-25 2014-11-25 Data bit width conversion method and device
CN201410692358.5 2014-11-25

Publications (1)

Publication Number Publication Date
WO2016082362A1 true WO2016082362A1 (en) 2016-06-02

Family

ID=55987845

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/073508 WO2016082362A1 (en) 2014-11-25 2015-03-02 Method, device and apparatus for converting data bit width

Country Status (2)

Country Link
CN (1) CN105607888A (en)
WO (1) WO2016082362A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109818603A (en) * 2018-12-14 2019-05-28 深圳市紫光同创电子有限公司 A kind of multiplexing method and bit width conversion circuit of bit width conversion circuit
CN115221082A (en) * 2022-07-18 2022-10-21 中国兵器装备集团自动化研究所有限公司 Data caching method and device and storage medium

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109002409A (en) * 2017-06-07 2018-12-14 深圳市中兴微电子技术有限公司 A kind of bit wide converting means and method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101166151A (en) * 2007-09-20 2008-04-23 北大方正集团有限公司 Method and device for transmitting data with different bits cross the clock domain
CN103714038A (en) * 2012-10-09 2014-04-09 中兴通讯股份有限公司 Data processing method and device
CN104021097A (en) * 2013-03-01 2014-09-03 中兴通讯股份有限公司 Data transmission method and device and direct memory access

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103186476B (en) * 2011-12-30 2017-07-28 上海贝尔股份有限公司 A kind of data cache method and device for multithread
CN103763063B (en) * 2014-01-21 2017-01-25 中国电子科技集团公司第五十八研究所 Gearbox circuit for reducing data bit width under condition of not changing Baud rate of data transmission and working method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101166151A (en) * 2007-09-20 2008-04-23 北大方正集团有限公司 Method and device for transmitting data with different bits cross the clock domain
CN103714038A (en) * 2012-10-09 2014-04-09 中兴通讯股份有限公司 Data processing method and device
CN104021097A (en) * 2013-03-01 2014-09-03 中兴通讯股份有限公司 Data transmission method and device and direct memory access

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109818603A (en) * 2018-12-14 2019-05-28 深圳市紫光同创电子有限公司 A kind of multiplexing method and bit width conversion circuit of bit width conversion circuit
CN115221082A (en) * 2022-07-18 2022-10-21 中国兵器装备集团自动化研究所有限公司 Data caching method and device and storage medium

Also Published As

Publication number Publication date
CN105607888A (en) 2016-05-25

Similar Documents

Publication Publication Date Title
JP6253514B2 (en) Processor
US9792044B2 (en) Decompression history buffer read/write pipelines
US8090921B2 (en) Processing device, computer system, and mobile apparatus
US20130019053A1 (en) Flash controller hardware architecture for flash devices
CN107526550B (en) Two-stage merging method based on log structure merging tree
US20120233441A1 (en) Multi-threaded instruction buffer design
JP4931828B2 (en) System and method for accessing memory using a combination of line access and word access
US8447957B1 (en) Coprocessor interface architecture and methods of operating the same
WO2016082362A1 (en) Method, device and apparatus for converting data bit width
US11693663B2 (en) Circular queue management with split indexes
US10585642B2 (en) System and method for managing data in a ring buffer
WO2016070668A1 (en) Method, device, and computer storage medium for implementing data format conversion
US11721373B2 (en) Shared multi-port memory from single port
US9058301B2 (en) Efficient transfer of matrices for matrix based operations
TW201303870A (en) Effective utilization of flash interface
CN109614145B (en) Processor core structure and data access method
JP6378775B2 (en) Reconfigurable device
CN108701102A (en) Direct memory access controller, method for reading data and method for writing data
KR101727407B1 (en) Lens distortion correction apparatus and operating method of the same
US11740900B2 (en) Associatively indexed circular buffer
US9043510B2 (en) Hardware streaming unit
EP2696280B1 (en) Method and device for data transmission between register files
JP2010061498A (en) Memory control device, semiconductor test apparatus and memory control method
CN115905038B (en) Cache data reading method, device, computer equipment and storage medium
US9396113B2 (en) Flexible configuration hardware streaming unit

Legal Events

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

Ref document number: 15863385

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15863385

Country of ref document: EP

Kind code of ref document: A1