Number Systems

16
Introduction to Computer Engineering by Richard E. Haskell Number Systems Module M3.1 Sections 2.1-2.2

description

Number Systems. Module M3.1 Sections 2.1-2.2. Number Systems. Counting in Binary Hexadecimal and Octal Numbers Positional Notation Fractional Numbers. Counting in Binary. BINARY HEX. Position:8421. 00000 00011 00102 00113 01004 01015 01106 - PowerPoint PPT Presentation

Transcript of Number Systems

Page 1: Number Systems

Introduction to Computer Engineering by Richard E. Haskell

Number Systems

Module M3.1

Sections 2.1-2.2

Page 2: Number Systems

Introduction to Computer Engineering by Richard E. Haskell

Number Systems

• Counting in Binary

• Hexadecimal and Octal Numbers

• Positional Notation

• Fractional Numbers

Page 3: Number Systems

Introduction to Computer Engineering by Richard E. Haskell

Counting in Binary

Position: 8 4 2 1

0 0 0 0 00 0 0 1 10 0 1 0 20 0 1 1 30 1 0 0 40 1 0 1 50 1 1 0 60 1 1 1 71 0 0 0 8

BINARY HEX

Page 4: Number Systems

Introduction to Computer Engineering by Richard E. Haskell

Counting in Binary

Position: 8 4 2 1

1 0 0 0 81 0 0 1 91 0 1 0 A1 0 1 1 B1 1 0 0 C1 1 0 1 D1 1 1 0 E1 1 1 1 F

BINARY HEX

Page 5: Number Systems

Introduction to Computer Engineering by Richard E. Haskell

Counting in Binary

128 64 32 16 8 4 2 1

0 0 1 1 0 1 0 0 52

1 0 1 0 0 0 1 1 163

1 1 1 1 1 1 1 1 255

BINARY DEC

Page 6: Number Systems

Introduction to Computer Engineering by Richard E. Haskell

Table 2.1Hexadecimal and Decimal Conversion

15 Byte 8 7 Byte 015 Char 12 11 Char 8 7 Char 4 3 Char 0Hex Dec Hex Dec Hex Dec Hex Dec0 0 0 0 0 0 0 01 4,096 1 256 1 16 1 12 8,192 2 512 2 32 2 23 12,288 3 768 3 48 3 34 16,384 4 1,024 4 64 4 45 20,480 5 1,280 5 80 5 56 24,576 6 1,536 6 96 6 67 28,672 7 1,792 7 112 7 78 32,768 8 2,048 8 128 8 89 36,864 9 2,304 9 144 9 9A 40,960 A 2,560 A 160 A 10B 45,056 B 2,816 B 176 B 11C 49,152 C 3,072 C 192 C 12D 53,248 D 3,328 D 208 D 13E 57,344 E 3,584 E 224 E 14F 61,440 F 3,840 F 240 F 15

Page 7: Number Systems

Introduction to Computer Engineering by Richard E. Haskell

Table 2.1Hexadecimal and Decimal Conversion

15 Byte 8 7 Byte 015 Char 12 11 Char 8 7 Char 4 3 Char 0Hex Dec Hex Dec Hex Dec Hex Dec0 0 0 0 0 0 0 01 4,096 1 256 1 16 1 12 8,192 2 512 2 32 2 23 12,288 3 768 3 48 3 34 16,384 4 1,024 4 64 4 45 20,480 5 1,280 5 80 5 56 24,576 6 1,536 6 96 6 67 28,672 7 1,792 7 112 7 78 32,768 8 2,048 8 128 8 89 36,864 9 2,304 9 144 9 9A 40,960 A 2,560 A 160 A 10B 45,056 B 2,816 B 176 B 11C 49,152 C 3,072 C 192 C 12D 53,248 D 3,328 D 208 D 13E 57,344 E 3,584 E 224 E 14F 61,440 F 3,840 F 240 F 15

87C9: 32,768 1,792 192

987C916 = 34,76110

Page 8: Number Systems

Introduction to Computer Engineering by Richard E. Haskell

Positional Notation

N = P4P3P2P1P0

= P4b4 + P3b3 + P2b2 + P1b1 + P0b0

58410 = 5 x 102 + 8 x 101 + 4 x 100

= 500 + 80 + 4= 584

Page 9: Number Systems

Introduction to Computer Engineering by Richard E. Haskell

Positional Notation

N = P4P3P2P1P0

= P4b4 + P3b3 + P2b2 + P1b1 + P0b0

101102 = 1 x 24 + 0 x 23 + 1 x 22 + 1 x 21 + 0 x 20

= 16 + 0 + 4 + 2 + 0= 2210

Binary

Page 10: Number Systems

Introduction to Computer Engineering by Richard E. Haskell

Positional Notation

N = P4P3P2P1P0

= P4b4 + P3b3 + P2b2 + P1b1 + P0b0

3AF16 = 3 x 162 + A x 161 + F x 160

= 3 x 256 + 10 x 16 + 15 x 1= 768 + 160 + 15= 94310

Hex

Page 11: Number Systems

Introduction to Computer Engineering by Richard E. Haskell

Positional Notation

N = P4P3P2P1P0

= P4b4 + P3b3 + P2b2 + P1b1 + P0b0

4578 = 4 x 82 + 5 x 81 + 7 x 80

= 4 x 64 + 5 x 8 + 7 x 1= 256 + 40 + 7= 30310

Octal

Page 12: Number Systems

Introduction to Computer Engineering by Richard E. Haskell

Fractional Numbers

N = ...P3P2P1P0 . P-1P-2P-3...

= ... + P3b3 + P2b2 + P1b1 + P0b0

+ P-1b-1 + P-2b-2 + P-3b-3 + ...

375.1710 = 3 x 102 + 7 x 101 + 5 x 100

+ 1 x 10-1 + 7 x 10-2 = 300 + 70 + 5 + 0.1 + 0.07= 375.17

Page 13: Number Systems

Introduction to Computer Engineering by Richard E. Haskell

Fractional Numbers

N = ...P3P2P1P0 . P-1P-2P-3...

= ... + P3b3 + P2b2 + P1b1 + P0b0

+ P-1b-1 + P-2b-2 + P-3b-3 + ...

1101.112 = 1 x 23 + 1 x 22 + 0 x 21 + 1 x 20 + 1 x 2-1 + 1 x 2-2

= 8 + 2 + 0 + 1 + 1/2 + 1/4= 11.7510

Binary

Page 14: Number Systems

Introduction to Computer Engineering by Richard E. Haskell

Fractional Numbers

N = ...P3P2P1P0 . P-1P-2P-3...

= ... + P3b3 + P2b2 + P1b1 + P0b0

+ P-1b-1 + P-2b-2 + P-3b-3 + ...

1AB.616 = 1 x 162 + A x 161 + B x 160

+ 6 x 16-1 = 1 x 256 + 10 x 16 + 11 x 1 + 6/16 = 256 + 160 + 11 + 0.375 = 427.37510

Hex

Page 15: Number Systems

Introduction to Computer Engineering by Richard E. Haskell

Fractional Numbers

N = ...P3P2P1P0 . P-1P-2P-3...

= ... + P3b3 + P2b2 + P1b1 + P0b0

+ P-1b-1 + P-2b-2 + P-3b-3 + ...

173.258 = 1 x 82 + 7 x 81 + 3 x 80

+ 2 x 8-1 + 5 x 8-2

= 1 x 64 + 7 x 8 + 3 x 1+ 2/8 + 5/64

= 64 + 56 + 3 + 0.25 + 0.078125= 123.32812510

Octal

Page 16: Number Systems

Introduction to Computer Engineering by Richard E. Haskell

Questions

What is the decimal value of 2435?

What is the decimal value of 21.34?