I need help with my homework!
- 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!
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...
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...

- 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!
Origin Online
EdgeworthScoundrels
EdgeworthScoundrels
- 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!
chickenfeather wrote:http://en.wikipedia.org/wiki/Two%27s_complement
-edit-
Nevermind, maybe I was over thinking this.

- Disconn3cted
- Veteran Member
- Posts: 3293
- Joined: Fri Mar 23, 2007 3:28 pm
- Quick Reply: Yes
- Location: WV, USA
- 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!
My solution:
It's been over a year since I made my last 2-complement's calculation ><
It's been over a year since I made my last 2-complement's calculation ><
Spoiler!
- CrimsonNuker
- Dom's Slut
- Posts: 13791
- Joined: Sun Aug 06, 2006 3:31 am
- Quick Reply: Yes
- Location: guildwars2
- 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!
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.

- 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!
Lawl. I'm in gr 12 computer science (ICS4U), and I've never done anything like this, all we do is program shit 



- 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!
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
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

- 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!
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
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
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...



Re: I need help with my homework!
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.

EDIT:

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.

EDIT:


- 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!
Man, did this stuff back when I took Computer Arithmetic(over 3 years ago...)
