Sunday, June 19, 2016

Binary Numbers and Computers

Hello,
Recently I wrote a small paper on binary numbers and how they came to be the number system used in computers. I will paste this below along with links to my reference. I am doing this because it partially explains why my next blog post will be on binary and hexadecimal math. :)

Binary Numbers and Computers
The first computers used electrical mechanical switches called relays. The computers are so large that they would take up the space of a large room. The switches were used because it was easy to determine the which state the relay was in; either it was on and current was present or it was off and there was no current. It was for this reason that engineers used the binary number system for computers, since in binary we only have two numbers, 0 & 1, and engineers could use this to correspond to the on/off state of the switch.
This dependency on binary numbers may change if those working on quantum computing have anything to say about it as quantum data has the property, such that, a quantum computer with x can be in an arbitrary superposition of up to 2^x different states simultaneously.
Anyway, the first electronic computer, ENIAC, was built 1946 at the University of Pennsylvania and used binary to calculate data. However, the binary number system had been around for almost 300 years before that, as it was discovered by the coauthor of calculus, Gottfried Wilhelm Leibniz, in 1701.
Binary Math? Binary addition and subtraction are very similar to the 10 based math we have today. I have a handout as an example.
What about Binary multiplication and division? Here’s how it works:
Binary multiplication   is actually much simpler than decimal multiplication. In the case of decimal multiplication, we need to remember 3 x 9 = 27, 7 x 8 = 56, and so on. In binary multiplication, we only need to remember the following,
0 x 0 = 0
0 x 1 = 0
1 x 0 = 0
1 x 1 = 1
Note that since binary operates in base 2, the multiplication rules we need to remember are those that involve 0 and 1 only. As an example of binary multiplication we have 101 times 11,
  101
  x11
First we multiply 101 by 1, which produces 101. Then we put a 0 as a placeholder as we would in decimal multiplication, and multiply 101 by 1, which produces 101.
  101
  x11
  101
1010  <-- the 0 here is the placeholder
The next step, as with decimal multiplication, is to add. The results from our previous step indicates that we must add 101 and 1010, the sum of which is 1111.
  101
  x11
  101
1010
1111

Binary division   is almost as easy, and involves our knowledge of binary multiplication. Take for example the division of 1011 into 11.
          11   R=10
 11 )1011
        -11
         101
          -11
           10  <-- remainder, R
To check our answer, we first multiply our divisor 11 by our quotient 11. Then we add its' product to the remainder 10, and compare it to our dividend of 1011.
     11
  x 11
     11
   11 
  1001  <-- product of 11 and 11
 1001
 +  10
  1011  <-- sum of product and remainder
The sum is equal to our initial dividend, therefore our solution is correct.

I got the information for this at the following pages:
https://en.wikipedia.org/wiki/Quantum_computing

1 comment:

  1. Good examples. Even in binary, I prefer the forgiving algorithm, especially since everything is multiply by powers of 10. For example, not 0 as a placeholder, but multiplying times 10. What is 10 times 101? 1010, just like you'd think.

    To be an exemplar this post could use some consolidation. What do you get out of this, why think about, what does it prepare you for?

    C's 4/5
    clear coherent complete content +

    ReplyDelete