The processor (the ‘brain’ of a device) in a modern smartphone is well over one hundred thousand times faster than the computer in the spaceship that sent humans to the Moon.
In the 21st century, the smartphone is probably the computer most people in the world use most regularly. Advances in technology mean that smartphones and tablets can now perform most of the same tasks just as well, and just as fast, as a desktop or laptop computer. Computers are everywhere because we take them with us everywhere.
A microcontroller is a tiny, reprogrammable chip – a miniature computer. It is not as powerful as the chip in your phone, but like any other computer, it can be programmed to perform certain tasks. A programmer will write code on their own computer, compile it into ‘machine code’ that the microcontroller can run, and then put that machine code onto the microcontroller.
Microcontrollers are made in such volume that the simplest ones have become very cheap: so cheap that functionality can be implemented with a handful of cheap components. For example, blinking a light or running a timer is now cheap to implement with a tiny computer and a few lines of code.
A kitchen is full of microcontrollers. Household appliances like microwaves or washing machines use microcontrollers to process input, for example: the switches and dials you set, or whether the door is closed. They all perform some logic to run for a particular length of time or put water into the drum at particular points. They also emit output, for example, beeping when they are done, or displaying a timer on a screen.
Before the digital age this logic might be implemented mechanically or with many individual electronic components. Now much of this logic can be implemented with a single microcontroller.
Bluetooth devices, which communicate wirelessly to phones or computers, all have tiny microcontrollers inside. They process user interactions, for example, pushing a button to:
skip a track
raise the volume
answer a call
manage wireless communications with other devices.
Again, all this code is written by programmers.
Think about a modern car. It’s full of code, from the code running the screens and entertainment systems, through to code that manages the engine or chooses when to shift gears. All of those are specific programs run by tiny computers.
Computers are everywhere, and so is computation. If you know where to look, the effects of computerisation can be seen in non-digital objects.
Have you ever typed a credit card number into a website incorrectly and been told instantly it wasn’t a valid card number? That’s possible because the sixteen digit number isn’t totally random. It follows a specific rule to make sure it can be checked against itself. You can confirm the validity of a credit card with arithmetic.
Let’s imagine the card number 4485 2219 3301 1700. To check it with Maths., write out the first fifteen digits of the card number. Then, counting from right to left, double every other number. If any of those numbers are more than nine, add the digits of that number together. Finally, add all the single-digit numbers together.
See TableIf you add the bottom row together, you get: (8 + 4 + 7 + 5 + 4 + 2 + 2 + 9 + 6 + 0 + 1 + 2 + 7 + 0) = 60.
Multiply this by nine to get: (60 x 9) = 540.
The last digit of this number is 0 which is the last digit of the sixteen digit credit card number. That means you’ve got a valid card number.
This kind of algorithm is called a checksum which is some arithmetic to prove the validity of a number. Of course, it doesn’t prove that it’s your card number, or that it relates to a real bank account. However, it does act as a simple check against mistakes. This is an artefact of living in a world full of code.
The credit card may just be a piece of plastic with a number on it, but that number is designed for use with code from the systems that work inside banks, to a checksum you can do with a pen and paper.
You can now see that whilst code may be written on computers, it can end up everywhere, from apps on phones and games on consoles, to cars and household devices. Programmers may work on many different kinds of code throughout their careers. However, the programming languages and tools used are very similar regardless of where the code will end up.
Code touches much of the modern world, not just in the software we use, but in objects and artefacts throughout it. These range from credit cards through to serial numbers on products and social security numbers.