What Are Bits and Bytes?

What Are Bits and Bytes?


You’ve likely heard of them, but unless you’re a programmer or an electrical engineer you also probably don’t know much about them. This article should get you up to speed.

You may have noticed that both Random Access Memory and hard disk capacities are measured in bytes, as are file sizes when you examine them in a file viewer. For example, a typical three-minute song is usually around 3Mb or 3 megabytes.

So what exactly does that mean? Computers operate using the base-2 number system, also called the binary number system. Because they use binary digits (a 0 or a 1), the two words have been shortened to one, creating the word “bit”. That means that a system has to be put in place for numbers composed of only 1’s and 0’s (like 1011) to signify numbers like 20, 678, 4,676,332, etc.

ascii code graphpHere’s how that system works: You look at where the numbers fall in their respective decimal places and assume that those decimal places are the exponents and 1 or the 0 determines whether or not it will be 1 or 0 times 2^decimal place. So in the case of a bit like 1011, you’ve got (1*2^3) + (0*2^2) + (1*2^1) + (1*2^0) =  8 + 0 + 2+ 1 = 11. So 1011 is 11 in binary code.

You don’t generally see bits just floating around on their own; they’re generally collected into bytes, which are made up of 8 bits each. Within one byte, 256 values of numbers between 0 to 255 can be stored. So long as you have infinite bytes, you can convey infinite numbers.

Bytes are also used to convey letters; the bit or byte behind each value between 0 and 127 is also given a specific character to represent. Computers often extend the ASCII character set to include a range of character sets that extends the full 256 character range by adding special things like accented characters from common foreign languages. The ASCII table charts the correspondence between numbers and letters as represented by the binary code. “F” for example, has the same binary digit representation as the number 70.

The first 32 values are actually not attributed to any letters; instead they double for things like spaces between words (actually that’s 33), carriage return, line feed, etc. After 32, the binary for punctuation, digits, uppercase letters and whatnot.

hard drive yoA lot of people misunderstand the measurement for how many bytes are stored by a computer; kilobytes are about a thousand bytes, megabytes are about a million bytes, gigabytes are about a billion bites, etc, but the measurements are actually done like so: KB = 2^10 bytes = 1,024 bytes. MB = 2^20 = 1,048,576 bytes. GB= 2^30 = 1,073,741,824 bytes. So the growth between the categories is actually determined by a base of 2’s exponent increasing by a 10 as opposed to the actual number of bytes increasing by a factor of 10.

Binary math is done in much the same way as decimal math, though the digits can only ever be 0 or 1. So long as you keep in mind that 1 + 1 = 10, you can figure it out.

happy wheels 2