Question

write down the maximum and minimum hexidecimal and decimal values achievable for each of the following...

write down the maximum and minimum hexidecimal and decimal values achievable for each of the following data types in C:

uin8_t unsigned 8 bit integer

int8_t signed 8 bit integer

uin16_t unsigned 16 bit integer

int32_t signed 32 bit integer

explain everything

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Unsigned 8-bit integer:

In case of 8-bit unsigned integer, we can represent integers from 0 to 28-1=255.

When all 8 bits are 0 then it represents 0 and when all 8 bits are 1 then it represents 255.

Hence minimum 8-bit unsigned integer: 0(decimal) and 0(hexadecimal)

Maximum 8-bit unsigned integer: 255(decimal ) and FF(hexadecimal).

Signed 8-bit integer:

In case of 8-bit signed number , most significant(left most) bit is used for sign bit(o for +ve and 1 for -ve).

So, positive numbers are 00000000 to 01111111. i.e. in decimal 0 to 27-1=127.

And negative numbers are, 10000000(-128) to 10000001(-1).

Hence minimum 8-bit signed integer: -128(decimal) and -80(hexadecimal)

Maximum 8-bit unsigned integer: 127(decimal ) and 7F(hexadecimal).

Unsigned 16-bit integer:

In case of 16-bit unsigned integer, we can represent integers from 0 to 216-1=65536.

When all 16 bits are 0 then it represents 0 and when all 16 bits are 1 then it represents 65536.

Hence minimum 8-bit unsigned integer: 0(decimal) and 0(hexadecimal)

Maximum 8-bit unsigned integer: 65536(decimal ) and 10000(hexadecimal).

Signed 16-bit integer:

In case of 16-bit signed number , most significant(left most) bit is used for sign bit(o for +ve and 1 for -ve).

So, positive numbers are 0000-0000-0000-0000 to 0111-1111-1111-1111. i.e. in decimal 0 to 215-1=32767.

And negative numbers are, 1000-0000-0000-0000(-32768) to 1000-0000-0000-0001(-1).

Hence minimum 16-bit signed integer: -32768(decimal) and -8000(hexadecimal)

Maximum 8-bit unsigned integer: 32767(decimal ) and 7FFF(hexadecimal).

Add a comment
Know the answer?
Add Answer to:
write down the maximum and minimum hexidecimal and decimal values achievable for each of the following...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT