Shop OBEX P1 Docs P2 Docs Learn Events
Understanding Binary — Parallax Forums

Understanding Binary

John BoardJohn Board Posts: 371
edited 2012-06-22 01:10 in General Discussion
G'day,

I've decided to not only make programs for the prop with the knowledge that I have, but to actually read up about programming them in general, perticually ASM. It got to the binary section in this (P16 - http://gadgetgangster.com/working_files/assembly_tutorial/potatohead.pdf) ASM tutorial and I thought that I ought to learn more about converting binary to decimal visa versa, so I took a look at this video (http://www.youtube.com/watch?v=tfKe8PPI2zs) which I found quite helpful. But then came the confliction. On P16 of the ASM tutorial on the first addition sum (binary) it said the answer should be 122, however, by my reconing, it should be 13:
------------------------------------------------------------------------------------------------------

   11             11 <---- Carry
     23            110
  + 99         + 111
      --             ---
    122          1101 <----- Sum

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

   8
   4
+ 1
-----
  13

------------------------------------------------------------------------------------------------------

Can anyone explain this?

Thanks,

John

Comments

  • John BoardJohn Board Posts: 371
    edited 2012-06-21 15:45
    Sorry - The indentation of a lot of those sums are out.
  • potatoheadpotatohead Posts: 10,261
    edited 2012-06-21 15:49
    That is a typo I thought was fixed.

    I will review that version. The decimal number example seems wrong. The important thing is the binary. Thanks for posting this.
  • John BoardJohn Board Posts: 371
    edited 2012-06-21 17:28
    Thanks for clarifying this - I thought I had done something wrong!
  • potatoheadpotatohead Posts: 10,261
    edited 2012-06-21 17:58
    No worries. Keep having fun!

    If you run windows operating system, be sure and check out the scientific and or programmer calculator options. It can take and convert decimal, binary and hex.
  • ajwardajward Posts: 1,130
    edited 2012-06-22 01:10
    John Board wrote: »
    G'day,

    I've decided to not only make programs for the prop with the knowledge that I have, but to actually read up about programming them in general, perticually ASM. It got to the binary section in this (P16 - http://gadgetgangster.com/working_files/assembly_tutorial/potatohead.pdf) ASM tutorial and I thought that I ought to learn more about converting binary to decimal visa versa, so I took a look at this video (http://www.youtube.com/watch?v=tfKe8PPI2zs) which I found quite helpful. But then came the confliction. On P16 of the ASM tutorial on the first addition sum (binary) it said the answer should be 122, however, by my reconing, it should be 13:
    ------------------------------------------------------------------------------------------------------
    
       11             11 <---- Carry
         23            110
      + 99         + 111
          --             ---
        122          1101 <----- Sum
    
    --------------------------------------------
    128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
    --------------------------------------------
                               1   1  0   1
    
       8
       4
    + 1
    -----
      13
    
    ------------------------------------------------------------------------------------------------------
    

    Can anyone explain this?

    Thanks,

    John

    Took me a second on that as well... till I realized the decimal and binary problems aren't the same. I suppose the 0030 fog might have had a hand in the confusion! ;-)

    The decimal problem, in binary, would look like:

    Bin.jpg


    Amanda
    152 x 87 - 24K
    Bin.jpg 23.6K
Sign In or Register to comment.