ANSWERS: 9
  • Some Basic Principles 1) The program is always a tree, growing from one root, into a multitude of branches. 2) Most modules are just IF statements, routing the user to a smaller branch of the tree, according to its test of the situation. 3) Every module's name is name of the module it is called from --- with another letter added. Thus modules ABC and ABD can be called from nowhere except from AB, and both AB and AE can only be called from A. 4) Thus, the length of the module's name indicates its level in the decision tree. A module with a six letter name is six levels down. 5) The goal of binary programming is to go down as many levels as possible, by considering and foreseeing all possibilities which can happen --- before you start coding any actions to deal with them. When you have exhausted all choices and all possibilities and built your tree, you'll have a program which will deal with reality very effectively. Moreover, the logic of the code is perfectly clear even to a newcomer. You always know where you are and how you got there. 6) Module names are acronyms for the logical circumstances which lead to them. A table of acronym letter full-word meanings, with a column for each letter position, is part of any real binary design. Other people can then read and understand your acronyms in the code with no training and almost no effort. Your Prince reminds you that it's hard to remember the meaning of one's own code acronyms after one has been away from it for more than a year, so that table's for YOU, too. So you won't have to stand their scratching your head when they bring you back to do some maintenance on your own creation. 7) IF must be followed by a function name, not by any code, test, or comparison. Functions are written for every if statement, and tests are done in a function outside the IF statement. Function names should be long, natural language phrases which document exactly what function they perform. (Since they are generally only referenced at one place in the code, there is no need for acronyms in function names in order to reduce keyboard effort.) Examples of binary-programming-type function names file_exists_for_this_name has_worked_more_days than limit balance-has-exceeded-limit AccountIsOverdrawn A typical binary programming procedure procedure ab; begin if has-worked-more-hours-than-limit then abo else abr; end; // o=overtime 8) Most binary programming procedures are just one line. Only functions have any size and complexity, but functions should also be built using binary design to arrive at function results. The tree of binary design may be complex, but it's so understandable that it's easy. When operations are thus splintered down to their very lowest levels, there's not much left to do. There really is no hard-to-understand complexity left at the lowest levels. That's one of the payoffs of binary programming. Almost all functions and procedures become one-line entities, instead of the big modules of most other programming techniques.
  • "There are 10 types of people in the world -- those who understand binary and those who don't." What is it? Binary is the beginning of all code. Every little bit of code put into computers gets broken down into 1s and 0s. It's purpose? Code has to has some sort of pattern and symbol. Having only a 0 and no 1 would mean there would be no pattern and no way for the computer to comprehend what to do. And since numbers were the first code implimented into computer, 0 and 1 were chosen...they probably could have done any numbers if they wanted though, like 3s and 7s. Look for an educated answer...I don't know too much about it.
  • Binary (in computers) refers to switches being either in a "1" and "on" position/value or in a "0" and "off" position or value. It would be much easier to show you than tell you in linear text but it goes like this. Imagine you have 4 light bulbs from right to left. The bulb on your right says "1" beneath it. The next bulb toward the left says "2". Next is "4" and next is "8". Like this: 0000 8421 So now lets count. With all bulbs off, the value is zero. With just the rightmost bulb on, the value is 1. Like this: 0001 8421 To get "2" you need to turn off the rightmost bulb since you have a bulb just for "2". Like this: 0010 8421 To get "3" you just add the "1" bulb back with the "2". 0011 8421. And so on. 1111 = 15 8421 = 8 + 4 + 2 + 1 = 15 Generally when dealing with binary conversions to and from normal decimal or hexidecimal the binary numbers are in 8-bit or for example : 01011010 (which = 90). http://www.pcguide.com/res/tablesASCII-c.html
  • Binary is an efficient way to describe data with a series of "switches". Basically the circuits on the processor of a computer can be on or off, representing 1 or 0 respectively. This is also called a "bit". Let's take a binary number, like 1001011. The way you calculate a decimal number like we are used to is to take the value of each digit that is turned on and add all the values up. The values go in powers of two from right to left, that is, the right-most digit is 1, to the left of that is 2 to the left of that is 4, then 8, then 16, then 32, then 64. (There can be more but we'll just use seven digits for now). So for 1001011, just add 1+2+8+64 and you get 75. So we can store the number 75 with just seven tiny pieces of information, which a computer can move around easily and remember with little effort. These numbers can represent many things to the computer, including the code that makes your computer do stuff.
  • Binary is a number system that only uses two values. This is perfect if you want to use an electrical circuit to represent data, because electrical circuits only have two states - on and off. Fast forward to the conclusion of this answer. Computers are just basically immense mazes of inter-related microscopic switches that when fed streams of ones and zeroes, produce a resultant stream of ones and zeroes that represent the result of a task. Is it just me, or does that sound too deep?
  • Binary is simply a system of writing down numbers. The comparison with decimal is instructive. For instance, forgetting about binary for a moment, we can write any number into its "decimal expansion": 65 = 6*10^1 + 5*10^0 ...or... 84019 = 8*10^4 + 4*10^3 + 0*10^2 + 1*10^1 + 9*10^0 If you notice, every digit is multiplied by a power of 10 (10 is called the "base" of the decimal numbering system) that corresponds to that digit's position in the number. The only reason we use 10 is because us humans happen to be made with ten of our own digits (our fingers), and that's how humanity learned to count. (It's no coincidence that fingers can be referred to as "digits.") By the way, there is no reason to necessarily stop when we reach the digit that is multiplied by 10^0 (which is 1). Numbers after the decimal can be represented in a decimal expansion too: 3.1415 = 3*10^0 + 1*10^-1 + 4*10^-2 + 1*10^-3 + 5*10^-4 Notice that in base-10, we always have digits 0 through 9 multiplied by powers of 10. Similarly, in binary, or base-2, we only use digits 0 through 1. So, to convert a binary number to decimal, all we have to do is do the binary expansion (making sure we use a base of 2 instead of 10). So let's say we see 1101 binary. What is that in decimal? 1101b = 1*2^3 + 1*2^2 + 0*2^1 + 1*2^0 (When mixing base-10 and base-2 values in the same calculation, it often helps to append a b to binary values to keep track of which is which. This way you won't confuse 11 base-10, which is 11, with 11 base-2, which is 3.) Before we continue, you might notice that for binary, this expansion can be easily simplified. Wherever a digit is a 1, we multiply the power of 2 corresponding to that digit's place by 1, which doesn't change it. So, we can leave those out. Wherever the digit is a 0, that term in the expansion is multiplied by 0 so it simply falls out. We're left with the simplified form: 1101b = 2^3 + 2^2 + 2^0 = 8 + 4 + 1 = 13 To go the other direction, if we have a decimal number that we want to convert to binary, we write the binary expansion of the number term by term, starting with the largest. For instance, let's say we want to find the binary form of the decimal number 146. First we ask: what is the largest power of 2 less than or equal to 146? The answer is 2^7, or 128, and 18 is left over. So we write: 2^7 + (18) Now we continue with the remainder. What's the biggest power of two less than or equal to 18? That's 2^4, or 16, with 2 left over: 2^7 + 2^4 + (2) The biggest power of two less than or equal to the new remainder is...2^1, with no remainder: 2^7 + 2^4 + 2^1 Now the number is completely represented by powers of 2. So, we have a 8-digit binary number in which bits associated with 2^7 position, 2^4 position, and 2^1 position are turned on: 2^7 + 2^4 + 2^1 = 1*2^7 + 0*(2^6 + 2^5) + 1*2^4 + 0*(2^3 + 2^2) + 1*2^1 + 0*2^0 = 10010010b You can easily do this process in your head with a little practice...it helps if you know your powers of 2 by heart. Also, there's a few neat things about binary. In decimal, if you add a 0 digit to the end of a number, you've just multiplied it by ten. In binary, if you add a 0 at the end, you multiplied it by 2. Similarly, in base-10 if a number ends in 0 and you remove it, you divided by ten, you'd divide a binary number by 2 by doing the same. Also, remember base-10 numbers with digits after the decimal point can be represented. Similarly, binary values can too! Let's figure out 3.625 in binary... 3.625 = 2^1 + 2^0 + (0.625) What's the biggest power of 2 that is equal or less than 0.625? 2^-1 = 0.5. If we continue on this way... 3.625 = 2^1 + 2^0 + 2^-1 + (0.125) = 2^1 + 2^0 + 2^-1 + 2^-3 = 1*2^1 + 1*2^0 + 1*2^-1 + 0*2^-2 + 1*2^-3 = 11.101b Neat, huh? If you do this for other numbers, you may be surprised to find out that certain decimal fractions, like 0.1, convert into infinitely repeating binary expansions. In the case of this example: 0.1 = 0.000110011001100110011...b with those last four digits "0011" repeating forever. There's nothing special about binary, by the way. You can convert any number to any base you like. Hexadecimal, or base-16, is a popular one because it turns out that it's a very efficient way to write a value down that can easily be converted to binary. Each digit of a base-16 number directly expands into 4 base-2 digits. For instance, 52h can be expanded to binary one digit at a time: 5h = 0101b 2h = 0010b so: 52h = 0101 0010b Once you master moving numbers between different bases, you can amuse yourself by experimenting with strange bases like base-4.9, where every digit is a multiple of a power of 4.9. And, if you really want to get complicated, you can try writing numbers in base-pi, or base-e (base-e is is mathematically a very useful thing to know about when it comes to calculus).
  • Binary is a series of (typically) eight "bits" that are either one or zero; four bits make a nybble and two nybbles make a byte. On a Windows system, the leftmost bit is 128 and each bit to the right is half of the last's value, so you have 128,64,32,16,8,4,2,1. All you do is add up the bits in that order to get an ASCII value (ASCII is another form of computer data representation). So, for instance, we have this byte: 01000001 By looking above, the "64" and "1" bits are on and the rest are off, and this byte totals 65. Anyone who knows ASCII can tell you that's the capital letter A, but you can also find that out at http://www.asciitable.com As for what it's used for, it was mentioned that everything you do on a computer is broken down into these bytes. You see pretty pictures, textboxes and colours on your screen, but it's simply a gigantic string of ones and zeroes for a computer. I found all of the previous answers were great in their completeness, but thought a somewhat simpler explanation was required (no offense meant, but I figured one devoid of knowledge of binary couldn't grasp most of what was being thrown around here).
  • The word "binary" or "binaries" is also used to describe software once it is compiled. Software is usually written in a human-readable language rather than in ones and zeros, then it is run through a specialized program called a compiler that translates the human-readable text into ones and zeros, or binaries. When downloading certain software, you'll sometimes see a button for "Source" and another for "Binaries." The Source file(s) are in human-readable form and can be downloaded but they must be compiled to become binaries before they can be run by your computer. Binary files are specific to the operating system for which they are compiled, so I can't compile something on my Mac and have you run it on your PC.
  • I am going to assume by binary you mean bitwise opperators, because "binary" does not "work", it just is. I havent seen anyone cover the second part of your question, of what it is used for? Binary is used for mainly 2 things, 1) is specific algorithms that can be better expressed using binary opperators. 2) Bitwise opperators are EXTREMELY fast. Beats out use of any other opperator. So, if your algorithm works only in binary opps, you will save lots of clock cycles.

Copyright 2023, Wired Ivy, LLC

Answerbag | Terms of Service | Privacy Policy