Computers and Math Binary, Hex, and Decimal Oh My Copyright © Texas Education Agency, All rights reserved.1
BACK TO THE FOUNDATION A brief review of decimal notation Copyright © Texas Education Agency, All rights reserved.2
Numbers Review a.Natural numbers b.Integers c.Positional numbering system d.Number base Copyright © Texas Education Agency, All rights reserved.3
Exponents Any number to the 0 power = 1 Example: 2 0 = 1 Any number to the 1 st power = that number Example: 2 1 = 2 Copyright © Texas Education Agency, All rights reserved.4
Decimals Copyright © Texas Education Agency, All rights reserved.5 Used with permission: Robyn Segrest May 12, 2015.
7 * 10 2 = 7 * 100 = * 10 1 = 4 * 10 = * 10 0 = 5 * 1 = Copyright © Texas Education Agency, All rights reserved.6 Used with permission: Robyn Segrest May 12, 2015.
CONVERTING FROM BINARY TO DECIMAL Copyright © Texas Education Agency, All rights reserved.7
Binary Base 2 Uses 0 and 1 Copyright © Texas Education Agency, All rights reserved.8
Binary Table This is where binary digits (0s and 1s) go Place holder value Decimal equivalent Copyright © Texas Education Agency, All rights reserved.9 Used with permission: Robyn Segrest May 12, 2015.
Convert from binary to decimal = * 0 = 0 64 * 0 = 0 32 * 0 = 0 16 * 0 = 0 8 * 1 = 8 4 * 1 = 4 2 * 1 = 2 1 * 0 = Copyright © Texas Education Agency, All rights reserved.10 Used with permission: Robyn Segrest May 12, 2015.
YOUR TURN Copyright © Texas Education Agency, All rights reserved.11
CONVERTING FROM DECIMAL TO BINARY Copyright © Texas Education Agency, All rights reserved.12
Binary Conversion Can be done two different ways –Long division –Subtraction Copyright © Texas Education Agency, All rights reserved.13
Long Division Convert to binary Binary bits = Copyright © Texas Education Agency, All rights reserved.14 Used with permission: Robyn Segrest May 12, 2015.
Subtraction = = 3 3 – 2 = 1 1 – 1 = Copyright © Texas Education Agency, All rights reserved.15 Used with permission: Robyn Segrest May 12, Convert 3710 from decimal to binary
YOUR TURN Copyright © Texas Education Agency, All rights reserved.16
HEXADECIMAL BASE 16 Copyright © Texas Education Agency, All rights reserved.17
Hexadecimal Characters –0 – 9 –A – F Can convert directly from hex to decimal but not from decimal to hex Copyright © Texas Education Agency, All rights reserved.18
Copyright © Texas Education Agency, All rights reserved.19 Hexadecimal (Hex) BinaryDecimal A B C D E F Used with permission: Robyn Segrest May 12, 2015.
Hexadecimal Table This is where hexadecimal characters (0 - F) would go Place holder value Decimal equivalent Copyright © Texas Education Agency, All rights reserved.20 Used with permission: Robyn Segrest May 12, 2015.
Convert FF 16 from to decimal FF 16 = * 16 = * 1 = FF Copyright © Texas Education Agency, All rights reserved.21 Used with permission: Robyn Segrest May 12, 2015.
YOUR TURN Copyright © Texas Education Agency, All rights reserved.22
DECIMAL TO HEX CONVERSION Copyright © Texas Education Agency, All rights reserved.23
Convert to Hexadecimal Copyright © Texas Education Agency, All rights reserved = – 16 = 6 6 – 4 = 2 2 – 2 = = = Convert from decimal to binary Convert from binary to hex Used with permission: Robyn Segrest May 12, 2015.
Convert to Hexadecimal Copyright © Texas Education Agency, All rights reserved = = = Binary to hex Decimal to binary Used with permission: Robyn Segrest May 12, 2015.
YOUR TURN Copyright © Texas Education Agency, All rights reserved.26
IP ADDRESSING Copyright © Texas Education Agency, All rights reserved.27
IPv4 Every node on a network must have a unique IP address: Internet Protocol version 4 Unique 32-bit number –Divided into four octets divided by decimal points »EX: Separated into classes Copyright © Texas Education Agency, All rights reserved.28
Commonly Used IPv4 Classes Copyright © Texas Education Agency, All rights reserved.29 Used with permission: Robyn Segrest March 29, ClassFirst Octet Shared Octets Number of Networks Maximum Addressable Hosts A1 – ,777,214 B128 – 1912> 16,00065,534 C192 – 2233> 2,000,000254
IPv4 Highest decimal number an octet may be is 255 –Each octet is equal to eight binary bits = Running out of IPv4 addresses due to 32-bit limitation Combined with a ‘subnet mask’ to increase number of addressable nodes on a network Copyright © Texas Education Agency, All rights reserved.30
Subnet Mask Copyright © Texas Education Agency, All rights reserved.31 Used with permission: Robyn Segrest March 29, ClassFirst Octet Default Subnet Mask A1 – B128 – C192 –
IPv6 Composed of 128 bits –Eight 16-bit fields Represented by hexadecimal numbers –Divided into groups of four hexadecimal characters »EX: FEE3:00FF:003D:0000:0000:0000:3015:AABC –Multiple fields with zero values can be abbreviated »EX: 00EE – EE » Copyright © Texas Education Agency, All rights reserved.32
Assigning IP Addresses Can be done manually or by DHCP (Dynamic Host Configuration Protocol) –Static IP address Manually assigned Does not change Human error in duplicating addresses can cause connection issues –Dynamic IP addressing Assigned automatically by a DHCP server Most common and simplest method Copyright © Texas Education Agency, All rights reserved.33
Boolean Operators Also called Logical Operators or just bool Logical operators that return true or false Three basic Boolean operators Order of Boolean operations Copyright © Texas Education Agency, All rights reserved.34
Truth Tables Copyright © Texas Education Agency, All rights reserved.35 AND Input 1Input 2Output OR Input 1Input 2Output !AND Input 1Input 2Output !OR Input 1Input 2Output Used with permission: Robyn Segrest May 12, 2015.
ANDING Every IP address has a default subnet mask –Class A – –Class B – –Class C – In order to locate a specific node on the network a computer must AND the IP address with the appropriate subnet mask in binary Based on our truth tables we should know the following –1 AND 1 = 1 –1 AND 0 = 0 –0 AND 1 = 0 –0 AND 0 = 0 Copyright © Texas Education Agency, All rights reserved.36
Finding the Network Address EXAMPLE: IP address: Subnet mask: First we convert both to binary: IP address: ( ) Subnet Mask: ( ) AND: ( ) The result of ANDing is the network address. Copyright © Texas Education Agency, All rights reserved.37
YOUR TURN Copyright © Texas Education Agency, All rights reserved.38