Overview of Residue Number System (RNS) for Advanced VLSI Design and VLSI Signal Processing 11-30-2002 NTUEE 吳安宇.

Slides:



Advertisements
Similar presentations
Mathematics of Cryptography Part II: Algebraic Structures
Advertisements

CENG536 Computer Engineering department Çankaya University.
CSE 246: Computer Arithmetic Algorithms and Hardware Design Instructor: Prof. Chung-Kuan Cheng Winter 2004 Lecture 2.
CSE115/ENGR160 Discrete Mathematics 03/13/12 Ming-Hsuan Yang UC Merced 1.
Number Theory and Cryptography
CENG536 Computer Engineering Department Çankaya University.
Kavita Hatwal Fall The decimal system, also called the base 10 number system is based on ten numbers: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. All the numbers.
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
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.
NEGATIVE BINARY NUMBER – Digital Circuit 1 Choopan Rattanapoka.
Prepared by: Hind J. Zourob Heba M. Matter Supervisor: Dr. Hatem El-Aydi Faculty Of Engineering Communications & Control Engineering.
Connecting with Computer Science 2 Objectives Learn why numbering systems are important to understand Refresh your knowledge of powers of numbers Learn.
Chapter 9 Mathematics of Cryptography Part III: Primes and Related Congruence Equations Copyright © The McGraw-Hill Companies, Inc. Permission required.
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.
MATH 224 – Discrete Mathematics
Data Representation – Binary Numbers
Chapter 2 Number Systems + Codes. Overview Objective: To use positional number systems To convert decimals to binary integers To convert binary integers.
Floating Point. Agenda  History  Basic Terms  General representation of floating point  Constructing a simple floating point representation  Floating.
Topic: Arithmetic Circuits Course: Digital Systems Slide no. 1 Chapter # 5: Arithmetic Circuits.
Logic Design Dr. Yosry A. Azzam. Binary systems Chapter 1.
Reconfigurable Computing - Multipliers: Options in Circuit Design John Morris Chung-Ang University The University of Auckland ‘Iolanthe’ at 13 knots on.
CE1111 :Digital Logic Design lecture 01 Introduction Dr. Atef Ali Ibrahim.
Mohammad Reza Najafi Main Ref: Computer Arithmetic Algorithms and Hardware Designs (Behrooz Parhami) Spring 2010 Class presentation for the course: “Custom.
Number Representation
Lecture notes Reading: Section 3.4, 3.5, 3.6 Multiplication
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
School of Computer and Communication Engineering, UniMAP Mohd ridzuan mohd nor DKT 122/3 - DIGITAL SYSTEM I Chapter.
DIGITAL SYSTEMS Number systems & Arithmetic Rudolf Tracht and A.J. Han Vinck.
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.
CSC 331: DIGITAL LOGIC DESIGN COURSE LECTURER: E. Y. BAAGYERE. CONTACT: LECTURE TIME: 15:40 – 17:45 hrs. VENUE: SP-LAB.
ECE DIGITAL LOGIC LECTURE 3: DIGITAL COMPUTER AND NUMBER SYSTEMS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2016, 01/19/2016.
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,
S 2/e C D A Computer Systems Design and Architecture Second Edition© 2004 Prentice Hall Chapter 6 Overview Number Systems and Radix Conversion Fixed point.
DATA REPRESENTATION Data Types Complements Fixed Point Representations
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)
Agenda Review:  Relation Properties Lecture Content:  Divisor and Prime Number  Binary, Octal, Hexadecimal Review & Exercise.
Floating Point Arithmetic – Part I
MATH Lesson 2 Binary arithmetic.
Number-Theoretic Algorithms
Addition and Subtraction
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
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
Chapter 1 Number Systems, Number Representations, and Codes
Brief Overview of Residue Number System (RNS)
Unconventional Fixed-Radix Number Systems
Modular Arithmetic and Change of Base
Introduction to Cryptography
UNIVERSITY OF MASSACHUSETTS Dept
Digital Systems and Binary Numbers
COMS 161 Introduction to Computing
Presentation transcript:

Overview of Residue Number System (RNS) for Advanced VLSI Design and VLSI Signal Processing NTUEE 吳安宇

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 five, the remainder is 3, If we count them by seven, 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 HAFA

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

Any integer in the residue class Z M has a unique L-tuple representation given by where X i =X mod p i and is called the ith residue. Definition

X1X X2X → → → → → → → → → → → → → → → → → → X1X X2X X1X X2X X X X Example

X → → → → → → → → → → → → → X1X X2X X3X X → → → → → → → → → → → → → X3X X → → → → → → → → → → → → → X3X X → → → → → → → → → → → → → X3X X → → → → → → → → → → → → → X3X X1X X1X X1X X1X X2X X2X X2X X2X Example

Signed Representation For signed RNS, any integer in (-M/2, M/2], has a unique RNS L-tuple representation where x i =(X mod p i ) if X>0, and (M-|X|) mod p i otherwise. X1X X2X → → → → → → → → → → → → → → → X1X X2X X1X X2X X X X

Operation

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) Operation (Example)

X → → → → → → → → → → → → → X1X X2X X3X X → → → → → → → → → → → → → X3X X → → → → → → → → → → → → → X3X X → → → → → → → → → → → → → X3X X → → → → → → → → → → → → → X3X X1X X1X X1X X1X X2X X2X X2X X2X (3,4,5) Modulo Set

Efficient and rapid implementation of the operation (X i o Y i ) mod p i must be found. Only for the case where p i =2^n can be easily implemented in conventional system. RAM or ROM Table Lookup Z i = (X i o Y i ) mod p i X i (n bits) Y i (n bits) Z i (n bits) 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

2 j mod p i j=4 i=1 i=2 j=3j=2j=1j= p i -(2 5 mod p i ) i=1 i=2 3 3

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) Residue-to-decimal Conversion

Multiplicative Inverse The multiplicative inverse of g of modulo p i is denoted as g i -1 and satisfies Example: P i =5 g g i -1 0  g P i =6 0   3  4  5 5 g g i -1 P i =7 0 

Mixed Radix Conversion RNS MRC The MRC representation is given by where v 1 =1, v 2 =p 1, v 3 =p 1 p 2, v 4 =p 1 p 2 p 3, …

Mixed radix conversion

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

Block Diagram of MRC p p M M p 1L -1 M p M p 2L -1 M p L-1,L -1 M

Chinese Remainder Theorem where and s i -1 is the multiplicative inverse of s i mod p i, so that

Chinese Remainder Theorem X 1 s 1 -1 mod p 1 X 2 s 2 -1 mod p 2 X L s L -1 mod p L mod M sLsL s2s2 s1s1

Chinese Remainder Theorem 1*2mod 3 0*3mod 4 4*3 mod mod 60

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 domain. RNS is not closed under division, since the RNS is an integer system. It is an 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 can be easily to implemented when scaling factor is: –Power of two (2 n ) in 2’complement. –Product of one or more of the moduli in RNS.

Overflow Detection A special form of magnitude comparison. Can be avoided by using scaling operation during run-time.

Applications High-speed systems (**) FPGA-based solution Filtering (FIR, IIR) systems Linear transformations Adaptive systems

References [1] A good tutorial paper of RNS: Fred J. Taylor, "Residue Arithmetic: A Tutorial with Examples", IEEE Trans. on Computer, pp. 50~62, May [2] A good paper collections for RNS: M. A. Soderstrand, W. K. Jenkins, G. A. Jullien, F. J. Taylor (eds.), Residue Number System Arithmetic: Modern Applications in digital Signal Processing, IEEE Press, New York, 1986.