Binary System for Computers and Mathematics


Introduction

Through the years, and probably through the centuries, teachers have struggled to make math meaningful by providing students with problems and examples demonstrating its applications in everyday life. Now, however, technology makes it possible for students to experience the value of math in daily life, instead of just reading about it. This week, Education World tells you about eight great math sites (plus a few bonus sites) that demonstrate relevance while teaching relevant skills. (http://www.educationworld.com/a_curr/curr148.shtml)
Computers are particularly adept at utilizing algorithms, and algorithms lie at the heart of computer programming, the set of instructions that computers use to analyze data. The creation of elegant (a term used by mathematicians to describe something simple yet powerful) and thus faster algorithms has become an important consideration in the study of theoretical computer science.
Logical algorithms (rules and steps based upon patterns of mathematical logic or proof) including a class of algorithms known as “backtracking” algorithms were developed in the 1960s to explore methods of solving computational problems. Such algorithms can be designed to test possible combinations of sub-problems and such algorithms result in tree-like solutions. A particular solution can be traced back to through prior solutions that are analogous to backtracking through the increasing larger more inclusive branches of a tree that ultimately lead to the trunk. Navigating the solution tree, analogous to a squirrel climbing through the limbs of a tree, produces computational solutions that can then be described as “longest” or “shortest” path solutions. Many computer-programming languages rely on backtracking. For example, if a particular sub-problem solution (a particular branch of the solution tree) proves to be incorrect, the computational algorithm “backtracks” and tries another path to solve the problem.

Literature Review

1. Binary system
All computers or computing devices think and process in binary code, a binary number system. In a binary number system, everything is described using two values—on or off, true or false, yes or no, one or zero, and so on. The simplest example of a binary system is a light switch, which is always either on or off. A computer contains millions of similar switches. The status of each switch in the computer represents a bit or binary digit. In other words, each switch is either on or off. The computer describes one as “on” and zero as “off.” Any number can be represented in the binary system as a combination of zeros and ones. In the binary number system, each number holds the value of increasing powers of two, e.g., 20, 21, and so on. This makes counting in binary easy. The binary representation for the numbers one to ten can be shown as follows:

• 0 = 0
• 1 = 1
• 2 = 10
• 3 = 11
• 4 = 100
• 5 = 101
• 6 = 110
• 7 = 111
• 8 = 1000
• 9 = 1001
• 10 = 1010.

2. Mathematics and Computers
Mathematics is integral to computers. Most computer processes and functions rely on mathematical principles. The word “computers” is derived from computing, meaning the process of solving a problem mathematically. Large complex calculations (or computing) in engineering and scientific research often require basic calculators and computers. Computers have evolved greatly over the years. These days, computers are used for practically anything under the Sun, education, communication, business, shopping, or entertainment. Mathematics forms the basis of all these applications.
Applications of mathematical concepts are seen in the way computers process data (or information) in the form of bits, bytes, and codes, store large quantities of data by compression, and send data from one computer to another by transmission. With the advent of the Internet, communication has become extremely easy. Every computer is assigned a unique identity, using mathematical principles, making communication possible. In addition, mathematics has also found other applications in computers, such as security and encryption. (K. Lee Lerner and Brenda Wilmoth Lerner, 2006)

3. How computers store numbers
Computer systems are constructed of digital electronics. That means that their electronic circuits can exist in only one of two states: on or off. Most computer electronics use voltage levels to indicate their present state. For example, a transistor with five volts would be considered “on”, while a transistor with no voltage would be considered “off.” Not all computer hardware uses voltage, however. CD-ROM’s, for example, use microscopic dark spots on the surface of the disk to indicate “off,” while the ordinary shiny surface is considered “on.” Hard disks use magnetism, while computer memory uses electric charges stored in tiny capacitors to indicate “on” or “off.”
These patterns of “on” and “off” stored inside the computer are used to encode numbers using the binary number system. The binary number system is a method of storing ordinary numbers such as 42 or 365 as patterns of 1’s and 0’s. Because of their digital nature, a computer’s electronics can easily manipulate numbers stored in binary by treating 1 as “on” and 0 as “off.” Computers have circuits that can add, subtract, multiply, divide, and do many other things to numbers stored in binary.
In magnetic storage devices (Hard Rigid Disk, Floppy, Zip, Tape, etc.) magnetized areas of the media are used to represent binary numbers: a magnetized area stands for 1, and the absence of magnetization means 0. Flip-flops-electronic devices that can only carry two distinct voltages at their outputs and that can be switched from one state to the other state by an impulse-can also be used to represent binary numbers; the two voltages correspond to the two digits. Optical and magneto-optical storage devices use two distinct levels of light reflectance or polarization to represent 0 or 1.
Bit is an abbreviation for binary digit – the smallest unit of information in a digital world. A bit is represented by the numbers 1 and 0, which correspond to the states on and off, true and false, or yes and no. Bits are the building blocks for all information processing that goes on in digital electronics and computers. The term bit was introduced by John Tukey, an American statistician and early computer scientist. He first used the term in 1946, as a shortened form of the term binary digit. Bits are usually combined into larger units called bytes.
Byte, in computer science, is a unit of information built from bits, the smallest units of information used in computers. One byte equals 8 bits. The values that a byte can take on range between 00000000 (0 in decimal notation) and 11111111 (255 in decimal notation). This means that a byte can represent 28 (2 raised to the eighth power) or 256 possible states (0-255). Bytes are combined into groups of 1 to 8 bytes called words. The size of the words used by a computer’s central processing unit (CPU) depends on the bit-processing ability of the CPU. A 32-bit processor, for example, can use words that are up to four bytes long (32 bits). The term byte was first used in 1956 by German-born American computer scientist Werner Buchholz to prevent confusion with the word bit. He described a byte as a group of bits used to encode a character. The eight-bit byte was created that year and was soon adopted by the computer industry as a standard.
Computers are often classified by the number of bits they can process at one time, as well as by the number of bits used to represent addresses in their main memory (RAM). Computer graphics are described by the number of bits used to represent pixels (short for picture elements), the smallest identifiable parts of an image. In monochrome images, each pixel is made up of one bit. In 256-color and gray-scale images, each pixel is made up of one byte (eight bits). In true color images, each pixel is made up of at least 24 bits. The particular sequence of bits in a byte encodes a unit of information such as a keyboard character. One byte typically represents a single character such as a number, letter, or symbol. Software designers use computers and software to combine bytes in complex ways and create meaningful data in the form of text files or binary files (files that contain data to be processed and interpreted by a computer). Bits and bytes are the basis for representing all meaningful information and programs on computers.
Bytes are the major unit for measuring quantities of data or data capacity. Data quantity is commonly measured in kilobytes (1024 bytes), megabytes (1,048,576 bytes), or gigabytes (about 1 billion bytes). A regular, floppy disk normally holds 1.44 megabytes of data, which equates to approximately 1,400,000 keyboard characters. At this storage capacity, a single disk can hold a document approximately 700 pages long, with 2000 characters per page. The number of bits used by a computer’s Central Processing Unit (CPU) for addressing information represents one measure of a computer’s speed and power. Computers today often use 16, 32, or 64 bits in groups of 2, 4, and 8 bytes in their addressing.
In computing, digital is synonymous with binary because the computers familiar to most people process information coded as combinations of binary digits (bits). One bit can represent at most two values; 2 bits, four values; 8 bits, 256 values; and so on. Values that fall between two numbers are represented as either the lower or the higher of the two. Because digital representation represents a value as a coded number, the range of values represented can be very wide, although the number of possible values is limited by the number of bits used. Digitizing means to convert any analog (or continuously varying signal), such as the lines in a drawing or a sound signal, into a series of discrete units represented by the digits 0 and 1. A drawing or photograph, for example, can be digitized by a scanner that converts lines and shading into combinations of 0’s and 1’s by sensing different intensities of light and dark.
Analog-to-digital converters are commonly used to perform this translation. Analog-To-Digital Converter or ADC, is an electronic device for converting data from analog (continuous) to digital (discrete) form for use in electronic equipment such as digital computers, digital audio and video recorders, and data storage devices. Analog or continuously varying electrical waveforms are applied to the device and are sampled at a fixed rate. Sample values are then expressed as a digital number, using a binary numbering system consisting only of 0’s and 1’s. The resulting digital codes can be used in various types of communications systems.

4. How binary works
The decimal number system that people use every day contains ten digits, 0 through 9. Start counting in decimal: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. How do we continue counting with only ten digits? We add a second column of digits, worth ten times the value of the first column. Start counting again: 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 (Note that the right column goes back to zero here.), 21, 22, 23, … , 94, 95, 96, 97, 98, 99. The only way to continue counting is to add yet another column worth ten times as much as the one before. Continue counting: 100, 101, 102, … 997, 998, 999, 1000, 1001, 1002, ….
Another way to make this clear is to write decimal numbers in expanded notation. 365, for example, is equal to 3×100 + 6×10 + 5×1. 1032 is equal to 1×1000 + 0×100 + 3×10 + 2×1. By writing numbers in this form, the value of each column becomes clear.
The binary number system works in the exact same way as the decimal system, except that it contains only two digits, 0 and 1. There are no more binary digits. In order to keep counting, we need to add a second column worth twice the value of the column before. It is time to add another column again. Counting further: 100, 101, 110, 111, 1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111…. Watch the pattern of 1’s and 0’s. You will see that binary works the same way decimal does, but with fewer digits.
Binary uses two digits, so each column is worth twice the one before. This fact, coupled with expanded notation, can be used convert between from binary to decimal. In the binary system, the columns are worth 1, 2, 4, 8, 16, 32, 64, 128, 256, etc. To convert a number from binary to decimal, simply write it in expanded notation. For example, the binary number 101101 can be rewritten in expanded notation as 1×32 + 0×16 + 1×8 + 1×4 + 0×2 + 1×1. By simplifying this expression, you can see that the binary number 101101 is equal to the decimal number 45.
An easy way to convert back and forth from binary to decimal is to use Microsoft Windows Calculator. You can find this program in the Accessories menu of your Start Menu. To perform the conversion, you must first place the calculator in scientific mode by clicking on the View menu and selecting Scientific mode. Then, enter the decimal number you want to convert and click on the “Bin” check box to convert it into binary. To convert numbers from binary to decimal, click on the “Bin” check box to put the calculator in binary mode, enter the number, and click the “Dec” check box to put the calculator back in decimal mode (http://www.swansontec.com/binary.html).

5. What mathematics is in binary system
Everywhere, except for computer-related operations, the main system of mathematical notation today is the decimal system, which is a base-10 system. As in other number systems, the position of a symbol in a base-10 number denotes the value of that symbol in terms of exponential values of the base. That is, in the decimal system, the quantity represented by any of the ten symbols used – 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 – depends on its position in the number. Unlike the decimal system, only two digits – 0, 1 – suffice to represent a number in the binary system. The binary system plays a crucial role in computer science and technology. The first 20 numbers in the binary notation are 1, 10, 11, 100, 101, 110, 111, 1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111, 10000, 10001, 10010, 10011, 10100, the origin of which may be better understood if they are re-written in the following way:

1: 00001 11: 01011
2: 00010 12: 01100
3: 00011 13: 01101
4: 00100 14: 01110
5: 00101 15: 01111
6: 00110 16: 10000
7: 00111 17: 10001
8: 01000 18: 10010
9: 01001 19: 10011
10: 01010 20: 10100

Any decimal number can be converted into the binary system by summing the appropriate multiples of the different powers of two. For example, starting from the right, 10101101 represents (1 x 20) + (0 x 21) + (1 x 22) + (1 x 23) + (0 x 24) + (1 x 25) + (0 x 26) + (1 x 27) = 173. This example can be used for the conversion of binary numbers into decimal numbers.
For the conversion of decimal numbers to binary numbers, the same principle can be used, but the other way around. Thus, to convert, first find the highest power of two that does not exceed the given number, and place a 1 in the corresponding position in the binary number. For example, the highest power of two in the decimal number 519 is 29 = 512. Thus, a 1 can be inserted as the 10th digit, counted from the right: 1000000000. In the remainder, 519 – 512 = 7, the highest power of 2 is 22 = 4, so the third zero from the right can be replaced by a 1: 1000000100. The next remainder, 3, consists of the sum of two powers of 2: 21 + 20, so the first and second zeros from the right are replaced by 1: 519 = 10000001112 (http://www.usbyte.com/common/binarysystem.htm).

Arithmetic operations in the binary system are extremely simple. The basic rules are: 1 + 1 = 10, and 1 x 1 = 1. Zero plays its usual role: 1 x 0 = 0, and 1 + 0 = 1. Addition, subtraction, and multiplication are done in a fashion similar to that of the decimal system:

Counting in binary is similar to counting in any other number system. Beginning with a single digit, counting proceeds through each symbol, in increasing order. Decimal counting uses the symbols 0 through 9, while binary only uses the symbols 0 and 1. When the symbols for the first digit are exhausted, the next-higher digit (to the left) is incremented, and counting starts over at 0. In decimal, counting proceeds like so:

000, 001, 002, … 007, 008, 009, (rightmost digit starts over, and next digit is
incremented)
010, 011, 012, …

090, 091, 092, … 097, 098, 099, (rightmost two digits start over, and next digit is
incremented)
100, 101, 102, …

After a digit reaches 9, an increment resets it to 0 but also causes an increment of the next digit to the left. In binary, counting is the same except that only the two symbols 0 and 1 are used. Thus after a digit reaches 1 in binary, an increment resets it to 0 but also causes an increment of the next digit to the left:

0000,
0001, (rightmost digit starts over, and next digit is incremented)
0010, 0011, (rightmost two digits start over, and next digit is incremented)

0100, 0101, 0110, 0111, (rightmost three digits start over, and the next digit is
incremented)
1000, 1001, …

Since binary is a base-2 system, each digit represents an increasing power of 2, with the rightmost digit representing 20, the next representing 21, then 22, and so on. To determine the decimal representation of a binary number simply take the sum of the products of the binary digits and the powers of 2 which they represent. For example, the binary number:
100101
is converted to decimal form by:
[(1) × 2^5 ] + [(0) × 2^4 ] + [(0) × 2^3 ] + [(1) × 2^2 ] + [(0) × 2^1 ] + [(1) × 2^0 ] =
[1 × 32] + [0 × 16] + [0 × 8] + [1 × 4] + [0 × 2] + [1 × 1] = 37
To create higher numbers, additional digits are simply added to the left side of the binary representation.

6. Representation of binary numbers
A binary number can be represented by any sequence of bits (binary digits), which in turn may be represented by any mechanism capable of being in two mutually exclusive states. The following sequences of symbols could all be interpreted as the binary numeric value of 667:

The numeric value represented in each case is dependent upon the value assigned to each symbol. In a computer, the numeric values may be represented by two different voltages; on a magnetic disk, magnetic polarities may be used. A “positive”, “yes”, or “on” state is not necessarily equivalent to the numerical value of one; it depends on the architecture in use. In keeping with customary representation of numerals using Arabic numerals, binary numbers are commonly written using the symbols 0 and 1. When written, binary numerals are often subscripted, prefixed or suffixed in order to indicate their base, or radix. The following notations are equivalent:
100101 binary (explicit statement of format)
100101b (a suffix indicating binary format)
100101B (a suffix indicating binary format)
bin 100101 (a prefix indicating binary format)
1001012 (a subscript indicating base-2 (binary) notation)
%100101 (a prefix indicating binary format)
0b100101 (a prefix indicating binary format, common in programming languages)

When spoken, binary numerals are usually read digit-by-digit, in order to distinguish them from decimal numbers. For example, the binary numeral 100 is pronounced one zero zero, rather than one hundred, to make its binary nature explicit, and for purposes of correctness. Since the binary numeral 100 is equal to the decimal value four, it would be confusing to refer to the numeral as one hundred.
Look at the example of digital clock that used binary numbers for its system, and then you can compare how it works with the picture below.

Conclusion
Mathematics is integral to computers. Most computer processes and functions rely on mathematical principles. All computers or computing devices think and process in binary code, a binary number system. In a binary number system, everything is described using two values—on or off, true or false, yes or no, one or zero, and so on. The simplest example of a binary system is a light switch, which is always either on or off. A computer contains millions of similar switches. The status of each switch in the computer represents a bit or binary digit. In computing, digital is synonymous with binary because the computers familiar to most people process information coded as combinations of binary digits (bits). Because digital representation represents a value as a coded number, the range of values represented can be very wide, although the number of possible values is limited by the number of bits used. Digitizing means to convert any analog (or continuously varying signal), such as the lines in a drawing or a sound signal, into a series of discrete units represented by the digits 0 and 1. A drawing or photograph, for example, can be digitized by a scanner that converts lines and shading into combinations of 0’s and 1’s by sensing different intensities of light and dark.

References
K. Lee Lerner and Brenda Wilmoth Lerner, 2006. Real-Life Math

http://www.swansontec.com/binary.html, accessed in March 28, 2010

http://www.usbyte.com/common/binarysystem.htm, accessed in March 26, 2010

http://en.wikipedia.org/wiki/Binary_numeral_system, accessed in March 27, 2010

http://demonstrations.wolfram.com/education.html?edutag=Middle+School+Mathematics&limit=20, accessed in March 28, 2010

Published by Nasrullah Matematika FMIPA UNM

Saat ini bekerja sebagai pendidik pada program studi pendidikan matematika di jurusan matematika FMIPA UNM, Makassar, Sulawesi Selatan, Indonesia. https://nasunsri048.wordpress.com/files/2009/07/nas2.jpg

Leave a comment