Changing signed integer 16 bit format to binary format.

How can I express the BIGGEST NEGATIVE number and SMALLEST POSITEVE number of a signed integer 16 bit format?
I know the range of singed integer 16 bit format is from -32768 to 32767, but...
Q1.I am not sure which value is the biggest negative and smallest positive.
Q2. Also, if there is negative integer value, how can I convert negative to binary?

 採用された回答

Walter Roberson
Walter Roberson 2020 年 4 月 14 日

1 投票

dec2bin(typecast(intmin('int16'),'uint16'))
dec2bin(typecast(intmax('int16'),'uint16'))

6 件のコメント

SeungHyun Cha
SeungHyun Cha 2020 年 4 月 14 日
what is biggest negative and smallest positive...?
I want to study the encodings . can you explain.?
Ameer Hamza
Ameer Hamza 2020 年 4 月 14 日
SeungHyun, the biggest negative and smallest positive, if restricted to int16, are -1 and 1, respectively.
SeungHyun Cha
SeungHyun Cha 2020 年 4 月 14 日
Yes I think so.
Sorry I am South Korean, I am really weak in English. However, again thank you!
SeungHyun Cha
SeungHyun Cha 2020 年 4 月 14 日
then...How can I convet -1 to binary..?
Walter Roberson
Walter Roberson 2020 年 4 月 14 日
dec2bin(typecast(int16(-1),'uint16'))
SeungHyun Cha
SeungHyun Cha 2020 年 4 月 14 日
Thank you two experts...!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by