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

I'm studying for a Java test...

6. [18 pts] Assuming 4-bit integer arithmetic add the negative numbers -3 and -6 and explain the result. Do this in steps: write down the binary representations of 3 and 6, convert them to their two’s complement negatives (using one’s complement as an in between step if you want), add the results, and explain the result.

I can do the binary fine..but how to do you convert to two's complemnet negatives?

2007-09-23 16:55:39 · 3 answers · asked by Anonymous in Computers & Internet Programming & Design

thanks, but you just overly complicated it.

I can get the two compliments:

1010 and 1101

but when i add them i dont get 9...whats wrong?

2007-09-23 17:26:19 · update #1

3 answers

Two's complement has a nifty side effect, x + -x = absolute 0 bit with an ignorable overflow bit; while one's complement doing the same arithmetic is absolute 0 or 1 row bits.

The formula/algorithm you should've applied is
1. Forget about signs, everything is done unsigned.
2. Do the formula: 2^(total bits, 4 here) - x; this gives unsigned decimal base representing the two's comp. number, let call it y.
3. Convert y to binary, and if the thing is retreated as signed, you've got two's complement of x.

FYI: this is not a Java question, but more advanced introductory hardware or intro to numerical systems.

2007-09-23 17:12:33 · answer #1 · answered by Andy T 7 · 1 0

i does not call it overbearing, based how the female takes compliments it would merely make her a sprint uncomfortable. some human beings can hear a compliment and say thank you yet some human beings don't comprehend a thank you to respond. i could depart it with one after the other. this form they are going to sound greater actual too. in case you tell her she has a large smile acceptable after telling her she has high quality hair she would think of you're justing announcing stuff to be announcing it. in case you tell her later after a humorous tale or some thing that she has a large smile that is going to propose greater announcing it by using itself. :-D

2016-12-17 08:54:38 · answer #2 · answered by caren 4 · 0 0

ditto what Andy said (way out of my league)

2007-09-23 17:23:51 · answer #3 · answered by topdn 7 · 0 0

fedest.com, questions and answers