Gadgetory


All Cool Mind-blowing Gadgets You Love in One Place

Coding Communication & CPU Microarchitectures as Fast As Possible

2015-04-16
well they're not you know how to code many of you have probably seen a few lines of a program written in a language like C Python or Pascal which are all based on English and designed to be readable by humans to some degree but when you get right down to it the CPU that processes all of that code is just a hunk of silicon and the last time I had a conversation with an inanimate object I didn't feel like it had a whole lot to contribute to the discussion so how do CPUs actually take code that's expressed in letters and numbers and put things onto the screen that makes sense to us carbon-based life forms well it first helps to realize that what we call code can actually refer to a number of things usually when people say code they're talking about source code which is the English or Chinese or whatever language you really want base set of instructions written in whatever programming language you like but after a programmer finishes writing a program in source code it needs to be further processed so that the CPU can actually understand it which is done by running a source code through a special kind of program called a compiler that will check the code for errors and convert it into a CPU understandable form which is called object code or machine code the reason that a CPU can interpret machine code is because it's compiled in binary the series of ones and zeros that is the basis for all modern digital computing but hold on a minute why can CPUs understand ones and zeros which are just another form of human readable information well they can do this because those ones and zeros are really just representations of an electrical signal which is on or off machine code travels around the inside of your PC as a series of electrical pulses that correspond to each a 1 and 0 that the compiler spits out and when these pulses hit your CPU a large number of things happen an average CPU has millions of transistors many of which serve as logic gates that open or shut depending if they're receiving an electrical impulse in other words whether they're receiving a zero or one logic gates will open and shut to manipulate machine code in very complex ways until the CPU spits out processed data that travels to other parts of your computer all the principles behind processor design are immensely complicated you can think of the transistors inside of a CPU as beads on a really big abacus these beads are arranged according to the processors microarchitecture denoted by code names such as Haswell Broadwell an Ivy Bridge for Intel CPUs or bulldozers themed roller and piledriver for AMD chips however even with all these different architectures most modern applications will run on any of these processors because nearly any PC CPU is going to use the same instruction set which is just what it sounds like the set of binary instructions that the CPU can use to understand and execute current consumer CPUs for desktops and laptops virtually all use either the x86 instruction set or the newer but backwards compatible x86 64 instruction set for 64-bit systems since so many different microarchitectures make use of the same instruction set the main difference between them is how quickly and efficiently different processors can execute those set instructions although a newer model Intel Core i7 and an older model Core 2 Duo can understand the same instructions the i7 is often going to be much much faster due to its radically different microarchitecture it's a little bit like the difference between accelerating in a Maserati versus a Yugo both cars understand that pressing down the gas pedal means go but because the Maseratis different engine architecture it can execute the instruction much faster than a Yugo and suddenly you're being pulled over don't worry though you'll never get pulled over for overclocking your processor you might just void your warranty speaking of logical systems today's episode sponsor is FreshBooks the cloud accounting software designed for freelance workers and small businesses fresh books is all about making invoicing getting paid and tracking expenses easier for you so you can get back to what you actually want to be doing they handle the whole accounting process so input your hours into the fresh books timesheet and they'll export those hours directly into an invoice they'll send that invoice to the client and even let you track whether or not the client has viewed that invoice if you're your own boss you should be using stuff that makes you actually feel like a boss which is exactly what FreshBooks was designed to do if you want to give it a shot you can head over to FreshBooks comm slash tech quickie and don't forget to enter tech quickie in the how did you hear about a section when you sign up for your free trial of the fresh book service thanks for watching this episode of fast as possible like it if you liked it dislike it if you disliked it leave a comment if you have a suggestion for future fast as possible episodes just like this one and don't forget to subscribe follow and all that good stuff
We are a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for us to earn fees by linking to Amazon.com and affiliated sites.