Docsity

techniek digital for university, Resumos de Direito Digital

Pré-visualização parcial do texto

Baixe techniek digital for university e outras Resumos em PDF para Direito Digital, somente na Docsity!

1

Chapter 1 Number Systems and Codes

2

Number Systems (1)

Positional Notation

N = ( a

n-

a

n-

... a

1

a

0

. a -

a

-

... a

-m

r

where. = radix point

r = radix or base

n = number of integer digits to the left of the radix point

m = number of fractional digits to the right of the radix point

a

n-

= most significant digit (MSD)

a

-m

= least significant digit (LSD)

Polynomial Notation (Series Representation)

N = a

n-

x r

n-

  • a

n-

x r

n-

  • ... + a

0

x r

0

  • a

-

x r

-

... + a

-m

x r

-m

N = (251.41)

10

= 2 x 10

2

  • 5 x 10

1

  • 1 x 10

0

  • 4 x 10

-

  • 1 x 10

-

a r

i

i

i m

n



1

4

Number Systems (3)

Important Number Systems (Table 1.1)

Decimal Binary Octal Hexadecimal

0 0 0 0

1 1 1 1

2 10 2 2

3 11 3 3

100 4 4

5 101 5 5

6 110 6 6

7 111 7 7

8 1000 10 8

9 1001 11 9

10 1010 12 A

11 1011 13 B

12 1100 14 C

13 1101 15 D

14 1110 16 E

15 1111 1 F

16 10000 20 10

5

Arithmetic (1)

Binary Arithmetic

Addition

111011 Carries

101011 Augend

  • 11001 Addend

Subtraction

0 1 10 0 10 Borrows

1 0 0 1 0 1 Minuend

  • 1 1 0 1 1 Subtrahend

7

Arithmetic (3)

  • Octal Arithmetic (Use Table 1.4) - Addition

1 1 1 Carries

5 4 7 1 Augend

  • 3 7 5 4 Addend

11445 Sum

  • Subtraction

6 10 4 10 Borrows

7 4 5 1 Minuend

  • 5 6 4 3 Subtrahend

1 6 0 6 Difference

8

Arithmetic (4)

Multiplication Division

326 Multiplicand

x 67 Multiplier

2732 Partial products

26772 Product

Quotient

Dividend

Remainder

Divider

10

Arithmetic (6)

Multiplication Division

B9A5 Multiplicand

x D50 Multiplier

3A0390 Partial products

96D

9A76490 Product

B

57F6D

79B

50F

85D

7F

6A

Remainder

Dividend

Quotient

Divider

11

Base Conversion (1)

  • Series Substitution Method - Expanded form of polynomial representation:

N = a

n-

r

n-

+ … + a

0

r

0

+ a

-

r

-

+ … + a

-m

r

-m

(1.3)

  • Conversation Procedure (base A to base B ) - Represent the number in base A in the format of Eq. 1.3. - Evaluate the series using base B arithmetic.
  • Examples : - (11010)

2

(? )

10

N = 1 









0

= (16)

10

  • (8)

10

  • 0 + (2)

10

  • 0

= (26)

10

  • (627)

8

 (? )

10

N = 6





= (384)

10

  • (16)

10

  • (7)

10

= (407)

10

13

Base Conversion (3)

Examples

10

8

10

= (13B)

16

LSD

MSD

B

LSD

MSD

14

Base Conversion (4)

  • Radix Multiply Method - Used to convert fractions. - Underlying theory: - ( N

F

)

A

= b

-

B

-

+ b

-

B

-

+ … + b

-m

B

-m

(1.5)

Here, ( N

F

)

A

is a fraction in base A and b

i

’s are the digits of ( N

F

)

B

in base

A.

  • B  N

F

= B ( b

-

B

-

+ b

-

B

-

+ … + b

-m

B

-m

)

= (Integer I

-

: b

-

) + (Fraction F

-

: b

-

B

-

+ … + b

-m

B

- ( m-1 )

)

  • In general, ( b

i

)

A

is the integer part I

-i

, of the product of F

- ( i+1 )

( B

A

).

  • Conversion Procedure
    1. Let F -

= ( N

F

)

A

.

  1. Compute digits ( b

-i

)

A

, for i = 1 … m , by multiplying F

i

by ( B )

A

,

producing integer I

-i

, which represents ( b

-i

)

A

, and fraction F

- ( i+1 )

.

  1. Convert each digits ( b

-i

)

A

to base B.

16

Base Conversion (6)

General Conversion Algorithm

Algorithm 1.

To convert a number N from base A to base B , use

(a) the series substitution method with base B arithmetic, or

(b) the radix divide or multiply method with base A arithmetic.

Algorithm 1.

To convert a number N from base A to base B , use

(a) the series substitution method with base 10 arithmetic to convert N

from base A to base 10, and

(b) the radix divide or multiply method with decimal arithmetic to convert

N from base 10 to base B.

Algorithm 1.2 is longer, but easier and less error prone.

17

Base Conversion (7)

  • Example

(18.6)

9

= (? )

11

(a) Convert to base 10 using series substitution method:

N

10

= 1  9

1

  • 8  9

0

  • 6  9

= 9 + 8 + 0.666…

= (17.666…)

10

(b) Convert from base 10 to base 11 using radix divide and multiply

method:

7.326 0.666  11

3.586 0.326  11

6.446 0.586  11

N

11

= (16.736 …)

11

.

19

Signed Number Representation

  • Signed Magnitude Method - N =  ( a

n-

... a

0

.a

-

... a

-m

)

r

is represented as

N = (s a

n-

... a

0

.a

-

... a

-m

)

rsm

, (1.6)

where s = 0 if N is positive and s = r - 1 otherwise.

  • N = -(15)

10

  • In binary: N = -(15)

10

= -(1111)

2

= (1, 1111)

2sm

  • In decimal: N = -(15)

10

= (9, 15)

10sm

  • Complementary Number Systems - Radix complements ( r 's complements)

[ N ]

r

= r

n

  • ( N )

r

(1.7)

where n is the number of digits in ( N )

r

.

  • Positive full scale : r

n-

- 1

Negative full scale : -r

n

- 1

Diminished radix complements ( r-1 ’s complements)

[ N ]

r-

= r

n

  • ( N )

r

  • 1

20

Radix Complement Number Systems (1)

Two's complement of ( N )

2

2

[ N ]

2

6

2

2

2

2

( N )

2

+ [ N ]

2

2

2

2

If we discard the carry, ( N )

2

+ [ N ]

2

Hence, [ N ]

2

can be used to represent -( N )

2

• [ [ N ]

2

]

2

= [(010111)

2

]

2

2

2

2

= ( N )

2

Ten's complement of ( N )

10

10

[ N ]

10

10

10

10