Docsity

Number Representations - Lecture Slides | ECE 645, Study notes of Electrical and Electronics Engineering

Partial preview of the text

Download Number Representations - Lecture Slides | ECE 645 and more Study notes Electrical and Electronics Engineering in PDF only on Docsity!

Lecture 2

Floating Point Representations

Number Representations

Little-Endian vs. Big-Endian

Galois Field Representations

Little-Endian vs. Big-Endian

Representation of

Integers

Little-Endian vs. Big-Endian Representation

A0 B1 C2 D3 E4 F5 67 89 16 MSB LSB

MSB = A B C D E F 67 LSB = 89

Big-Endian Little-Endian

LSB = 89

0

MAX

67 F E D C B MSB = A

address

Little-Endian vs. Big-Endian Camps

Big-Endian Little-Endian

0

MAX

address

MSB

LSB

...

LSB

MSB

...

Motorola 68xx, 680x0 (^) Intel IBM Hewlett-Packard

DEC VAX

Internet TCP/IP

Sun SuperSPARC

Bi-Endian Motorola Power PC Silicon Graphics MIPS RS 232

Origin of the terms

Little-Endian vs. Big-Endian

Jonathan 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 France

Little-Endian vs. Big-Endian

Big-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 multiplication of multiprecision numbers

Advantages and Disadvantages

Fig. 17.3 The ANSI/IEEE standard floating-point number representation formats.

Fig. 17.4 Denormals in the IEEE single-precision format.

Evariste Galois (1811-1832)

1829 Galois submits his results for the first time to the French Academy of Sciences Reviewer 1 Augustin-Luis Cauchy forgot or lost the communication

1930 Galois submits the revised version of his manuscript, hoping to enter the competition for the Grand Prize in mathematics Reviewer 2 Joseph Fourier – died shortly after receiving the manuscript

1931 Third submission to the French Academy of Sciences Reviewer 3 Simeon-Denis Poisson – did not understand the manuscript and rejected it.

Evariste Galois (1811-1832)

May 1832 Galois provoked into a duel

The night before the duel he writes a letter to his friend containing the summary of his discoveries. The letter ends with a plea: “ Eventually there will be, I hope, some people who will find it profitable to decipher this mess. ”

May 30, 1832 Galois is grievously wounded in the duel and dies in the hospital the following day.

1843 Galois manuscript rediscovered by Joseph Liouville

1846 Galois manuscript published for the first time in a mathematical journal

Field

**Set 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.

For details see one of the next lectures of ECE 746 Lecture 3 - Mathematical Background: Groups, Rings, and Fields (you can attend the lecture or follow the corresponding viewgraphs posted on the web)

set Z p ={0, 1, 2, … , p -1},

  • (mod p) : addition modulo p ,
  • (mod p) : multiplication modulo p }

Examples of fields Infinite fields

Finite fields

R= set of real numbers,

  • addition of real numbers
  • multiplication of real numbers }

Finite Fields = Galois Fields

GF(p) GF(2m)

Polynomial basis representation

Normal basis representation

Fast in hardware

Arithmetic operations present in many libraries

Fast squaring

GF(pm)

p – prime pm^ – number of elements in the field

Most significant special cases

Elements of the Galois Field GF(2m)

Binary representation (used for storing and processing in computer systems):

Polynomial representation (used for the definition of basic arithmetic operations):

A = (am-1, am-2, …, a 2 , a 1 , a 0 ) ai ∈ {0, 1}

A(x) =

ai⋅xi^ = am-1⋅xm-1^ + am-2⋅xm-2^ + …+ a 2 ⋅x^2 + a 1 ⋅x+a 0

⋅ multiplication

  • addition modulo 2 (XOR)

i=

m-