EECS 203 Mailing List
Re: 5a

Re: 5a

From: Robert Dick <dickrp_at_avoiding.spam>
Date: Sat May 10 2008 - 21:31:47 CDT

Byron Cheng:
> Does anyone have any suggestions for converting sign magnitude to two's
> complement and the reverse? I have a table laid out showing what the sign
> magnitude representation is decimally, and then I converted the decimals to
> two's complement but can't think of a good way to convert using logic
> gates. I do see that only the negative sign magnitude numbers change, but
> other than that, don't have any idea.

From sign-magnitude to two's-complement, if it is negative, you can complement
all bits and add one. That can be done with a ripple-chain of half-adders.
A half-adder is like a full-adder but has only two inputs instead of three
inputs. There might be a more efficient way but this will work.

From two's-complement to sign-magnitude, if it is negative, do exactly the
same thing!

-Robert Dick-
Received on Sat May 10 21:31:47 2008

This archive was generated by hypermail 2.1.8 : Sat Aug 23 2008 - 21:08:11 CDT