# Binary/Hexadecimal Representations

## FIELDS OF STUDY

Computer Science; Computer Engineering; Software Engineering

## ABSTRACT

The binary number system is a base-2 number system. It is used by digital devices to store data and perform mathematical operations. The hexadecimal number system is a base-16 number system. It enables humans to work efficiently with large numbers stored as binary data.

## PRINICIPAL TERMS

• base-16: a number system using sixteen symbols, 0 through 9 and A through F.
• base-2 system: a number system using the digits 0 and 1.
• bit: a single binary digit that can have a value of either 0 or 1.
• byte: a group of eight bits.
• nibble: a group of four bits.

A mathematical number system is a way of representing numbers using a defined set of symbols. Number systems take their names from the number of symbols the system uses to represent numbers. For example, the most common mathematical number system is the decimal system, or base-10 system. Deci- means “ten.” It uses the ten digits 0 through 9 as symbols for numbers. Number systems can be based on any number of unique symbols, however. For example, the number system based on the use of two digit symbols (0 and 1) is called the binary or base-2 system.

Both the decimal and binary number systems use the relative position of digits in a similar way when representing numbers. The value in the rightmost, or first, position is multiplied by the number of digits used in the system to the zero power. For the decimal system, this value is 100. For the binary system, this value is 20. Both 100 and 20 are equal to 1. Any number x raised to the zero power is equal to 1. The power used increases by one for the second position and so on. Using the decimal number system, the integer 234 is represented by placing the symbols 2, 3, and 4 in positions 3, 2, and 1, respectively. In the decimal system, 234 = (2 × 100) + (3 × 10) × (4 × 1), or (2 × 102) + (3 × 101) + (4×100). The binary system uses the relative position of the symbols 0 and 1 to express the integer 234 in a different manner.  The American Standard Code for Information Interchange (ASCII) was an early system used to translate basic characters into a numerical code readable by computers.
EBSCO illustration.
SAMPLE PROBLEM

To work with binary numbers in digital applications, it is important to be able to translate numbers from their binary values to their decimal values. Translate the following binary byte to its decimal value: 10111001

Answer:

The decimal value of the binary byte 10111001 is 185. The decimal value can be determined using a chart and then calculating. = (1 × 27) + (0 × 26) + (1 × 25) + (1 × 24) + (1 × 23) + (0 × 22) + (0 × 21) + (1 × 20)

= (1 × 128) + (0 × 64) + (1 x 32) + (1 × 16) + (1 × 8) + (0 × 4) + (0 × 2) + (1 × 1)

= 185

In the binary system, 234 = (1 × 128) + (1 × 64) + (1 × 32) + (0 × 16) + (1 × 8) + (0 × 4) + (1 × 2) + (0 × 1), or 234 = (1 × 27) + (1 × 26) + (1 × 25) + (0 × 24) + (1 × 23) + (0 × 22) + (1 × 21) + (0 × 20).

The binary number system is used to store numbers and perform mathematical operations in computers systems. Such devices store data using transistors, electronic parts that can each be switched between two states. One state represents the binary digit 0 and the other, the binary digit 1. These binary digits are bits, the smallest units of data that can be stored and manipulated. A single bit can be used to store the value 0 or 1. To store values larger than 1, groups of bits are used. A group of four bits is a nibble. A group of eight bits is a byte.

The hexadecimal number system is a base-16 system. It uses the digits 0 through 9 and the letters A through F to represent numbers. The hexadecimal digit, or hex digit, A has a decimal value of 10. Hex digit B equals 11, C equals 12, D equals 13, E equals 14, and F equals 15. In hexadecimal, the value 10 is equal to 16 in the decimal system. Using hexadecimal, a binary nibble can be represented by a single symbol. For example, the hex digit F can be used instead of the binary nibble 1111 for the decimal value 15. Sixteen different combinations of bits are possible in a binary nibble. The hexadecimal system, with sixteen different symbols, is therefore ideal for working with nibbles.  Computers can quickly and easily work with large numbers in binary. Humans have a harder time using binary to work with large numbers. Binary uses many more digits than hexadecimal does to represent large numbers. Hex digits are therefore easier for humans to use to write, read, and process than binary.

—Maura Valentino, MSLIS

Australian National University. Binary Representation and Computer Arithmetic. Australian National U, n.d. Digital file.

Cheever, Erik. “Representation of Numbers.” Swarthmore College. Swarthmore College, n.d. Web. 20 Feb. 2016.

Govindjee, S. Internal Representation of Numbers. Dept. of Civil and Environmental Engineering, U of California Berkeley, Spring 2013. Digital File.

Glaser, Anton. History of Binary and Other Nondecimal Numeration. Rev. ed. Los Angeles: Tomash, 1981. Print.

Lande, Daniel R. “Development of the Binary Number System and the Foundations of Computer Science.” Mathematics Enthusiast 1 Dec. 2014: 513–40. Print.

“A Tutorial on Data Representation: Integers, Floating-Point Numbers, and Characters.” NTU. edu. Nanyang Technological U, Jan. 2014. Web. 20 Feb. 2016.