Presentation is loading. Please wait.

Presentation is loading. Please wait.

numbers BY SA.

Similar presentations


Presentation on theme: "numbers BY SA."— Presentation transcript:

1 http://proglit.com/

2 numbers

3 BY SA

4

5

6

7

8

9

10

11 0 1 bit (one of two states)

12

13 number system (a scheme for symbolically and verbally representing quantity)

14 unary (the tally system)

15  

16 positional notation (represents arbitrarily large quantities using a finite set of symbols)

17 decimal base-10 (positional notation using 10 symbols)

18 Arabic numerals 0 1 2 3 4 5 6 7 8 9

19 39 40

20 9 0909 …0000000009

21 0909 10

22 86999 87000

23 78 seventy-eight seven eight

24

25 octal base-8 (positional notation using 8 symbols)

26 0 1 2 3 4 5 6 7

27 0707 10

28 1 2 3 4 5 6 7 10 11 12 13 14 1 2 3 4 5 6 7 8 9 10 11 12 octal base-8 decimal base-10

29 15 16 17 20 21 22 23 24 25 26 27 30 13 14 15 16 17 18 19 20 21 22 23 24 octal base-8 decimal base-10

30 317777 320000

31 61 (decimal) 061 (octal)

32 05673

33 hexadecimal hex base-16 (positional notation using 16 symbols)

34 0 1 2 3 4 5 6 7 8 9 A B C D E F

35 0F0F 10

36 123456789ABC123456789ABC 1 2 3 4 5 6 7 8 9 10 11 12 hex base-16 decimal base-10

37 D E F 10 11 12 13 14 15 16 17 18 13 14 15 16 17 18 19 20 21 22 23 24 hex base-16 decimal base-10

38 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 hex base-16 decimal base-10

39 ADD BAD BEAD BEE BEEF CAFE DEAD DEAF DEED FAD FEED

40 0xADD 0xBAD 0xBEAD 0xBEE 0xBEEF 0xCAFE 0xDEAD 0xDEAF 0xDEED 0xFAD 0xFEED

41 0xA3BFFFFF 0xA3C00000

42 binary base-2 (positional notation using 2 symbols)

43 0 1

44 0101 10

45 1 10 11 100 101 110 111 1000 1001 1010 1011 1100 1 2 3 4 5 6 7 8 9 10 11 12 binary base-2 decimal base-10

46 13 14 15 16 17 18 19 20 21 22 23 24 binary base-2 decimal base-10 1101 1110 1111 10000 10001 10010 10011 10100 10101 10110 10111 11000

47 101b (binary) 101 (decimal)

48 10101111b 10110000b

49 http://proglit.com/

50 base conversions

51 36259

52 (30000) + (6000) + (200) + (50) + (9)

53 (3 * 10000) + (6 * 1000) + (2 * 100) + (5 * 10) + (9 * 1)

54 (3 * 10 4 ) + (6 * 10 3 ) + (2 * 10 2 ) + (5 * 10 1 ) + (9 * 10 0 )

55 36259 10 4 10 3 10 2 10 1 10 0 100001000100101

56 octal to decimal

57 03675

58 (03000) + (0600) + (070) + (05)

59 (03 * 01000) + (06 * 0100) + (07 * 010) + (05 * 01)

60 (03 * 010 3 ) + (06 * 010 2 ) + (07 * 010 1 ) + (05 * 010 0 )

61 (3 * 8 3 ) + (6 * 8 2 ) + (7 * 8 1 ) + (5 * 8 0 )

62 (3 * 512) + (6 * 64) + (7 * 8) + (5 * 1)

63 (1636) + (384) + (56) + (5)

64 03675 = 2081

65 decimal to octal

66 36256

67 (3 * 10 4 ) + (6 * 10 3 ) + (2 * 10 2 ) + (5 * 10 1 ) + (6 * 10 0 )

68 (03 * 012 4 ) + (06 * 012 3 ) + (02 * 012 2 ) + (05 * 012 1 ) + (06 * 012 0 )

69 (03 * 023420) + (06 * 01750) + (02 * 0144) + (05 * 012) + (06 * 01)

70 (072460) + (013560) + (0310) + (062) + (06)

71 36256 = 0106640

72 hex to decimal

73 0x36E59

74 (0x3 * 16 4 ) + (0x6 * 16 3 ) + (0xE * 16 2 ) + (0x5 * 16 1 ) + (0x9 * 16 0 )

75 (3 * 65536) + (6 * 4096) + (14 * 256) + (5 * 16) + (9 * 1)

76 (196608) + (24576) + (3584) + (80) + (9)

77 0x36E59 = 224857

78 binary to decimal

79 10101b

80 (1 * 2 4 ) + (0 * 2 3 ) + (1 * 2 2 ) + (0 * 2 1 ) + (1 * 2 0 )

81 (1 * 16) + (0 * 8) + (1 * 4) + (0 * 2) + (1 * 1)

82 (16) + (0) + (4) + (0) + (1)

83 10101b = 21

84 10101101b

85 12832841

86 (128) + (32) + (8) + (4) + (1)

87 10101101b = 173

88 2 2 4 2 3 8 2 4 16 2 5 32 2 6 64 2 7 128 2 8 256 2 9 512 2 10 1024 2 11 2048 2 12 4096 2 13 8192 2 14 16384 2 15 32768 2 16 65536 2 17 131072 2 18 262144 2 19 524288 2 20 1048576

89 decimal to binary

90 1)find biggest fitting power of two 2)subtract it out 3)repeat until left with 0

91 35872

92 32768 (2 15 )

93 1???????????????b

94 35872 - 32768 = 3104

95 2048 (2 11 )

96 10001???????????b

97 3104 – 2048 = 1056

98 1024 (2 10 )

99 100011??????????b

100 1056 – 1024 = 32

101 32 (2 5 )

102 10001100001?????b

103 32 – 32 = 0

104 1000110000100000b

105 why use hex and octal?

106 octal to binary (and vice versa)

107 0123456701234567 000 001 010 011 100 101 110 111 octal base-8 binary base-2

108 03673

109 0123456701234567 000 001 010 011 100 101 110 111 octal base-8 binary base-2

110 03673 011110111011b

111 1101010110b

112 001101010110b 01526

113 hex to binary (and vice versa)

114 0123456789ABCDEF0123456789ABCDEF 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 hex base-16 binary base-2

115 0x7E9 011111101001b

116 1100101101b 0x32D

117 recap Each digit is a coefficient of the number base raised to an increasing power. One technique works for all number base conversions. Shortcut conversions: decimal to binary (sum powers of 2) binary to decimal (subtract out powers of 2) octal and binary (1 octal digit = 3 binary digits) hex and binary (1 hex digit = 4 binary digits) Effectively, hex and octal serve as a compacter way of writing binary.

118 http://proglit.com/

119 meaning relies upon agreement

120 integer (whole number) 5878 0 -87 234

121 signed integer unsigned integer

122 0, 1, 2, 3, 4, 5… 0b, 1b, 10b, 11b, 100b, 101b…

123 n bits = 2 n values 1 bit = 2 values 2 bits = 4 values 3 bits = 8 values 4 bits = 16 values 5 bits = 32 values 6 bits = 64 values 7 bits = 128 values 8 bits = 256 values etc…

124 unsigned value range 1 bit = 0..1 2 bits = 0..3 3 bits = 0..7 4 bits = 0..15 5 bits = 0..31 6 bits = 0..63 7 bits = 0..127 8 bits = 0..255 etc…

125 10000011 (negative three) 00000011 (positive three) sign bit

126 11111100 (negative three) 00000011 (positive three) one’s complement

127 11111101 (negative three) 00000011 (positive three) two’s complement

128 00000011 (positive three) 11111101 (negative three) two’s complement

129 00000101 (negative three in excess-8) 00001011 (positive three in excess-8) excess-n

130 00100111 (negative three in excess-42) 00101101 (positive three in excess-42) excess-n

131 sign bit: -127 to +127 one’s complement: -127 to +127 two’s complement: -128 to +127 8-bit range

132 rational numbers 2/5 1/98 7/1 -61/1738

133 radix-point notation (ratio written as an integer component and a fractional component, separated by a radix point) 3/4 1/8 -7/1 138/20 0.75 0.125 -7.0 6.9

134 36.259

135 (30) + (6) + (0.2) + (0.05) + (0.009)

136 (3 * 10 1 ) + (6 * 10 0 ) + (2 * 10 -1 ) + (5 * 10 -2 ) + (9 * 10 -3 )

137 36.259 10 1 10 0 10 -1 10 -2 10 -3 1011/101/1001/1000

138 062.732 8181 8080 8 -1 8 -2 8 -3 811/81/641/512

139 10.111b 2121 2020 2 -1 2 -2 2 -3 211/21/41/8

140 finite rational (rational with a fractional component which can be expressed with a finite number of digits) 3/4 -7/1 138/20 1/3 738/61 0.75 -7.0 6.9 0.33 12.0983606557…

141 a ratio with denominator 2 a 5 b is finite in decimal a ratio with denominator 2 a is finite in octal a ratio with denominator 2 a is finite in hex a ratio with denominator 2 a is finite in binary all ratios which are finite in binary are also finite in decimal some ratios which are finite in decimal are also finite in binary

142 rational as two integers 3/4 Numerator: 00000011 Denominator: 00000100 -7/13 Numerator: 11111001 Denominator: 00001101

143 fixed-point 57/8 111.001b Integer: 00000111 Fraction: 00100000 (the computing equivalent of radix-point notation)

144 scientific notation engineering notation 362.354 = 3.62354 * 10 2 0.00736234 = 7.36234 * 10 -3 989777.1 = 9.897771 * 10 5

145 floating-point 21/2 1010.1b 1.0101b * 2 3 Significand: 10101000 Exponent: 00000011 (the computing equivalent of scientific notation)

146 6.75

147 110b + 0.?b

148 0.75 3/4

149 1/2 + 1/4 2 -1 + 2 -2

150 6.75 = 110.11b

151 = 1.1011b * 2 2

152 Significand: 11011000 Exponent: 00000010

153 IEEE floating-point (an international standard)

154 http://proglit.com/


Download ppt "numbers BY SA."

Similar presentations


Ads by Google