Friday, November 22, 2013

Binary Code

Computers use binary code to store or transmit data. It is a very simple language. Binary code is very absolute, there is no in-between.

  • yes or no
  • on or off
  • light or no light
  • reflection or no reflection
  • magnetic flux or no magnetic flux
  • voltage or no voltage
  • one or zero

Each piece of the binary code is a bit (a contraction of the phrase, “binary digit”). The bits are usually grouped in eights for organizational purposes, also called bytes (a contraction of the phrase, “by eight”). On a side note, a group of four bits is called a nibble, which is a small byte (ha! Get it?!)

Bits (abbreviated with a lowercase b) are usually used when referring to transmission speeds or compression rates.

  • 128kb/s mp3 file
  • 9.8Mb/s video stream

Bytes (abbreviated with an uppercase B) are usually used when referring to file size or drive space.

  • 8 GB RAM
  • 1 TB HDD

Abbreviations:

Bit b 1 bit
Kilobit kb 1024 bits
Megabit mb 10242 bits 1024 kilobits
Gigabit Gb 10243 bits 1024 megabits
Terabit Tb 10244 bits 1024 gigabits

Bits typically use the binary prefix (210 = 1024) for kilo-, mega-, etc.

Byte B 1 byte
Kilobyte kB 1 thousand bytes
Megabyte MB 1 million bytes 1 thousand kilobytes
Gigabyte GB 1 billion bytes 1 thousand megabytes
Terabyte TB 1 trillion bytes 1 thousand gigabytes

Bytes typically use the Internation System of Units (SI) prefix for kilo-, mega-, etc.