Modern CPUs all use pipelining to improve performance, but how does it work? We will use a warehouse robot analogy to explain how.

Image for post
Image for post
A factory robot moving packages around in an imaginary warehouse for processing. The moving corresponds to CPU instructions and packages can be thought of as data being processed.

Pipelining is in many ways such a universal way to speed up any task, that it is possible to find countless analogies for it in manufacturing or in your every day life, such as doing laundry, or cooking.

At the heart we deal with the challenge of getting as much work done per time unit as possible. There are many ways of achieving this. I will go through different approaches to help you understand how microprocessor designers arrived at pipelining as a smart solution. We will look at:

  • Clock frequency. How early CPUs got speed bumps by increasing clock frequency.


What a 1922 IQ test of immigrants to America tells us about intelligence, race and prejudice.

Image for post
Image for post
Immigrants to the US on Ellis Island

Digging through some old documents, I came across this old study from 1922, which I had forgotten about. It tells an interesting story about race, IQ and prejudice. The study is enlightening to anybody who wants to push back against the resurgent “scientific racism.”

Being a racist is no longer acceptable in polite society and hence modern day racists are calling themselves “race realists,” and prefer to hint at racial inferiority and superiority through pointing to IQ tests of different populations. They are only presenting the science they claim. It is all very innocent you see. …


Do you think running tests are too slow? Cannot figure out how to do Test Driven Development (TDD) in Julia? Here is a guide.

Image for post
Image for post

A lot of programming provide you with ready made solutions where there is one particular way of doing things. In the Julia community the approach is more around supply flexible building blocks from which you can construct whatever solution you want.

Read more: Julia v1.5 Testing: How to Organize Tests.

The advantage of this approach is that you can easily tailor a solution to your particular needs. The downside is that to someone fresh to Julia, it may not be immediately obvious what blocks to combine. One example of this is the Julia testing framework. It is flexible and can easily be tailored to your needs. …


CODEX

We explore how Julia tests are organized differently from what you may be used to in other testing frameworks.

Image for post
Image for post

Julia development practices will likely not be the same as what you have experienced in Java, JavaScript, Python, Ruby and other popular programming languages.

Thus in this story I will do a sort of quick recap of how testing is often done in other languages and compare that with the common practice followed in Julia as exemplified by the Julia standard library.

How to effectively run tests: Julia v1.5 Testing: Best Practices.

No Tests But Nested Test Sets

Testing in Julia is a lot more free form than what you may be used to. For contrast let me show some examples from other tests frameworks.

Pytest

Pytest is a frequently used testing framework for Python. Here one simply prefixes functions that represents tests with test_ as shown…


Experience of Dutch neighborhoods and American suburbia from a Norwegian point of view.

Image for post
Image for post
Downtown Amsterdam, Netherlands, but not the type of area we will explore in this story.

After my first experience with the neat manicured but desolate American suburbs I moved to one of the densest most urban places on the planet, the Netherlands.

A lot can be said about the beautiful historical downtown areas of Dutch cities. That is what the tourists see and the images online. However I want to convey a different side. Whether you are tourist in America or the Netherlands you will not spend any time in the suburbs. Here I want to take you to the suburbs to give some sense of the life in the suburbs.

Mind you, this is not an attempt at giving a balanced portrayal. This is partly a criticism of how American suburbs have been planned. American suburbs offer a lot of benefits which I think people are quite familiar with such a large houses and yards, surprisingly often with swimming pools. There is certainly an affluence seen few other places in the world. Yet the American suburb suffers from being built with a very individualistic mindset and without much consideration to public spaces or life without a car. …


Image for post
Image for post
Photo by Austin Distel on Unsplash

CODEX

Reflections on the use of proprietary standards by Apple, Microsoft and others.

Apple gets a lot of flak for its use of proprietary standards whether that is the lightning connector or Metal for 3D graphics. This topic has arisen again due to Apple adding lots of specialized hardware to their Mac lineup which must be used through Apple APIs such as Core ML or Accelerate.

There are a lot of things to be said about this. I do wish that Apple had embraced USB-C rather than continue with lightening plugs e.g.

But my intention with this story is to reflect upon the merits of open and proprietary standards. When I began as a Linux user and later a Mac user I certainly felt the pain of the dominance of Microsoft proprietary standards. As a Linux user you could not easily interact with the rest of the world. Seemingly every written document passed around was written in Microsoft Word. A format which was not a standard anyone could implement until governments basically twisted Microsoft’s arm. …


Or is it simply prudent capitalist thinking put into practice?

Recently I wrote about what happens when Norway runs out of oil? Will it be the end of the social democracy and the welfare state? In it I discuss how Norway stashed away oil money for a rainy day, what is known as the Norwegian Oil Fund worth of a trillion dollars.

Not everyone agreed in my characterization of countries and states following capitalist ideology blowing their money instead of saving it. Jim Roye writes:

Despite your bemoaning “capitalist ideology”, Norway has used a very (economically) conservative method of funding social programs. …


Developer Dougall Johnson has through reverse engineering, uncovered a secret powerful coprocessor dubbed AMX: Apple Matrix coprocessor inside the M1 chip.

Image for post
Image for post

Stories about the Apple Matrix coprocessor (AMX) are already out there. But not exactly discussed in a beginner friendly manner. And that is what I try to do here. Bring you the story buried under thick layers of technical jargon without treating you like an idiot.

To tell this story we need to clarify the basics such as what is a coprocessor? What is a matrix? And why should you even care about any of this?

More importantly why does none of the Apple slides talk about this coprocessor? Why is it seemingly a secret? If you have read about the Neural Engine inside the M1 System-on-a-Chip (SoC) you may be confused about what makes Apple’s Matrix coprocessor (AMX) is different. …


There is a common perception that Norway as we know it today is unsustainable and will radically change once oil runs out. But is that true?

Image for post
Image for post

It is commonly assumed that Norway is similar in situation to oil rich gulf-states with respect to a future without oil. However we need to look at the specifics to explain why this is not the fact and that Norway will most likely handle a future without oil quite fine.

Superficially a world without oil exports seems hard for Norway to handle. By various metrics Norwegian oil exports has made up 60% of exports and 25% of Norwegian GDP. How can a country survive that big of a hit to its exports?

To answer this we first need to understand the role of exports in any economy. …


Image for post
Image for post
Photo by Clyde He on Unsplash

CODEX

General-purpose microprocessors are a fairly modern phenomenon, but the aid of specialized hardware for particular types of calculations is not.

Recently I have been writing about how Apple’s M1 microprocessor has all these specialized coprocessors and accelerators to do particular tasks very fast such as video encoding, encryption, and machine learning.

But it turns out that if you look at history humans themselves have played the role of a general-purpose CPU feeding data to specialized hardware. Let us have a look at some of these ancient and long-forgotten types of calculating hardware.

You may think that scientists before computers had to perform all their calculations using pen, paper, and mental arithmetic, but they did not. …

About

Erik Engheim

Geek dad, living in Oslo, Norway with passion for UX, Julia programming, science, teaching, reading and writing.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store