RESIDUE NUMBER SYSTEM. (introduction to hardware aspects) Dr. Danila Gorodecky

Similar documents
Solutions to Exam 1. Problem 1. a) State Fermat s Little Theorem and Euler s Theorem. b) Let m, n be relatively prime positive integers.

Exam 1 7 = = 49 2 ( ) = = 7 ( ) =

The Chinese Remainder Theorem

MATH 324 Elementary Number Theory Solutions to Practice Problems for Final Examination Monday August 8, 2005

Is 1 a Square Modulo p? Is 2?

MT 430 Intro to Number Theory MIDTERM 2 PRACTICE

SIZE OF THE SET OF RESIDUES OF INTEGER POWERS OF FIXED EXPONENT

The congruence relation has many similarities to equality. The following theorem says that congruence, like equality, is an equivalence relation.

Number Theory - Divisibility Number Theory - Congruences. Number Theory. June 23, Number Theory

Quadratic Residues. Legendre symbols provide a computational tool for determining whether a quadratic congruence has a solution. = a (p 1)/2 (mod p).

Number Theory: Modulus Math

Modular arithmetic Math 2320

Introduction to Number Theory 2. c Eli Biham - November 5, Introduction to Number Theory 2 (12)

Modular Arithmetic. claserken. July 2016

Overview. The Big Picture... CSC 580 Cryptography and Computer Security. January 25, Math Basics for Cryptography

Evolutionary Circuit Design: Information Theory Perspective on Signal Propagation

p 1 MAX(a,b) + MIN(a,b) = a+b n m means that m is a an integer multiple of n. Greatest Common Divisor: We say that n divides m.

Distribution of Primes

Professor Fearing EECS150/Problem Set 10 Solution Fall 2013 Released December 13, 2013

CMPSCI 250: Introduction to Computation. Lecture #14: The Chinese Remainder Theorem David Mix Barrington 24 February 2012

Math 124 Homework 5 Solutions

SQUARING THE MAGIC SQUARES OF ORDER 4

Groups, Modular Arithmetic and Geometry

A new family of highly linear CMOS transconductors based on the current tail differential pair

Design and Analysis of RNS Based FIR Filter Using Verilog Language

IMPROVED POLYNOMIAL TRANSITION REGIONS ALGORITHM FOR ALIAS-SUPPRESSED SIGNAL SYNTHESIS

Collection of rules, techniques and theorems for solving polynomial congruences 11 April 2012 at 22:02

A New RNS 4-moduli Set for the Implementation of FIR Filters. Gayathri Chalivendra

Economics of Strategy (ECON 4550) Maymester 2015 Foundations of Game Theory

1.6 Congruence Modulo m

Calculators will not be permitted on the exam. The numbers on the exam will be suitable for calculating by hand.

6. Find an inverse of a modulo m for each of these pairs of relatively prime integers using the method

An Overview of PAPR Reduction Optimization Algorithm for MC-CDMA System

CMPSCI 250: Introduction to Computation. Lecture #14: The Chinese Remainder Theorem David Mix Barrington 4 October 2013

Introduction. and Z r1 Z rn. This lecture aims to provide techniques. CRT during the decription process in RSA is explained.

University of Twente

An Efficient VLSI Architecture Parallel Prefix Counting With Domino Logic Λ

Discrete Square Root. Çetin Kaya Koç Winter / 11

Discrete Math Class 4 ( )

Matching Book-Spine Images for Library Shelf-Reading Process Automation

Random Access Compressed Sensing in Underwater Sensor Networks

LUCAS-SIERPIŃSKI AND LUCAS-RIESEL NUMBERS

Grade 6/7/8 Math Circles April 1/2, Modular Arithmetic

Digital Finite Impulse Response Filter based on Residue Number System

INTERNET PID CONTROLLER DESIGN: M. Schlegel, M. Čech

Lecture 8. Outline. 1. Modular Arithmetic. Clock Math!!! 2. Inverses for Modular Arithmetic: Greatest Common Divisor. 3. Euclid s GCD Algorithm

MTH 3527 Number Theory Quiz 10 (Some problems that might be on the quiz and some solutions.) 1. Euler φ-function. Desribe all integers n such that:

b) Find all positive integers smaller than 200 which leave remainder 1, 3, 4 upon division by 3, 5, 7 respectively.

Data security (Cryptography) exercise book

Design of Delay Efficient PASTA by Using Repetition Process

Example Enemy agents are trying to invent a new type of cipher. They decide on the following encryption scheme: Plaintext converts to Ciphertext

Improvements of Bayesian Matting

High-Speed RSA Crypto-Processor with Radix-4 4 Modular Multiplication and Chinese Remainder Theorem

Example Enemy agents are trying to invent a new type of cipher. They decide on the following encryption scheme: Plaintext converts to Ciphertext

Degree project NUMBER OF PERIODIC POINTS OF CONGRUENTIAL MONOMIAL DYNAMICAL SYSTEMS

Semi Blind Channel Estimation: An Efficient Channel Estimation scheme for MIMO- OFDM System

Introduction to Modular Arithmetic

Solutions to Problem Set 6 - Fall 2008 Due Tuesday, Oct. 21 at 1:00

CHAPTER 5 INTERNAL MODEL CONTROL STRATEGY. The Internal Model Control (IMC) based approach for PID controller

A Novel, Robust DSP-Based Indirect Rotor Position Estimation for Permanent Magnet AC Motors Without Rotor Saliency

Spiking Neural Networks for Real-Time Infrared Images Processing in Thermo Vision Systems

The Multi-Focus Plenoptic Camera

Numbers (8A) Young Won Lim 5/22/17

Parameter Controlled by Contrast Enhancement Using Color Image

Numbers (8A) Young Won Lim 6/21/17

Efficient Importance Sampling for Monte Carlo Simulation of Multicast Networks

Numbers (8A) Young Won Lim 5/24/17

Number-Theoretic Algorithms

Scenarios for Development, Test and Validation of Automated Vehicles

Uplink Scheduling in Wireless Networks with Successive Interference Cancellation

Design of PID Controller Based on an Expert System

FEATURE EXTRACTION FOR SPEECH RECOGNITON

Analysis of Electronic Circuits with the Signal Flow Graph Method

Advancing Test in Coherent Transmission Systems. Daniel van der Weide

Escaping from a Labyrinth with One-way Roads for Limited Robots

Physics. Valve Electronics.

Postprocessed time-delay interferometry for LISA

Figure 1 7-chip Barker Coded Waveform

Modular Arithmetic: refresher.

D-BLAST Lattice Codes for MIMO Block Rayleigh Fading Channels Λ

MAT Modular arithmetic and number theory. Modular arithmetic

Analysis of Pseudorange-Based DGPS after Multipath Mitigation

LECTURE 9: QUADRATIC RESIDUES AND THE LAW OF QUADRATIC RECIPROCITY

NUMBER THEORY AMIN WITNO

Servo Mechanism Technique based Anti-Reset Windup PI Controller for Pressure Process Station

An elementary study of Goldbach Conjecture

RICIAN FADING DISTRIBUTION FOR 40GHZ CHANNELS

The Gini Coefficient: An Application to Greece

THE HELMHOLTZ RESONATOR TREE

Control of Grid Integrated Voltage Source Converters under Unbalanced Conditions

Performance Analysis of MIMO System using Space Division Multiplexing Algorithms

1 = 3 2 = 3 ( ) = = = 33( ) 98 = = =

The covering congruences of Paul Erdős. Carl Pomerance Dartmouth College

Perceptual Uniform Simulation for Tang Tomb Mural Inapinting by Camera Array

Chapter 7 Local Navigation: Obstacle Avoidance

Secondary Transceiver Design in the Presence of Frequency Offset between OFDM-based Primary and Secondary Systems

MLSE Diversity Receiver for Partial Response CPM

A Multi-View Nonlinear Active Shape Model Using Kernel PCA

Calculators will not be permitted on the exam. The numbers on the exam will be suitable for calculating by hand.

Multi-TOA Based Position Estimation for IR-UWB

Transcription:

RESIDUE NUMBER SYSTEM (introduction to hardware asects) Dr. Danila Gorodecky danila.gorodecky@gmail.com

Terminology Residue number system (RNS) (refers to Chinese remainder theorem) Residue numeral system (RNS) Modular arithmetic (MA) (refers to moduli X (mod P) ) Comlete residue system Clock arithmetic (refers to -hour arrow clock in which numbers "wra around uon reaching the modulo)

Milestones Chinese mathematician Sunzi Suanjing roosed a theorem (Chinese remainder theorem) in the 3rd century AD; the theorem was generalized by Chinese mathematician Qin Jiushao in 47; first real imlementation of the theorem by German mathematician Carl Gauss in 80 "to find the years that have a certain eriod number with resect to the solar and lunar cycle and the Roman indiction ; first imlementation in comuter science by Czechoslovakian engineer Miro Valach in 955 Origin of the code and number system of remainder classes, Stroje Na ZracovaniInformaci, vol. 3, Nakl. CSAV, Prague.

Imlementation of RNS Processing of results of the Unified State Exam (utilized to entrance to University in Russia; Digital filternig with finite imulse resonse (FIR-filtering); Cryto system of Federal Reserve System of USA; Air Defense System (USA, Russia); crytograhy in Sace (Russia); Sace flight control (Russia) 4

Chinese remainder theorem Let s,,..., n are ositive integers (are often called as moduli) such, that greatest common divisor for a coule i j equals. Then the system, yx yx... mod mod yx n mod n has a simultaneous solution which is unique modulo,..., n, 5

Examle for the Theorem P 579 3 35 We can exress an arbitrary number definitely in the scoe from 0 to 34 Let s A00, hence A000 A00 A00 mod 5 mod 7 mod 9 and A 0,, in the RNS reresentation 6

NOT ositional numeral system RNS is not ositional numeral system 00(mod 5), 00(mod 7), 00(mod 9) (0,, ) 00 00(mod 7), 00(mod 9), 00(mod 5) (,, 0) 00 Binary system (0000) (0000) 00 5 0 0 7

Examle of the comutation in RNS P 579 3 AB003S 35 ) A0,, B3,6,4 ) A B 0 3 mod 5, 6 mod 7, 4 mod 9 3 mod 5, mod 7, 5 mod 9 3,,5 8

Y i 3) Examle of the comutation in RNS S SY S Y S3 Y3 r P P ki ; Y i (mod i ); i i r P S Y S Y S Y r P 3 3 a) 35 Y k 63 k 5 35 b) Y k 45 k 7 35 с) Y3 k3 35 k 9 3 63 k 5 (mod 5) and, then k and Y 6 k and, then and Y 5 45 (mod 7 35 k 3 (mod 9 7) 9) k 5 and, then k 3 8 andy 3 80 d) 35 r 35 36 8 5 5 80 r r, then 6 S 36 8 5 5 80 635 003 890 3

Exercises ) What is maximum bit range of A and B should be chosen for unambiguous reresentation A + B = S in RNS with moduli,3, and 5? P = * 3 * 5 = 45 0 S < 45 and S is -bit number. Hence, in order to reresent A + B = S, A and B should be limited -bit tules, when A and B both equal 077. ) What is maximum bit range of A, B, and C can be used for unambiguous reresentation A * B * C = R in RNS with moduli,3, and 5? P = * 3 * 5 = 45 0 S < 45 and S is -bit number. Hence, in order to reresent A * B * C = R, A, B, and C should be limited 4-bit tules, when A, B, and C equal. 0

Main advantage of RNS Significantly smaller ranges of numbers in arithmetic calculations than initial numbers

Examle of the comutation in RNS A B i i A { A, A, A3} (mod i ) A 0A34 A i B { B, B, B3} B (mod i ) B i 0B34 i i SSY SY S3Y 3rP Yi (mod i ) i Yi P i k i i,,3 k i, i r 0,,,...

X (mod P) hardware calculations in RNS X mod P A A Converter of A A g summator/multilier (mod ) S Converter of A ositional numbers to A A A g summator/multilier (mod ) S modular reresentation to S A g modular reresentation () A A summator/multilier (mod m ) S m ositional number () A g 3

4 Pielining aroach of X (mod P) calculations ) Pielining (iterative) aroach. It is based on the formula: A q P q P q P A Q P X 0 0......,,, x x x X...,,, P P P

50 Pielining aroach of X (mod P) calculations mod7 7Q Amod7 6 5 4 3 0 7 q6 7 q5 7 q4 7 q3 7 q 7 q 7 q0 Amod 7 Amod 7 50 6 3 mod 7 7Q A 7 7 Amod 76 mod 7 5

Recursive aroaches of calculation X (mod P) in hardware ) Recursive aroach. It is suitable for secial moduli, e.c. and X as x x x3... x x x, x,..., x X x, x,..., x X X... X X X3... n x, x,..., n 3 x,..., so X X X X... mod mod mod 3 {0, } Examle. X (mod P), where and X437 000 P 3 7 a) 000 0 0 0 mod7 000 mod 7 b) 00 00 mod 7 0 mod 7 3 mod 7 6

Recursive aroaches of calculation X (mod P) in hardware 3) It is suitable for an arbitrary modulo and is based on the next formula: X x X 0 0 3 x x x3 x4... mod P 3 x mod P x mod P x mod P x mod P... Examle. X (mod P), where 0 and 9x If If 3 X x, x,..., x P3 4 x, x, x3, x4,... {0,} 0 3 4 5 6 7 8 9 x x x3 x4 x5 x6 x7 x8 x9 x0 mod3 mod3 xmod34 x3mod38 x4mod36x5 mod3 mod38x mod33x mod33 x mod36 x mod3 6 0S3 3 Let s 7 X mod X mod X P 3S46 X 3 8 If If 9 0 mod 3 X P mod 3 X P 46S69 X 69S9 X 3 mod 3 X 030 (mod 3) 7

^n (mod P) calculation in hardware 4) X (mod P), where n P n n x, x,..., x, x,..., x mod X mod n n n x x,..., x mod n, n x, x, x3, x4,... {0,} X 000 000 0 P6 Examle. X (mod P), where and X 000 000 0mod 6 0 4 8

Exercises Using one of the considered techniques, calculate: ) 65536 (mod 3 ) 0? ) 65536 (mod 3 )? 3) (000000000) (mod 3 )? (000000000) (mod )? 4) with technique 3) 3

Arithmetic calculations in RNS Arithmetic calculations on moduli A A Converter of A A g summator/multilier (mod ) S Converter of A ositional numbers to A A A g summator/multilier (mod ) S modular reresentation to S A g modular reresentation () A A summator/multilier (mod m ) S m ositional number () A g 0

Arithmetic calculations in RNS Standard aroach of arithmetic calculations in RNS includes ) arithmetic calculations (A B=R, A+B=S, and etc., where A and B vary from 0 to P-); ) modulus function calculation (R (mod P), S (mod P), and etc.) Examle. A B=R (mod 7), hence A and B vary from 0 to 6. Lets A=5 and B=6. ) ) 56 30 0 30 (mod (00) 7) (0) ((0) (0)) (mod ((00) (00)) (mod 7) (mod 0 (mod 7) 7) 7) (mod (00)(mod 7) 7)

Arithmetic calculations in RNS 300 What is about P? ) A B R 600 ) R (mod 300 ) or Montgomery and a-la Montgomery multilication: Examle. (56) (mod 7) ((0) 4 (0) (mod 7) )(mod 7) (mod 7) (( 9(mod 7) (00)(mod 7) 3 (mod 7) 3 0 ) ( (mod 7) ))(mod 7) (mod 7) ( 4 )(mod 7) 0 (mod 7) ( )(mod 7)

Exercises ) How many rows and columns in the truth table of system of Boolean functions, which reresents A + B = R (mod 5)? ) How many rows and columns in the truth table of system of Boolean functions, which reresents A * B = R (mod 7)?

Backward conversion S S Y S Y... S m Y m r P A A Converter of A A g summator/multilier (mod ) S Converter of A ositional numbers to A A A g summator/multilier (mod ) S modular reresentation to S A g modular reresentation () A A summator/multilier (mod m ) S m ositional number () A g 4

S S Y S Y... Yi (mod i ) i S Y i m Y P Backward conversion i m k i r P ) multilication by a big number; ) big numbers summation; 3) comarison Examle. A B in RNS with moduli set P,, } {3,3,33} { 3 R s 6864 s 373 s3 6896 r 3736 5

Exercises Multily 9 * 03 in RNS with moduli set {, 3, 5, 6}?

Electronic Design Automation (EDA) tools Synosys executes X mod P; Xilinx (ISE, Vivado) imlementation IPblocks; LeonardoSectrum (Mentor Grahics) allows to use custom libraries; and etc. 7

Secial sets of moduli alied in RNS 8

Five moduli set A B A, B In order to calculate, where, 739 the average bit-range of 5 moduli sets is 300 bits, i.e. 300 3 45 9

Moduli set for A B, where A and B are 739 bits P = {0 09 03 009 997 99 983 977 97 967 96 953 947 94 937 99 99 9 907 887 883 88 877 863 859 857 853 84 839 89 87 83 8 8 809 797 787 773 769 76 757 75 743 739 733 79 77 79 709 70 69 683 677 673 66 659 653 647 643 64 63 65 69 67 63 607 60 599 593 587 577 57 569 563 557 547 54 59 53 5 5 509 503 499 49 487 479 467 463 46 457 449 443 439 433 43 4 49 409 40 397 389 383 379 373 367 36 359 353 349 347 343 337 33 37 33 3 307 93 89 83 8 77 7 69 63 57 5 4 39 33 9 7 3 99 97 93 9 8 79 73 69 67 63 57 5 49 39 37 3 7 3 09 07 03 0 97 89 83 79 73 7 67 6 59 53 47 43 4 37} 7 P 478 P 30

Features and roblems It is assumed, that: the main feature is the high seed rocessing (it is achieved with hundreds bits numbers); indeendence of calculation under each modulo; flexibility of layout; small ower consumtion; reliability Problems: unknown an efficient aroach of hardware realization for an arbitrary modulo P no IP-blocks and no hardware libraries for RNS system realization; slow seed converters to/from RNS for non secial sets of moduli 3

Residue Number Systems: Algorithms and Architectures Kluwer Academic Publishers, 00 RNS literature (in English) Digital arithmetic Morgan Kaufmann Publishers, 004 Residue Number Systems: Theory and Imlementation Imerial College Press, 007 Residue Number System Bookvika Publishing, 0 Finite recision number systems and arithmetic Cambridge University Press, 00 3