CSE20 Lecture 6

CSE20 Lecture 6 - CSE 20 Lecture 6 Residual Number System...

This preview shows pages 1–10. Sign up to view the full content.

1 CSE 20 Lecture 6 2/02/10 Residual Number System 1.Intro 2.Definitions 3.Operations 4.Conversions

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
2 2. Definitions 1. Relatively Prime: Two integers a & b are relatively prime if their greatest common divisor is 1. e.g. 3 & 8, 4 & 9, but not 6 & 9 Residual number: Given m 1 , m 2 ,…,m k relatively prime and a positive integer x < = M (0 x M ) represent x as ( x % m 1 , x % m 2 ,…, x % m k )
3 Example k = 3 ( m 1 , m 2 , m 3 ) = ( 2, 3, 7 ) M = m 1 m 2 m 3 = 2 x 3 x 7 = 42 Given x = 30 ( x % m 1 , x % m 2 , x % m 3 ) = ( 30 % 2, 30 % 3, 30 % 7 ) = ( 0, 0, 2 ) Given y = 4 ( y % m 1 , y % m 2 , y % m 3 ) = ( 4 % 2, 4 % 3, 4 % 7 ) = ( 0, 1, 4 ) Given x + y = 34 ( (x + y) % m 1 , (x + y) % m 2 , (x + y) % m 3 ) = ( 34 % 2, 34 % 3, 34 % 7 ) = ( 0, 0, 6 )

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
4 Theorem: for all x, y in the domain [ 0, M –1 ] If x y ( x % m 1 , x % m 2 ,…, x % m k ) ( y % m 1 , y % m 2 ,…, y % m k ) & differ by at least one element in the representation Proof: suppose x > y Let z = x –y > 0 Then ( z % m 1 , z % m 2 ,…, z % m k ) Has at least one nonzero element.
5 3. Operations: Decimal number Residual Number x ( x % m 1 , x % m 2 ,…, x % m k ) y ( y % m 1 , y % m 2 ,…, y % m k ) x + y ( (x + y) % m 1 , (x + y) % m 2 ,…, (x + y) % m k ) x – y (x > y) ( (x - y) % m 1 , (x - y) % m 2 ,…, (x - y) % m k ) xy (xy < M) ( (xy) % m 1 , (xy) % m 2 ,…, (xy) % m k )

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
6 Example (m 1 , m 2 , m 3 ) = (2, 3, 7) x = 8 (x 1 , x 2 , x 3 ) = (0, 2, 1) y = 5 (y 1 , y 2 , y 3 ) = (1, 2, 5) x + y = 13 barb2right

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern