Brief Overview of Residue Number System (RNS)

Slides:



Advertisements
Similar presentations
CENG536 Computer Engineering department Çankaya University.
Advertisements

CENG536 Computer Engineering Department Çankaya University.
MOHD. YAMANI IDRIS/ NOORZAILY MOHAMED NOOR 1 Lecture 3 Number System.
Improving Power And Performance of Embedded Applications Using Residue Number System Compilers For Embedded Systems Rooju Chokshi.
ECE 331 – Digital System Design
ECE 301 – Digital Electronics Number Systems and Conversion, Binary Arithmetic, and Representation of Negative Numbers (Lecture #10) The slides included.
COMPUTER ARCHITECTURE & OPERATIONS I Instructor: Hao Ji.
DIGITAL SYSTEMS TCE1111 Representation and Arithmetic Operations with Signed Numbers Week 6 and 7 (Lecture 1 of 2)
Number System and Codes
Computer Arithmetic Integers: signed / unsigned (can overflow) Fixed point (can overflow) Floating point (can overflow, underflow) (Boolean / Character)
Number Systems Lecture 02.
Mehmet Can Vuran, Instructor University of Nebraska-Lincoln Acknowledgement: Overheads adapted from those provided by the authors of the textbook.
Coping With the Carry Problem 1. Limit Carry to Small Number of Bits Hybrid Redundant Residue Number Systems 2.Detect the End of Propagation Rather Than.
Data Representation – Binary Numbers
Number-Theoretic Algorithms
Chapter 2 Number Systems + Codes. Overview Objective: To use positional number systems To convert decimals to binary integers To convert binary integers.
Reconfigurable Computing - Multipliers: Options in Circuit Design John Morris Chung-Ang University The University of Auckland ‘Iolanthe’ at 13 knots on.
46 Number Systems Problem: Implement simple pocket calculator Need: Display, adders & subtractors, inputs Display: Seven segment displays Inputs: Switches.
ECE 331 – Digital System Design
Mohammad Reza Najafi Main Ref: Computer Arithmetic Algorithms and Hardware Designs (Behrooz Parhami) Spring 2010 Class presentation for the course: “Custom.
ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU CORDIC (Coordinate rotation digital computer) Ref: Y. H. Hu, “CORDIC based VLSI architecture.
Computer Architecture Lecture 32 Fasih ur Rehman.
Applications of Distributed Arithmetic to Digital Signal Processing:
Data Representation in Computer Systems. 2 Signed Integer Representation The conversions we have so far presented have involved only positive numbers.
Chinese Remainder Theorem. How many people What is x? Divided into 4s: remainder 3 x ≡ 3 (mod 4) Divided into 5s: remainder 4 x ≡ 4 (mod 5) Chinese Remainder.
Unconventional Fixed-Radix Number Systems
DIGITAL SYSTEMS Number systems & Arithmetic Rudolf Tracht and A.J. Han Vinck.
Overview of Residue Number System (RNS) for Advanced VLSI Design and VLSI Signal Processing NTUEE 吳安宇.
EPFL-IC-IIF-LACAL Marcelo E. Kaihara April 27 th, 2007 Algorithms for public-key cryptology Montgomery Arithmetic.
9.1 Primes and Related Congruence Equations 23 Sep 2013.
ECE DIGITAL LOGIC LECTURE 3: DIGITAL COMPUTER AND NUMBER SYSTEMS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2016, 01/19/2016.
ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU Multirate Processing of Digital Signals (II): Short-Length FIR Filter VLSI Signal Processing.
Reconfigurable Computing - Options in Circuit Design John Morris Chung-Ang University The University of Auckland ‘Iolanthe’ at 13 knots on Cockburn Sound,
ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU Brief Overview of Residue Number System (RNS) VLSI Signal Processing 台灣大學電機系 吳安宇.
Reconfigurable Computing - Options in Circuit Design John Morris Chung-Ang University The University of Auckland ‘Iolanthe’ at 13 knots on Cockburn Sound,
DATA REPRESENTATION Data Types Complements Fixed Point Representations
VLSI SP Course 2001 台大電機吳安宇 1 Why Systolic Architecture ? H. T. Kung Carnegie-Mellon University.
Choosing RNS Moduli Assume we wish to represent 100, Values Standard Binary  lg 2 (100,000) 10  =   =17 bits RNS(13|11|7|5|3|2), Dynamic.
CORDIC (Coordinate rotation digital computer)
Unit I From Fundamentals of Logic Design by Roth and Kinney.
MATH Lesson 2 Binary arithmetic.
Unit 1 Introduction Number Systems and Conversion.
Cosc 2150: Computer Organization
Lecture 1: Introduction and Numbers
Addition and Subtraction
UNIVERSITY OF MASSACHUSETTS Dept
CORDIC (Coordinate rotation digital computer)
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
Advanced Algorithms Analysis and Design
Lecture 3.2: Public Key Cryptography II
Data Representation in Computer Systems
Overview of Residue Number System (RNS) for Advanced VLSI Design and VLSI Signal Processing NTUEE 吳安宇.
Chapter 3 Data Representation
CSE 575 Computer Arithmetic Spring 2003 Mary Jane Irwin (www. cse. psu
CHAPTER 4: Representing Integer Data
Reconfigurable Computing - Options in Circuit Design
Number Systems.
CSE 575 Computer Arithmetic Spring 2005 Mary Jane Irwin (www. cse. psu
Chapter 1 Number Systems, Number Representations, and Codes
ECE 331 – Digital System Design
Unconventional Fixed-Radix Number Systems
Modular Arithmetic and Change of Base
Introduction to Cryptography
UNIVERSITY OF MASSACHUSETTS Dept
Chapter 5 – Number Representation and Arithmetic Circuits
Digital Systems and Binary Numbers
Overview Part 1 – Design Procedure Part 2 – Combinational Logic
Number Systems Rayat Shikshan Sanstha’s
ECE 331 – Digital System Design
FFT VLSI Implementation
Presentation transcript:

Brief Overview of Residue Number System (RNS) VLSI Signal Processing 台灣大學電機系 吳安宇

Outline History Why RNS is needed ? Fundamental concepts in RNS. Conversion between Decimal and Residue. Conventional complex RNS Difficult arithmetic operations Applications

History The ancient study of the residue numbering system begins with a verse from a third-centry book, Suan-Ching, by Sun Tzu. We have things of which we do not know the number, If we count them by three, the remainder is 2, If we count them by fives, the remainder is 3, If we count them by sevens, the remainder is 2, How many things are there?

History We commemorate this contribution as the Chinese Remainder Theorem, or CRT. This theorem, as well as RNS, was set forth in the 19th by Carl Friedrich Gauss in his celebrated Disquisitiones Arithmetical.

Why RNS? It is a “carry-free” system that performs addition, substraction, and multiplication as parallel operations. FA FA FA FA HA

Definition The RNS is defined in terms of a set of relatively prime moduli. If P denotes the moduli set, then The dynamic range M is

Definition Any integer in the residue class ZM has a unique L-tuple representation given by where Xi=(X mod pi) and is called the ith residue.

Example X1 1 2 X2 3 4 → X 5 6 7 8 9 10 11 12 13 14

Example 4 5 6 7 8 9 10 11 1 2 3 X → X1 X2 X3 16 17 18 19 20 21 22 23 12 13 14 15 28 29 30 31 32 33 34 35 24 25 26 27 40 41 42 43 44 45 46 47 36 37 38 39 52 53 54 55 56 57 58 59 48 49 50 51

Sign Representation For signed RNS, any integer in (-M/2, M/2], has a unique RNS L-tuple representation where xi=(X mod pi) if X>0, and (M-|X|) mod pi otherwise. X1 1 2 X2 3 → X -6 -5 -4 -3 -2 -1 4 5

Operation

Operation (Example) 7(1, 3, 2 ) +3(0, 3, 3 ) 7(1, 3, 2 ) +3(0, 3, 3 ) 10(1 mod 3, 6 mod 4, 5 mod 5) = (1,2,0) 7(1, 3, 2 ) - 3(0, 3, 3 ) 4(1 mod 3, 0 mod 4, -1 mod 5) = (1,0,4) 7(1, 3, 2 ) *3(0, 3, 3 ) 21(0 mod 3, 9 mod 4, 6 mod 5) = (0,1,1)

Conversion Efficient and rapid implementation of the operation (Xi o Yi) mod pi must be found. Only for the case where pi=2n can be easily implemented in conventional system. Xi (n bits) RAM or ROM Table Lookup Zi = (Xi o Yi) mod pi Zi (n bits) Yi (n bits)

Decimal-to-residue Conversion To be competitive system, the speed of data acquisition and the accompanying decimal-to-residue conversion must be equally fast.

Decimal-to-residue Conversion 2j mod pi j=4 i=1 i=2 j=3 j=2 j=1 j=0 1 3 4 2 pi-(25mod pi)

Residue-to-decimal Conversion Generally speaking, the speed limitation of residue-to-decimal conversion is a problem in residue number system. The R/D problem can be solved in one of the following two ways: Mixed radix conversion (MRC) Chinese Remainder Theorem (CRT)

Multiplicative Inverse The multiplicative inverse of g of modulo pi is denoted as gi-1 and satisfies Example: Pi=5 g gi-1  1 2 3 4 g gi-1 Pi=6  1 2 3 4 5 g gi-1 Pi=7  1 2 4 3 5 6

Mixed Radix Conversion RNS MRC The MRC representation is given by where v1=1, v2=p1, v3=p1p2, v4=p1p2p3, …

Mixed Radix Conversion

Mixed Radix Conversion Use nesting subtractions and multiplicative inverse to make sequential conversion.

Block Diagram of MRC M M M M M M p12-1 p13-1 p23-1 p1L-1 p2L-1 pL-1,L-1 M

where si=M/pi and si-1 is the multiplicative Chinese Remainder Theorem where si=M/pi and si-1 is the multiplicative inverse of si mod pi, so that

Chinese Remainder Theorem X1 s1-1 mod p1 s1 X2 s2-1 mod p2 s2 mod M XL sL-1 mod pL sL

Chinese Remainder Theorem 1*2 mod 3 20 0*3 mod 4 15 mod 60 4*3 mod 5 12

Conventional Complex RNS A complex number Z is defined to be

Difficult Arithmetic Operations Magnitude comparison / Sign detection Division Base extension Scaling / Rounding / Truncation Overflow detection

Magnitude Comparison Sign Detection Not a weighted number system. Every digits are equally important. The problem makes the RNS-based signal processors inefficient.

Division Blend of nested subtractions and magnitude comparisons, so it is more difficult in the RNS. RNS is not closed under division, since the RNS is an integer system, it is. Slow, high-overhead operation and should be avoided in RNS.

Base Extension Increase the dynamic range Increase the resolution. R/D and D/R conversions are needed. R/D conversion L - tuple RNS D/R conversion K - tuple RNS Moduli extension

Scaling / Rounding / Truncation Prevent dynamic-range overflow. A special form of division. The scaling operation is easily to implement when scaling factor is: power of two (2n) in 2’complement. product of one or more of the moduli in RNS.

Overflow Detection Take the form of magnitude comparison. To be avoided by using scaling operation during run-time.

Applications Filtering (FIR, IIR) Adaptive system Linear transformations