0001 0000 1100 0011 (unsigned, that is, interpreted as b2u)i.8 bit truncated value:ii.does the value change when truncated to 8 bits?iii.how did you decide?d.1101 1111 0011 1010 (signed, that is, interpreted as b2t)i.8 bit truncated value:ii.does the value change when truncated to 8 bits?iii.how did you decide?

Respuesta :

DeanR
I don't know what b2u and b2t are but I'll manage.

0001 0000 1100 0011 unsigned

i. We'll assume when we' truncate we get the low order bits:

1100 0011 unsigned

ii. Those are different

iii.  There's a 1 in the high order bits that got thrown away when we truncated.

1101 1111 0011 1010 signed 

i. Truncated:

0011 1010 

Typically when we'd coerce a signed twos complement value to eight bits we'd preserve the sign.  Calling it truncation makes it sound to me that wasn't intended.

ii. yes, different value

iii. Again, we threw out bits