Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
すべてはバイナリ
Search
Satoru Takeuchi
PRO
June 06, 2020
Technology
220
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
すべてはバイナリ
以下動画のテキストです。
https://youtu.be/8qg2b8ZZm_c
Satoru Takeuchi
PRO
June 06, 2020
More Decks by Satoru Takeuchi
See All by Satoru Takeuchi
119-多機能ファイルシステムBtrfs_のコピー.pdf
sat
PRO
1
67
Linuxカーネルの インタフェースは変わりうる?
sat
PRO
1
92
あなたの知らないバージョン命名規則
sat
PRO
3
890
Rook: Intro and Deep Dive with Ceph
sat
PRO
1
64
Machine Check Exception
sat
PRO
2
66
バイナリダンプの模様を読む
sat
PRO
0
89
cpコマンドはディスク上でデータを コピーしないことがある
sat
PRO
3
87
114-ファイルのshallow_copy.pdf
sat
PRO
2
57
113-Btrfsのスナップショット.pdf
sat
PRO
0
40
Other Decks in Technology
See All in Technology
Adaptive Warehouse を今すぐ導入すべき理由と迷ったときの判断基準
__allllllllez__
0
200
登壇の自信を奪う3匹のオバケ / 3 Ghosts That Rob You of Your Confidence in Public Speaking
pauli
3
190
Screen Lens - 今見てる画面を翻訳する
komagata
0
250
AI時代に顧客へ最速で価値を 届けるための試行錯誤 〜「AI × マネジメント」領域におけるmentoのケース〜
posterkeisuke
0
110
Code4Lib JAPANカンファレンス2026 開会挨拶 / Code4Lib JAPAN Conference 2026: Opening Remarks
ykiyota
0
340
AIオーケストレーションを活用した 開発ワークフローの設計と実践
bqnq
0
140
クロスボーダーM&AのValue Upを支えるプロダクト開発。日米チームのハブになったプロダクトエンジニアの実践 / Product Engineering Conference 2026
genda
0
120
Oracle Cloud Infrastructure IaaS 新機能アップデート 2026/6 - 2026/8
oracle4engineer
PRO
0
170
#jawssonic2026 あの時代が悪かった ~動かなかったSageMakerと共に迎えたイベント当日~
ktkn1129
0
150
2026-09-09 【sigma_ucj#1】Sigma を IaC 管理したい! / IaC for Sigma
civitaspo
0
120
Microsoft 365 Copilot chat -tekoälypalvelun tietosuojaongelmat
hponka
0
740
目の前の楽しいが人生を変える - コミュニティの螺旋の歩き方と楽しむコツ / change your life
soudai
PRO
4
510
Featured
See All Featured
Practical Orchestrator
shlominoach
191
12k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
660
Fashionably flexible responsive web design (full day workshop)
malarkey
408
67k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.2k
How to train your dragon (web standard)
notwaldorf
97
6.8k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Code Reviewing Like a Champion
maltzj
528
40k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
250
Designing for humans not robots
tammielis
254
26k
Building Flexible Design Systems
yeseniaperezcruz
330
41k
sira's awesome portfolio website redesign presentation
elsirapls
0
410
Scaling GitHub
holman
464
140k
Transcript
すべてはバイナリ Jun 6th, 2020 Satoru Takeuchi Twitter: satoru_takeuchi 1
目次 1. コンピュータにおける情報の表現方法 2. 整数の表現方法 3. 文字の表現方法 4. まとめ 2
目次 1. コンピュータにおける情報の表現方法 2. 整数の表現方法 3. 文字の表現方法 4. まとめ 3
コンピュータシステムのデータといえば… • 人間から見て半端な、不自然な数が多い ◦ データの単位であるバイトは 8bit → 10bitじゃだめなの? ◦ メモリ量16GB、32GBとか
→ なぜ30GBとか40GBじゃだめなの? ◦ 32 bit CPUとか64bit CPUとか → なぜ50bitとか100bitじゃだめなの? • これらの数値は全部2^n • 理由: データは2^n単位で扱うのが自然 4
データの実体 • データは何らかの物理的な素子のon/offのかたまりであらわされる ◦ メモリ(DRAM), SSD: 素子内の電荷 ◦ HDD: 磁性体の磁化の向き
◦ DVD: ディスク表面の溝の深さが閾値以上かどうか • たくさんのデータを表現したければ素子を大量に並べる • 1つが1ビット、ビットが8つ集まると1バイト 5 素子1つ: 表現できる状態は2つ 素子2つ: 表現できる状態は4つ off off off on off on on off on on
データの数値表記 • データは二進表記するのが便利 ◦ ビットが立っているかどうかが一目でわかる 6 素子の状態: 素子の数は3つ → 3bit
10進表記 2進表記 0 000 1 001 2 010 3 011 4 100 5 101 6 110 7 111 off off off off off on off on off off on on on off off on off on on on off on on on
16進表記 • 2進表記は桁数が大きくなるのでデータは16進数で表現することが多い • 便宜上一桁を0~9,a~fで表現する。fに1を足すと桁上がり 7 データの2進表記 16進表記 00000 0
00001 1 .... ... 01111 f 10000 10
すべてはバイナリ • すべてのデータはビットないしバイトの列 ◦ 2進表記されることが多いので一般にバイナリ /バイナリデータと呼ぶ • データの例 ◦ 整数
◦ 文字列 ◦ 画像 ◦ 音声 ◦ 動画 • それぞれ規格が決まっている ◦ ときには自分で決めなければいけないこともある ▪ 例: 独自アプリ内のデータ通信方法 8
目次 1. コンピュータにおける情報の表現方法 2. 整数の表現方法 3. 文字の表現方法 4. まとめ 9
表現方法 • 0以上の整数(符号なし整数)について扱う ◦ 負の数を考えると2の補数が云々とか難しい話が出てくるので省略 • データの2進数表記がそのまま数値に対応するのでスゲエ楽! 10 0以上の整数の値 データの2進表記
10進表記 16進表記 0 00000 0 0 1 00001 1 1 2 00010 2 2 ... ... .... ... 15 01111 15 f 16 10000 16 10
演習 • 使うもの ◦ xxdプログラム(xxdパッケージに入っている ): ファイルの中身を2進表記や16進表記で見る ◦ (自作)numプログラム: 1バイトで表現される符号なし整数値を標準出力に書き込む
• やること ◦ 以下の表に記載されている整数値の 2進、16進データ表現を見る 11 0以上の整数の値 データの2進表記 16進表記 0 00000 0 1 00001 1 2 00010 2 ... ... ... 15 01111 f 16 10000 10
目次 1. コンピュータにおける情報の表現方法 2. 整数の表現方法 3. 文字の表現方法 4. まとめ 12
表現方法 • ASCII Codeという規格について扱う ◦ https://www.ieee.li/computer/ascii.htm ◦ 1バイトで一文字を扱う ◦ 数値、アルファベット
(小文字、大文字)、一部記号を表現可能 • 日本語とか考え出すと終わらないので省略 ◦ キーワード: Unicode, UTF-8, 文字コード, 地獄 13
演習 • 使うもの ◦ xxd • やること ◦ 適当に文字やら文字列をファイルに書いて xxdで覗いてみる
14
目次 1. コンピュータにおける情報の表現方法 2. 整数の表現方法 3. 文字の表現方法 4. まとめ 15
まとめ • データは物理的素子の状態(on/off)によって表現する ◦ 2つの状態をあらわすものがビット、それが 8つ集まるとバイト ◦ 2進表記、16進表記が楽 • すべてのデータはビット列で表現されるバイナリ
• 多くのデータは表現方法が規格化されている 16