What are bitwise operators in programming? They are the symbols & (AND), | (OR), ^ (XOR), ~ (NOT), << and (shifts), and they work on the single 0s and 1s inside a number, one position at a time, instead of on the number…
How computers work
64 posts
What is an enum in programming? An enum is a type that gives names to a short, fixed list of values. You write the list once, and from then on a variable of that type can only hold one of those names. Behind each name,…
You drop a logo onto a colored page and it arrives inside an ugly white box. So what does the alpha channel do in an image? It stores how see-through each pixel is. This guide shows how that number works, how a program…
If you have ever asked what computer textures are, here is the short answer: a texture is an image that is applied to the surface of a shape, so the shape gets its color and detail. The shape says where things are; the…
What is a bit in a computer? It is the smallest thing a computer stores: one binary digit, a 0 or a 1. One bit can hold only one of those two values, so it answers a single yes or no question. Everything else, from the…
If you have ever asked what is pixel art in video games?, here is the short answer. It is art where you can see the single dots, and each dot was placed on purpose. This guide explains what makes art pixel art, why it…
If you have ever asked how does enemy AI work in video games?, the short answer is this: enemy AI is a small set of rules the game checks many times a second, not a mind that learns. There is no thinking mind behind the…
If you have ever wondered how does a game loop work?, the answer is simple. A game runs the same small routine over and over, many times a second. It reads what you pressed, moves everything a little, and draws the…
What is a sprite in gaming? It is a small 2D picture that the game draws on top of a larger scene, and that can move on its own. That is also the answer to "what is a sprite in video games" and "what are sprites". Your…
What is collision detection in video games? It is the part of a game that checks whether two things are touching: a shot and a wall, a tank and another tank, a shot and an enemy. Every time something moves, the game asks…
If you have ever asked what is a tile map in 2D video games, the short answer is this: a tile map is a level built from a grid of small, reusable squares. Each square holds one kind of tile, such as a wall, a floor, or…
If you have ever asked what does a CPU scheduler do in an operating system?, the short answer is that it decides which ready program runs on the processor next. Your computer usually has more programs wanting to run than…
How do video games make random numbers? They almost never roll real dice. Instead, a game runs a small piece of math that turns out a long string of numbers that look random but follow a fixed rule. In this post you will…
What is pathfinding? In short, pathfinding is the method a game uses to get a character from where it is to where it wants to be without walking through walls. Every chasing enemy and every unit you order across a map…
If you have ever played the same game twice and found a different map waiting for you, you have met procedural generation in video games. It is a way of building game content with rules and code instead of placing every…
What is chiptune music? It is music written for, or in the style of, the tiny sound chips inside old computers and game consoles. Those chips could play only a few simple tones at once, so composers learned to do a lot…
What is WebGL? It is the part of your web browser that lets a page draw fast graphics with your computer's graphics chip. It is why you can open a link and start a tank battle without installing anything. Below you will…
The question of computer memory vs storage comes down to one word: power. Memory (RAM) is the fast, temporary workspace your computer uses for whatever it is doing right now, and it forgets everything when the power goes…
What are computer chips made of? Almost every computer chip, including a CPU, starts as silicon. So why are computer chips made of silicon, and not copper, carbon or gold? The short answer: silicon is a semiconductor, it…
Liquid cooling is a way to keep a computer chip cool by moving its heat into a liquid instead of leaving it to a fan. So how does liquid cooling work in a PC? A liquid flows through a block on the hot chip, soaks up its…
What are the parts of a circuit board? If you have ever opened a computer or an old phone, you have seen one: a flat board covered in thin lines, tiny parts and a few big chips. The short answer: the thin lines are…
What is a load balancer? It is a piece of software or hardware that sits in front of a group of servers and hands each incoming request to one of them, so no single server is swamped while the others sit idle. This guide…
What is clock speed? Also called clock rate, it is how many steps a processor takes each second, set by a clock inside the chip that ticks billions of times a second. It is the GHz number on every spec sheet, and it…
Is overclocking safe? It can be done carefully, but it is never risk free. Overclocking means running a computer chip, such as a CPU or a graphics chip, faster than the clock speed its maker rated it for. It can shorten…
A CPU pipeline is what makes instruction pipelining possible. So what is instruction pipelining? It is the trick that lets a processor work on several instructions at once, each at a different step, instead of finishing…
Spec sheets for laptops and phones list "cores" and "threads" as if everyone knows what they mean. So what is a CPU core? It is one complete processing unit inside the processor chip: a small engine that reads a…
Any disk drive can fail. The question is what you lose when it does. So what is RAID? RAID, short for Redundant Array of Independent Disks, is a way of spreading your data across two or more drives so the set works as…
Your program gives the wrong answer and you have no idea why. You could read the code again, line by line, and guess. Or you could stop the program in the middle of running and look. That is what a breakpoint is for. So…
Every program uses memory while it runs: for the text you type, the pictures on screen, the enemies in a game. When the program is done with a piece of memory, someone has to give it back, or the program slowly fills up.…
Your laptop runs a game smoothly for ten minutes, then the fan roars and everything gets sluggish. Nothing is broken. What is thermal throttling? Thermal throttling is a processor slowing itself down on purpose because…