Coding Communication & CPU Microarchitectures as Fast As Possible
Techquickie
·Techquickie
·2015-05-07
·
918 words · ~4 min read
0:00
whether or not you know how to code many of you have probably seen a few lines of
0:03
a program written in a language like C python or Pascal which are all based on
0:09
English and designed to be readable by humans to some degree but when you get
0:13
right down to it the CPU that processes all of that code is just a hunk of
0:17
silicon and the last time I had a conversation with an inanimate object I
0:22
didn't feel like it had a whole lot to contribute to the discussion so how do
0:26
CPUs actually take code that's expressed in letters and numbers and put things
0:30
onto the screen that make sense to us carbon-based life forms well it first
0:35
helps to realize that what we call code can actually refer to a number of things
0:40
usually when people say code they're talking about source code which is the
0:43
English or Chinese or whatever language you really want based set of
0:47
instructions written in whatever programming language you like but after
0:51
a programmer finishes writing a program in source code it needs to be further
0:55
processed so that the CPU can actually understand it which is done by running
1:00
source code through a special kind of program called a compiler that will
1:04
check the code for errors and convert it into a CPU understandable form which is
1:09
called object code or machine code the
1:13
reason that a CPU can interpret machine code is because it's compiled in binary
1:17
the series of ones and zeros that is the basis for all modern digital Computing
1:22
but hold on a minute why can CPUs understand ones and zeros which are just
1:26
another form of human readable information well they they can do this
1:30
because those ones and zeros are really just representations of an electrical
1:35
signal which is on or off machine code
1:38
travels around the inside of your PC as a series of electrical pulses that
1:42
correspond to each of one and zero that the compiler spits out and when these
1:47
pulses hit your CPU a large number of things happen an average CPU has
1:52
millions of transistors many of which serve as logic gates that open or shut
1:57
depending if they're receiving an electrical impulse in other words
2:00
whether they're receiving a zero or one logic gates will open and shut to
2:05
manipulate machine code in very complex ways until the CPU spits out process
2:10
data that travels to other parts of your computer although the principles behind
2:14
processor design are immensely complicated you can think of the
2:18
transistors inside of a CPU as beads on a really big Abacus these beads are
2:24
arranged according to the processor's micro architecture denoted by code names
2:29
such as Haswell Broadwell and ivybridge for Intel CPUs or bulldozzer Steamroller
2:35
and pile driver for AMD chips however even with all these different
2:38
architectures most modern applications will run on any of these processors
2:43
because nearly any PC CPU is going to
2:46
use the same instruction set which is just what it sounds like the set of
2:50
binary instructions that the CPU can use to understand and execute current
2:55
consumer CPUs for desktops and laptops virtually all use either the x86
3:00
instruction set or the newer but backwards compatible x86-64 instruction
3:04
set for 64-bit systems since so many
3:07
different microarchitectures make use of the same instruction set the main
3:11
difference between them is how quickly and efficiently different processors can
3:15
execute those said instructions although a newer model Intel Core i7 and an older
3:20
model Core 2 Duo can understand the same
3:23
instructions the i7 is often going to be much much faster due to its radically
3:29
different micr architecture it's a little bit like the difference between
3:32
accelerating in a Maserati versus a Yugo
3:36
both cars understand that pressing down the Gas Pedal means go but because the
3:40
Maserati's different engine architecture it can execute the instruction much
3:45
faster than a Yugo and suddenly you're being pulled over don't worry though
3:49
you'll never get pulled over for overclocking your processor you might
3:54
just avoid your warranty speaking of logical systems
3:57
today's episode sponsor is fresh books the cloud accounting software designed
4:01
for freelance workers and small businesses freshbooks is all about
4:05
making invoicing getting paid and tracking expenses easier for you so you
4:10
can get back to what you actually want to be doing they handle the whole
4:13
accounting process so input your hours into the freshbooks time sheet and
4:17
they'll export those hours directly into an invoice they'll send that invoice to
4:20
the client and even let you track whether or not the client has viewed
4:24
that invoice if you're Your Own Boss you should be using stuff that makes you
4:27
actually feel like a boss B which is
4:31
exactly what freshbooks was designed to do if you want to give it a shot you can
4:35
head over to freshbooks.com Techquickie and don't forget to enter
4:40
Techquickie in the how did You Hear About Us section when you sign up for
4:44
your free trial of the freshbook service
4:47
thanks for watching this episode of fast as possible like it if you liked it
4:51
dislike it if you disliked it leave a comment if you have a suggestion for
4:54
future fastest Possible episodes just like this one and don't forget to
4:58
subscribe follow and all that good stuff