Computer Conversions

Often, you hear people talk about 50-kilobyte files or 2-gig hard drives. These might sound like random numbers. It's important to understand how all these quantities are related. They all describe quantities of information that the computer can read or store. Remember that the computer actually reads binary code.

When you program code in a language such as C++, you need a compiler to translate your code into binary code. Then the computer flips a bunch of switches on (1) or off (0). Binary code is simply a series of 0s and 1s that state whether each individual switch is currently on or off. Each of these switches holds 1 bit of information: 0 or 1. Then these bits can be grouped into sets of eight, which is 1 byte of information. ...

Get Beginning Math and Physics for Game Programmers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.