I need help with my homework!

Anything else. Post a funny site or tell us about yourself. Discuss current events or whatever else you want. Post off topic threads here.
Post Reply
User avatar
Disconn3cted
Veteran Member
Posts: 3293
Joined: Fri Mar 23, 2007 3:28 pm
Quick Reply: Yes
Location: WV, USA

I need help with my homework!

Post by Disconn3cted »

I am supposed to "Evaluate these expressions where A is 11111110 and B is 00000010 using two’s complement."

A+B=?
-B=?

I know how to add binary numbers but I don't know what two's compliment is and my book doesn't give a book explanation on how this relates to arithmetic.

I know 11111110 + 00000010 = 100000000 but I found a website that has the answers to all of the questions in this assignment and the answer is supposed to be 00000000. I'm totally lost, please help me. I don't want the answers. I really want to know how to solve this...
Image

User avatar
chickenfeather
Frequent Member
Posts: 1497
Joined: Tue Aug 15, 2006 3:24 pm
Quick Reply: Yes
Location: Origin Online
Contact:

Re: I need help with my homework!

Post by chickenfeather »

Origin Online
EdgeworthScoundrels

User avatar
Disconn3cted
Veteran Member
Posts: 3293
Joined: Fri Mar 23, 2007 3:28 pm
Quick Reply: Yes
Location: WV, USA

Re: I need help with my homework!

Post by Disconn3cted »

chickenfeather wrote:http://en.wikipedia.org/wiki/Two%27s_complement


-edit-

Nevermind, maybe I was over thinking this.
Image

User avatar
Smi!ezZ
Active Member
Posts: 558
Joined: Tue Dec 16, 2008 10:05 pm
Quick Reply: Yes
Location: Yukon

Re: I need help with my homework!

Post by Smi!ezZ »

11111120
and
-10

=]
Image
ECSRO ~ 86 Blader Dead

User avatar
Disconn3cted
Veteran Member
Posts: 3293
Joined: Fri Mar 23, 2007 3:28 pm
Quick Reply: Yes
Location: WV, USA

Re: I need help with my homework!

Post by Disconn3cted »

Smi!ezZ wrote:11111120
and
-10

=]


:roll:
Image

User avatar
Razorhead
Active Member
Posts: 820
Joined: Tue Apr 22, 2008 9:19 pm
Quick Reply: Yes
Location: leagueoflegends

Re: I need help with my homework!

Post by Razorhead »

My solution:
It's been over a year since I made my last 2-complement's calculation ><
Spoiler!

User avatar
CrimsonNuker
Dom's Slut
Posts: 13791
Joined: Sun Aug 06, 2006 3:31 am
Quick Reply: Yes
Location: guildwars2

Re: I need help with my homework!

Post by CrimsonNuker »

Dayum. What class is this?
ImageImageImage

User avatar
Disconn3cted
Veteran Member
Posts: 3293
Joined: Fri Mar 23, 2007 3:28 pm
Quick Reply: Yes
Location: WV, USA

Re: I need help with my homework!

Post by Disconn3cted »

CrimsonNuker wrote:Dayum. What class is this?


It is "Introduction to computer science" or Computer Science 111.

I think I figured it out. Two's compliment is used to represent a negative binary number. All the ones and zeros are reversed and then one is added to it. The directions confused me because it sounded like two's compliment was necessary for solving all of them and it wasn't.
Image

User avatar
CrimsonNuker
Dom's Slut
Posts: 13791
Joined: Sun Aug 06, 2006 3:31 am
Quick Reply: Yes
Location: guildwars2

Re: I need help with my homework!

Post by CrimsonNuker »

Lawl. I'm in gr 12 computer science (ICS4U), and I've never done anything like this, all we do is program shit :P
ImageImageImage

User avatar
BlackFox898
Loyal Member
Posts: 1844
Joined: Thu May 01, 2008 2:35 pm
Quick Reply: Yes
Location: ¿ɥǝ ɐpɐuɐɔ

Re: I need help with my homework!

Post by BlackFox898 »

CrimsonNuker wrote:Lawl. I'm in gr 12 computer science (ICS4U), and I've never done anything like this, all we do is program shit :P


lol same, even the same course code (ICS4U). our teacher is going to teach us C++, but all hes been doing is talking about SDLC and company structure :banghead:
Image

User avatar
CrimsonNuker
Dom's Slut
Posts: 13791
Joined: Sun Aug 06, 2006 3:31 am
Quick Reply: Yes
Location: guildwars2

Re: I need help with my homework!

Post by CrimsonNuker »

BlackFox898 wrote:
CrimsonNuker wrote:Lawl. I'm in gr 12 computer science (ICS4U), and I've never done anything like this, all we do is program shit :P


lol same, even the same course code (ICS4U). our teacher is going to teach us C++, but all hes been doing is talking about SDLC and company structure :banghead:


Everybody I know from other schools are learning C++, but our teacher is making us finish up Visual Basic from ICS3U, then we're moving on the Adobe Flex Builder...
ImageImageImage

User avatar
EvGa
Addicted Member
Posts: 2612
Joined: Wed Apr 23, 2008 4:33 am
Quick Reply: Yes
Location: Texas

Re: I need help with my homework!

Post by EvGa »

Speaking of CS homework here's a problem I'm having trouble with right now...

Read in a text file with the first int declaring 2D array size and then two coordinates (3,0) and (1,3). The coordinates correspond to components in the array. Using a northeast path, ie the ability to move up or right, find and print out all possible paths to the finish cord.

So, from a 5 by 5 2D array, print out all possible paths from (3,0) to (1,3), only allowed up or right movements.

Do this using only recursion. <---- FML

In java. <---- FML


It's due tomorrow. <---- FML

I've been working on this shit for 4hrs now, I waited until the last day thinking I had it all planned out in my head.. failed when I went to actually code it. I blow at recursion, give me loops any day. Going to be an all-nighter.

:soosad:

EDIT: :soosad: :soosad: :? :soosad: :soosad:
Image

User avatar
Aiyas
Loyal Member
Posts: 1679
Joined: Thu Jul 12, 2007 5:31 pm
Quick Reply: Yes
Location: JENGAAAA!!!!

Re: I need help with my homework!

Post by Aiyas »

Man, did this stuff back when I took Computer Arithmetic(over 3 years ago...)

Post Reply

Return to “Off Topic Lounge”