Code Retired
Wednesday, June 10th, 2009Code Retired

Many have cursed their computer for taking things too literally! It is easy to blame the computer when something goes wrong.
You to get the cash market, and the item you purchased on special "runs at full price. The manager must be called for correct, and what does it mean? "We've had problems with the computer, he gets the wrong price on certain things. "
You put in a address list to your word processor and print party invitations for next week. Then you find that today's date has been inserted in the signature block – the computer!
Perhaps you've heard the expression garbage garbage out "? Someone at one point instruct the computer to do what he did, he did not you decided to live deliberately. Computers can only do what they are told they are more logical that Spock and they take everything literally.
We'll look at why they are so pedantic!
The world around us has many aspects that work the same way a computer. There are many examples of otherwise, eg Up and Down, Left and right, front to rear. A light may be turned on or off, perhaps it's the night or day. Yes or No? You can think of many others. This system of two possible states is called a binary system. If this is not one it must be the other.
A computer uses the binary system to perform all its functions, the base unit, originally a vacuum tube, then a transistor, a chip is used thousands of times to make the total unity. Light On or Off, which we mentioned above is controlled by a switch. On the computer this switch is a transistor, which is either yes or no.
Now we get to the math! Do not worry, it's very simple Math! In fact it is so simple that we can count to 1. True, we can have two states if you count from 0 to 1. (That's another thing computers are pedantic about, they insist on starting from scratch).
The binary system is a digital system. You are familiar with the decimal system, which has 10 numbers 0 to 9 (think like a computer the first 0 contingency). You can do all kinds of number systems for any purpose you want. You probably know ten (12) and have also heard about a half-dozen. If you use your computer as you may have met the hexadecimal system. It has 16 'Figures' 0-9 and AF. Another numbering system used by people is a computer system octal, which has 8 digits, 0-7.
Ok then how we count only 0 and 1. Simple, exactly the same way you count in decimal. The first ten digits are OK, 0-9, but what now? We start, but adding a 1 making 10 or "one, zero. This leads to "one nine" and we continue to "two, zero, and so on until "Nine, nine, and then we again add 1 to 100 -" one, zero, zero. "
DECIMAL 0-9, 10-19, 20 -…..- 99 100.
If you have followed so far, you're ready for the binary sequence, it is much simpler. From zero, we have 0.1 – And that's all. We follow the same rule and add a 1, making it "one, zero." Followed a "a" and "one, zero, zero "-" one, zero, one, "etc., are equivalent to decimal 0,1,2,3,4,5. How does this relate to computers? That's next.
BINARY – 0 1 10 11 100 101
DECIMAL – 0, 1, 2, 3, 4, 5
In our computer we transistor switches as described above. For example math we just watch, we need 3 switches. They represent each a binary digit or bit. To represent a decimal 1, these switches is OFF, OFF, ON or 001. For a decimal 5, we have ON, OFF, ON, or 101. By extension, you can see that with 4 switches we could go until 1111 or 15 decimal.
TRANSISTORS [OFF ON OFF] [ON OFF] [ON ON ON ON]
BINARY …… 001 101 1111
DECIMAL ….. 1, 5, 15
Another point to note is that each binary digit or bit, has a value. Just like in decimal, we have units, tens, hundreds, etc. in binary values are 1,2,4,8,16,32,64,128 etc. so binary code 1111 mentioned above is 1 +2 +4 +8 = 15. binary 1010 which would be in decimal?
Bit Value 8 4 2 1
BINARY …. 1 0 1 0
DECIMAL … 8 +2 = 10
If you want to work that binary is 100101100 in decimal, we can adding the individual values. In fact people who work on basic machines need to know "machine code"! For 1010 would be a hexadecimal or 12 in octal.
One reason to use octal or hexadecimal code is to enable humans to interpret the codes for the machine. Some Words mainframe computers use''with 24, 32, 36 or 72 bits. These are displayed or printed in groups of three octal, or four hex. For example, the binary word 24 bits in a computer may be interpreted as shown here.
BINARY 100 111 000 011 010 000 011 100
OCTAL .. 4 7 0 3 2 0 3 4
BINARY 1001 1100 0011 0100 0001 1100
HEX …. 9 D 3 4 1 D
This probably seems a very long term way of working the numbers, until you remember that these "switches" can operate at nanosecond speeds, of about 1000000000 times per second, the calculations can become great.
That's probably enough to digest at once. Then we'll see how a computer adds and multiplies.
Tony is an experienced computer engineer. He runs a series of web sites based at http://theze-group.com
Top Secret Magic Code Review



