CSE20 Lecture 5 4/12/11 - PowerPoint PPT Presentation

About This Presentation
Title:

CSE20 Lecture 5 4/12/11

Description:

CSE20 Lecture 5 4/12/11 CK Cheng UC San Diego * Residual Numbers (NT-1 and Shaum s Chapter 11) Introduction Definition Operations Range of numbers * Introduction ... – PowerPoint PPT presentation

Number of Views:89
Avg rating:3.0/5.0
Slides: 12
Provided by: David3182
Learn more at: https://cseweb.ucsd.edu
Category:

less

Transcript and Presenter's Notes

Title: CSE20 Lecture 5 4/12/11


1
CSE20 Lecture 54/12/11
  • CK Cheng
  • UC San Diego

2
Residual Numbers(NT-1 and Shaums Chapter 11)
  • Introduction
  • Definition
  • Operations
  • Range of numbers

3
Introduction
  • Applications communication, cryptography, and
    high performance signal processing
  • Goal Simplify arithmetic operations (, -, x)
    when bit width n is huge, e.g. n 1000. Note no
    division is involved.
  • Flow

Residual number (x1, x2, , xk) , -, x
operations for each xi under mi
Number x
Results
Chinese Remainder Theorem
4
Definition
  • Mod (Modular) operation.
  • Given integer x and d (dgt 0), find q and r such
    that x qdr, 0lt r ltd,
  • where q quotient, d divisor, and r remainder.
  • We define xd r.
  • Conversion to residual system
  • Given moduli (m1, m2, , mk), where all mi are
    mutually prime, transform
  • integer x to (r1, r2, , rk), where rixmi

5
Definitions
  • Mutually Prime Two integers a b are
  • mutually (or relatively) prime if their greatest
  • common divisor is 1.
  • e.g. 3 8, 4 9, but not 6 9
  • Residual number Given (m1, m2,,mk) where mis
    are mutually prime and a positive integer x
    ltMm1xm2xxmk
  • (0 x ltM ) represent x as
  • ( xm1, xm2,, xmk )

6
Examples (xmiri)
  • Given (m1, m2, m3) (3, 5, 7), convert
  • x (r1, r2, r3).
  • 0 (0, 0, 0) 030, 050, 07 0
  • 2 (2, 2, 2) 232, 252, 272
  • 21 (0, 1, 0) 2130 , 2151, 2170
  • -2 (1, 3, 5) -231, -253, -275
  • -3 (0, 2, 4) -330, -352, -374
  • -21 (0, 4, 0) -2130, -215 4, -2170
  • Hint 0lt ri lt mi

7
Examples
  • k 3 ( m1, m2, m3 ) ( 2, 3, 7 )
  • M m1 x m2 x m3 2 x 3 x 7 42
  • Given x30, ( xm1, xm2, xm3 )
  • ( 302, 303, 307 ) ( 0, 0, 2 )
  • Given y4, ( ym1, ym2, ym3 )
  • ( 42, 43, 47 ) ( 0, 1, 4 )
  • Given xy34, ((xy)m1,(xy)m2,(xy)m3 )
  • ( 342, 343, 347 ) ( 0, 1, 6 )

8
3. Modular Operations
  • Theorem Given three integers x,y,d, we have
  • (xy)d(xdyd)d.
  • Proof
  • Let x qxd rx, y qyd ry
  • We have (xy)d (qxd rx qyd ry)d
  • (rxry)d
  • Therefore, (xy)d (xdyd)d

9
3. Modular Operations
  • Theorem Given three integers x,y,d, we have
  • (xy)d(xd yd)d.
  • Proof
  • Let x qxd rx, y qyd ry
  • We have (xy)d (qxd rx )(qyd ry)d
  • (qxqyd2ryqxdrxqydrxry)d
  • (rxry)d
  • Therefore, (xy)d (xd yd)d

10
3. Modular Operations
  • What about division?
  • Could we state the following equality?
  • ((xd)/(yd))d (x/y)d
  • Answer No! We have the following problems.
  • yd can be zero.
  • (xd)/(yd) or x/y can be fractional.

11
Range of Numbers
  • Theorem Given (m1, m2, , mk), where all mi are
    mutually prime, let Mm1xm2xxmk.
  • For 0lt xlt M, the residual number
  • (x1, x2, , xk) is distinct.
  • Proof By contradiction, let 0lt yltx lt M.
  • Suppose (x1, x2, , xk)(y1, y2, , yk) then
  • x-y (0,0, ,0). However, for all numbers in the
    range of the interval, only 0 (0,0, ,0)
    because the mods mi are mutually prime.
Write a Comment
User Comments (0)
About PowerShow.com