0
Psychonaut

decimal binary conversion

Recommended Posts

Quote

Anyone have any idea how to convert -123 the decimal to

1) Convert it to a 12-bit natural-biased binary number.
2) Convert it to a 4-digit 10's complement decimal number.




I'm a graduate of the Jethro Bodine School of Arithmatic and I don't have a clue what you said after,"Anyone have any idea how to convert ..." :)
Most of the things worth doing in the world had been declared impossilbe before they were done.
Louis D Brandeis

Where are we going and why are we in this basket?

Share this post


Link to post
Share on other sites
Ok, so here are just some steps to convert it to binary (2 bits).

-123 dec = -(123 dec)

So, find the binary equivalent of 123.

123 = 2*(61) + 1
61 = 2*(30) + 1
30 = 2*(15) + 0
15 = 2*(7) + 1
7 = 2*(3) + 1
3 = 2*(1) + 1
1 = 2*(0) + 1

So, -123 = -1111011

And, I'm not sure what you mean by a 12-bit natural based binary number. Maybe you mean -000001111011?
Don't forget to pull!

Share this post


Link to post
Share on other sites
I can convert from dec to binary, hex, base 4 8 whatever, but I'm needing help with these specific cases such as the 10's complement. In addition, from what I've been trying to figure out, the negative aspect really throws a wrench into the situation at times..
Stay high pull low

Share this post


Link to post
Share on other sites
Quote

Anyone have any idea how to convert -123 the decimal to

1) Convert it to a 12-bit natural-biased binary number.
2) Convert it to a 4-digit 10's complement decimal number.



Do a search on two's complement. What you are looking for is not that difficult (I have kids to deal with now) but if you don't have it solved by tomorrow I will look up my notes.

There is a simple trick of invert and add 1 or something similar as this is from memory.
Experienced jumper - someone who has made mistakes more often than I have and lived.

Share this post


Link to post
Share on other sites
Quote

Anyone have any idea how to convert -123 the decimal to

1) Convert it to a 12-bit natural-biased binary number.
2) Convert it to a 4-digit 10's complement decimal number.



A byte and a half?
"I may be a dirty pirate hooker...but I'm not about to go stand on the corner." iluvtofly
DPH -7, TDS 578, Muff 5153, SCR 14890
I'm an asshole, and I approve this message

Share this post


Link to post
Share on other sites
Quote

A byte and a half?



Nope, not necessarily!

8 bits is an Octet but not always a Byte.. Depends upon the machine architecture.

It's the atomic data storage size for a computer. A byte may be 9 bits on 36-bit computers. Some older architectures used "byte" for quantities of 6 or 7 bits,

(.)Y(.)
Chivalry is not dead; it only sleeps for want of work to do. - Jerome K Jerome

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

0