Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
What is processor (brighton ruby edition)
Search
Penelope Phippen
July 09, 2016
Technology
0
94
What is processor (brighton ruby edition)
Penelope Phippen
July 09, 2016
Tweet
Share
More Decks by Penelope Phippen
See All by Penelope Phippen
Introducing Rubyfmt
penelope_zone
0
530
How RSpec Works
penelope_zone
0
6.4k
Quick and easy browser testing using RSpec and Rails 5.1
penelope_zone
1
75
Teaching RSpec to play nice with Rails
penelope_zone
2
120
Little machines that eat strings
penelope_zone
1
84
What is processor?
penelope_zone
1
340
extremely defensive coding - rubyconf edition
penelope_zone
0
250
Agile, etc.
penelope_zone
2
210
Extremely Defensive Coding
penelope_zone
0
86
Other Decks in Technology
See All in Technology
Evangelismo técnico: ¿qué, cómo y por qué?
trishagee
0
360
ハイパーパラメータチューニングって何をしているの
toridori_dev
0
140
Lexical Analysis
shigashiyama
1
150
サイバーセキュリティと認知バイアス:対策の隙を埋める心理学的アプローチ
shumei_ito
0
380
TanStack Routerに移行するのかい しないのかい、どっちなんだい! / Are you going to migrate to TanStack Router or not? Which one is it?
kaminashi
0
580
スクラムチームを立ち上げる〜チーム開発で得られたもの・得られなかったもの〜
ohnoeight
2
350
B2B SaaSから見た最近のC#/.NETの進化
sansantech
PRO
0
680
AWS Lambda のトラブルシュートをしていて思うこと
kazzpapa3
2
170
【令和最新版】AWS Direct Connectと愉快なGWたちのおさらい
minorun365
PRO
5
750
ISUCONに強くなるかもしれない日々の過ごしかた/Findy ISUCON 2024-11-14
fujiwara3
8
870
DMARC 対応の話 - MIXI CTO オフィスアワー #04
bbqallstars
1
160
Why does continuous profiling matter to developers? #appdevelopercon
salaboy
0
180
Featured
See All Featured
The Cult of Friendly URLs
andyhume
78
6k
Building Better People: How to give real-time feedback that sticks.
wjessup
364
19k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
How to Think Like a Performance Engineer
csswizardry
20
1.1k
Building Your Own Lightsaber
phodgson
103
6.1k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
Being A Developer After 40
akosma
86
590k
Automating Front-end Workflow
addyosmani
1366
200k
Gamification - CAS2011
davidbonilla
80
5k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
Building Applications with DynamoDB
mza
90
6.1k
Thoughts on Productivity
jonyablonski
67
4.3k
Transcript
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]