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 5 years have passed since last update.

【基本情報】2進法(2進数)と8進数・16進数の表記について

0
Posted at

コーディング以外のシステム・業務関係を知る手段として基本情報技術者試験の内容が包括的に学べると聞き覗いてみたので、備忘録として書きます。
表現の不満や誤りなどがあれば仰って頂けると非常に助かります(^_^;)

2進法(2進数)とは

2進法とは、「1」 と 「0」 の2つの数値のみで表された数字表現のことで、その数を2進数と呼ぶ。
普段我々が使っているのは10進法と呼ばれ、0, 1, 2, 3, 4, 5, 6, 7, 8, 9 で表現されている。
(2、10などのベースの数値のことを基数と呼ぶ)

10進法では9の次には繰り上がり10(1と0で表現)となるが、
2進法では1と0しか数字記号がないため、0 → 1 の次は繰り上がり10(10進法での2にあたる)
 

<対比>

2進数 10進数
1 1
10 2
11 3
100 4
101 5
110 6
111 7
1000 8
1001 9
1100 10
1011 11
1111 12

2進法はコンピュータを構成する論理演算(AND, OR, NOT)に加え、メモリの構成にも用いられるすべてのベースとされる。

8進数と16進数

8進数:  0, 1, ..., 7 の8つの数字で表される。

16進数: 0, 1, ..., 9, A, B, ..., F の16の数字とアルファベットで表される。
桁が上がる表記としては、 0, 1, ..., F, 10(Fの次がないので桁上がり), ...19, 1A(9の次は), 1B, ..., 1F, ..., FF, 100

IPポート番号やカラー表記(青:0000ff)などにも使われる。

 
■色を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?