November 14, 2019

Binary Number System

 

Before looking at the binary representation of numbers, it is worth taking a quick look at the representation and meaning of decimal, or denary, numbers.

This system employs a base 10 representation. Another way of describing this is to say that it has a radix of 10, meaning that each digit to the left of the decimal point represents increasing powers of 10 and digits to the right of the point represent decreasing powers of 10.

Consider the decimal number 251, which can be illustrated as follows:

102=100 101=100 100=100
2 5 1

 

In other words, 251 represents the addition of 2x100 + 5x10 + 1x1.

Binary representation (radix 2) simply offers another form of numeric representation by adding increasing powers of 2, rather than 10.

The decimal value 251 can be represented by the binary representation 11111011.

27=128 26=64 25=32 24=16 23=8 22=4 21=2 20=1
1 1 1 1 1 0 1 1

 

Computer programs operate on data and ultimately enable humans to derive meaning from these representations.

The binary number system is the simplest of all number systems. Its representation requires a combination of just two numbers, 0 and 1, to represent any binary value. 1s and 0s are binary digits or bits. An 8-bit unit is called a byte; employed by most computers as the basic unit of data representation. A byte is a subdivision of a word.

A word is "a vector of bits that is treated as a unit by the computer hardware. The number of bits, referred to as the word length or word size, is now usually 16 or 32. The memory of a computer is divided into words (and possibly subdivided into bytes). A word is usually long enough to contain an instruction or an integer."

"word" A Dictionary of Computing. Oxford University Press, 1996. Oxford Reference Online. Oxford University Press. Open University. 6 March 2004 <http://www.oxfordreference.com/views/ENTRY.html?subview=Main&entry=t11.e5841>

How does a computer utilise the binary system?

At its lowest level (machine level) a computer operates by switching on or off millions of transistors at great speed. These transistors, a form of switch, are etched onto the microprocessor/chip.

A computer processes data, held in memory and represented in a binary form or code. Switches that are either "on" or "off" implement this.

A transistor/switch is a two-state device and can be in one of two states:

  • On, which represents the binary digit 1
  • Off, which represents the binary digit 0

Consequently, 8 transistors with appropriate state can, for example, represent the binary code 11111011.

On On On On On Off On On

Example Usage

IP (Internet Protocol) addresses are numeric identifiers and are assigned to any machine on an IP network. They are software addresses and represent encoded information that enables the routing of datagrams, or packets, on the Internet. They consist of four bytes (32 bits). Each byte of an IP address, known as an octet, can take any value with a decimal equivalent of between 0 and 255. Here is a binary value for the IP address of IBM (http://www.ibm.com/us/)

1000 0001 0010 1010 0001 0010 0110 0011

The decimal equivalent, which is far easier for humans to read, is

129 42 18 99

An IP address is written in dotted quad form and in the case of the IBM example, we can write 129.42.18.99
By entering http://129.42.18.99 into a browser, a user can access the IBM website.
Note that when you enter http://www.ibm.com/us/ into a browser this name is resolved into a number by another computer on the Internet known as a Domain Name Server. (go here for a decription of packet handling and Telnet)

32 bits is 322-1 or 4294967295 or 4.294967295 x 109 (approx. 4.3 billion, lots of potential addresses, although not enough to satisfy anticipated demand).

Next page » Octal Number System

Previous page « Transformation of data into information

Up to top of page