DOC PREVIEW
MASON ECE 645 - Lecture 2 Number Representations

This preview shows page 1-2-3-4-5-6 out of 19 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 19 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 19 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 19 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 19 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 19 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 19 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 19 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

1Lecture 2Floating Point RepresentationsNumber RepresentationsLittle-Endian vs. Big-EndianGalois Field RepresentationsSigned Number RepresentationsSigned Number Representations1 – xi= xi1 – xixixi011010Useful dependencies|X| =X when X ≥ 0- X when X < 02One’s complement transformationOC(A) = A = 2k– 2-l- AFor ikliiAA 21⋅=−−=≥ 00 ≤ OC(A) ≤ 2k– 2-lOC(OC(A)) = Adefk-1 k-2 ... 0 -1 -2 ... -l1 1 ... 1 . 1 1 ... 1– Ak-1Ak-2… A0. A-1A-2 ... A-lAk-1Ak-2… A0. A-1A-2 ... A-lProperties:Two’s complement transformation (1)A + 2-l= 2k– A for A > 0For ikliiAA 21⋅=−−=≥ 0defProperties:TC(A) =0 for A = 00 ≤ TC(A) ≤ 2k– 2-lTC(TC(A)) = A2k– A = 2k– A – 2-l+ 2-l== (2k– 2-l– A)+2-l= A + 2-lTwo’s complement transformation (2)For ikliiAA 21⋅=−−=≥ 0A + 2-lmod 2k= 2k– A mod 2kdefTC(A) =3Representations of signed numbersSigned-magnitudeBiasedComplementRadix-complementDiminished-radix complement(Digit complement)Two’s complement One’s complementr=2r=2Signed number XUnsigned Representation R(X)Bit vector (xk-1xk-2...x0.x-1...x-l)Binary mappingRepresentation mappingikliixXR 2)(1⋅=−−=Biased and complement representations with radix 2One’s Complement Representation of Signed NumbersR(X) = X for X > 00 or 2k-2-lfor X = 0OC(|X|) for X < 0For –(2k-1– 2-l) ≤ X ≤ 2k-1– 2-l0 ≤ R(X) ≤ 2k– 2-ldef4One’s complement representation of signed integers-8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15Xk=4X>0 0X<0X+2k-1 = 2k-1 - |X|0,2k-1Two’s Complement Representation of Signed NumbersR(X) = X for X ≥ 0TC(|X|) for X < 0For –2k-1≤ X ≤ 2k-1– 2-l0 ≤ R(X) ≤ 2k– 2-ldefTwo’s complement representation of signed integers-8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15Xk=4X>0 0X<0X+2k = 2k- |X|05Divisibilitya | b iff ∃ c ∈ Z such that b = c ⋅ aa | b a divides ba is a divisor of ba | b a does not divide ba is not a divisor of bTrue or False?-3 | 18 14 | 7 7 | 63 -13 | 65 14 | 21 14 | 140 | 63 7 | 0 -5 | 0 0 | 0Quotient and remainderGiven integers a and n, n>0∃! q, r ∈ Z such thata = q⋅n + r and 0 ≤ r < nq – quotientr – remainder(of a divided by n)q = an= a div nr = a - q⋅n = a –an⋅n== a mod n632 mod 5 =-32 mod 5 =Integers coungruent modulo nTwo integers a and b are congruent modulo n(equivalent modulo n) written a ≡≡≡≡ biffa mod n = b mod nora = b + kn, k ∈∈∈∈ Zorn | a - bRules of addition, subtraction and multiplicationmodulo na + b mod n = ((a mod n) + (b mod n)) mod na - b mod n = ((a mod n) - (b mod n)) mod na ⋅ b mod n = ((a mod n) ⋅ (b mod n)) mod n79 · 13 mod 5 =25 · 25 mod 26 =Little-Endian vs. Big-EndianRepresentation of IntegersLittle-Endian vs. Big-Endian Representation A0 B1 C2 D3 E4 F5 67 8916LSBMSBMSB = A0B1C2D3E4F567LSB = 89Big-EndianLittle-EndianLSB = 890MAX67F5E4D3C2B1MSB = A0address8Little-Endian vs. Big-Endian Camps Big-EndianLittle-Endian0MAXaddressMSBLSB. . .LSBMSB. . .Motorola 68xx, 680x0IntelIBMHewlett-PackardDEC VAXInternet TCP/IPSun SuperSPARCBi-EndianMotorola Power PCSilicon Graphics MIPSRS 232AMDOrigin of the termsLittle-Endian vs. Big-EndianJonathan Swift, Gulliver’s Travels• A law requiring all citizens of Lilliput to break their soft-eggs at the little ends only• A civil war breaking between the Little Endians and the Big-Endians, resulting in the Big Endians taking refuge on a nearby island, the kingdom of Blefuscu• Satire over holy wars between Protestant Church of England and the Catholic Church of France9Little-Endian vs. Big-EndianBig-Endian Little-Endian• easier to determine a sign of the number• easier to compare two numbers• easier to divide two numbers• easier to print• easier addition and multiplicationof multiprecision numbersAdvantages and DisadvantagesPointers (1)8967F5E4D3C2B1A0Big-EndianLittle-Endian0MAXaddressint * iptr;(* iptr) = 8967; (* iptr) = 6789;iptr+1Pointers (2)8967F5E4D3C2B1A0Big-EndianLittle-Endian0MAXaddresslong int * lptr;(* lptr) = 8967F5E4; (* lptr) = E4F56789;lptr + 110Floating Point Representations1112Fig. 17.3 The ANSI/IEEE standard floating-point number representation formats.Table 17.1 Some features of the ANSI/IEEE standard floatingpoint number representation formats13Fig. 17.4 Denormals in the IEEE single-precision format.1415Polynomial Representationof the Galois Fieldelements16Evariste Galois (1811-1832)Evariste Galois (1811-1832)Studied the problem of finding algebraic solutions for the generalequations of the degree ≥ 5, e.g.,f(x) = a5x5+ a4x4+ a3x3+ a2x2+ a1x+ a0= 0Answered definitely the question which specific equations of a given degree have algebraic solutionsOn the way, he developed group theory,one of the most important branches of modern mathematics.Evariste Galois (1811-1832)1829 Galois submits his results for the first time to the French Academy of SciencesReviewer 1Augustin-Luis Cauchy forgot or lost the communication1830 Galois submits the revised version of his manuscript,hoping to enter the competition for the Grand Prizein mathematicsReviewer 2Joseph Fourier – died shortly after receiving the manuscript1831 Third submission to the French Academy of SciencesReviewer 3Simeon-Denis Poisson – did not understand the manuscriptand rejected it.17Evariste Galois (1811-1832)May 1832 Galois provoked into a duelThe night before the duel he writes a letter to his friendcontaining the summary of his discoveries.The letter ends with a plea:“Eventually there will be, I hope, some people whowill find it profitable to decipher this mess.”May 30, 1832 Galois is grievously wounded in the duel and diesin the hospital the following day.1843 Galois manuscript rediscovered by Joseph Liouville1846 Galois manuscript published forthe first time in a mathematical journalFieldSet G, and two operations typically denoted by (but not necessarily equivalent to)+ and *Set G, and definitions of these two operations must fulfill special conditions.18{set Zp={0, 1, 2, … , p-1}, + (mod p): addition modulo p, * (mod p): multiplication modulo p}Examples of fieldsInfinite fieldsFinite fields{R= set of real numbers, + addition of real numbers* multiplication of real


View Full Document

MASON ECE 645 - Lecture 2 Number Representations

Documents in this Course
Load more
Download Lecture 2 Number Representations
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture 2 Number Representations and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture 2 Number Representations 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?