GIDForums  

Go Back   GIDForums > Computer Programming Forums > Assembly Language
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 08-Feb-2009, 14:23
bonekrusher bonekrusher is offline
New Member
 
Join Date: Sep 2007
Posts: 9
bonekrusher is on a distinguished road

Two Complient Adjustment


Hi - I am taking an Assemble class and trying to learn hexadecimal representation of decimals. I was hoping someone can explain how to convert -32d to hex

I know that 32d is 20h, but how do I invert 0020h then add 1?
  #2  
Old 08-Feb-2009, 15:34
davekw7x davekw7x is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Left Coast, USA
Posts: 5,217
davekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to behold

Re: Two Complient Adjustment


Quote:
Originally Posted by bonekrusher
...but how do I...
Code:
I conceptualize it in binary. With 16 bit arithmetic: 32 Decimal = 20 Hex = 0000 0000 0010 0000 Binary Start with the binary representation 0000 0000 0010 0000 Take the ones complement 1111 1111 1101 1111 Add one to the ones complement +1 ------------------- The 16-bit binary sum 1111 1111 1110 0000 Hex representation of 1111 1111 1110 0000 is FFE0

Regards,

Dave
  #3  
Old 08-Feb-2009, 16:55
bonekrusher bonekrusher is offline
New Member
 
Join Date: Sep 2007
Posts: 9
bonekrusher is on a distinguished road

Re: Two Complient Adjustment


Thank you very much
 
 

Recent GIDBlogProgramming ebook direct download available by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 09:14.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.