CN102214082B - 余数系统的缩放装置 - Google Patents

余数系统的缩放装置 Download PDF

Info

Publication number
CN102214082B
CN102214082B CN201110130170.8A CN201110130170A CN102214082B CN 102214082 B CN102214082 B CN 102214082B CN 201110130170 A CN201110130170 A CN 201110130170A CN 102214082 B CN102214082 B CN 102214082B
Authority
CN
China
Prior art keywords
module
output
input
described module
temp
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
Application number
CN201110130170.8A
Other languages
English (en)
Other versions
CN102214082A (zh
Inventor
胡剑浩
马上
唐青
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
University of Electronic Science and Technology of China
Original Assignee
University of Electronic Science and Technology of China
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 University of Electronic Science and Technology of China filed Critical University of Electronic Science and Technology of China
Priority to CN201110130170.8A priority Critical patent/CN102214082B/zh
Publication of CN102214082A publication Critical patent/CN102214082A/zh
Application granted granted Critical
Publication of CN102214082B publication Critical patent/CN102214082B/zh
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/60Methods or arrangements for performing computations using a digital non-denominational number representation, i.e. number representation without radix; Computing devices using combinations of denominational and non-denominational quantity representations, e.g. using difunction pulse trains, STEELE computers, phase computers
    • G06F7/72Methods or arrangements for performing computations using a digital non-denominational number representation, i.e. number representation without radix; Computing devices using combinations of denominational and non-denominational quantity representations, e.g. using difunction pulse trains, STEELE computers, phase computers using residue arithmetic
    • G06F7/729Methods or arrangements for performing computations using a digital non-denominational number representation, i.e. number representation without radix; Computing devices using combinations of denominational and non-denominational quantity representations, e.g. using difunction pulse trains, STEELE computers, phase computers using residue arithmetic using representation by a residue number system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/60Methods or arrangements for performing computations using a digital non-denominational number representation, i.e. number representation without radix; Computing devices using combinations of denominational and non-denominational quantity representations, e.g. using difunction pulse trains, STEELE computers, phase computers
    • G06F7/72Methods or arrangements for performing computations using a digital non-denominational number representation, i.e. number representation without radix; Computing devices using combinations of denominational and non-denominational quantity representations, e.g. using difunction pulse trains, STEELE computers, phase computers using residue arithmetic
    • G06F7/727Modulo N arithmetic, with N being either (2**n)-1,2**n or (2**n)+1, e.g. mod 3, mod 4 or mod 5

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • General Engineering & Computer Science (AREA)
  • Complex Calculations (AREA)

Abstract

本发明公开了一种基为{2n,2n-1,2n-1-1}的余数系统(RNS)的2n缩放装置,包括模2n-1和模2n-1-1加法器、n比特普通二进制加法器、符号检测模块、选择器、以及循环移位、按位取反等一些简单的逻辑操作。该实现结构简单明了,通过在适当的位置增加流水寄存器使得关键路径变得很小,这对减小余数系统在数字信号处理系统应用中的关键路径时延起到积极的作用。

Description

余数系统的缩放装置
技术领域
本发明涉及信号处理领域,具体地说,涉及用于通信及信号处理中的基于余数系统(RNS)的数值缩放电路的实现结构。
背景技术
在数值运算过程中,大量的乘加运算将导致数据动态范围的扩大,从而导致溢出的发生。数值缩放是解决运算溢出最常用的方法之一。在二进制补码系统中,通常利用截位操作进行2n缩放,在VLSI实现时不需要任何额外的资源。类似地,在余数系统的应用中,对于那些乘加密集型的数字信号处理系统,也难免会发生溢出的情况。因此,也同样可以利用缩放操作抑制运算的溢出,使得运算在有限动态范围内正确进行。然而,由于余数系统中各余数分量之间是独立的,其缩放操作不再如二进制补码系统那样简单。因此,高效的余数系统的数值缩放是推动其在数字信号处理系统中应用的基本问题之一。
发明内容
本发明的目的是提供一种基为{2n,2n-1,2n-1-1}的余数系统的2n缩放装置,其能够在减小余数系统在数字信号处理系统应用中的关键路径时延起到积极作用。
具体而言,本发明的目的是提供一种基为{2n,2n-1,2n-1-1}的余数系统的2n缩放装置,其特征在于,该装置包括实现两个RNS整数的加法运算的模2n-1加法器模块,该模加法器为端回进位的方式;RNS符号检测模块,对余数基为{2n,2n-1,2n-1-1}的RNS整数进行符号判断,若为负数则输出“1”,否则输出“0”;选择器,根据符号检测模块的输出结果,判断是处理正数的缩放还是负数的缩放。
本发明的附加技术方案如下:
优选地,模2n-1加法器对两个n比特的数进行模加法运算。
优选地,余数基{2n,2n-1,2n-1-1}通过RNS符号检测模块确定RNS所表示整数的正负特性,若为负数则输出逻辑“1”,否则输出逻辑“0”。
优选地,RNS符号检测模块检测RNS数(x1,x2,x3),模块输出为“1”时,即处理负数是按照式(1)进行缩放,RNS符号检测模块输出为“0”时,即处理正数缩放是按照式(2)进行缩放。
y 1 = < y 3 + ( 2 n - 1 - 1 ) &times; < 2 ( y 3 - y 2 ) > 2 n - 1 + ( 2 n - 1 - 1 ) > 2 n y 2 = < x 2 - x 1 > 2 n - 1 y 3 = < ( x 3 - x 1 ) &times; 2 n - 2 > 2 n - 1 - 1 - - - ( 1 )
y 1 = < y 3 + ( 2 n - 1 - 1 ) &times; < 2 ( y 3 - y 2 ) > 2 n - 1 > 2 n y 2 = < x 2 - x 1 > 2 n - 1 y 3 = < ( x 3 - x 1 ) &times; 2 n - 2 > 2 n - 1 - 1 - - - ( 2 )
优选地,计算y1的输入数据采用y2和y3输出寄存器前的数据,y2_temp和y3_temp,将y2_temp按位取反,y3_temp高位扩0为n位,两者一并输入模2n-1加法器,所得结果循环右移n-1位,记为y1_temp1,取y1_temp1低1位,与y3_temp拼接为n位,所得结果为y1_temp2,其中y1_temp1的低1位作为y1_temp2的最低位,y1_temp1按位取反后与选择器的输出相加结果,记为y1_temp3,y1_temp2与y1_temp3相加,取结果的低7位即为y1的值,并通过一级寄存器后输出,其中选择器根据符号检测的结果来0或2n-1-1,其中正数选择0,负数选择2n-1-1,计算y2的是模块201;计算y3的是模块202;模块203实现的操作,模块206为一级流水寄存器,模块207为三级流水寄存器,用于保证整个结构的时序的正确性。
本发明的有益效果如下:结构简单明了,还可以进一步地通过在适当的位置增加流水寄存器使得关键路径变得很小,这对减小余数系统在数字信号处理系统应用中的关键路径时延起到积极的作用。
附图说明
图1是基为{2n,2n-1,2n-1-1}的余数系统的2n缩放基本实现结构视图。
图2是基为{2n,2n-1,2n-1-1}的余数系统的2n缩放具体实现结构视图。
图3是基为{2n,2n-1,2n-1-1}的符号检测模块视图。
图4是模2n-1加法器视图。
图5是模2n-1加法器所需的基本模块视图。
图6是7比特的一种前缀运算结构视图。
具体实施方式
图1示出了基为{2n,2n-1,2n-1-1}的余数系统的2n缩放基本实现结构。RNS数(x1,x2,x3)对应的十进制数如果为负数,则按式(1)对其进行2n缩放;否则按式(2)进行缩放。从数学表达式来看,式(1)与式(2)的唯一区别在于:在计算y1时,式(1)比式(2)多一项(2n-1-1)。101实现RNS数的符号检测,102用于计算y3,103用于计算y2。y1的计算需要用到y2和y3的信息,以及符号检测的结果。模块104—108用于计算y1
图2示出了基为{2n,2n-1,2n-1-1}的余数系统的2n缩放具体实现结构。计算y1需要用到y2和y3的信息,为了使最后三组数据同时输出,计算y1的输入数据采用y2和y3输出寄存器前的数据,即图2中的y2_temp和y3_temp。将y2_temp按位取反,y3_temp高位扩0为n位,两者一并输入模2n-1加法器,所得结果循环右移n-1位,记为y1_temp1,取y1_temp1低1位,与y3_temp拼接为n位,所得结果为y1_temp2,其中y1_temp1的低1位作为y1_temp2的最低位。y1_temp1按位取反后与选择器MUX的输出相加结果,记为y1_temp3。y1_temp2与y1_temp3相加,取结果的低7位即为y1的值,并通过一级寄存器后输出。其中MUX根据符号检测的结果来0或2n-1-1,其中正数选择0,负数选择2n-1-1。201和103一样用于计算y2;202与102一样,用于计算y3;203实现
Figure GDA00003019112200031
的操作。206为一级流水寄存器,207为三级流水寄存器。
图3示出了基为{2n,2n-1,2n-1-1}的符号检测模块。{2n,2n-1,2n-1-1}的动态范围为[0,M-1],其中M=2n×(2n-1)×(2n-1-1)。RNS数(x1,x2,x3)对应的十进制数X与M/2比较,如果X≥M/2,则为负数;否则为非负数。根据新中国剩余定理II,可以先计算出一个中间结果X2和xx,如式(3)和式(4)所示:
X 2 = x 3 + ( 2 n - 1 - 1 ) &times; < ( 2 n - 3 ) &times; ( x 2 - x 3 ) > 2 n - 1 = x 3 + ( 2 n - 1 - 1 ) &times; < ( 2 n - 1 - 2 ) &times; ( x 2 - x 3 ) > 2 n - 1 = x 3 + ( 2 n - 1 - 1 ) &times; < 2 &times; ( x 3 - x 2 ) > 2 n - 1 - < 2 &times; ( x 3 - x 2 ) > 2 n - 1 - - - ( 3 )
xx = < ( 2 n + 1 ) &times; ( X 1 - X 2 ) > 2 n = < ( 2 n + 1 ) &times; ( X 1 - X 2 ) > 2 n = < 2 n ( X 1 - X 2 ) + ( X 1 - X 2 ) > 2 n - - - ( 4 )
其中301完成式(3)的操作,302实现式(4)的操作。303是一个n比特的比较器,304为一级流水寄存器。
图4示出了模2n-1加法器。该模加法器采用端回进位的方式进行设计。401用于对输入数据做预处理。402用于实现前缀运算。403是一个或门,用来得到端回进位位。404和405为数据后处理模块,分别用于修正各级的进位位和计算最后的输出结果。
图5示出了模2n-1加法器实现结构所需的基本模块。501实现式(5)的操作:
g i = a i b i p i = a i &CirclePlus; b i - - - ( 5 )
其中gi为ai和bi相与的结果,为ai和bi的进位产生信息;pi为ai和bi做异或的结果,为ai和bi的进位传播信息。502实现式(6)的操作:
g i &prime; = g i + 1 + p i + 1 g i p i &prime; = p i + 1 p i . - - - ( 6 )
503实现式(7)的操作:
ci=gi-1+pi-1cout(7)
504实现式(8)的操作:
s i = p i &CirclePlus; c i - - - ( 8 )
其中si(i=0,1,L,n-1)为最后的输出信息。
图6示出了7比特的一种前缀运算模块。601为Buffer,只用来缓存数据,不对数据进行其它操作。602即为502,实现式(6)的操作。
本说明书中公开的所有特征,或公开的所有方法或过程中的步骤,除了互相排斥的特征和/或步骤以外,均可以以任何方式组合。
本说明书(包括任何附加权利要求、摘要和附图)中公开的任一特征,除非特别叙述,均可被其他等效或具有类似目的的替代特征加以替换。即,除非特别叙述,每个特征只是一系列等效或类似特征中的一个例子而已。
本发明并不局限于前述的具体实施方式。本发明扩展到任何在本说明书中披露的新特征或任何新的组合,以及披露的任一新的方法或过程的步骤或任何新的组合。

Claims (2)

1.一种余数系统的缩放装置,是基为{2n,2n-1,2n-1-1}的余数系统的2n缩放装置,其特征在于,该装置包括:模块101、模块102、模块103、模块104、模块105、模块106、模块107以及模块108;其中所述模块103、模块104中包括实现两个RNS整数的加法运算的模2n-1加法器模块,用于对两个n比特的数进行模加法运算,所述模2n-1加法器模块为端回进位的方式;所述模块101为RNS符号检测模块,对余数基为{2n,2n-1,2n-1-1}的RNS整数(x1,x2,x3)进行符号判断,若为负数则输出“1”,否则输出“0”;所述模块102用于计算输出y3,其输入为x1和x3,具体操作为
Figure FDA0000383138640000012
;所述模块103用于计算输出y2,其输入为x1和x2,具体操作为x2-x12 n -1;所述模块104的输入为y2和y3,具体操作为
Figure FDA0000383138640000011
;所述模块105输入为模块104的输出,具体操作为乘以(2n-1-1);所述模块107的两个输入分别为所述模块105的输出和y3,对两个输入进行模2n加法操作;所述模块106的输入为所述模块107的输出,对输入加上(2n-1-1)后进行模2n加法操作;所述模块108为选择器模块,根据所述模块101的输出结果,判断是处理正数的缩放还是负数的缩放,处理负数的缩放选择所述模块106的输出作为输出y1,处理正数的缩放选择所述模块107的输出作为输出y1
2.根据权利要求1所述的余数系统的缩放装置,其特征在于,计算y1的输入数据采用y2和y3输出寄存器前的数据,y2_temp和y3_temp,将y2_temp按位取反,y3_temp高位扩0为n位,两者一并输入模2n-1加法器,所得结果循环右移n-1位,记为y1_temp1,取y1_temp1低1位,与y3_temp拼接为n位,所得结果为y1_temp2,其中y1_temp1的低1位作为y1_temp2的最低位,y1_temp1按位取反后与选择器的输出相加结果,记为y1_temp3,y1_temp2与y1_temp3相加,取结果的低7位即为y1的值,并通过一级寄存器后输出,其中选择器根据符号检测的结果来选择0或2n-1-1,其中正数选择0,负数选择2n-1-1。
CN201110130170.8A 2011-05-19 2011-05-19 余数系统的缩放装置 Expired - Fee Related CN102214082B (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110130170.8A CN102214082B (zh) 2011-05-19 2011-05-19 余数系统的缩放装置

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110130170.8A CN102214082B (zh) 2011-05-19 2011-05-19 余数系统的缩放装置

Publications (2)

Publication Number Publication Date
CN102214082A CN102214082A (zh) 2011-10-12
CN102214082B true CN102214082B (zh) 2014-04-09

Family

ID=44745405

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110130170.8A Expired - Fee Related CN102214082B (zh) 2011-05-19 2011-05-19 余数系统的缩放装置

Country Status (1)

Country Link
CN (1) CN102214082B (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105183425B (zh) * 2015-08-21 2017-09-01 电子科技大学 一种具有高精度低复杂度特性的固定位宽乘法器

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101552610A (zh) * 2009-05-13 2009-10-07 上海理工大学 数据转换系统的后向数值转换模块及实现方法
CN101552604A (zh) * 2009-05-13 2009-10-07 上海理工大学 数据转换系统的前向数值转换模块及实现方法

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101552610A (zh) * 2009-05-13 2009-10-07 上海理工大学 数据转换系统的后向数值转换模块及实现方法
CN101552604A (zh) * 2009-05-13 2009-10-07 上海理工大学 数据转换系统的前向数值转换模块及实现方法

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
马上 等.以{2n-1,2n,2n+1}为基的余数系统2n高性能缩放.《电子科技大学学报》.2010,第39卷(第2期),306-310. *

Also Published As

Publication number Publication date
CN102214082A (zh) 2011-10-12

Similar Documents

Publication Publication Date Title
US20100235417A1 (en) Circuit and method converting boolean and arithmetic masks
CN112099761B (zh) 基于改进的二进制左移模逆算法的装置及其控制方法
KR20200134281A (ko) 추계학적 반올림 로직
CN102214082B (zh) 余数系统的缩放装置
CN107885486B (zh) 一种基于查找树的复合有限域求逆装置
JP3003467B2 (ja) 演算装置
CN108809323B (zh) 循环冗余校验码的生成方法和装置
CN100517214C (zh) 一种实现二进制多项式运算的硬件配置方法及硬件系统
CN113672196B (zh) 一种基于单数字信号处理单元的双乘法计算装置和方法
CN112764713B (zh) 随机数的生成方法和装置
JP5225115B2 (ja) Naf変換装置
CN102214083B (zh) 余数系统的后向转换方法和装置
JP2018097864A (ja) リーディングゼロ予想
US9032009B2 (en) Multiplier circuit
WO2007083377A1 (ja) パリティ生成回路、計数回路および計数方法
US8933731B2 (en) Binary adder and multiplier circuit
US6138134A (en) Computational method and apparatus for finite field multiplication
KR100875928B1 (ko) 고속 리드-솔로몬 복호기의 수정 유클리드 알고리즘 연산회로 및 그 방법
RU2562411C1 (ru) Устройство для вычисления модуля комплексного числа
KR100901280B1 (ko) 모듈러 3 연산 장치 및 방법
CN109343825B (zh) 一种约翰逊计数器装置
CN107533455B (zh) 增量/减量装置和方法
JP2009267606A (ja) 演算器
Petrovsky et al. RISC-V hardware modification for M-sequences generation
CN114895868A (zh) 基于两位商计算的除法运算单元及除法器

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20140409

CF01 Termination of patent right due to non-payment of annual fee