0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【基本情報技術者】2進数を16進数に変換

Posted at

2進数1010.01を16進数に変換

【解説】
まず2進数1010.01を4桁ごとに区切ります.
ここでは計算しやすいように、小数点で区切り、
計4桁になるように0を付け加えます。

今回であれば1010-.0100 という感じです.

16進数は2の4条なので
4桁目は値×8
3桁目は値×4
2桁目は値×2
1桁目は値×1
となり、
それぞれ出た数値を文字列的に並べれば16進数へと変換できます。

今回の場合だと

1010
1 * 8 = 8
0 * 4 = 0
1 * 2 = 2
0 * 1 = 1
= 11 = B

0100
0 * 8 = 0
1 * 4 = 4
0 * 2 = 0
0 * 1 = 0
= .4

これを並べると B.4となり、この数値が16進数に変換した1010.01となります。

*補足
16進数は、0123456789ABCDEFの16桁で表します

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?