The Best Cyprus Community

Skip to content


How can I Convert negative decimal to binary

Feel free to talk about anything that you want.

Postby boomerang » Tue Oct 30, 2007 1:32 am

phoenix wrote:


Thanks Boom! :D

The first one won't open . . . but I'll have a play with the second (if those pop-ups stop interfering) :D

How are you with Fermat's Last theorem? . . . and BTW have you read "The Music of the Primes" by Marcus du Sautoy ?


Hi Phoenix,

Both links work, as I have downloaded both prior to posting them...

I haven't read these 2 books, as I left my scientific studies behind...
User avatar
boomerang
Main Contributor
Main Contributor
 
Posts: 7337
Joined: Sat May 14, 2005 5:56 am

Postby Acunga » Tue Oct 30, 2007 2:21 am

O my god, and some people say i talk too much.
I need to know hoto to calulate NEGATIVE decimal to binary one on hand, by head or whatever it is in english.
Here i did not see any normal answer and it came from one of my classmates - just convert the decimal as if it was a plus and after that replace all 1 with 0 and 0 with 1.
So if we have 110010 for 100 with -100 we have 1001101 add 00000001 and -100 = 1001110.
Cheers.
Now i would dare to ask how we multiplex with heximals:)
Acunga
Member
Member
 
Posts: 71
Joined: Fri May 25, 2007 12:18 pm

Postby Get Real! » Tue Oct 30, 2007 2:29 am

Acunga wrote:O my god, and some people say i talk too much.
I need to know hoto to calulate NEGATIVE decimal to binary one on hand, by head or whatever it is in english.
Here i did not see any normal answer and it came from one of my classmates - just convert the decimal as if it was a plus and after that replace all 1 with 0 and 0 with 1.
So if we have 110010 for 100 with -100 we have 1001101 add 00000001 and -100 = 1001110.
Cheers.
Now i would dare to ask how we multiplex with heximals:)

Something tells me that both you and your classmate are going to fail this subject because you ain't listening... :(

+100 = 1100100

-100 = 11100100
User avatar
Get Real!
Forum Addict
Forum Addict
 
Posts: 48333
Joined: Mon Feb 26, 2007 12:25 am
Location: Nicosia

Postby Acunga » Tue Oct 30, 2007 2:36 am

Well I did not see a simple explanation like mine in order to understand it.I mean what the hell this means:
[qoute]Pyrpolizer wrote:
Hey GR I think the guy wants you to write him the whole program of dividing by twos...

Just a question though. How can someone tell if a given binary contains the MSB or not?
I mean without knowing this in advance one would think like that
111010=+58
0111010=+58
1111010=+122 not -58


You've only used up 7 bits Pyro, you forgot one bit!

I started off the theory for Acunga with the simplest 8-bit system that works for numbers between -128..127.

Here's a handy table to clear things up...

Name.................. Size.........Range
Byte.....................8-bit.......-128..127
Word....................16-bit......-32768..32767
Double Word.........32-bit......-2147483648..2147483647

Regards, GR.

In case you didn't understand...

10111010 -58
01111010 122[/quote]
Just tell the rule, no need to make it more complex and loong.No ofence just try to help with the help in the forum
Acunga
Member
Member
 
Posts: 71
Joined: Fri May 25, 2007 12:18 pm

Postby halil » Tue Oct 30, 2007 9:44 am

Negative Numbers In Binary :


Negatives:
Two’s complement system
Same as sign-magnitude for positives
With N bit numbers, to compute negative
Invert all the bits
Add 1
Example: -25 in 8-bit two’s complement
25 « 00011001
Invert bits: 11100110
Add 1: 1
11100111

Negatives:
Sign-Magnitude system
With a fixed number of bits, say N
The leftmost bit is used to give the sign
0 for positive number
1 for negative number
The other N-1 bits are for the magnitude
Example: -25 with 8 bit numbers
Sign: 1 since negative
Magnitude: 11001 for 25
8-bit result: 10011001
Note: This would be 153 as a positive.
halil
Main Contributor
Main Contributor
 
Posts: 8804
Joined: Fri Mar 09, 2007 2:21 pm
Location: nicosia

Postby B&N SERVICES » Tue Jan 01, 2008 11:51 pm

As I still remember, when for example computer is working on a binary numbers, first digit is always reserved for "plus" or "minus", where "0" means plus and "1' means minus
That's all...
B&N SERVICES
Member
Member
 
Posts: 69
Joined: Sat Dec 29, 2007 9:54 pm

Postby rawk » Wed Jan 02, 2008 12:40 am

I'd ask Mr Quamersland, he'll probably look it up in the Koran and give you the answer.

Half past two!

Rawk
User avatar
rawk
Contributor
Contributor
 
Posts: 648
Joined: Thu Mar 09, 2006 11:03 pm
Location: Larnaca on Sea, Cyprus

Re: How can I Convert negative decimal to binary

Postby webbo » Wed Jan 02, 2008 10:51 am

God, I hate maths and this only confirms why............................. :( :wink: :wink: :lol:

Bubbles x 8)
User avatar
webbo
Main Contributor
Main Contributor
 
Posts: 4698
Joined: Mon Sep 25, 2006 4:08 pm

Previous

Return to General Chat

Who is online

Users browsing this forum: No registered users and 0 guests