Presentation is loading. Please wait.

Presentation is loading. Please wait.

Number Systems CIT 1121. Network Math www.thinkgeek.com.

Similar presentations


Presentation on theme: "Number Systems CIT 1121. Network Math www.thinkgeek.com."— Presentation transcript:

1 Number Systems CIT 1121

2 Network Math www.thinkgeek.com

3 Base 10 number system – The Math The decimal number system: based on powers of 10. Each column position of a value, from right to left, is multiplied by the number 10, which is the base number, raised to a power, which is the exponent. The power that 10 is raised to depends on its position to the left of the decimal point. 2134 = (2x10 3 ) + (1x10 2 ) + (3x10 1 ) + (4x10 0 )

4 Base 10 (Decimal) Number System Digits (10): 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Number of: 10 4 10 3 10 2 10 1 10 0 10,000’s 1,000’s 100’s 10’s 1’s 1,309 1 3 0 9 99 9 9 100 1 0 0

5 1. All digits start with 0 2. A Base-n number system has n number of digits: –Decimal: Base-10 has 10 digits –Binary: Base-2 has 2 digits –Hexadecimal: Base-16 has 16 digits 3. The first column is always the number of 1’s Each of the following columns is n times the previous column (n = Base-n) –Base 10: 10,000 1,000 100 10 1 –Base 2: 16 8 4 2 1 –Base 16: 65,536 4,096 256 16 1 Number System Rules

6 Base 2 number system – The Math 10110 2 = (1 x 2 4 = 16) + (0 x 2 3 = 0) + (1 x 2 2 = 4) + (1 x 2 1 = 2) + (0 x 2 0 = 0) = 22 (16 + 0 + 4 + 2 + 0)

7 Digits (2): 0, 1 Number of: 2 7 ___ ___ ___ 2 3 2 2 2 1 2 0 128’s 8’s 4’s 2’s 1’s Dec. 2 1 0 10 1 0 1 0 17 70 130 255 Base 2 (Binary) Number System

8 Digits (2): 0, 1 Number of: 2 7 2 6 2 5 2 4 2 3 2 2 2 1 2 0 128’s 64’s 32’s 16’s 8’s 4’s 2’s 1’s Dec. 2 1 0 10 1 0 1 0 17 1 0 0 0 1 70 1 0 0 0 1 1 0 130 1 0 0 0 0 0 1 0 255 1 1 1 1 1 1 1 1 Base 2 (Binary) Number System

9 Digits (2): 0, 1 Number of: 2 7 2 6 2 5 2 4 2 3 2 2 2 1 2 0 128’s 64’s 32’s 16’s 8’s 4’s 2’s 1’s Dec. 1 0 0 0 1 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 172 192 Converting between Decimal and Binary

10 Digits (2): 0, 1 Number of: 2 7 2 6 2 5 2 4 2 3 2 2 2 1 2 0 128’s 64’s 32’s 16’s 8’s 4’s 2’s 1’s Dec. 70 1 0 0 0 1 1 0 40 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 128 1 0 0 0 0 0 0 0 172 1 0 1 0 1 1 0 0 192 1 1 0 0 0 0 0 0 Converting between Decimal and Binary

11 Computers do Binary 0 1 If this is new to you, see me after class. Bits have two values: OFF and ON The Binary number system (Base-2) can represent OFF and ON very well since it has two values, 0 and 1 –0 = OFF –1 = ON Understanding Binary to Decimal conversion is critical in networking. Although we use decimal numbers in networking to display information such as IP addresses (LATER), they are transmitted as OFF’s and ON’s that we represent in binary.

12 Base 16 (Hexadecimal) Number System Digits (16): 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F Decimal Hexadecimal 0088 11 99 22 10A 33 11B 44 12C 55 13D 66 14E 77 15F

13 Digits (16): 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F Number of: ___ ___ 16 1 16 0 Dec. 16’s 1’s 8 9 10 15 16 17 Base 16 (Hexadecimal) Number System

14 Digits (16): 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F Number of: 16 3 16 2 16 1 16 0 Dec. 4,096’s 256’s 16’s 1’s 8 9 10 A 15 F 16 1 0 17 1 1 Base 16 (Hexadecimal) Number System

15 Digits (16): 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F Number of: 16 3 16 2 16 1 16 0 Dec. 4,096’s 256’s 16’s 1’s 25 66 100 254 255 Base 16 (Hexadecimal) Number System

16 Digits (16): 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F Number of: 16 3 16 2 16 1 16 0 Dec. 4,096’s 256’s 16’s 1’s 25 1 9 66 4 2 100 6 4 254 F E 255 F F Base 16 (Hexadecimal) Number System

17 Digits (16): 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F Number of: 16 3 16 2 16 1 16 0 Dec. 4,096’s 256’s 16’s 1’s 1 AC 2 0 3 Base 16 (Hexadecimal) Number System

18 Digits (16): 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F Number of: 16 3 16 2 16 1 16 0 Dec. 4,096’s 256’s 16’s 1’s 428 1 AC 515 2 0 3 Base 16 (Hexadecimal) Number System

19 Hexadecimal

20 Why Hexadecimal? Hexadecimal is perfect for matching 4 bits. 16 Hex values which means 16 4 bit possibilities. 4 bits can be represented by 1 Hex value 8 bits (1 byte or octet) can be represented by 2 Hex values Dec. Hex. Binary 8421 8421 0 0 0000 8 1 9 2 10 3 11 4 12 5 13 6 14 7 15

21 Why Hexadecimal? Dec. Hex. Binary Dec. Hex. Binary 8421 8421 0 0 0000 8 8 1000 1 1 0001 9 9 1001 2 2 0010 10 A 1010 3 3 0011 11 B 1011 4 4 0100 12 C 1100 5 5 0101 13 D 1101 6 6 0110 14 E 1110 7 7 0111 15 F 1111

22 Dec. Hex. Binary 0 0 0000 8 8 1000 1 1 0001 9 9 1001 2 2 0010 10 A 1010 3 3 0011 11 B 1011 4 4 0100 12 C 1100 5 5 0101 13 D 1101 6 6 0110 14 E 1110 7 7 0111 15 F 1111 ----------------------------------------------------- Here are 48 bits being transmitted: 000000000010000011100000011010110001011101100010 Break them up into 4 bit chunks: 0000 0000 0010 0000 1110 0000 0110 1011 0001 0111 0110 0010 0 0 2 Convert each 4 bits to Hexadecimal: Why Hex?

23 Dec. Hex. Binary 0 0 0000 8 8 1000 1 1 0001 9 9 1001 2 2 0010 10 A 1010 3 3 0011 11 B 1011 4 4 0100 12 C 1100 5 5 0101 13 D 1101 6 6 0110 14 E 1110 7 7 0111 15 F 1111 ----------------------------------------------------- Here are 48 bits being transmitted: 000000000010000011100000011010110001011101100010 Break them up into 4 bit chunks: 0000 0000 0010 0000 1110 0000 0110 1011 0001 0111 0110 0010 0 0 2 0 E 0 6 B 1 7 6 2 Convert each 4 bits to Hexadecimal: Why Hex?

24 Hexadecimal is an easy way to represent a string of bits. Here are 48 bits being transmitted: 0000000000100000011010110001011101100010 Break them up into 4 bit chunks: 0000 0000 0010 0000 1110 0000 0110 1011 0001 0111 0110 0010 Convert each 4 bits to Hexadecimal: 0 0 2 0 E 0 6 B 1 7 6 2

25 Converting Decimal, Hex, and Binary Dec. Hex. Binary 0 0 0000 8 8 1000 1 1 0001 9 9 1001 2 2 0010 10 A 1010 3 3 0011 11 B 1011 4 4 0100 12 C 1100 5 5 0101 13 D 1101 6 6 0110 14 E 1110 7 7 0111 15 F 1111 ----------------------------------------------------- Dec. Hex Binary Dec. Hex Binary Dec. Hex Binary 0 0010 10 F 1110 12 A 0000 5 C 0010 1000

26 Converting Decimal, Hex, and Binary Dec. Hex. Binary 0 0 0000 8 8 1000 1 1 0001 9 9 1001 2 2 0010 10 A 1010 3 3 0011 11 B 1011 4 4 0100 12 C 1100 5 5 0101 13 D 1101 6 6 0110 14 E 1110 7 7 0111 15 F 1111 ----------------------------------------------------- Dec. Hex Binary Dec. Hex Binary Dec. Hex Binary 0 0 0000 2 2 0010 10 A 1010 15 F 1111 14 E 1110 12 C 1100 10 A 1010 0 0 0000 5 5 0101 12 C 1100 2 2 0010 8 8 1000

27 Converting Hex, and Binary Dec. Hex. Binary 0 0 0000 8 8 1000 1 1 0001 9 9 1001 2 2 0010 10 A 1010 3 3 0011 11 B 1011 4 4 0100 12 C 1100 5 5 0101 13 D 1101 6 6 0110 14 E 1110 7 7 0111 15 F 1111 ----------------------------------------------------- Hex Binary Hex Binary Hex Binary 12 0001 0010 3C 99 AB 1A 00 02 B4 7D 0111 0111 1000 1111 1111 1111 0000 0010 1100 1001 0101 1100

28 Converting Hex and Binary (Bytes) Dec. Hex. Binary 0 0 0000 8 8 1000 1 1 0001 9 9 1001 2 2 0010 10 A 1010 3 3 0011 11 B 1011 4 4 0100 12 C 1100 5 5 0101 13 D 1101 6 6 0110 14 E 1110 7 7 0111 15 F 1111 ----------------------------------------------------- Hex Binary Hex Binary Hex Binary 12 0001 0010 3C 0011 1100 99 1001 1001 AB 1010 1011 1A 0001 1010 00 0000 0000 02 0000 0010 B4 1011 0100 7D 0111 1101 77 0111 0111 8F 1000 1111 FF 1111 1111 02 0000 0010 C9 1100 1001 5C 0101 1100

29 A little extra….

30 RGB Colors and Binary Representation A monitors screen is divided into a grid of small unit called picture elements or pixels. (See reading from Chapter 1). The more pixels per inch the better the resolution, the sharper the image. All colors on the screen are a combination of red, green and blue (RGB), just at various intensities.

31 Each Color intensity of red, green and blue represented as a quantity from 0 through 255. Higher the number the more intense the color. Black has no intensity or no color and has the value (0, 0, 0) White is full intensity and has the value (255, 255, 255) Between these extremes is a whole range of colors and intensities. Grey is somewhere in between (127, 127, 127)

32 RGB Colors and Binary Representation You can use your favorite program that allows you to choose colors to view these various red, green and blue values.

33 www.december.com For those of you interested in Web Design and Digital Media, you will work with colors based on hexadecimal code, hue, other codes, or shades. http://www.december.com/html/spec/color.html

34 Color Codes http://www.december.com/html/spec/colorcodes.html This page shows a variety of notations used to represent color including ways you can define colors in HTML or style sheets.

35 HTML With HTML (Hypertext Markup Language), colors are sometime described using their RGB color specification in hexadecimal.

36 HTML For example, the RGB code for Carrot Orange is #FF8E2A Or in decimal (255, 142, 42) How is FF8E2A the same as 255, 142, 42 ?

37 Why Hexadecimal? Dec. Hex. Binary 0 0 0000 8 8 1000 1 1 0001 9 9 1001 2 2 0010 10 A 1010 3 3 0011 11 B 1011 4 4 0100 12 C 1100 5 5 0101 13 D 1101 6 6 0110 14 E 1110 7 7 0111 15 F 1111 ----------------------------------------------------- We said the hexadecimal RGB code for Carrot Orange is #FF8E2A or in decimal (255, 142, 42) Remember that this is using 24 bits for color or 3 bytes. Carrot Orange is In binary: 1111 1111, 1000 1110, 0010 1010 In hexadecimal: F F, 8 E, 2 A In decimal: 255, 142, 42

38 Color Codes Dec. Hex. Binary 0 0 0000 8 8 1000 1 1 0001 9 9 1001 2 2 0010 10 A 1010 3 3 0011 11 B 1011 4 4 0100 12 C 1100 5 5 0101 13 D 1101 6 6 0110 14 E 1110 7 7 0111 15 F 1111

39 Chili Powder C 7 3 F 1 7 1100 0111 0011 1111 0001 0111 199 63 23

40 Number Systems


Download ppt "Number Systems CIT 1121. Network Math www.thinkgeek.com."

Similar presentations


Ads by Google