• Our Minecraft servers are offline but we will keep this forum online for any community communication. Site permissions for posting could change at a later date but will remain online.

[EASY!] » How to learn Code! w/ Daniel! {Binary}

Did you like Part I of my How to Code series?

  • Yes! I learned so much <3

  • Umm... It's all right and stuff.

  • I just came here for the juice box.

  • Its mediocre.

  • MY BRAIN IS BLEEDING!!!! EXPLAIN BETTORZ


Results are only viewable after voting.
Joined
Nov 25, 2014
Messages
635
Reaction score
466
So I haven't been so active on the forums, so I thought I contribute to this section with a thread on how to learn binary! I thought since I know how to do code so well, I thought I can show everyone I know. So here is part 1 with the topic of binary!

~|~«»«»~|~

So the first thing you need to know is what binary is. Binary is relating to, being, or belonging to a system of numbers having 2 as its base <the binary digits 0 and 1>. If you don't understand this definition, it basically means that instead of using your standard 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 numbers (Arabic Number System), you use 0 and 1 as your numbers which is expressed in a system of numerical notation that has 2 rather than 10 as a base.

So lets begin!
So the first thing you need to do is make a chart like this:

64 | 32 | 16 | 8 | 4 | 2 | 1

Obviously, you can see the pattern and if you want to expand the chart for numbers higher than 127, you can expand the chart by getting 64 and multiplying it by two and so forth.

So let's take the number 26 to turn into binary form. Now looking at the chart above, which numbers can appropriately be between 26 without going higher than twenty six? That number would be 16 because if we used 32, then it would automatically become wrong! So what we would do is that in our chart, is put a number 1 under 16 because what we are striving to get is the set of 1s to add up to 26.

So in our chart, we will put:

64 | 32| 16 | 8 | 4 | 2 | 1

1

So now, what we do is find an exceptionally large number that can get us closer to 26, so the number we would choose is "8" because 16+8= 24 and that is a number that can get us closer to 26.

Now that we have gotten 8, in our chart, we will put:

64 | 32 | 16 | 8 | 4 | 2 | 1
1 1

Now that we are closer to the end of our chart, what we can simply do is get 26, the number we are working with, and subtract it with 24, the number we have so far, and we should get 2, and in our chart, it will be expressed as:

64 | 32 | 16 | 8 | 4 | 2 | 1
1 1 0 1 0

And this is because 16+8+2= 24, and because 4 and two are not in any use in this string of numbers, they are expressed with a zero.

So the binary form of 26 is 11010!

____________
Now for turning binary numbers into regular form. Now this is very simple! Lets take 101010 for example. Lets make our chart again and put the numbers in the chart:

64 | 32 | 16 | 8 | 4 | 2 | 1
1 0 1 0 1 0

Now, lets do some adding!

First, we get 32, 8, and 2 and add them up, and we get 42! We ignore 16 , 4, and 1 because they are defined as zeroes in the chart and we only add up the numbers that are defined with ones.


Try it yourself with these numbers, and click the spolier to see if you got the answer right!:

Turn 56 into binary form!:
You should have gotten 111000! Did you get it wrong? Check your math!
Turn 125 into binary form!:
You should have gotten 1111101! Did you get it wrong? Check your math!
Turn 1010001 into regular form!:
You should have gotten 81! Did you get it wrong? Check your math!

_______________

That's all for now! If you found this useful at all or found mistakes or want this improved, just talk about it below and I will be sure to fix it! If you want more of these, just tell me below, and don't take my idea of doing this ;_:
 

LukeTheCat

Survivor
Joined
Apr 23, 2015
Messages
120
Reaction score
85
I don't understand why you'd start with teaching binary to people wanting to code.
 
Joined
Nov 25, 2014
Messages
635
Reaction score
466
I don't understand why you'd start with teaching binary to people wanting to code.
Binary numbers consist of only two digits, 0 and 1. This seems very inefficient and simple for us humans who are used to working in base 10, but for a computer base 2, or binary, is the perfect numbering system. This is because all calculations in a computer are based on millions of transistors that are either in an on position, or an off position. So there we have it, 0 for off, and 1 for on. But that on it’s own isn’t very interesting or useful. Having a switch that is either off or on tells us nothing and doesn’t allow us to do any maths at all, which after all is what we want computers for.

In order to do anything useful we have to group our switches (called bits) into something bigger. For example, eight bits becomes a byte, and by alternating the position of the bits, either 1 or 0, we end up with 256 combinations. All of a sudden we have something useful we can work with. As it happens, we can now use any number up to 255 (we lose one because 0 is counted as a number) for our mathematics, and if we use two bytes, the number of combinations for our sixteen bits becomes 65,536. Quite staggering considering we’re only talking about sixteen transistors.

Now, in modern computers, a CPU is likely to have anything up to a billion transistors. That’s 1000 million switches all working together at nearly the speed of light, and if we can count to sixty-five thousand with only sixteen transistors, then think what we can achieve with a billion.


But many people have forgotten the basics of the computer processor these days. To many it’s just a chip that you stick into a motherboard that makes it go. No thought is given to the sheer number of calculations that goes on inside a processor, even just to read the article you’re reading right now. This is probably because the size of these transistors are now so small, you actually need a microscope to see them, and they can be packed into a processor core so small, the wires that connect them all together are many times thinner than a human hair. Even now, the scientists of Silicon Valley are working on ways to fit even more transistors into one space, so that each one is barely bigger than an atom.

This is all even more amazing when we thing back to the days when the first computers were around. A simple processor would need an entire building of space, not just a small square just a few centimeters across, and these behemoths were very low powered in comparison, perhaps only capable of a mere 70 thousand instructions per second back in the 1970’s, but yet well into the trillions today. But at the end of the day, all this is done with billions of tiny switches, off and on, 0 and 1.


Your move, LukeTheCat.
 

LukeTheCat

Survivor
Joined
Apr 23, 2015
Messages
120
Reaction score
85
Binary numbers consist of only two digits, 0 and 1. This seems very inefficient and simple for us humans who are used to working in base 10, but for a computer base 2, or binary, is the perfect numbering system. This is because all calculations in a computer are based on millions of transistors that are either in an on position, or an off position. So there we have it, 0 for off, and 1 for on. But that on it’s own isn’t very interesting or useful. Having a switch that is either off or on tells us nothing and doesn’t allow us to do any maths at all, which after all is what we want computers for.

In order to do anything useful we have to group our switches (called bits) into something bigger. For example, eight bits becomes a byte, and by alternating the position of the bits, either 1 or 0, we end up with 256 combinations. All of a sudden we have something useful we can work with. As it happens, we can now use any number up to 255 (we lose one because 0 is counted as a number) for our mathematics, and if we use two bytes, the number of combinations for our sixteen bits becomes 65,536. Quite staggering considering we’re only talking about sixteen transistors.

Now, in modern computers, a CPU is likely to have anything up to a billion transistors. That’s 1000 million switches all working together at nearly the speed of light, and if we can count to sixty-five thousand with only sixteen transistors, then think what we can achieve with a billion.


But many people have forgotten the basics of the computer processor these days. To many it’s just a chip that you stick into a motherboard that makes it go. No thought is given to the sheer number of calculations that goes on inside a processor, even just to read the article you’re reading right now. This is probably because the size of these transistors are now so small, you actually need a microscope to see them, and they can be packed into a processor core so small, the wires that connect them all together are many times thinner than a human hair. Even now, the scientists of Silicon Valley are working on ways to fit even more transistors into one space, so that each one is barely bigger than an atom.

This is all even more amazing when we thing back to the days when the first computers were around. A simple processor would need an entire building of space, not just a small square just a few centimeters across, and these behemoths were very low powered in comparison, perhaps only capable of a mere 70 thousand instructions per second back in the 1970’s, but yet well into the trillions today. But at the end of the day, all this is done with billions of tiny switches, off and on, 0 and 1.


Your move, LukeTheCat.
I know how computers work, I've studied Systems Architecture for the past year. But that's not programming. The average programmer doesn't have to know a single thing about binary or other counting systems unless they want to program in low-level languages. I'd actually read your post fully if I had time, but I have work now. I'll reply properly when I get back.
 
Joined
Nov 25, 2014
Messages
635
Reaction score
466
I know how computers work, I've studied Systems Architecture for the past year. But that's not programming. The average programmer doesn't have to know a single thing about binary or other counting systems unless they want to program in low-level languages. I'd actually read your post fully if I had time, but I have work now. I'll reply properly when I get back.
Well, if you're going to contradict what I have to say, instead of making an assumption of what you read, actually read the entire thing :)
 
Last edited:

YourAverageTiger

i control this entire operation
Joined
Apr 18, 2014
Messages
1,416
Reaction score
1,888
I know how to code, and I definitely like how you decided your approach. But in my opinion the best way to introduce someone to coding is to provide examples and have them follow up.

This is how I learned it, and how it should be taught in my opinion.


Axanite should be able to provide a reply to this as well.
 

Axanite | Liam

Plate head.
Joined
Apr 10, 2014
Messages
931
Reaction score
1,161
Okay, to be very honest here. Without binary, computers would either not be as simple or not even existing. Binary is used in many cases and can be referred similarly to Digital Signals from Physics as they both use the same principal as 1's and 0's or On's and Off's. Technically speaking, this does relate to some sort of coding and this is relevant. c:

On another note, I really like this. Considering my Computer Science GCSE is coming up, I will definitely need this as Binary is not one of my strong subjects. c:
 

Members online

No members online now.

Forum statistics

Threads
242,192
Messages
2,449,550
Members
523,972
Latest member
Atasci