Dsy Network www | forum | my | didattica | howto | wiki | el goog | stats | blog | dona | rappresentanti
Homepage
 Register   Calendar   Members  Faq   Search  Logout 
.dsy:it. : Powered by vBulletin version 2.3.1 .dsy:it. > Didattica > Corsi A - F > Architettura degli elaboratori e delle reti > Aiuto conversione Floating point
  Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
Sylar
.novellino.

User info:
Registered: Jul 2007
Posts: 8 (0.00 al dì)
Location:
Corso: Informatica
Anno: 2^n
Time Online: 1:44:03: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
Aiuto conversione Floating point

Ciao a tutti, esercitandomi a fare qualche floating point qualcosa non mi quadra:

Trasfomare 25 da decimale a floating point
25 = 11001
Esponente 2^4 83
Mantissa 1001

e fin qui tutto ok.
Ma ora in che modo riesco a scrivere il floating point? Un bit è del segno, 8 dell'esponente ed il resto della mantissa (23), per cui

0 1000 0011 1001 000... Provando a scrivero in "esadecimale" viene fuori 41C80000.

Provando a trasformare questo float per verficare se tutto è corretto facciamo:

41*2 +1 (dato che c'è C) = 83
83-7F=4 l'esponente è 4.

Scriviamo la mantissa C8
1100 1000
dato che l'esponente è 4 dobbiamo mettere la virgola dopo la 5° cifra a partire da sinistra, per cui 11001,000 che equivale a 25,00

RIPORTA!

Ora se provo a far la stessa cosa con -15 non mi riporta! :(

15 = 1111
E = 2^3 82
Mantissa 111

1 1000 0010 111 il che equivale a C1700000

Ora se provo a convertire di nuovo il floatinf in decimale ho:
C1*2 = 82 2^3

Scrivo la mantissa 70
0111 0000
dato che l'esponente è 3 viene fuori 111,0000 cioè 7,000 che in teoria è -7,00 dato che il bit del segno è 1.

Dov'è che sbaglio?

11-04-2008 17:50
Click Here to See the Profile for Sylar Click here to Send Sylar a Private Message Find more posts by Sylar Add Sylar to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 17:52.    Post New Thread    Post A Reply
  Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread | Add to Bookmarks

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is ON
 

Powered by: vBulletin v2.3.1 - Copyright ©2000 - 2002, Jelsoft Enterprises Limited
Mantained by dsy crew (email) | Collabora con noi | Segnalaci un bug | Archive | Regolamento | Licenze | Thanks | Syndacate
Pagina generata in 0.049 seconds (64.87% PHP - 35.13% MySQL) con 22 query.