XOR - PowerPoint PPT Presentation

About This Presentation
Title:

XOR

Description:

... if there is an odd ... Numbers Four bytes 10101010 01010101 11110000 00110001 First Parity Bit First bit of each 1, 0, 1, 0 Even number Parity ... – PowerPoint PPT presentation

Number of Views:38
Avg rating:3.0/5.0
Slides: 31
Provided by: dsin150
Category:

less

Transcript and Presenter's Notes

Title: XOR


1
XOR
  • XOR True (1) if there is an odd number of 1s
  • XOR False (0) if an even number of 1s

2
Parity Values
  • Supplementary Slideset
  • (Best viewed individually)

3
Parity Example
  • 10101010 . 01010101 . 11100010
  • Parity XOR(1,0,1) 0
  • XOR(0,1,1) 0
  • XOR(1,0,1) 0
  • XOR(0,1,0) 1
  • XOR( 1,0,0) 1
  • XOR(0,1,0) 1
  • XOR(1,0,1) 0
  • XOR(0,1,0) 1

4
Parity Recovery
  • 10101010 . 01010101 .
  • Parity 00011101
  • 11100010

5
Initial Numbers
  • Four bytes
  • 10101010
  • 01010101
  • 11110000
  • 00110001

6
First Parity Bit
  • First bit of each
  • 1, 0, 1, 0
  • Even number
  • Parity is 0

7
Second Parity Bit
  • Second bit of each
  • 0, 1, 1, 0
  • Even number
  • Parity is 0

8
Third Parity Bit
  • Third bit of each
  • 1, 0, 1, 1
  • Odd number
  • Parity is 1

9
Fourth Parity Bit
  • 0, 1, 1, 1
  • Odd number
  • Parity is 1

10
Fifth Parity Bit
  • 1, 0, 0, 0
  • Odd Number
  • Parity is 1

11
Sixth Parity Bit
  • 0, 1, 0, 0
  • Odd Number
  • Parity is 1

12
Seventh Parity Bit
  • 1, 0, 0, 0
  • Odd Number
  • Parity is 1

13
Eigth Parity Bit
  • 0, 1, 0, 1
  • Even Number
  • Parity is 0

14
Regenerating
  • To regenerate a lost value
  • Find the parity of the remaining bits
  • Partial-parity
  • For each bit of Parity
  • If the Partial-parity bit is the same
  • Same number of ones before/after, value is a 0
  • If Partial-parity is different
  • Different number of ones before/after, value is a
    1

15
Recover Bit 1
  • 1, 1, 0
  • Partial-parity 0
  • Parity 0
  • Value is 0

16
Recover Bit 2
  • 0, 1, 0
  • Partial Parity 1
  • Parity 0
  • Value is a 1

17
Recover Bit 3
  • 1, 1, 1
  • Partial-parity is 1
  • Parity is 1
  • Value is 0

18
Recover Bit 4
  • 0, 1, 1
  • Partial-parity is 0
  • Parity is 1
  • Value is 1

19
Recover Bit 5
  • 1, 0 ,0
  • Partial Parity is 1
  • Parity is 1
  • Value is 0

20
Recover Bit 6
  • 0,0,0
  • Partial-parity is 0
  • Parity is 1
  • Value is 1

21
Recover Bit 7
  • 1, 0, 0
  • Partial-parity is 1
  • Parity is 1
  • Value is 0

22
Recover Bit 8
  • 0, 0, 1
  • Partial-parity is 1
  • Parity is 0
  • Value is 1

23
Recover Bit 1
  • 1, 0, 0
  • Partial-parity is 1
  • Parity is 0
  • Value is 1

24
Recover Bit 2
  • 0, 1, 0
  • Partial-parity is 1
  • Parity is 0
  • Value is 1

25
Recover Bit 3
  • 1, 0, 1
  • Partial-parity is 0
  • Parity is 1
  • Value is 1

26
Recover Bit 4
  • 0, 1, 1
  • Partial-parity is 0
  • Parity is 1
  • Value is 1

27
Recover Bit 5
  • 1, 0, 0
  • Partial-parity is 1
  • Parity is 1
  • Value is 0

28
Recover Bit 6
  • 0, 1, 0
  • Partial-parity is 1
  • Parity is 1
  • Value is 0

29
Recover Bit 7
  • 1, 0, 0
  • Partial-parity is 1
  • Parity is 1
  • Value is 0

30
Recover Bit 8
  • 0, 1, 1
  • Partial-parity is 0
  • Parity is 0
  • Value is 0
Write a Comment
User Comments (0)
About PowerShow.com