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
What is processor (brighton ruby edition)
Search
Penelope Phippen
July 09, 2016
Technology
160
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
What is processor (brighton ruby edition)
Penelope Phippen
July 09, 2016
Transcript
107 slides
What is Processor?
None
None
None
None
3.days.ago
new DateTime( System.currentTime() - 3 * 24 * 3600 )
Thinking in terms of the domain
Instead of thinking in terms of the computer
This is one way we can measure abstraction
Amount of computers
Amount of computers
SQL Amount of computers
select * from sheep_parts
None
None
None
None
SQL Amount of computers
SQL C Amount of computers
int main() { printf(“Hello\n”); return 0; }
Let’s look at one difference
None
None
None
None
None
None
None
None
Human readable source code at execution time
Interpreted
Compiled
None
(it’s a gnu)
(it’s a gnu)
None
Source code separate at execution time
So why is C “low level”
John sort of stole my thunder
Hacker news has been lying to you
None
Those earlier languages express similar ideas.
Ruby has an object model
C has a memory model
C Amount of computers
C Assembly Amount of computers
Memory is slow
The accumulator from baby encodes this concept
Register Tiny piece of memory in the processor that can
beaccessed very quickly
mov 3, $c mov 4, $d add $c, $d, $a
mov 3, $c mov 4, $d add $c, $d, $a
Execution
mov 3, $c mov 4, $d add $c, $d, $a
mov 3, $c mov 4, $d add $c, $d, $a
Instructions (do exactly one thing to the processor)
Operation mov 3, $c mov 4, $d add $c, $d,
$a
Operand mov 3, $c mov 4, $d add $c, $d,
$a
Operand mov 3, $c mov 4, $d add $c, $d,
$a
mov 3, $c mov 4, $d add $c, $d, $a
Operand Register reference
a: nil b: nil c: nil d: nil mov 3,
$c mov 4, $d add $c, $d, $a
a: nil b: nil c: 3 d: nil mov 3,
$c mov 4, $d add $c, $d, $a
a: nil b: nil c: 3 d: nil mov 3,
$c mov 4, $d add $c, $d, $a
a: nil b: nil c: 3 d: 4 mov 3,
$c mov 4, $d add $c, $d, $a
a: nil b: nil c: 3 d: 4 mov 3,
$c mov 4, $d add $c, $d, $a
a: 7 b: nil c: 3 d: 4 mov 3,
$c mov 4, $d add $c, $d, $a
(it’s a gnu)
None
None
None
C Assembly Amount of computers
Assembly Binary Amount of computers
Let’s talk about how machine code gets executed
(one model)
Fetch
Decode
Execute
Retire
FDER
None
None
None
0: 0x36010000 1: 0x03040501 2: 0x23813200 PC: 0 IR: <nil>
IR: 0x36010000
Decode
0x36010283
0x36010283 0x36: add
0x36010283 0x36: add 0x01: value 1
0x36010283 0x36: add 0x01: value 1 0x02: value 2
0x36010283 0x36: add 0x01: value 1 0x02: value 2 0x83:
register 3
None
None
IR: 0x36010283 PC: 0 A: <nil> B: <nil> C: <nil>
Execute
IR: 0x36010283 PC: 0 A: <nil> B: <nil> C: <nil>
IR: 0x36010283 PC: 0 C: <nil>
IR: 0x36010283
IR: 0x36 01 02 83 10 2 3 +
Retire
IR: 0x36010283 PC: 0 A: <nil> B: <nil> C: <nil>
3
IR: 0x36010283 PC: 0 A: <nil> B: <nil> C: 3
3
IR: <nil> PC: 1 A: <nil> B: <nil> C: 3
3
0: 0x36010000 1: 0x03040501 2: 0x23813200 PC: 1
This process repeats
That’s how programs execute (kinda) (I’m still lying to you)
Fetch: get instruction from memory into processor
Decode: prep processor for instruction
Execute: do computation
Retire: results and cleanup
Thanks @samphippen
[email protected]
More Decks by Penelope Phippen
See All by Penelope Phippen
Introducing Rubyfmt
penelope_zone
0
640
How RSpec Works
penelope_zone
0
6.9k
Quick and easy browser testing using RSpec and Rails 5.1
penelope_zone
1
130
Teaching RSpec to play nice with Rails
penelope_zone
2
190
Little machines that eat strings
penelope_zone
1
150
What is processor?
penelope_zone
1
400
extremely defensive coding - rubyconf edition
penelope_zone
0
310
Agile, etc.
penelope_zone
2
270
Extremely Defensive Coding
penelope_zone
0
150
Other Decks in Technology
See All in Technology
狙われているAPIの脆弱性!今こそ手をつけるべき根本的な対策とは?
nagix
0
130
3文字略語に騙されない! 世界一わかりやすい『EDR』超入門
kamadamakoto
1
130
MCPでネットワーク障害調査を自動化する前に直すべき3つのこと
yama3133
0
210
Frontier Teams — Amazon は AI で「開発のやり方」をどう変えたのか
kmotohas
0
250
速くなった開発の効果をどう推し量るのか
bulbulpaul
0
110
20261113_JAWS_Osaka
takuyay0ne
0
470
小さなエージェントから始めてみよう!実践コンテキストエンジニアリング
iwamot
PRO
0
120
異夢同船〜異なる夢でも同じ船でなんとかする〜
fortegp05
0
230
契約書SaaSにAIエージェントを組み込む
sansantech
PRO
0
130
うちなーぐちが認識できるなら、秋田弁もいけるはず!? Amazon Transcribe方言チューニング検証
ryouto715
1
180
E2E Test というハーネス — AI時代の自動テスト民主化
daishukojima
1
690
AI時代の組織作り:チーム開発から「個人×AI」への移行と、持続可能な「開発資本」の築き方
ham0215
3
840
Featured
See All Featured
So, you think you're a good person
axbom
PRO
2
2.3k
A better future with KSS
kneath
240
18k
Utilizing Notion as your number one productivity tool
mfonobong
4
640
ラッコキーワード サービス紹介資料
rakko
5
5.8M
Ten Tips & Tricks for a 🌱 transition
stuffmc
1
280
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
380
Unsuck your backbone
ammeep
672
58k
Amusing Abliteration
ianozsvald
1
390
A designer walks into a library…
pauljervisheath
211
25k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
520
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
310
The World Runs on Bad Software
bkeepers
PRO
72
12k