ELE107_ELE107-Week2-2014

© All Rights Reserved

Als PDF, TXT **herunterladen** oder online auf Scribd lesen

4 Aufrufe

ELE107_ELE107-Week2-2014

© All Rights Reserved

Als PDF, TXT **herunterladen** oder online auf Scribd lesen

- MAX DNA DPU_a1
- Mid semester exam - Computer Fundamentals - (101) - SLIIT
- Report Encryption Decryption
- Lesson 4
- Computer Codes
- Emu8086 Tutorial
- java_file
- 2cdc120036m0201
- fgsrgsg txt
- Number System
- Math Lab 05
- 121 Lec Delimited
- Untitled
- Access Serial Ports
- MC0061
- Bit Manipulation
- 20091218112714 j Yee 1 z
- 7260844 Basics of PLCs
- Number Systems and its conversion
- Hid Cock Data

Sie sind auf Seite 1von 18

Number Systems

We use numbers in daily life as a quantization

tool. A numeral is an expression (symbol) that

represents a number.

Numbers are abstractions that in turn represent

quantity: count, length, money, mass, duration

of time, etc.

Unfortunately, numbers can be represented in

many different ways. Also, a number may have

extra information associated with it, which

increases the choice of ways to represent it.

Number Systems

ELE 107

Computers and Programming I

Number Systems

of the number 11, which has no associated units.

Some different ways of representing 11 might be:

11 , XI , eleven , 11.00 ,

The choices depend on the context. The two

representations 11 and 11.00 tell us that there are

also different types of numbers: whole numbers

and fractions.

measure of quantity, and requires some choice of

units.

So, we might say the fuel capacity is: 88,828

gallons, or 336,250 liters, or 606,701 pounds.

of fuel capacity, but because different units are

used, different numbers become involved.

3

Number Systems

Number Systems

In Roman number system a symbol always

represents the same weight:

such as the Roman number system, or

they may be weighted-positional, such as the Arabic

number system we normally use.

I = 1 , V = 5 , X = 10 , L = 50 , C = 100

D = 500 , M = 1000.

another symbol, then the value of the symbol is

additive. (CXV is ..).

If a symbol is repeated or lies to the left of a

higher-valued symbol, then the value of the

symbol is subtractive. (XXC is ..).

number systems.

Number Systems

fuel capacity of an Airbus A380.

Number Systems

Number Systems

value of a particular digit depends on its

position in the sequence of digits relative to a

radix (base) point.

Number is a concept independent of its representation; any given number can be zero, an

integer, fractional, irrational, transcendental,

negative, prime, or complex depending on the

underlying base system.

7

Number Systems

(734)14

4196 + 314 + 71

78410 + 4210 + 710

7196 + 314 + 41

137210 + 4210 + 410

(833)10

7100 + 310 + 41

700 + 30 + 4

437

734

9

Number Systems

10

Number Systems

General form:

Position:

n n-1 2 1 0 . -1 -2 -m

Position value: r n r n-1 r2 r1 r0 . r -1 r -2 r -m

Number:

xn xn-1 x2 x1x0 . x-1 x-2 x-m

integer part radix fractional part

point

where,

r is the base of the number N,

xn is the most significant digit (MSD),

x-m is the least significant digit (LSD).

4100 + 310 + 71

400 + 30 + 7

constructed around any integral base. Most

common ones used are: radix 10, radix 2,

radix 8, radix 16.

A number in any weighted-positional number

system can be represented using a string of

digits (symbols) :

(1418)10

734

Number Systems

(437)14

437

{ 0, 1, 2 , , r-1 }

The position values (weights) are powers of the base.

Each digit has a value relative to its position in the

number.

Any number greater than r can be described by a

combination these digits.

11

12

Number Systems

Representation of Numbers

Each number has a

unique representation.

Counting:

When you run out of

digits, make it a zero

and increment the next

place value to the left.

99 becomes 100

= xn r n + +x1r1 +x0r0 +x-1 r -1 + x-m r -m

= (M)10

13

binary digit)

The weights of each position are powers of two.

A number such as (101.01)2 will be expanded as:

2

22

1

-1 -2

10 -1 10 -2

3

5

15

0

20

1

-1 -2

2 -1 2 -2

0

1

16

Number Systems

Decimal

Decimal: Base 10

00

Binary: Base 2

01

02

Octal: Base 8

03

Hexadecimal: Base 16

04

Octal and Hex forms are 05

06

more convenient for

07

humans to use

08

Dont have to deal with

09

long and confusing strings 10

11

of 1s and 0s

12

Most computer manuals use13

either octal or hex numbers 14

Binary

0000

0001

0010

0011

0100

0101

0110

0111

1000

1001

1010

1011

1100

1101

1110

15

1111

(1010)2 = 1 x 23 + 0 x 22 + 1 x 21 + 0 x 20

=1x8 + 0x4 + 1x2 + 0x1

= 810 + 210 = (10)10

1

21

0

= 5.25 in the decimal system.

= 642.35 in the decimal system.

a number from base r to decimal

(xk is the kth digit of the number)

14

The positional values (weights) of each position are

powers of ten.

A number such as (642.35 )10 will be expanded as:

0

100

2

digits, make it a zero and

increment the next place

value to the left.

11two becomes 100two

Binary Numbers

1

101

4

unique representation.

Counting:

Decimal Numbers

2

102

6

Binary

Decimal

system can be easily converted to an equivalent

decimal number by expressing the number as a

polynomial in powers of the radix:

D = xk r k

k = -m

17

Octal Hexadecimal

00

0

01

1

02

2

03

3

04

4

05

5

06

6

07

7

10

8

11

9

12

A

13

B

14

C

15

D

16

E

17

F

18

It takes 3 binary digits Decimal

00

(bits) to represent the

01

numbers 0-7

02

Each group of 3 bits

03

04

corresponds to exactly

05

one octal digit

06

It takes 4 (bits) to

07

represent the numbers

08

09

0-15

10

Each group of 4 bits

11

corresponds to exactly

12

one hex digit

13

Binary

0000

0001

0010

0011

0100

0101

0110

0111

1000

1001

1010

1011

1100

1101

14

1110

15

1111

Octal Numbers

Octal Hexadecimal

00

0

01

1

02

2

03

3

04

4

05

5

06

6

07

7

10

8

11

9

12

A

13

B

14

C

15

D

16

E

17

F

19

0

160

1

81

4

0

80

2

26 25 24 23 22 21 20

64+0+16+0+0+2+1 = (83)10

21

Binary-to-Decimal Conversion

20

21

22

23

24

25

26

27

28

29

210

211

212

213

214

215

216

1

2

4

8

16

32

64

128

256

512

1024

2048

4096

8192

16384

32768

65536

1K

2K

4K

8K

16K

32K

64K

22

Decimal-to-Binary Conversion

12-2

= 8 + 0 + 2 + 1 + + = (11.75)10

Repeated

Subtraction

when subtracted from N it yields a positive

difference N1

2. Place a 1 in the MSB

3. Repeat Step 1, starting from N1 and finding

difference N2 . Place a 1 in the corresponding bit.

Stop when the difference is zero.

2

1

0

-1

-2

(100.101)

2 = 12 + 02 + 02 + 12 + 02 + 12

3

= 4 + 0 + 0 + + 0 + = (4.625)10

(111.10)2 = 122 + 121 + 120 + 12-1 + 02-2

= 4 + 2 + 1 + + 0 = (7.5)10

(011.001)2 = 022+121+120+02-1+02-2+12-3

= 0 +2 + 1 + 0 + 0 + = (3.125)10

ELE 107 Dr. Derya Altunay

20

= (1615.1875)10 in the decimal system.

ELE 107 Dr. Derya Altunay

-1 -2

8 -1 8 -2

3

0

= (418.375)10 in the decimal system.

1010011

-1 -2

16 -1 16 -2

3

2

82

6

refers to a power of two:

B, C, D , E and F.

The positional values (weights) of each position are

powers of sixteen.

A number such as (64F.30 )16 will be expanded as:

1

161

The positional values (weights) of each position are

powers of eight.

A number such as (642.30 )8 will be expanded as:

Binary-to-Decimal Conversion

Hexadecimal Numbers

2

162

23

24

Decimal-to-Binary Conversion

Start with decimal integer N = (25)10

Decimal-to-Binary Conversion

Repeated

Subtraction

25 - 24 = 25 - 16 = 9

Subtract largest power of two Difference

9 - 23 = 9 - 8 = 1

Subtract largest power of two Difference

1 - 20 = 1 - 1 = 0

Now, we see (25)10 = 24 + 23 + 20 = (1 1 0 0 1)2

until you get to zero

2. Read the remainders in reverse order.

Repeated

Subtraction

+ 23 + + 21 + 20

1 0 1 1)2

26

Decimal-to-Binary Conversion

Let N be a decimal integer:

512 = 29

128 = 27

64 = 26

8 = 23

2 = 21

1 = 20

203 128 = 75 = N2

75 64 = 11 = N3

11 8 = 3 = N4

3 2 = 1 = N5

1 1 = 0 = N6

(715)10 = 29 +

27 + 26

=(1 0 1 1 0

25

Let N = (715)10

Decimal-to-Binary Conversion

Let N= (109)10

Repeated

109/2 = 54 remainder 1 (l.s.b)

Division

54/2 = 27 remainder 0

27/2 = 13 remainder 1

13/2 = 6 remainder 1

Read

6/2 = 3 remainder 0

backwards

3/2 = 1 remainder 1

1/2 = 0 remainder 1 (m.s.b)

Repeated

Division

(109)10 = (1101101)2

27

28

Binary Octal

Binary Hexadecimal

3 bits per group starting from the radix point.

4 bits per group starting from the radix point.

(3

( 2

7 . 1

5 )8

(2

( 2

6 . 5

4 )8

29

C .

D )16

B

3.

C )16

30

Octal Hexadecimal

Go through decimal:

Hex Decimal Octal

Octal Decimal Hex

carried out by separating the number into its

integer and fraction parts and converting

each part separately.

Divide the integer successively by r and collect

the remainders backwards (read up).

Multiply the fraction successively by r , keep

track of the integral part until the fraction

becomes zero, and read down.

Hex Binary Octal

Octal Binary Hex

31

Decimal to Binary

(6.6875)10 = ( ? )2 = (110.1011)2

Integer part:

6/2 = 3 remainder 0 (l.s.b)

3/2 = 1 remainder 1

1/2 = 0 remainder 1 (m.s.b)

Fraction part:

0.6875 x 2 = 1.3750 (m.s.b)

0.3750 x 2 = 0.7500

0.7500 x 2 = 1.5000

0.5000 x 2 = 1.0000 (l.s.b)

Decimal to Octal

Read

up

(167.6875)10 = ( ? )8 = (247.54)8

Integer part:

167/8 = 20 remainder 7 (l.s.d)

20/8 = 2 remainder 4

2/8 = 0 remainder 2 (m.s.d)

Fraction part:

Read

down

0.500 x 8 = 4.000 (l.s.d)

33

0.5 x 16

= 8.0 (l.s.d)

ELE 107 Dr. Derya Altunay

Read

up

Read

down

Decimal to Hexadecimal

(1631.78125)10 = ( ? )H = (65F.C8)H

Integer part:

1631/16 = 101 remainder 15 = F (l.s.d)

101/16 = 6 remainder 5

6/16 = 0 remainder 6 (m.s.d)

Fraction part:

32

34

Notes on Fractions

Radix point (number point)

Read

up

Binary point in base 2

Octal point in base 8

Hex point in base 16

separately

Read

down

35

36

Notes on Fractions

Notes on Fractions

(Base)0 is always 1 regardless of the base

Example: (427.6)10

(4276)10

Shift the radix point one place to the left

numbers in different number bases

Example: (427.6)10

37

(42.76)10

38

Notes on Fractions

Notes on Fractions

(0.10101)2 = (0.65625)10

(0.4293)10

Position

10-1

10-2

10-3

10-4

Value

1/10

1/100

1/1000

1/10000

Position

2-1

2-2

2-3

2-4

2-5

Value

1/2

1/4

1/8

1/16

1/32

Sum

Sum

.4

.02

.009

.0003

39

Notes on Fractions

0.125

0.03125

40

Notes on Fractions

(0.6875)10 = (0.1011)2

(0.9375)10 = (0.74)8

0.6875 x 2 = 1.3750

0.9375 x 8 = 7.5000

0.3750 x 2 = 0.7500

0.5000 x 8 = 4.0000

0.7500 x 2 = 1.5000

(terminates)

(0.513)10 = (?)8

0.5000 x 2 = 1.0000

(terminates)

ELE 107 Dr. Derya Altunay

.5

0 x 1/16 1 x 1/32

41

0.513 x 8 = 4.104

0.104 x 8 = 0.832

0.832 x 8 = 6.656

0.656 x 8 = 5.248

0.248 x 8 = 1.984

. . . (does not terminate!)

ELE 107 Dr. Derya Altunay

42

Notes on Fractions

Notes on Fractions

0.975 x 8 = 7.800

0.800 x 8 = 6.400

0.400 x 8 = 3.200

0.200 x 8 = 1.600

0.600 x 8 = 4.800

0.800 x 8 = 6.400

types 1/10k and 1/2k

A number representable in decimal may not be

representable in binary

The converse is true: all fractions of the form 1/2k

can be represented in decimal

another are stopped

If there is a rational solution or

When the desired accuracy is attained

(repeates!)

43

Number Ranges

Data Representation

When we communicate with each other, the information

is represented in an understandable notation, e.g., we use

unsigned integers and fractions:

Integer part (16-bit)

Letters to represent text

Text and numbers are entered through keyboard/mouse

Text, numbers, and images are displayed on the screen

216-1

Integer range:

0 to

(0 to 65535)

16

Fraction range:

0 to (2 -1) / 216

(0 to 65535/65536 = 0.9999847412)

How do humans store the information internally?

How do computers store the information internally?

45

Data Representation

Humans:

Computers:

computer commonly manipulates:

Text, numbers,

sounds

???

Text, numbers,

images, sounds

Text, numbers,

images, sounds

Numeric

Character

Visual

Audio

Instructional

into an acceptable representation that the

computer will accept.

Binary Numbers

ELE 107 Dr. Derya Altunay

46

Data Representation

Internal

Text, numbers,

images, sounds

44

47

48

Binary Systems

Binary Systems

represented and manipulated is called the

binary system.

All modern computers work with a system of

numbers called binary numbers.

cheapest and function most reliably if they

assume only two states.

Open circuit

Closed circuit

49

Binary Systems

Binary systems have two

values

Zero and One

to represent using

physical phenomena

All numbers can be

represented in binary as

well as in any other base

Zero

0

False

Off

Low V

0V

Current

N-S polar.

Cold

50

Binary Systems

One

1

True

On

High V

5V

No current

E-W polar.

Hot

51

ON

OFF

information

can have two values

can represent numbers,

codes, or instructions

switches: yes and no, black

and white, high and low, or

ON and OFF

52

Bits as Instructions

Off/On Switches

grouping bits as units

constructing combinations of off or on

switches.

of bits.

For instance, 01101010 might instruct the

computer to add two numbers.

OFF

or

ON

to find numbers stored in memory or where

to store them.

ELE 107 Dr. Derya Altunay

53

54

Zero or One?

The Bit

the digits zero and one.

or

one bit

two bits

three bits

digits in the binary system.

55

Each 0 or 1

in the binary

system is

called a bit.

56

Representation of Numbers

The Byte

A group of 8 bits is called a byte.

Has eight possible

combinations on and off.

Could be used to indicate the

numbers 0, 1, 2, 3, 4, 5, 6, 7.

0 = 000 4 = 100

1 = 001 5 = 101

2 = 010 6 = 110

3 = 011 7 = 111

= J

Storing Bytes

58

Computer Word

in the number of bytes they can hold:

bits that constitute a common unit of data.

Word length varies by computer.

For example:

1 megabyte (MB) = 220 or 1,048,576 bytes

1 gigabyte (GB) = 230 or 1,073,741,824 bytes

1 terabyte (TB) = 240 or about one million MB

1 petabyte (PB) = 250 or about one million GB

(a letter, digit, or special character).

57

32 bits = 4 bytes = one word length

64 bits = 8 bytes = one word length

bits: Intel Pentium 32 bits , Intel Itanium 64 bits

59

60

10

Bits as Codes

represent which characters on a keyboard is

called ASCII.

ASCII has been adopted, as the standard, by the

U.S. government and is found in a variety of

computers.

0 1 0 0 1 0 1 0

ASCII-8 code

Code for Information Interchange

Most widely used code,

represents each character as a

unique 8-bit code.

Keyboard character

61

62

The binary number system is the most natural

system for the computer, but people are

accustomed to the decimal system.

Computers work internally with binary

numbers, the I/O generally uses decimal

numbers (human-interface).

Binary Codes

ELE 107

Computers and Programming I

63

Terminology

A codeword (encoding) is a symbolic

representation based on the binary

alphabet, that is a sequence of 1s and 0s.

perform operations in binary, and convert

the binary results back to decimal.

Therefore, we have to store the decimal

numbers in the computer in a way that they

can be converted to binary.

We represent the decimal digits by a

binary code.

ELE 107 Dr. Derya Altunay

64

of bits in the codeword. For example,

0110010 has a length of seven.

65

66

11

Terminology

Terminology

An n-bit binary code is a group of n bits that

assume up to 2n distinct combinations of 1s

and 0s.

For example, a set of 4 distinct numbers can

be represented by 2-bit codes such that each

number in the set is assigned exactly one of

the combinations in {00,01,10,11}.

the set {110, 001, 101, 011, 111 } is a code

that has five codewords.

Because each codeword has the same

length, this is a fixed-length code.

Variable-length codes have codewords

with different lengths.

67

Terminology

BCD

must be satisfied.

A code that uses n-bit strings need not contain

2n valid codewords.

At least four bits are necessary to represent

the ten decimal digits (6 are unused) .

There are many different ways to choose ten

4-bit codewords.

called binary-coded decimal (BCD).

BCD numbers are decimal numbers even

though they are represented in bits.

Each decimal digit is represented by a 4-bit

unsigned binary number.

Multiple digit decimal numbers are represented

by coding each of the digits.

69

70

BCD

BCD

Decimal Symbol

0

1

2

3

4

5

6

7

8

9

number to binary.

For example (97)10 , when converted to binary,

is (1100001)2.

97 when represented in BCD is (1001 0111)BCD.

Although BCD requires more bits, it is easier to

understand and interpret.

68

71

BCD Digit

0000

0001

0010

0011

0100

0101

0110

0111

1000

1001

72

12

BCD

BCD is a weighted code because each

decimal digit can be obtained by assigning a

fixed weight to each codeword bit.

The weights are 8, 4, 2, and 1 8421 code

Other binary codes besides BCD exist to

represent decimal digits:

2421 code

Excess-3 (XS-3) code

Bi-quinary code

1-out-of-10 code, etc.

ELE 107 Dr. Derya Altunay

73

74

are both examples of self-complementing

codes.

Self-complementing property:The 9s

complement of each digit (9-d) is obtained by

complementing each bit in the codeword.

Self-complementing property is useful when

performing operations such as subtraction.

The bits are multiplied by indicated weights

and the sum gives the decimal digit.

The XS-3 code is a nonweighted code.

XS-3 code is obtained from the

corresponding BCD code added to 3.

XS-3 code is useful in decimal subtraction.

75

76

Gray Code

decimal digit.

The first two bits indicate whether the digit

is in the range 0-4 or 5-9.

The last five bits indicate which of the five

numbers in the selected range is

represented.

Any advantage using more than the minimum

number of bits in a code ?

all successive codewords differ in only one bit

(cyclic codes).

An important cyclic code is the Gray code.

Continuous, or analog, information is converted

into digital form by means of an A/D converter.

The Gray code, is sometimes used for the

converted digital data.

Used in electromechanical applications of

digital systems, such as copy machines, brake

systems, machine tools, etc.

77

78

13

Gray Code

Gray Code

codeword changes between each pair of successive

codewords.

This is useful when the analog signal is on the

border between two of the binary coded values.

For example, switching from 7 (0111) to 8 (1000)

requires four bits to be changed simultaneously. If

this does not happen, then various illegitimate

numbers could be momentarily generated during

the transition.

Using the Gray code keeps the value from being

misrepresented in such cases.

sometimes used to provide

the timing sequences that

control the operations in a

digital system.

The Gray code is also an

example of a reflected

code ; i.e., the n-bit code

can be obtained by reflecting

the (n -1)st-bit code.

79

Gray Code

Binary to Gray :

Alphanumeric:

g n = bn

g i = bi bi +1 ;

0 i n 1

(1 0 0 1 1 0)2 = (1 1 0 1 0 1)GRAY

Gray to Binary :

80

Characters: a b X Y

Number digits: 0 1 8 9

Punctuation marks: : ; ? !

Special-purpose characters: # & $ %

bn = g n

Computer converts into numbers for calculation

bi = g n g n 1 L g i

programmer

( 0 i n 1)

Examples: Phone numbers, ZIP codes

(1 0 1 1 0 1)GRAY = (1 1 0 1 1 0)2

ELE 107 Dr. Derya Altunay

81

Alphanumeric Codes

82

Representing Characters

ASCII : most widely used coding scheme

Unicode : developed for worldwide use

characters

Standard (consistency): input and output device

must recognize same code

Value of binary number representing character

corresponds to placement in the alphabet

file (Although a text file can be encoded in

ASCII code, or Unicode)

83

84

14

ASCII

ASCII

Standards Institute)

American Standard Code for Information

Interchange.

The standard alphanumeric binary code

Represents

a code length of seven

Basic ASCII uses 7 bits to code 128 characters

Most computers manipulate the 7-bit ASCII

code as a byte with the m.s.b set to 0.

This extra bit is used for specific purposes:

punctuation characters

Plus small set of accents and other European

special characters

set to 1.

As a parity bit (check for memory/communication

errors)

85

ASCII

ASCII

87

88

control characters and the printable characters.

The control characters include the first 32

characters and the last character (delete).

The remaining characters are the printable

characters.

The printable characters can be generated by

typing the appropriate keys on keyboards.

The control characters can be generated by

holding down the control key while typing a

single character.

ELE 107 Dr. Derya Altunay

86

89

Decimal

0 31

ASCII

Invisible (control characters)

32 47

48 - 57

58 64

Characters 0 9

Comparators and other miscellaneous characters : ; ? @

65 - 90

91 96

97 122

123 127

More miscellaneous characters [ \ ] ^ _ '

Alphabetic (lower case a - z)

More miscellaneous characters { | } ~ DEL

90

15

Decoding

Unicode

to decode sequences of encoded characters.

Start breaking the sequence into subsequences

consisting of 7 bits.

Then match each subsequence to a character

using the ASCII table.

Decode the ASCII string :

10010001100101110110011011001101111

ASCII Latin-I subset of Unicode

Unicode used by Web browsers, Java, most software.

Nearly every character-based alphabet

Large set of ideographs for Chinese, Japanese and Korean

Composite characters for vowels and syllabic clusters

required by some languages

91

92

U+2602 (alt-09730) UMBRELLA = rainy weather

U+2603 (alt-09731) SNOWMAN = snowy weather

U+221E INFINITY

93

94

for Unicode

U+2654 (alt-09812) WHITE CHESS KING

U+2655 (alt-09813) WHITE CHESS QUEEN

U+2656 (alt-09814) WHITE CHESS ROOK

U+2657 (alt-09815) WHITE CHESS BISHOP

U+2658 (alt-09816) WHITE CHESS KNIGHT

U+2659 (alt-09817) WHITE CHESS PAWN

95

96

16

Character Encodings

Error Detection/Correction

communication.

Machine cannot provide a direct representation

for every character we use (There are many

symbols and new symbols are created).

Each machine provides a limited set of

characters called the character set of the

machine.

Now almost every manufacturer uses the

ASCII character set.

incorrectly change the value.

We can use an error detection or an error correction

strategy to limit the scope of that change.

In error detection, the goal is to detect errors that

occur. The detected errors cannot be corrected, but

can prompt the data to be retransmitted.

The goal of error correction is to correct any errors

that occur during transmission.

Error correction is frequently called error masking

because errors are not visible to any part of the

system other than the receiver.

97

Bit Flip

Example

Suppose that you

Bit

send the ASCII

flipped

encoding for the

none

character S

0

(101 0011).

1

Show the

2

different values

3

that a receiver

4

will receive if a

5

single bit is

flipped during

6

transmission.

codes will be considered.

We only consider errors that change individual

bits.

We ignore the possibility of inserting or

deleting bits.

Changes to bits are frequently called bit flips

because the change flips the bit from 0 to 1 or

from 1 to 0.

ELE 107 Dr. Derya Altunay

99

Hamming Distance

Received

pattern

101 0011

101 0010

101 0001

101 0111

101 1011

100 0011

110 0011

001 0011

Received

symbol

S

R

Q

W

[

C

c

^S

100

Hamming Distance

two codewords, you count the number of bits in

the first codeword that need to be changed to result

in the second codeword.

1011001 and 1011010?

To convert the first pattern to the second , we need to

change the first and the second bits in the first pattern.

The Hamming distance between the two patterns is 2.

ELE 107 Dr. Derya Altunay

98

101

considering the elements of the code in a pair-wise

fashion.

Given a fixed-length code, the Hamming distance for

the code is the minimum distance between any two

codewords in the code.

What is the Hamming distance of the following code?

{ 1010, 1101, 0110 }

dist (1010, 1101) = 3

dist (1010, 0110) = 2

The Hamming distance is 2.

dist (1101, 0110) = 3

ELE 107 Dr. Derya Altunay

102

17

Hamming Distance

Hamming Distance

degree of redundancy in the code.

If a code has a Hamming distance of two,

changing a single bit in any of the codewords

will result in a bit pattern that is not in the code.

Thus, we can decide if an error introduced a

single bit flip.

A code with a minimum distance of 2c + d + 1

can correct up to c bit errors and detect up to

additional d bit errors.

10111011

10010011 it is 2

91738254 and 92337254 is ?

91738254

92337254 it is 3

COMPUTATION and CALCULATION is ?

COMPUTATION

CALCULATION it is 4

103

104

Parity

Parity Bit

Hamming distance of a code is at least two.

The parity of a binary pattern is determined by

counting the number of 1s in the pattern.

If the number of 1s is even, then the pattern has even

parity ; otherwise, the pattern has odd parity.

What is the parity of the pattern 1010111?

parity, we add a bit called the parity bit, to each

codeword.

Given a codeword, we set the parity bit to 1 or 0

to make sure that the resulting bit pattern has the

desired parity.

Then we add a parity bit to the ASCII code, the

parity bit is the 8th bit in the codeword.

If every codeword in a code has the same parity, the

code must have a Hamming distance of at least two.

105

Parity Bit

Example

Symbol

0

1

2

3

A

d

#

computers exchange information.

The sender and the receiver must agree on the

type of parity.

The simple parity scheme provides us with

enough information to detect a single error, but

not enough to correct it.

106

107

ASCII

011 0000

011 0001

011 0010

011 0011

100 0001

110 0100

010 0011

Even parity

0011 0000

1011 0001

1011 0010

0011 0011

0100 0001

1110 0100

1010 0011

Odd parity

1011 0000

0011 0001

0011 0010

1011 0011

1100 0001

0110 0100

0010 0011

108

18

- MAX DNA DPU_a1Hochgeladen vonld_ganesh
- Mid semester exam - Computer Fundamentals - (101) - SLIITHochgeladen vonSankha Palihawadana
- Report Encryption DecryptionHochgeladen vonSimranjotSingh
- Lesson 4Hochgeladen vonpubmed
- Computer CodesHochgeladen vonAbdul Hameed
- Emu8086 TutorialHochgeladen vonhlvhung
- java_fileHochgeladen vonAtinderpal Singh
- 2cdc120036m0201Hochgeladen vonIrfan Ashraf
- fgsrgsg txtHochgeladen vonRahul Shivanand Shandilya
- Number SystemHochgeladen vonarjun
- Math Lab 05Hochgeladen vonKellogg Yu
- 121 Lec DelimitedHochgeladen vonJonathanA.Ramirez
- UntitledHochgeladen vonapi-174391216
- Access Serial PortsHochgeladen vonMarco Mancin
- MC0061Hochgeladen vonkaranpuri6
- Bit ManipulationHochgeladen vonthietdaucong
- 20091218112714 j Yee 1 zHochgeladen vonMicky Boza
- 7260844 Basics of PLCsHochgeladen vonmirkofedor
- Number Systems and its conversionHochgeladen vonMAYA
- Hid Cock DataHochgeladen vonSuryakant Solanki
- note2_hoHochgeladen vonlinchi
- ECC208A_4Hochgeladen vonKiran Kumar B M
- Binary - Learn.sparkfun.comHochgeladen vonPav
- Pg213 Pcie4 Ultrascale PlusHochgeladen vonMai Khoa
- Acuvim 72 User's Manual V1.0Hochgeladen vonSang Penggila Hujan
- V02S120101Hochgeladen vonkudd
- Computer Studied Past Papers 2210Hochgeladen vonJohn Winchester Domingo
- Prog-Lang-C.docxHochgeladen vonk l mandal
- digital.ppt,chapter1.pdfHochgeladen vontazeb Abebe
- Compendium_computer architecture.pdfHochgeladen vonThobius Joseph

- energybands-2pHochgeladen vonpursey
- 33-Synchronous_Generators_part2.pdfHochgeladen vonpursey
- Clock GeneratorHochgeladen vonpursey
- Ds 18007Hochgeladen vonMichael Bradley
- Thesis FinalHochgeladen vonAhmed Tarhan
- Electrons Holes 2pHochgeladen vonpursey
- note2Hochgeladen vonspj99696649148
- w9 Hacettepe[2016]Hochgeladen vonpursey
- 2008-bah-fiz144-ara2-mHochgeladen vonpursey
- Circuits+ RC ch27Hochgeladen vonpursey
- ELE107_ELE107-Week8-2014.pdfHochgeladen vonpursey
- ELE107_ELE107-Week6-2014.pdfHochgeladen vonpursey
- ELE107_ELE107-Week7-2014.pdfHochgeladen vonpursey
- ELE107_ELE107-Week4-2014.pdfHochgeladen vonpursey
- ELE107_ELE107-Week3-2014.pdfHochgeladen vonpursey
- ELE107_ELE107-Week1-B-2014Hochgeladen vonpursey
- Thevenin Norton Superposition-2pHochgeladen vonpursey
- Pnjunction Slides 2pHochgeladen vonpursey
- ohmslaw-2pHochgeladen vonpursey

- 2016 Parts CatalogueHochgeladen vonAnonymous 1XBCMX
- 910_ERP605_BPD_EN_INHochgeladen vonPutra Saleh Siregar
- wheelsHochgeladen vonneeshakothari31
- EXP_0004Hochgeladen vonKishore Reddy
- TOWARDS AN ORGANIC PERSPECTIVE ON STRATEGY_FARJOUN (2002)Hochgeladen vonSaurabh Marya
- Dsc How to Program a Dsc SystemHochgeladen vonMauricio Venado
- MbaHochgeladen vonShiva Prakasam Perneti
- Comparison Between Micro-Deval and Los Angeles Aggregate TestsHochgeladen vonyusuf
- Cisco 7912Hochgeladen vonkizonz
- Mock Exam 2017Hochgeladen vonطه احمد
- pipeHochgeladen vonTahuu Ahmed
- JAWAD_CV_10-May-2011Hochgeladen vonjawadkhan0428870
- E-Studio16!20!25 Operator Manual Toshiba Wiewer EnHochgeladen vonAJ
- Carbon Policy in SwitzerlandHochgeladen vonPradeep Kumar
- KEB CombivertHochgeladen vonruisengo
- Data Sheet Heradesign Superfine_englHochgeladen vonDaniel Maft
- Calgary John Howard Society Responds to Community ConcernsHochgeladen vonPreventCrimeNow
- 00Jenny-JLY16v3Hochgeladen vonSatishKumarSinha
- bmat_testseriesprosp2012Hochgeladen vonShipra Kumari
- AutoCAD Time SaversHochgeladen vonPraveen9677
- ATBA164DOMHochgeladen vonUsman Ahmad
- 28701fHochgeladen vonphangiakhoi
- Referencing Styles in ResearchHochgeladen vonHeena Nargotra
- dse550-manual.pdfHochgeladen vonVinicius
- Salinan terjemahan METODEHochgeladen vonkomang ridwan
- 6SL3210 1PE24 5UL0 Datasheet EnHochgeladen vonWaqar Shaikh
- Mass Effect 2Hochgeladen voniuliuscezar59
- Cornerstone Seminars Fidic Contracts[1]Hochgeladen vonNidai Ilkay
- c inheritance exercises.pdfHochgeladen vonBrian Guvava
- HTC Blackstone Service ManualHochgeladen vonthebuzzdev

## Viel mehr als nur Dokumente.

Entdecken, was Scribd alles zu bieten hat, inklusive Bücher und Hörbücher von großen Verlagen.

Jederzeit kündbar.