39
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

posted at

updated at

2進数10進数16進数

対応表

10進数 16進数 2進数
0 0x0 0000
1 0x1 0001
2 0x2 0010
3 0x3 0011
4 0x4 0100
5 0x5 0101
6 0x6 0110
7 0x7 0111
8 0x8 1000
9 0x9 1001
10 0xA 1010
11 0xB 1011
12 0xC 1100
13 0xD 1101
14 0xE 1110
15 0xF 1111

下位ビットの取り出し

ビット数 16進マスク 2進マスク
1 0x01 0000 0001
2 0x03 0000 0011
3 0x07 0000 0111
4 0x0F 0000 1111
5 0x1F 0001 1111
6 0x3F 0011 1111
7 0x7F 0111 1111
8 0xFF 1111 1111

各ビット単体

2進数 16進数
1000 0000 0x80
0100 0000 0x40
0010 0000 0x20
0001 0000 0x10
0000 1000 0x08
0000 0100 0x04
0000 0010 0x02
0000 0001 0x01
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Sign upLogin
39
Help us understand the problem. What are the problem?