205 lines
5.7 KiB
Plaintext
205 lines
5.7 KiB
Plaintext
|
Binary tutorial for begginers.
|
|||
|
----------------------------------
|
|||
|
|
|||
|
This tutorial is for people with a base
|
|||
|
knowledge that binary is ones and zeros.
|
|||
|
Easy, right? The 1 represents an "on"
|
|||
|
function, and the 0 represents an "off
|
|||
|
function.
|
|||
|
|
|||
|
Decimal - Binary
|
|||
|
-----------------------
|
|||
|
I'm going to use the easiest method I can
|
|||
|
think of in this tutorial.
|
|||
|
~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
|
|||
|
Example: 129
|
|||
|
|
|||
|
now, count from the right ot left multiplying by
|
|||
|
twos until you reach the lowest number closest
|
|||
|
to the decimal you.
|
|||
|
Example:
|
|||
|
128 64 32 16 8 4 2 1
|
|||
|
We start with the number 128.
|
|||
|
Subtract the number from the decimal you wish to
|
|||
|
convert.
|
|||
|
EX/ _ 129
|
|||
|
128 = 1
|
|||
|
Now take that number and see if you can subtract
|
|||
|
it from the other number in the row.
|
|||
|
128? Yes, = 1
|
|||
|
64? No
|
|||
|
32? No
|
|||
|
16? No
|
|||
|
8? No
|
|||
|
4? No
|
|||
|
2? No
|
|||
|
1? Yes
|
|||
|
|
|||
|
All the numbers that were subtractable are ones, and
|
|||
|
the ones you were unable to subtract are zeros.
|
|||
|
|
|||
|
EX/
|
|||
|
128 64 32 16 8 4 2 1
|
|||
|
1 0 0 0 0 0 0 1
|
|||
|
Answer:
|
|||
|
Decimal 129 in Binary is: 10000001
|
|||
|
*******************************************************
|
|||
|
Binary to decimal
|
|||
|
-----------------
|
|||
|
No that we have the binary, how do we get it back to a
|
|||
|
decimal? Incredibly simple.
|
|||
|
Take the binary 10000001
|
|||
|
no insert the numbers multiplied by two again, but not putting
|
|||
|
anything for the zeros.
|
|||
|
EX/ 1 0 0 0 0 0 0 1
|
|||
|
128 x x x x x x 1
|
|||
|
Now add the numbers together to get the decimal
|
|||
|
128+1 = 129
|
|||
|
|
|||
|
Remember, the far left is always 128, and the far right is always 1
|
|||
|
|
|||
|
Let us take another random binary now, and try that again.
|
|||
|
1 0 0 1 0 1 0 0
|
|||
|
128 +16 + 4 = 148
|
|||
|
***********************************************************************
|
|||
|
Remember, every ASCII character has a number, and with that decimal in
|
|||
|
mind, you can speak letters etc in binary!
|
|||
|
Below is a chart:
|
|||
|
|
|||
|
32   |143 <20> 
|
|||
|
33 ! ! |144 <09> 
|
|||
|
34 " " |145 <09> ‘
|
|||
|
35 # # |146 <09> ’
|
|||
|
36 $ $ |147 <09> “
|
|||
|
37 % % |148 <09> ”
|
|||
|
38 & & |149 <09> •
|
|||
|
39 ' ' |150 <09> –
|
|||
|
40 ( ( |151 <09> —
|
|||
|
41 ) ) |152 <09> ˜
|
|||
|
42 * * |153 <09> ™
|
|||
|
43 + + |154 <09> š
|
|||
|
44 , , |155 <09> ›
|
|||
|
45 - - |156 <09> œ
|
|||
|
46 . . |157 <09> 
|
|||
|
47 / / |158 <09> ž
|
|||
|
48 0 0 |159 <09> Ÿ
|
|||
|
49 1 1 |160  
|
|||
|
50 2 2 |161 <09> ¡
|
|||
|
51 3 3 |162 <09> ¢
|
|||
|
52 4 4 |163 <09> £
|
|||
|
53 5 5 |164 <09> ¤
|
|||
|
54 6 6 |165 <09> ¥
|
|||
|
55 7 7 |166 <09> ¦
|
|||
|
56 8 8 |167 <09> §
|
|||
|
57 9 9 |168 <09> ¨
|
|||
|
58 : : |169 <09> ©
|
|||
|
59 ; ; |170 <09> ª
|
|||
|
60 < < |171 <09> «
|
|||
|
61 = = |172 <09> ¬
|
|||
|
62 > > |173 <09> ­
|
|||
|
63 ? ? |174 <09> ®
|
|||
|
64 @ @ |175 <09> ¯
|
|||
|
65 A A |176 <09> °
|
|||
|
66 B B |177 <09> ±
|
|||
|
67 C C |178 <09> ²
|
|||
|
68 D D |179 <09> ³
|
|||
|
69 E E |180 <09> ´
|
|||
|
70 F F |181 <09> µ
|
|||
|
71 G G |182 <09> ¶
|
|||
|
72 H H |183 <09> ·
|
|||
|
73 I I |184 <09> ¸
|
|||
|
74 J J |185 <09> ¹
|
|||
|
75 K K |186 <09> º
|
|||
|
76 L L |187 <09> »
|
|||
|
77 M M |188 <09> ¼
|
|||
|
78 N N |189 <09> ½
|
|||
|
79 O O |190 <09> ¾
|
|||
|
80 P P |191 <09> ¿
|
|||
|
81 Q Q |192 <09> À
|
|||
|
82 R R |193 <09> Á
|
|||
|
83 S S |194 <09> Â
|
|||
|
84 T T |195 <09> Ã
|
|||
|
85 U U |196 <09> Ä
|
|||
|
86 V V |197 <09> Å
|
|||
|
87 W W |198 <09> Æ
|
|||
|
88 X X |199 <09> Ç
|
|||
|
89 Y Y |200 <09> È
|
|||
|
90 Z Z |201 <09> É
|
|||
|
91 [ [ |202 <09> Ê
|
|||
|
92 \ \ |203 <09> Ë
|
|||
|
93 ] ] |204 <09> Ì
|
|||
|
94 ^ ^ |205 <09> Í
|
|||
|
95 _ _ |206 <09> Î
|
|||
|
96 ` ` |207 <09> Ï
|
|||
|
97 a a |208 <09> Ð
|
|||
|
98 b b |209 <09> Ñ
|
|||
|
99 c c |210 <09> Ò
|
|||
|
100 d d |211 <09> Ó
|
|||
|
101 e e |212 <09> Ô
|
|||
|
102 f f |213 <09> Õ
|
|||
|
103 g g |214 <09> Ö
|
|||
|
104 h h |215 <09> ×
|
|||
|
105 i i |216 <09> Ø
|
|||
|
106 j j |217 <09> Ù
|
|||
|
107 k k |218 <09> Ú
|
|||
|
108 l l |219 <09> Û
|
|||
|
109 m m |220 <09> Ü
|
|||
|
110 n n |221 <09> Ý
|
|||
|
111 o o |222 <09> Þ
|
|||
|
112 p p |223 <09> ß
|
|||
|
113 q q |224 <09> à
|
|||
|
114 r r |225 <09> á
|
|||
|
115 s s |226 <09> â
|
|||
|
116 t t |227 <09> ã
|
|||
|
117 u u |228 <09> ä
|
|||
|
118 v v |229 <09> å
|
|||
|
119 w w |230 <09> æ
|
|||
|
120 x x |231 <09> ç
|
|||
|
121 y y |232 <09> è
|
|||
|
122 z z |233 <09> é
|
|||
|
123 { { |234 <09> ê
|
|||
|
124 | | |235 <09> ë
|
|||
|
125 } } |236 <09> ì
|
|||
|
126 ~ ~ |237 <09> í
|
|||
|
127  |238 <09> î
|
|||
|
128 <09> € |239 <09> ï
|
|||
|
129 <09>  |240 <09> ð
|
|||
|
130 <09> ‚ |241 <09> ñ
|
|||
|
131 <09> ƒ |242 <09> ò
|
|||
|
132 <09> „ |243 <09> ó
|
|||
|
133 <09> … |244 <09> ô
|
|||
|
134 <09> † |245 <09> õ
|
|||
|
135 <09> ‡ |246 <09> ö
|
|||
|
136 <09> ˆ |247 <09> ÷
|
|||
|
137 <09> ‰ |248 <09> ø
|
|||
|
138 <09> Š |249 <09> ù
|
|||
|
139 <09> ‹ |250 <09> ú
|
|||
|
140 <09> Œ |251 <09> û
|
|||
|
141 <09>  |252 <09> ü
|
|||
|
142 <09> Ž |253 <09> ý
|
|||
|
143 <09>  |254 <09> þ
|
|||
|
------------------------------------------------------------
|
|||
|
Adding binary
|
|||
|
--------------
|
|||
|
adding binary is very simple.
|
|||
|
|
|||
|
simply take the two numbers you wish to add, put one on top
|
|||
|
of the other, and then add.
|
|||
|
Using the simple rules:
|
|||
|
1+0=1
|
|||
|
0+1=1
|
|||
|
0+0=0
|
|||
|
1+1=0 (and carry the 1 to the next space to the left)
|
|||
|
|
|||
|
EX/ 00000010 (2)
|
|||
|
+ 00000011 (3)
|
|||
|
= 00000101 (5)
|
|||
|
---------------------------------------------------------------
|
|||
|
And there you have it! A simple begginers mini course in binary.
|
|||
|
Not the greatest text-file, but it works. :)
|
|||
|
~*~*~*~*~~*~*
|
|||
|
Written by
|
|||
|
David Carlton - Resurgam
|
|||
|
|
|||
|
0100100101100110001000000111100101101111011101010010000001100011011000010110111000100000011100100110010101100001011001000010000001110100011010000110100101110011001000000111100101101111011101010010000001100001011100100110010100100000011011110111011001100101011100100110010101100100011101010110001101100001011101000110010101100100
|