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

I'm majoring in CS and I have to figure out how to: Translate expressions from decimal real number to a binary number with radix and fractional parts.

The first one I have to do is 20.25

Is it 0001 1100 and 1/4? or maybe 0001 1100 and 0001/0010?

Please tell me a good process to go through to help me through the rest of my assignment.

Thank you!

2006-09-09 10:21:40 · 3 answers · asked by Ricky B 3 in Computers & Internet Programming & Design

3 answers

Well the first thing you have to do is split the whole number and the fraction.

So 20.25 becomes: 20 & 0.25

Then you take the whole number and subtract the highest possible factor of 2, in this case that would be 16. Which leaves you with 4, then you repeat it again. The highest factor of 2 that one can subtract from that is 4. The remainder is obviously zero. The way I used to do it when I was studying was by drawing up a table...

So I would start with 2 to the power of 7 which is 128 and then all the way to 2 to the power of 0 which is 1. Which meant you had all the factors of 2 from 0 to 7. Then you checked to see if it could be subtracted from the decimal number and if so then I would put a one beneath that block.

So in your case 20 in binary would be 10100.

As for the fraction, you also use 2 to the power of but take the recipicle. So 1/2 is = 0.5 and 1/(2 to the power of 2 is 4) = 0.25 and so on.

Check the links below for a really good explanation. Once you get a hang of it it's really easy.

2006-09-09 10:41:15 · answer #1 · answered by Anonymous · 0 0

i assume that you're not from now on allowed to apply a calculator, so we will basically might want to apply straightforward math. each digit of a binary determination has a cost in decimal even as that's a a million. you already know this from with the ability to bypass from binary to decimal. So the determination 1011 = 8+0+2+a million = 11. So do exactly an analogous yet backwards. the biggest digit that matches interior of 228 is 128. So placed a a million down for 128. (10000000) That leaves you with one hundred. the biggest binary digit that matches interior it is sixty 4, so placed a a million there... (11000000) Now you've 36. the biggest digit for that? 32. placed a a million down for that... (11100000). Now you've 4. the biggest digit for it truly is.... 4! placed a a million contained in the 4 digit... (11100100) each thing else is a nil. Voila! 11100100

2016-11-25 22:31:09 · answer #2 · answered by egbe 4 · 0 0

Try this link. Looks like it has all you will need to know.

http://www.wikihow.com/index.php?title=Convert-from-Decimal-to-Binary&&oldid=0

2006-09-09 10:24:08 · answer #3 · answered by TheHumbleOne 7 · 0 0

fedest.com, questions and answers