JAOIT 8. Binary Programming As someone just starting their adventures in the networking world...

12
JAOIT 8

Transcript of JAOIT 8. Binary Programming As someone just starting their adventures in the networking world...

JAOIT 8

Binary Programming As someone just

starting their adventures in the networking world binary can be both scary and confusing. I am going to attempt to make learning binary as pain free as possible and break it down to its simplest form.

Binary Programming Let’s start off with some basics. First off

binary is a string of 0's and 1's. The 1's being the on switch, and the 0's being the off switch. When a computer sees the 0's and 1's it only counts the 1's. Take for example what we've grown up learning with numbers. In our base 10 system we have the 1's place, the 10's place, the 100's place, etc. So basically our base 10 is just anything to the 10th power.

Binary Programming 0^10 = 1's place;

1^10 = 10's place; 2^10 = 100's place; etc.

So Binary is just everything to the 2nd power. It makes it a bit more confusing at first, but once you get the hang of it, it makes total sense.

Binary Programming

0^2 = 1; 1^2 = 2; 2^2 = 4; 3^2 = 8; etc.

Binary Programming Basically binary just doubles as you go,

and is split into 8 bits (each zero and each one is a bit). So typically you'd see something like this 1001 1011 0101 0101. Every 8 bits if turned on equals 256. Counting in multiples of 2's we'd look at it like this 128 64 32 16 8 4 2 1 equaling 8 separate bits. This is important to remember later on in networking for sub-netting and how IP addresses work.

Binary Programming

So let’s count to 9 in binary. Remember the computer only counts the 1's. So 1001 would equal 9. We know this because 0^2 = 1; and 3^2 = 8 and we just add those together. Whenever I have to use binary I always start out writing all 8 bits out to make things easier to add up later on. Especially when the number gets rather large.

Binary ProgrammingCounting to 64 in Binary language

000000 = 0 010001 = 17 100001 = 33 110001 = 49

000001 = 1 010010 = 18 100010 = 34 110010 = 50

000010 = 2 010011 = 19 100011 = 35 110011 = 51

000011 = 3 010100 = 20 100100 = 36 110100 = 52

000100 = 4 010101 = 21 100101 = 37 110101 = 53

000101 = 5 010110 = 22 100110 = 38 110110 = 54

000110 = 6 010111 = 23 100111 = 39 110111 = 55

000111 = 7 011000 = 24 101000 = 40 111000 = 56

001000 = 8 011001 = 25 101001 = 41 111001 = 57

001001 = 9 011010 = 26 101010 = 42 111010 = 58

001010 = 10 011011 = 27 101011 = 43 111011 = 59

001011 = 11 011100 = 28 101100 = 44 111100 = 60

001100 = 12 011101 = 29 101101 = 45 111101 = 61

001101 = 13 011110 = 30 101110 = 46 111110 = 62

001110 = 14 011111 = 31 101111 = 47 111111 = 63

001111 = 15 100000 = 32 110000 = 48 1000000 = 64

010000 = 16

Binary Programming

Do you notice any patterns?

Numbers are created in 6 bit binary bytes up to the number 64.

Binary ProgrammingThe Alphabet in Binary Code – Small Letters

a 097 01100001 n 110 01101110

b 098 01100010 o 111 01101111

c 099 01100011 p 112 01110000

d 100 01100100 q 113 01110001

e 101 01100101 r 114 01110010

f 102 01100110 s 115 01110011

g 103 01100111 t 116 01110100

h 104 01101000 u 117 01110101

i 105 01101001 v 118 01110110

j 106 01101010 w 119 01110111

k 107 01101011 x 120 01111000

l 108 01101100 y 121 01111001

m 109 01101101 z 122 01111010

Binary ProgrammingThe Alphabet in Binary Code – Large Letters

A 065 01000001 N 078 01001110

B 066 01000010 O 079 01001111

C 067 01000011 P 080 01010000

D 068 01000100 Q 081 01010001

E 069 01000101 R 082 01010010

F 070 01000110 S 083 01010011

G 071 01000111 T 084 01010100

H 072 01001000 U 085 01010101

I 073 01001001 V 086 01010110

J 074 01001010 W 087 01010111

K 075 01001011 X 088 01011000

L 076 01001100 Y 089 01011001

M 077 01001101 Z 090 01011010

Binary Programming

Let’s write your name in Binary code.