Binary is a system of representing data or information using only two options or states. These two states are often represented using the digits 0 and 1. The word “binary” comes from the Latin word “binarius,” which means “consisting of two.”
In a digital electronic system, a binary digit (or “bit”) is the basic unit of information. A bit can have one of two values, usually represented by 0 and 1. These values can also be represented by the presence or absence of a voltage, a change in a magnetic field, or the presence or absence of light.
Binary Code
Binary code, also known as machine code or assembly code, is a system of representing information using only two symbols, typically 0 and 1. These symbols are often referred to as “bits”, and groups of bits are used to represent numbers, characters, and other data. Binary code is the fundamental language of computers, and all software and data is ultimately represented as a series of binary digits.
The history of binary code dates back to the invention of the electronic computer, and the person credited with inventing it is a mathematician and computer pioneer named George Boole.
Boole, an English mathematician, published a paper in 1847 called “The Mathematical Analysis of Logic” which introduced what is now known as Boolean algebra. Boolean algebra is a system of mathematics that deals with binary operations, and it was this system that eventually formed the basis of binary code. Boolean algebra is named after George Boole and it is a mathematical logic that studies the Boolean functions, which are the functions that take one of two possible values, conventionally labeled as 0 and 1.
Binary code, however, was not used in electronic computers until the 20th century. The first electronic computers, such as the ENIAC, used a variety of different codes, such as decimal and octal. It wasn’t until the development of the Universal Automatic Computer (UNIVAC) in the early 1950s that binary code was used in electronic computers on a large scale. The UNIVAC was the first computer to be mass-produced, and it used binary code to represent both data and instructions.
The use of binary code in computers has several advantages. For one, it is a simple and straightforward system that is easy for computers to process and understand. Additionally, binary code is a highly efficient system for representing data, as it requires less storage space and can be processed more quickly than other codes. This is because computer circuits are essentially on or off switches, and by using the binary code this on/off state can be utilized to represent the numerical values of 0 and 1.
Binary code is also known for its universality, this means that it can be executed by all types of computer architectures and by all programming languages and so it has been the common language of computers for a long time.
One of the most important features of binary code is that it is easily processed by electronic devices. This is because a binary digit (or “bit”) can have one of only two possible states: on or off, represented by a 1 or 0 respectively. This is in contrast to other forms of representation, such as decimal or hexadecimal, which use a larger number of symbols.
Definitions:
- Binary Code: a system of representing information using only two symbols, typically 0 and 1
- Bit: a binary digit, which can have one of only two possible states: on or off, represented by a 1 or 0 respectively
- Machine Code: another term for binary code, which is the language that computers understand
- Assembly Code: a symbolic representation of binary code, which is easier for humans to read and understand
Examples of Binary Code:
- Representing numbers: Numbers can be represented in binary code using a series of bits. For example, the decimal number 10 can be represented in binary as 1010. This can be understood as “1” in the 2^3 position, “0” in the 2^2 position and “1” in the 2^1 position. The value of the number is 12^3 + 02^2 + 12^1 + 02^0 = 10.
- Representing characters: Characters, such as letters and symbols, can also be represented in binary code using a specific encoding scheme. One common encoding scheme is ASCII, which assigns a unique 8-bit binary code to each character in the English alphabet, as well as various punctuation marks and other symbols. For example, the letter “A” is represented as 01000001 in binary.
- Representing images: Images can be represented in binary code by breaking them down into a grid of pixels, and assigning a binary value to each pixel based on its color. For example, a black pixel might be represented as 0 and a white pixel might be represented as 1. This creates a binary image, which can then be transmitted or stored for later use.
- Representing sound: Sound can also be represented in binary code by breaking it down into a series of samples, and representing each sample as a binary number. These binary numbers represent the amplitude of the sound wave at a specific point in time. The series of binary numbers that represents a sound is called a digital audio file, which could be in different format like mp3, wav, flac, etc
- Representing instructions in a computer program: A computer program is a set of instructions that a computer can execute. These instructions can be represented in binary code, using machine code, which is the native language that computers understand. Assembly code is a symbolic representation of machine code that is more easily readable by humans. A programmer writes code in assembly, which is then translated into machine code for the computer to execute.
Binary is also used in many other fields, such as telecommunications, cryptography, and electronics.
Examples of binary in use:
- The ones and zeros of a binary code represent the instructions that a computer follows to perform a task
- In a digital circuit, a switch can be in either an on or off state, represented by a 1 or 0 respectively.
- In image and audio compression, certain data that is less important for the overall quality of the file is removed and replaced with a binary value of 0.
- In the context of networking, a message that was sent across the internet can be broken down into binary packets which are then reassembled at the receiving end.
Binary Used in Barcodes
A barcode is a method of representing data in a visual, machine-readable format. The most common type of barcode is the one-dimensional (1D) barcode, which consists of a series of parallel lines of varying widths. These lines represent a sequence of binary digits, or “bits,” which are used to encode information. The binary code used in barcodes is a method of representing numbers and letters using only two symbols: 0 and 1.
Definitions:
- Binary Code: A system of representing numbers, letters, and other characters using only two symbols: 0 and 1. Each digit in a binary code is known as a “bit.”
- Barcode: A visual representation of data that can be read by a machine. The most common type of barcode is the one-dimensional (1D) barcode, which consists of a series of parallel lines of varying widths.
Examples:
- UPC (Universal Product Code): The UPC is a type of barcode that is used to identify products in retail stores. The code is 12 digits long and consists of a combination of numbers and a check digit. The first six digits represent the manufacturer’s identification number, while the next five digits represent the product’s identification number. The last digit is a check digit used to verify the accuracy of the code.
- ISBN (International Standard Book Number): The ISBN is a unique identifying number that is assigned to books. The code is 10 or 13 digits long and consists of a combination of numbers and a check digit. The first three digits represent the country or language of the book, while the next nine digits represent the book’s identification number. The last digit is a check digit used to verify the accuracy of the code.
- Code 39: Code 39 is a type of barcode that can be used to encode a variety of characters, including letters, numbers, and special characters. It consists of a series of parallel lines of varying widths, as well as a start and stop character. Code 39 barcodes are commonly used in industrial and commercial applications, such as product identification and tracking.
- Code 128: Code 128 is a type of barcode that can be used to encode a variety of characters, including letters, numbers, and special characters. It consists of a series of parallel lines of varying widths, and also it is used for more complex information where more characters are needed to be encoded. It is commonly used in shipping and logistics, health care, and manufacturing.
- QR Code: QR code is a two-dimensional (2D) barcode that consists of a series of black and white squares arranged in a square pattern. These codes can be scanned using a smartphone camera and a QR code reader app, and are commonly used to store information such as website URLs, contact information, and product details. QR codes are commonly used in marketing and advertising, as well as in other applications such as event tickets and boarding passes.
- Quiz:
- What does the word “binary” mean?
- What is the basic unit of information in a digital electronic system?
- What is the purpose of a compiler or interpreter in computer programming?
- In a digital circuit, what binary value represents an “on” switch?
- In what other fields is binary commonly used?
- How is binary used in image and audio compression?
- What is the purpose of a barcode?
- What is the relationship between binary packets and internet communications?
- Is binary an exclusive system to computers and programming?
- How many unique values can a bit have?