14.08.2013 Views

Lucidi in formato PDF - Dipartimento di Matematica e Informatica

Lucidi in formato PDF - Dipartimento di Matematica e Informatica

Lucidi in formato PDF - Dipartimento di Matematica e Informatica

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Rappresentazione con bit <strong>di</strong><br />

segno<br />

• Supponiamo <strong>di</strong> avere a <strong>di</strong>sposizione 8 bit; <strong>di</strong>vi<strong>di</strong>amo<br />

l’<strong>in</strong>tervallo dei 256 valori rappresentabili <strong>in</strong> due parti:<br />

– 0-127 (rappresentanti i numeri da 0 a 127);<br />

– 128-255 (rappresentanti i numeri da –0 a –127).<br />

• Il bit più significativo (più a s<strong>in</strong>istra) rappresenta qu<strong>in</strong><strong>di</strong><br />

il segno del numero:<br />

– 0: numero positivo (<strong>in</strong>tervallo da 0 a 127);<br />

– 1: numero negativo (<strong>in</strong>tervallo da 128 a 255).<br />

• Aspetto negativo: lo zero ha due rappresentazioni:<br />

– +0 (00000000),<br />

– - 0 (10000000).

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!