Shop OBEX P1 Docs P2 Docs Learn Events
Help with nibbles: Solved — Parallax Forums

Help with nibbles: Solved

Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
edited 2009-11-04 03:18 in Propeller 1
Could someone tell me why..

cn1:=11110000 (High Nibble padded with 0's)
cn2:=00000011 (Low Nibble padded with 0's)
total:=cn1+cn2

debug.bin(total,8)

generates 01111011 instead of 11110011 I'm looking for?

Thanks!
OBC

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?

Visit the: The Propeller Pages @ Warranty Void.

Post Edited (Oldbitcollector) : 11/4/2009 3:16:05 AM GMT

Comments

  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-11-04 03:13
    Duh! Rookie mistake!

    [noparse][[/noparse]code]
    cn1:=%11110000
    cn2:=%00000011
    total:=cn1+cn2


    Fixed! (For now)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Visit the: The Propeller Pages @ Warranty Void.
  • James LongJames Long Posts: 1,181
    edited 2009-11-04 03:18
    Oldbitcollector said...
    Could someone tell me why..

    cn1:=11110000 (High Nibble padded with 0's)
    cn2:=00000011 (Low Nibble padded with 0's)
    total:=cn1+cn2

    debug.bin(total,8)

    generates 01111011 instead of 11110011 I'm looking for?

    Thanks!
    OBC

    Ha.....rookie mistakes will get you every time.

    I was posting while you were.......you are stealing the air from my sails. smilewinkgrin.gif

    James

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    James L
    Partner/Designer
    Lil Brother SMT Assembly Services

    Are you addicted to technology or Micro-controllers..... then checkout the forums at Savage Circuits. Learn to build your own Gizmos!
Sign In or Register to comment.