English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

How would I convert a decimal number, say 5, into a 4-bit 2's Complement number? I keep getting 1001, but my table says the answer is 0101. I am so confused! Please help.

2007-02-17 08:45:41 · 2 answers · asked by Anonymous in Computers & Internet Programming & Design

2 answers

We understand your question, but Two's Comp. only come into play if the number is negative, and how 5 can be 1001 is beyond me, but -5 is 1011 in complement form, 1001 is 9 in regular form.

2007-02-17 10:56:36 · answer #1 · answered by Andy T 7 · 0 0

Translating the number into Hexadecimal or Binary,
makes it clearer what is happening. Basically you flip
the bits, then add one to the result.

Rather than write reams here, its far easier to send
you to the link below:

HTH

2007-02-17 16:52:37 · answer #2 · answered by Chipz 3 · 0 0

fedest.com, questions and answers