110
Monday, October 11 Assignment(s) due: Assignment #7: IEEE FLOATING POINT FORMATS EMULATOR PROGRESS WORKSHEET 1 Quiz(zes) due: Quiz #7: Debug Note: Quiz #8: Floating Point Formats is due next Monday Tonight is the cutoff date for Assignment #5 (Complement Arithmetic) Next Monday is the cutoff date for all Debug and Floating Point assignments and quizzes(these topics will be covered on the midterm) Any assignments turned in to me by Thursday afternoon will be available in the lab on Monday afternoon Please note: The midterm is next Monday (at the beginning of class) - an 8.5 in. * 11 in. cheat sheet will be allowed We will review for the midterm tonight

Monday, October 11 Assignment(s) due:Assignment #7: IEEE FLOATING POINT FORMATS

  • Upload
    goldy

  • View
    36

  • Download
    0

Embed Size (px)

DESCRIPTION

Monday, October 11 Assignment(s) due:Assignment #7: IEEE FLOATING POINT FORMATS EMULATOR PROGRESS WORKSHEET 1 Quiz(zes) due:Quiz #7: Debug Note:Quiz #8: Floating Point Formats is due next Monday Tonight is the cutoff date for Assignment #5 (Complement Arithmetic) - PowerPoint PPT Presentation

Citation preview

Page 1: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

Monday, October 11

Assignment(s) due: Assignment #7: IEEE FLOATING POINT FORMATSEMULATOR PROGRESS WORKSHEET 1

Quiz(zes) due: Quiz #7: Debug

Note: Quiz #8: Floating Point Formats is due next Monday

Tonight is the cutoff date for Assignment #5 (Complement Arithmetic)

Next Monday is the cutoff date for all Debug and Floating Point assignmentsand quizzes(these topics will be covered on the midterm)

Any assignments turned in to me by Thursday afternoon will be available in the labon Monday afternoon

Please note: The midterm is next Monday (at the beginning of class)

- an 8.5 in. * 11 in. cheat sheet will be allowed

We will review for the midterm tonight

Page 2: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

Conversion to/from floating point formats:

- decimal number to hexadecimal floating point format:

- convert decimal number to binary

- convert to normalized scientific form (varies)

- convert exponent to its excess-N form

- add sign bit

- convert binary number to hexadecimal

- hexadecimal floating point format to decimal value

- convert hexadecimal number to binary

- determine sign

- determine exponent

- determine fraction from its normalized form

- convert to its non-scientific binary form

- convert to decimal

Page 3: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

- a problem using the same format as Lab #9

- 32 bits

- 1 bit for the sign bit

- 7 bits for the exponent- using excess-64- using base 16 for the exponent

- 24 bits for the normalized fraction- radix point to the left of the most significant

bit

- round-off because of rounding

- how would 25.12510 be stored in hexadecimal?

Page 4: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

Step 1: Convert 25.12510 to binary

Page 5: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

Step 1: Convert 25.12510 to binary 25.12510 = 11001.0012

Step 2: Normalize the binary number

Page 6: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

Step 1: Convert 25.12510 to binary 25.12510 = 11001.0012

Step 2: Normalize the binary number .00011001001 * (162)10

Page 7: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

Step 1: Convert 25.12510 to binary 25.12510 = 11001.0012

Step 2: Normalize the binary number .00011001001 * (162)10

Step 3: Calculate the exponent

Page 8: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

Step 1: Convert 25.12510 to binary 25.12510 = 11001.0012

Step 2: Normalize the binary number .00011001001 * (162)10

Step 3: Calculate the exponent2 + 64 = 6610 = 10000102

Page 9: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

Step 1: Convert 25.12510 to binary 25.12510 = 11001.0012

Step 2: Normalize the binary number .00011001001 * (162)10

Step 3: Calculate the exponent2 + 64 = 6610 = 10000102

Step 4: Put the number together

0 1000010 000110010010000000000000

Page 10: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

Step 1: Convert 25.12510 to binary 25.12510 = 11001.0012

Step 2: Normalize the binary number .00011001001 * (162)10

Step 3: Calculate the exponent2 + 64 = 6610 = 10000102

Step 4: Put the number together

0 1000010 000110010010000000000000

In hexadecimal:0100 0010 0001 1001 0010 0000 0000 0000

4 2 1 9 2 0 0 0

Page 11: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

- the same problem using the same format as Lab #9, part 2 (IEEE format)

- 32 bits

- 1 bit for the sign bit

- 8 bits for the exponent- using excess-127- using base 2 for the exponent

- 24 bits for the normalized fraction- radix point to the right of the most significant bit

- the most significant bit is "hidden"

- round-off because of rounding

- how would 25.12510 be stored in hexadecimal?

Page 12: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

Step 1: Convert 25.12510 to binary

Page 13: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

Step 1: Convert 25.12510 to binary 25.12510 = 11001.0012

Step 2: Normalize the binary number

Page 14: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

Step 1: Convert 25.12510 to binary 25.12510 = 11001.0012

Step 2: Normalize the binary number 1.1001001 * (24)10

Page 15: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

Step 1: Convert 25.12510 to binary 25.12510 = 11001.0012

Step 3: Calculate the exponent

Step 2: Normalize the binary number 1.1001001 * (24)10

Page 16: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

Step 1: Convert 25.12510 to binary 25.12510 = 11001.0012

Step 3: Calculate the exponent4 +127 = 13110 = 100000112

Step 2: Normalize the binary number 1.1001001 * (24)10

Page 17: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

Step 1: Convert 25.12510 to binary 25.12510 = 11001.0012

Step 4: Put the number together

0 10000011 10010010000000000000000

Step 2: Normalize the binary number 1.1001001 * (24)10

Step 3: Calculate the exponent4 +127 = 13110 = 100000112

Page 18: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

Step 1: Convert 25.12510 to binary 25.12510 = 11001.0012

Step 4: Put the number together

0 10000011 10010010000000000000000

In hexadecimal0100 0001 1100 1001 0000 0000 0000 0000

4 1 C 9 0 0 0 0

Step 2: Normalize the binary number 1.1001001 * (24)10

Step 3: Calculate the exponent4 +127 = 13110 = 100000112

Page 19: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

- using the IEEE standard short real

- 32 bits

- 1 bit for the sign bit

- 8 bits for the exponent- using excess-127- using base 2 for the exponent

- 23 bits for the normalized fraction- radix point to the right of the most significant bit

- the most significant bit is hidden

- round-off because of rounding

- how would 414E000016 be represented as a decimal number?

Page 20: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

Step 1: Convert 414E000016 to binary 414E000016 = 01000001010011100000 . . .2

or 0 10000010 10011100000 . . .2

Page 21: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

Step 1: Convert 414E000016 to binary 414E000016 = 01000001010011100000 . . .2

or 0 10000010 10011100000 . . .2

Step 2: The exponent is 13010 or 3 (130 - 127)

Page 22: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

Step 1: Convert 414E000016 to binary 414E000016 = 01000001010011100000 . . .2

or 0 10000010 10011100000 . . .2

Step 2: The exponent is 13010 or 3 (130 - 127)

Step 3: The fraction is1.10011100000 . . .2

Page 23: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

Step 1: Convert 414E000016 to binary 414E000016 = 01000001010011100000 . . .2

or 0 10000010 10011100000 . . .2

Step 2: The exponent is 13010 or 3 (130 - 127)

Step 3: The fraction is1.10011100000 . . .2

Step 4: The normalized form is1.1001112 * (23)10

Page 24: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

Step 1: Convert 414E000016 to binary 414E000016 = 01000001010011100000 . . .2

or 0 10000010 10011100000 . . .2

Step 2: The exponent is 13010 or 3 (130 - 127)

Step 3: The fraction is1.10011100000 . . .2

Step 4: The normalized form is1.1001112 * (23)10

Step 5: In binary1100.1112

Page 25: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

Step 1: Convert 414E000016 to binary 414E000016 = 01000001010011100000 . . .2

or 0 10000010 10011100000 . . .2

Step 2: The exponent is 13010 or 3 (130 - 127)

Step 3: The fraction is1.10011100000 . . .2

Step 4: The normalized form is1.1001112 * (23)10

Step 5: In binary1100.111

Step 6: In decimal12.875

Page 26: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS
Page 27: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

Data Table

N: 18X: 19

Page 28: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

20: 40021: 82022: 518

23: 019

24: 119

25: 41826: 31927: 518

28: 730

29: 623

30: 900

Data Table

N: 18X: 19

Page 29: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

20: 40021: 82022: 518

23: 019

24: 119

25: 41826: 31927: 518

28: 730

29: 623

30: 900

If the inputcards are:

013 052 070 005 041

What is theoutput?

Data Table

N: 18X: 19

Page 30: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS
Page 31: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

016

005

013

007

Page 32: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS
Page 33: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS
Page 34: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS
Page 35: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

6. Given the following information in DEBUG:

-u 100, 10A21F0:0100 BB2001 MOV BX, 12021F0:0103 BE0200 MOV SI, 221F0:0106 0307 MOV AX, [BX]21F0:0108 0300 ADD AX, [BX + SI]21F0:010A 034002 ADD AX, [BX + SI + 02]21F0:010D 894004 MOV [BX + SI +04], AX21F0:0110 CD20 INT 20

-e 120 12 03 24 00 10 FF 0120 0121 0122 0123 0124 0125 0126 0127

AX BX SI

Page 36: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

6. Given the following information in DEBUG:

-u 100, 10A21F0:0100 BB2001 MOV BX, 12021F0:0103 BE0200 MOV SI, 221F0:0106 0307 MOV AX, [BX]21F0:0108 0300 ADD AX, [BX + SI]21F0:010A 034002 ADD AX, [BX + SI + 02]21F0:010D 894004 MOV [BX + SI +04], AX21F0:0110 CD20 INT 20

-e 120 12 03 24 00 10 FF 0120 0121 0122 0123 0124 0125 0126 0127

AX BX SI

12 03 24 00 10 FF

Page 37: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

6. Given the following information in DEBUG:

-u 100, 10A21F0:0100 BB2001 MOV BX, 12021F0:0103 BE0200 MOV SI, 221F0:0106 0307 MOV AX, [BX]21F0:0108 0300 ADD AX, [BX + SI]21F0:010A 034002 ADD AX, [BX + SI + 02]21F0:010D 894004 MOV [BX + SI +04], AX21F0:0110 CD20 INT 20

-e 120 12 03 24 00 10 FF 0120 0121 0122 0123 0124 0125 0126 0127

AX BX SI0120

12 03 24 00 10 FF

Page 38: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

6. Given the following information in DEBUG:

-u 100, 10A21F0:0100 BB2001 MOV BX, 12021F0:0103 BE0200 MOV SI, 221F0:0106 0307 MOV AX, [BX]21F0:0108 0300 ADD AX, [BX + SI]21F0:010A 034002 ADD AX, [BX + SI + 02]21F0:010D 894004 MOV [BX + SI +04], AX21F0:0110 CD20 INT 20

-e 120 12 03 24 00 10 FF 0120 0121 0122 0123 0124 0125 0126 0127

AX BX SI0120 0002

12 03 24 00 10 FF

Page 39: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

6. Given the following information in DEBUG:

-u 100, 10A21F0:0100 BB2001 MOV BX, 12021F0:0103 BE0200 MOV SI, 221F0:0106 0307 MOV AX, [BX]21F0:0108 0300 ADD AX, [BX + SI]21F0:010A 034002 ADD AX, [BX + SI + 02]21F0:010D 894004 MOV [BX + SI +04], AX21F0:0110 CD20 INT 20

-e 120 12 03 24 00 10 FF 0120 0121 0122 0123 0124 0125 0126 0127

AX BX SI0312 0120 0002

12 03 24 00 10 FF

Page 40: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

6. Given the following information in DEBUG:

-u 100, 10A21F0:0100 BB2001 MOV BX, 12021F0:0103 BE0200 MOV SI, 221F0:0106 0307 MOV AX, [BX]21F0:0108 0300 ADD AX, [BX + SI]21F0:010A 034002 ADD AX, [BX + SI + 02]21F0:010D 894004 MOV [BX + SI +04], AX21F0:0110 CD20 INT 20

-e 120 12 03 24 00 10 FF 0120 0121 0122 0123 0124 0125 0126 0127

AX BX SI0312 0120 00020336

12 03 24 00 10 FF

Page 41: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

6. Given the following information in DEBUG:

-u 100, 10A21F0:0100 BB2001 MOV BX, 12021F0:0103 BE0200 MOV SI, 221F0:0106 0307 MOV AX, [BX]21F0:0108 0300 ADD AX, [BX + SI]21F0:010A 034002 ADD AX, [BX + SI + 02]21F0:010D 894004 MOV [BX + SI +04], AX21F0:0110 CD20 INT 20

-e 120 12 03 24 00 10 FF 0120 0121 0122 0123 0124 0125 0126 0127

AX BX SI0312 0120 000203360246

12 03 24 00 10 FF

Page 42: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

6. Given the following information in DEBUG:

-u 100, 10A21F0:0100 BB2001 MOV BX, 12021F0:0103 BE0200 MOV SI, 221F0:0106 0307 MOV AX, [BX]21F0:0108 0300 ADD AX, [BX + SI]21F0:010A 034002 ADD AX, [BX + SI + 02]21F0:010D 894004 MOV [BX + SI +04], AX21F0:0110 CD20 INT 20

-e 120 12 03 24 00 10 FF 0120 0121 0122 0123 0124 0125 0126 0127

AX BX SI0312 0120 000203360246

12 03 24 00 10 FF 46 02

Page 43: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS
Page 44: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

More practice:

Given the following information in DEBUG:

-u 100

21F0:0100 MOV AX,ABCD

21F0:0103 MOV BX,0120

21F0:0106 MOV CX,0004

21F0:0109 SUB AX,[BX]

21F0:010B ADD BX,0002

21F0:010E LOOP 109

21F0:0110 INT 20

-d 120,12F EB 02 46 00 EB 38 5A 01 - 10 FF 01 02 A3 FF 88 04

Trace through the program above and indicate below the contents of the registers and memory location just before the INT 20 instruction is executed.

AX = BX = CX =

Page 45: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

The number 1.27510 = ? 2

a) 1.010001

b) 1.01

c) 1.1001101

d) 1.1

Page 46: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

If the number 1.010001 normalized using the IEEE standard (using radix 2 to normalize, radix point to the right of the most significant bit, and the most significant bit being hidden) it will result in whichfraction and exponent?

a) .1010001 and 1

b) .1010001 and 0

c) .010001 and 1

d) .010001 and 0

Page 47: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS
Page 48: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

For the binary number 1 10000101 01010001000000000000000:

Using excess-127, what is the exponent in base 10?

1. -6

2. 0

3. 4

4. 6

Page 49: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

For the binary number 1 10000101 01010001000000000000000:

With an exponent of 6 and using radix 2, what is the binary normalized form?

1. -.010100001 * (26)10

2. -.010100000101 * (2-6)10

3. -1.01010001 * (26)10

4. -1.101010001 * (26)10

Page 50: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

If the binary normalized form is -1.01010001 * (26)10: The number in binary is:

1. -1010100.01

2. -101010001.1

3. -101010001

4. -.00000101010001

Page 51: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

If the binary number is -1010100.01: The number in decimal is:

1. -168.25

2. -84.25

3. -84.5

4. -168.1

Page 52: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

Vocabulary:

address DS (data segment)

ASCII code IP (instruction pointer)

bit LOOP instruction

byte memory

compilation/translation register

Page 53: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

Noise and Distortion:

-occurs every time a signal is transmittted

- may be random

- white noise (a background hiss)

- impulse noise (amplitude peaks that block out data)

- external, usually from equipment

- internal, signal from another channel

- echoes on the line

- amplitude changes

- circuit failures

Page 54: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

Transmission in the presence of noise:

Page 55: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

Error Detection

- error-detecting Codes

- add redundant bits to each unit of data

- receiver knows when an error has occurred

- receiver can ask for retransmission

Page 56: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

- to detect single-bit errors

- often used with 7-bit ASCII code characters

- add one parity bit so number of 1-bits in the word is always even (even parity) or odd (odd parity)

- works about 70% of the time

- e.g. to transmit the character ‘A’ (6510 => 4116 => 10000012)

1 0 10 0 0 0

Page 57: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

- to detect single-bit errors

- often used with 7-bit ASCII code characters

- add one parity bit so number of 1-bits in the word is always even (even parity) or odd (odd parity)

- works about 70% of the time

- e.g. to transmit the character ‘A’ (6510 => 4116 => 10000012)

- using odd parity:

1 0 10 0 0 0

1 0 10 0 0 01

Page 58: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

- to detect single-bit errors

- often used with 7-bit ASCII code characters

- add one parity bit so number of 1-bits in the word is always even (even parity) or odd (odd parity)

- works about 70% of the time

- e.g. to transmit the character ‘A’ (6510 => 4116 => 10000012)

- using odd parity:

- using even parity:

1 0 10 0 0 0

1 0 10 0 0 0

1 0 10 0 0 0

1

0

Page 59: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

Error Detection and Correction

- error-correcting Codes

- add more redundant bits to each unit of data

- receiver can detect and sometimes correct the error

-Hamming Codes

- use a “block parity” method of adding parity bits

- use more than 1 parity bit

- allow for detection and correction of single-bit errors

Page 60: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

- Hamming algorithm:

- start numbering the bits at 1 (from the left)

bit 1 bit 2 bit 3 bit 4 bit 5

Page 61: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

- Hamming algorithm:

- start numbering the bits at 1 (from the left)

- all bits whose position is a power of 2 are parity bits

- i.e. bits 1, 2, 4, 8, 16 etc.

parity bit

bit 1 bit 2 bit 3 bit 4 bit 5

parity bit

parity bit

Page 62: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

- Hamming algorithm:

- start numbering the bits at 1 (from the left)

- all bits whose position is a power of 2 are parity bits

- i.e. bits 1, 2, 4, 8, 16 etc.

- then fill in the data bits

parity bit

data bit

bit 1 bit 2 bit 3 bit 4 bit 5

data bit

parity bit

parity bit

Page 63: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

- Hamming algorithm:

- start numbering the bits at 1 (from the left)

- all bits whose position is a power of 2 are parity bits

- i.e. bits 1, 2, 4, 8, 16 etc.

- then fill in the data bits

- so a code with 2 data bits

- would require:

parity bit

data bit

bit 1 bit 2 bit 3 bit 4 bit 5

data bit

parity bit

parity bit

Page 64: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

parity bit

data bit

bit 1 bit 2 bit 3 bit 4 bit 5

data bit

parity bit

parity bit

- Hamming algorithm continued:

- each data bit is checked by those parity bits before it whose bit positions add up to its position

- data bit 3 is checked by parity bit 1 and parity bit 2

Page 65: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

parity bit

data bit

bit 1 bit 2 bit 3 bit 4 bit 5

data bit

parity bit

parity bit

- Hamming algorithm continued:

- each data bit is checked by those parity bits before it whose bit positions add up to its position

- data bit 3 is checked by parity bit 1 and parity bit 2

- data bit 5 is checked by parity bit 1 and parity bit 4

Page 66: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

parity bit

data bit

bit 1 bit 2 bit 3 bit 4 bit 5

data bit

parity bit

parity bit

- Hamming algorithm continued:

- or - parity bit 1 checks data bits 3 and 5

- parity bit 2 checks data bit 3

- parity bit 4 checks data bit 5

parity bit

data bit

bit 1 bit 2 bit 3 bit 4 bit 5

data bit

parity bit

parity bit

parity bit

data bit

bit 1 bit 2 bit 3 bit 4 bit 5

data bit

parity bit

parity bit

Page 67: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

parity bit

data bit

bit 1 bit 2 bit 3 bit 4 bit 5

data bit

parity bit

parity bit

- Hamming algorithm continued:

- each parity bit forms a group of itself and the data bits it checks

- 3 groups are formed

- there will be an overlap of data bits

- each group must add up to an even number of 1’s (or none) for even parity

- or an odd number of 1’s for odd parity

- groups:

- bits 1, 3 and 5

- bits 2 and 3

- bits 4 and 5

Page 68: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

- each group contains only 1 parity bit

- groups:

Group 1: bit 1

Group 2: bit 2

Group 3: bit 4

parity bit

data bit

bit 1 bit 2 bit 3 bit 4 bit 5

data bit

parity bit

parity bit

Page 69: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

- each group contains only 1 parity bit

- groups:

Group 1: bit 1

Group 2: bit 2

Group 3: bit 4

- data bit 3 is checked by parity bit 1 and parity bit 2- (1 + 2 = 3 or 3 = 1 + 2)

parity bit

data bit

bit 1 bit 2 bit 3 bit 4 bit 5

data bit

parity bit

parity bit

Page 70: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

- each group contains only 1 parity bit

- groups:

Group 1: bit 1 bit 3

Group 2: bit 2 bit 3

Group 3: bit 4

- data bit 3 is checked by parity bit 1 and parity bit 2- (1 + 2 = 3 or 3 = 1 + 2)

parity bit

data bit

bit 1 bit 2 bit 3 bit 4 bit 5

data bit

parity bit

parity bit

Page 71: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

- each group contains only 1 parity bit

- groups:

Group 1: bit 1 bit 3

Group 2: bit 2 bit 3

Group 3: bit 4

- data bit 3 is checked by parity bit 1 and parity bit 2- (1 + 2 = 3 or 3 = 1 + 2)

- data bit 5 is checked by parity bit 1 and parity bit 4- (1 + 4 = 5 or 5 = 1 + 4)

parity bit

data bit

bit 1 bit 2 bit 3 bit 4 bit 5

data bit

parity bit

parity bit

Page 72: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

- each group contains only 1 parity bit

- groups:

Group 1: bit 1 bit 3 bit 5

Group 2: bit 2 bit 3

Group 3: bit 4 bit 5

- data bit 3 is checked by parity bit 1 and parity bit 2- (1 + 2 = 3 or 3 = 1 + 2)

- data bit 5 is checked by parity bit 1 and parity bit 4- (1 + 4 = 5 or 5 = 1 + 4)

parity bit

data bit

bit 1 bit 2 bit 3 bit 4 bit 5

data bit

parity bit

parity bit

Page 73: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

0

1

1

0

0

0

P1 P4P2 D3 D5

P1

P1

P1

P2

P2

P2

P4

P4

P4

D3

D3

D3

D5

D5

D5

1 1

Legal codewords for the 2-data-bit Hamming code (even parity):

Page 74: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

0

1

1

0

0

0

P1 P4P2 D3 D5

P1

P1

P1

P2

P2

P2

P4

P4

P4

D3

D3

D3

D5

D5

D5

1 1

Parity Bit Data Bits P1 D3, D5 P2 D3 P4 D5

Legal codewords for the 2-data-bit Hamming code (even parity):

Page 75: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

0

1

1

0

0

0

P1 P4P2 D3 D5

P1

P1

P1

P2

P2

P2

P4

P4

P4

D3

D3

D3

D5

D5

D5

1 1

Parity Bit Data Bits P1 D3, D5 P2 D3 P4 D5

Legal codewords for the 2-data-bit Hamming code (even parity):

Page 76: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

0

1

1

0

0

0

P1 P4P2 D3 D5

P1

P1

P1

P2

P2

P2

P4

P4

P4

D3

D3

D3

D5

D5

D5

1 1

Parity Bit Data Bits P1 D3, D5 P2 D3 P4 D5

0

Legal codewords for the 2-data-bit Hamming code (even parity):

Page 77: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

0

1

1

0

0

0

P1 P4P2 D3 D5

P1

P1

P1

P2

P2

P2

P4

P4

P4

D3

D3

D3

D5

D5

D5

1 1

Parity Bit Data Bits P1 D3, D5 P2 D3 P4 D5

0

Legal codewords for the 2-data-bit Hamming code (even parity):

Page 78: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

0

1

1

0

0

0

P1 P4P2 D3 D5

P1

P1

P1

P2

P2

P2

P4

P4

P4

D3

D3

D3

D5

D5

D5

1 1

Parity Bit Data Bits P1 D3, D5 P2 D3 P4 D5

0 0

Legal codewords for the 2-data-bit Hamming code (even parity):

Page 79: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

0

1

1

0

0

0

P1 P4P2 D3 D5

P1

P1

P1

P2

P2

P2

P4

P4

P4

D3

D3

D3

D5

D5

D5

1 1

Parity Bit Data Bits P1 D3, D5 P2 D3 P4 D5

0 0

Legal codewords for the 2-data-bit Hamming code (even parity):

Page 80: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

0

1

1

0

0

0

P1 P4P2 D3 D5

P1

P1

P1

P2

P2

P2

P4

P4

P4

D3

D3

D3

D5

D5

D5

1 1

Parity Bit Data Bits P1 D3, D5 P2 D3 P4 D5

0 0 0

Legal codewords for the 2-data-bit Hamming code (even parity):

Page 81: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

0

1

1

0

0

0

P1 P4P2 D3 D5

P1

P1

P1

P2

P2

P2

P4

P4

P4

D3

D3

D3

D5

D5

D5

1 1

Parity Bit Data Bits P1 D3, D5 P2 D3 P4 D5

0 0 0

Legal codewords for the 2-data-bit Hamming code (even parity):

Page 82: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

0

1

1

0

0

0

P1 P4P2 D3 D5

P1

P1

P1

P2

P2

P2

P4

P4

P4

D3

D3

D3

D5

D5

D5

1 1

Parity Bit Data Bits P1 D3, D5 P2 D3 P4 D5

0 0 0

1

Legal codewords for the 2-data-bit Hamming code (even parity):

Page 83: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

0

1

1

0

0

0

P1 P4P2 D3 D5

P1

P1

P1

P2

P2

P2

P4

P4

P4

D3

D3

D3

D5

D5

D5

1 1

Parity Bit Data Bits P1 D3, D5 P2 D3 P4 D5

0 0 0

1 0

Legal codewords for the 2-data-bit Hamming code (even parity):

Page 84: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

0

1

1

0

0

0

P1 P4P2 D3 D5

P1

P1

P1

P2

P2

P2

P4

P4

P4

D3

D3

D3

D5

D5

D5

1 1

Parity Bit Data Bits P1 D3, D5 P2 D3 P4 D5

0 0 0

1 0 1

Legal codewords for the 2-data-bit Hamming code (even parity):

Page 85: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

0

1

1

0

0

0

P1 P4P2 D3 D5

P1

P1

P1

P2

P2

P2

P4

P4

P4

D3

D3

D3

D5

D5

D5

1 1

Parity Bit Data Bits P1 D3, D5 P2 D3 P4 D5

0 0 0

1 0 1

1 1 0

Legal codewords for the 2-data-bit Hamming code (even parity):

Page 86: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

0

1

1

0

0

0

P1 P4P2 D3 D5

P1

P1

P1

P2

P2

P2

P4

P4

P4

D3

D3

D3

D5

D5

D5

1 1

Parity Bit Data Bits P1 D3, D5 P2 D3 P4 D5

0 0 0

1 0 1

1 1 0

110

Legal codewords for the 2-data-bit Hamming code (even parity):

Page 87: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

- to transmit the data number 01

- we use the Hamming code word

- if we transmit

- there is an error in a parity bit

- the receiver checks the groups:

10P1 P2 P4D3 D5

01 1

10P1 P2 P4D3 D5

11 1

Page 88: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

- to transmit the data number 01

- we use the Hamming code word

- if we transmit

- there is an error in a parity bit

- the receiver checks the groups: p1, d3, d5 ok

10P1 P2 P4D3 D5

01 1

10P1 P2 P4D3 D5

11 1

Page 89: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

- to transmit the data number 01

- we use the Hamming code word

- if we transmit

- there is an error in a parity bit

- the receiver checks the groups: p1, d3, d5 okp2, d3 no

10P1 P2 P4D3 D5

01 1

10P1 P2 P4D3 D5

11 1

Page 90: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

- to transmit the data number 01

- we use the Hamming code word

- if we transmit

- there is an error in a parity bit

- the receiver checks the groups: p1, d3, d5 okp2, d3 nop4, d5 ok

10P1 P2 P4D3 D5

01 1

10P1 P2 P4D3 D5

11 1

Page 91: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

- to transmit the data number 01

- we use the Hamming code word

- if we transmit

- there is an error in a parity bit

- the receiver checks the groups: p1, d3, d5 okp2, d3 nop4, d5 ok

- only one group is wrong- the error is in the parity bit for that group

10P1 P2 P4D3 D5

01 1

10P1 P2 P4D3 D5

11 1

Page 92: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

- to transmit the data number 01

- we use the Hamming code word

- if we transmit

- there is an error in a data bit

- the receiver checks the groups: p1, d3, d5 nop2, d3 nop4, d5 ok

- two groups are wrong- the error is in the common bit

10P1 P2 P4D3 D5

01 1

11P1 P2 P4D3 D5

01 1

Page 93: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

10P1 P2 P4 P8 3 5 6 7 9 10 11

00 0 01

7-bit character ‘A’ using the Hamming code and odd parity:

- 6510 => 4116 => 10000012

Page 94: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

10P1 P2 P4 P8 3 5 6 7 9 10 11

00 0 01

groups: p1,p2,p4,p8,

7-bit character ‘A’ using the Hamming code and odd parity:

- 6510 => 4116 => 10000012

Page 95: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

7-bit character ‘A’ using the Hamming code and odd parity:

- 6510 => 4116 => 10000012

10P1 P2 P4 P8 3 5 6 7 9 10 11

00 0 01

groups: p1, 3p2, 3p4p8

Page 96: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

7-bit character ‘A’ using the Hamming code and odd parity:

- 6510 => 4116 => 10000012

10P1 P2 P4 P8 3 5 6 7 9 10 11

00 0 01

groups: p1, 3, 5p2, 3p4, 5p8

Page 97: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

7-bit character ‘A’ using the Hamming code and odd parity:

- 6510 => 4116 => 10000012

10P1 P2 P4 P8 3 5 6 7 9 10 11

00 0 01

groups: p1, 3, 5p2, 3, 6p4, 5, 6p8

Page 98: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

7-bit character ‘A’ using the Hamming code and odd parity:

- 6510 => 4116 => 10000012

10P1 P2 P4 P8 3 5 6 7 9 10 11

00 0 01

groups: p1, 3, 5, 7p2, 3, 6, 7p4, 5, 6, 7p8

Page 99: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

7-bit character ‘A’ using the Hamming code and odd parity:

- 6510 => 4116 => 10000012

10P1 P2 P4 P8 3 5 6 7 9 10 11

00 0 01

groups: p1, 3, 5, 7, 9p2, 3, 6, 7p4, 5, 6, 7p8, 9

Page 100: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

7-bit character ‘A’ using the Hamming code and odd parity:

- 6510 => 4116 => 10000012

10P1 P2 P4 P8 3 5 6 7 9 10 11

00 0 01

groups: p1, 3, 5, 7, 9p2, 3, 6, 7, 10p4, 5, 6, 7p8, 9, 10

Page 101: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

7-bit character ‘A’ using the Hamming code and odd parity:

- 6510 => 4116 => 10000012

10P1 P2 P4 P8 3 5 6 7 9 10 11

00 0 01

groups: p1, 3, 5, 7, 9, 11p2, 3, 6, 7, 10, 11p4, 5, 6, 7p8, 9, 10, 11

Page 102: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

7-bit character ‘A’ using the Hamming code and odd parity:

- 6510 => 4116 => 10000012

10P1 P2 P4 P8 3 5 6 7 9 10 11

00 0 01

10P1 P2 P4 P8 3 5 6 7 9 10 11

00 0 01

groups: p1, 3, 5, 7, 9, 11p2, 3, 6, 7, 10, 11p4, 5, 6, 7p8, 9, 10, 11

Page 103: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

7-bit character ‘A’ using the Hamming code and odd parity:

- 6510 => 4116 => 10000012

10P1 P2 P4 P8 3 5 6 7 9 10 11

00 0 01

10P1 P2 P4 P8 3 5 6 7 9 10 11

00 0 011

groups: p1, 3, 5, 7, 9, 11p2, 3, 6, 7, 10, 11p4, 5, 6, 7p8, 9, 10, 11

Page 104: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

7-bit character ‘A’ using the Hamming code and odd parity:

- 6510 => 4116 => 10000012

10P1 P2 P4 P8 3 5 6 7 9 10 11

00 0 01

10P1 P2 P4 P8 3 5 6 7 9 10 11

00 0 011 1

groups: p1, 3, 5, 7, 9, 11p2, 3, 6, 7, 10, 11p4, 5, 6, 7p8, 9, 10, 11

Page 105: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

7-bit character ‘A’ using the Hamming code and odd parity:

- 6510 => 4116 => 10000012

10P1 P2 P4 P8 3 5 6 7 9 10 11

00 0 01

10P1 P2 P4 P8 3 5 6 7 9 10 11

00 0 011 1 1

groups: p1, 3, 5, 7, 9, 11p2, 3, 6, 7, 10, 11p4, 5, 6, 7p8, 9, 10, 11

Page 106: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

7-bit character ‘A’ using the Hamming code and odd parity:

- 6510 => 4116 => 10000012

10P1 P2 P4 P8 3 5 6 7 9 10 11

00 0 01

10P1 P2 P4 P8 3 5 6 7 9 10 11

00 0 011 1 1 0

groups: p1, 3, 5, 7, 9, 11p2, 3, 6, 7, 10, 11p4, 5, 6, 7p8, 9, 10, 11

Page 107: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

7-bit character ‘A’ using the Hamming code and odd parity:

- 6510 => 4116 => 10000012

10P1 P2 P4 P8 3 5 6 7 9 10 11

00 0 01

10P1 P2 P4 P8 3 5 6 7 9 10 11

01 0 011 1 1 0

- what if we transmitted:

1 1 1 0

groups: p1, 3, 5, 7, 9, 11 Check 1, skip 1p2, 3, 6, 7, 10, 11 Check 2, skip 2p4, 5, 6, 7 Check 4, skip 4p8, 9, 10, 11 Check 8, skip 8

Or . . . Starting at the parity bit:

Page 108: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

7-bit character ‘A’ using the Hamming code and odd parity:

- 6510 => 4116 => 10000012

10P1 P2 P4 P8 3 5 6 7 9 10 11

00 0 01

10P1 P2 P4 P8 3 5 6 7 9 10 11

01 0 011 1 1 0

groups: p1, 3, 5, 7, 9, 11 Check 1, skip 1p2, 3, 6, 7, 10, 11 Check 2, skip 2p4, 5, 6, 7 Check 4, skip 4p8, 9, 10, 11 Check 8, skip 8

- what if we transmitted:

1 1 1 0

Or . . . Starting at the parity bit:

Reconstitute the groups,and check

Page 109: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

From Lab #10:

Identify the parity bits and the data bits:

Complete the table for the 11-bit Hamming codeword:

Group Parity Bit Data Bits1 P12 P23 P44 P8

Using even parity, which bit (if any) is in error:

Bit# 1 2 3 4 5 6 7 8 9 10 11

a) 0 1 1 1 0 0 0 0 1 1 0

b) 0 1 1 1 0 0 1 1 0 1 0

c) 1 1 0 1 1 1 1 0 0 1 1

Page 110: Monday, October 11 Assignment(s) due:Assignment #7:  IEEE FLOATING POINT FORMATS

Monday, October 11

Assignment(s) due: Assignment #7: IEEE FLOATING POINT FORMATSEMULATOR PROGRESS WORKSHEET 1

Quiz(zes) due: Quiz #7: Debug

Note: Quiz #8: Floating Point Formats is due next Monday

Tonight is the cutoff date for Assignment #5 (Complement Arithmetic)

Next Monday is the cutoff date for all Debug and Floating Point assignments(these topics will be covered on the midterm)

Any assignments turned in to me by Thursday afternoon will be available in the labon Monday afternoon

Please note: The midterm is next Monday (at the beginning of class)

- an 8.5 in. * 11 in. cheat sheet will be allowed

We will review for the midterm tonight