16-bit hexadeciaml stored in sign-magnitude

  • Thread starter Thread starter Scooouuuty
  • Start date Start date
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 13K views
Scooouuuty
Messages
1
Reaction score
0

Homework Statement



What is the sum of A and B if they represent signed 16-bit hexadecimal numbers stored in sign-magnitude format?

A = 0D34
B = DD17

Homework Equations



A + B = C :)

The Attempt at a Solution



so far the hexadecimal can be converted to binary numbers

A = 0000 1101 0011 0100
B = 1101 1101 0001 0111

since the hexadecimal is stored in sign-magnitude, then the most significant bit, controls the sign either plus or minus (in this case its -)

Therefor i write the following

0000 1101 0011 0100
-0101 1101 0001 0111
--------------------------------
? 0000 0001 1101

I'm stuck afterwards, because where do i borrow or get the last bits?

Because when i use a binary calculator i get the following result
1100 1111 1110 0011 => CFE3

I would like to understand how to get this result, not just use the calculator...
 
on Phys.org
you do realize that B is negative right because its sign bit is on, so you adding a positive number and a negative number.

Your mistake is in flipping the sign bit and subtracting the B.

Remember in binary:
- a plus ONE is 0000 0000 0000 0001 and
- a minus ONE is 1111 1111 1111 1111

(((ie a minus ONE is not the sequence 1000 0000 0000 0001)))

and when you add them together what do you get? and where did the carry bit go?
 
Last edited:
Scooooty: You should check out two's compliment, which is what jedishrfu is discussing.