Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Binary Arithmetic

  1. Apr 2, 2007 #1
    I was wondering if anyone could suggest a resource to help me understand binary math better. Specifically I am having trouble two's compliment problems and binary multiplication.

    An example of where my thought process is getting confused:

    1110 * 010

    The answer given for this example is 00011100

    Now when I work it through I end up with 011100 by just following basic multiplication rules and I cannot figure where the extra two zeros are coming from.

    Not really looking for an answer for the problem which is why this isn't posted in the homework section. Really interested in some links to some sites that explain this well or even a text that I could study.
     
  2. jcsd
  3. Apr 2, 2007 #2

    cristo

    User Avatar
    Staff Emeritus
    Science Advisor

    The zeros at the beginning don't matter though, do they? It's like sayin 16=016 in decimal-- both are correct.

    Note that here you are multiplying the number by two (since two in binary is 10). To do this, you simply shift the number to the left and add a zero.. so 1110*10=11100. (c.f. 17*10=170 in decimal)
     
  4. Apr 2, 2007 #3
    so basically the zeros in the front mean nothing.... which makes more sense to me. Is there a reason you would write it out like that ever? I've noticed that there are groupings of 4 in how things are written out sometimes 0010 1110 etc. I haven't gotten that far into the studies yet to know - perhaps its just leading to something further along?
     
  5. Apr 4, 2007 #4
    Binary numbers are inconveniently long for human beings to handle (though not as bad as unary ones!) so grouping the digits makes life more comfortable. Visually it's easier to count fewer groups of 4 digits rather than 4 times as many individual digits. It's the same reason that in many parts of the world, decimal numbers are written in 3-digit groups ("12,345,678").

    A more compact notation still is hexadecimal, where each digit corresponds exactly to groups of four binary digits (0000=0, 0001=1, ... 1001=9, 1010=A, 1011=B, 1100=C, 1101=D, 1110=E, 1111=F). So another reason for using groups of 4 binary digits is that you can think of each group as a single hexadecimal digit if you prefer.

    In computing applications the groups-of-4 notation is also useful because a byte (the currently fashionable standard unit of data storage) is 8 bits, hence two 4-binary-digit groups.

    Before hexadecimal came into fashion everyone used octal notation (and often "characters" of 6 bits and "words" of 36 bits). People from that era will tend to group their binary digits in threes rather than fours, thus confusing everyone else and, increasingly, themselves.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Binary Arithmetic
  1. Modular arithmetic (Replies: 5)

  2. Arithmetic progression (Replies: 2)

  3. Arithmetic Sequence (Replies: 4)

  4. Modular arithmetic (Replies: 7)

Loading...