ELLIOT'S CISCO NOTES

for future reference by me for me

lesson 5: number systems

we will be learning about binary and hexidecimals here!!!

5.1 == binary number system

// 5.1.1 == binary and ipv4 addresses

ipv4 addresses are shown in binary

most network administrators convert these to decimal, because it is easier to read

addresses contain a string of 32 bits, devided into 4 sections called octets. each octet contains a byte seperated with a dot

// 5.1.2 == video yurrr

decimal is base 10, while binary is base 2

decimal ex.: 10, 100, 1000

binary ex.: 1, 2, 4, 8, 16

ip address octets represent the amount of a power of 2 between 0 and 7, starting at 7. they are all added together, making that octet

to make binary from a decimal, starting at 128, go down the list and subtract and count up the number of subtractions

7-0: 128, 64, 32, 16, 8, 4, 2, 1

// 5.1.3 == binary positional notation

big phat example

position value 128 64 32 16 8 4 2 1
binary number [11000000] 1 1 0 0 0 0 0 0
add em up... 128 +64 +0 +0 +0 +0 +0 +0
reslut 192

5.2 == hexadecimal number system

// 5.2.1 == hexadecimal and ipv6 addresses

while ipv4 addresses use binary, v6 and ethernet mac use hexidecimal.

hexadecimal uses a base 16 system. this uses the digits 0-9 and letters a-f.

decimal binary hexadecimal
0 0000 0
1 0001 1
2 0010 2
3 0011 3
4 0100 4
5 0101 5
6 0110 6
7 0111 7
8 1000 8
9 1001 9
10 1010 a
11 1011 b
12 1100 c
13 1101 d
14 1110 e
15 1111 f

these addresses are 128 bits, and each 4 bits is represented by one hexadecimal digit. this totals 32 hexadecimal digits.

also not case sensitive!!

ipv6 addresses are formatted with a ':' between each 4 digits. a hextet means 4 hexadecimal values.

// 5.2.3 == decimal to hexadecimal

* first, convert the decimal number to 8 bit binary strings

* divide the strings into groups of 4 from the right

* convert each of the 4 binary digits into hexadecimal

ex with the number 168

** 168 in binary is 10101000

** 10101000 can be split into 1010 1000

** 1010 is a and 1000 is 8

** answer: a8!!

// 5.2.4 == hexadecimal to decimal

do the above backwards!!! hex -> binary -> decimal



NEXT -->

PREV <--