Being familiar with number systems is important as it helps you comprehend how data is represented before it can be processed by any digital system including a digital computer. In this article, we look at the most commonly applied number systems in computer systems such as the binary, octal, and hexadecimal number systems.
Contents
Different characteristics that define a number system include the number of independent digits used in the number system, the place values of the different digits constituting the number and the maximum numbers that can be written with the given number of digits. Among the three characteristics parameters, the most basic is the number of independent digits or symbols used in the number system. It is termed to as the radix or base of the number system. The decimal system is said to have a radix of 10 as it has 10 independent digits, that is, 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9. In the same way, the binary number with only two independent digits, 0 and 1, is a radix-2 number system. The octal and hexadecimal number systems have a radix (or base) of 8 and 16 respectively.
The radix of the number system also determines the other two characteristics [place value, and maximum numbers]. The place values of different digits in the integer part of the number is given by r0, r1, r2, r3, and so forth, starting with the digit adjacent to the radix point. For the fractional part, these are r-1, r-2, r-3, and so on, starting with the digit next to the radix point. Here r is the radix of the number system. Also, the maximum numbers that can be written with n digits in a given number system are equal to rn.
The decimal number system is a radix-10 number system and thus has 10 different digits or symbols. These are 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9. All the higher numbers after 9 are represented in terms of these 10 digits only for example 11, 17, 20, 29, 99, 101, 1133, etc.
The place values of different digits in a mixed decimal number, starting from the decimal point, are 100, 101, 102, and so on (for the integer part) and 10-1, 10-2, 10-3 and so forth (for the fractional part).
The subscript 10 indicates that the number is in decimal format for example, the decimal number 245 is shown as 24510.
The value or magnitude of a given decimal number can be expressed as the sum of the various digits multiplied by their place value or weights.
For example:
3586 = 6 x 100 + 8 x 101 + 5 x 102 + 3 x 103
The fractional part can be expressed as:
0.265 = 2 x 10-1 + 6 x 10-2 + 5 x 10-3 = 0.2 + 0.06 + 0.005
The binary number system consists of two numbers: 0 and 1. A subscript 2 indicates a number is in binary format. For instance, the binary number 1011 would be 10112.
Starting from the binary point, the place values of different digits in a mixed binary number are 20, 21, 22, and so on (for the integer part) and 2-1, 2-2, 2-3, and so forth (for the fractional part).
For example the binary number 11102 can be written as:
11102 = 0 x 20 + 1 x 21 + 1 x 22 + 1 x 23
Logic operations are the backbone of any digital computer, in addition to arithmetic operations that are used in solving problems in computers.
All kinds of data can be conveniently represented in terms of 0s and 1s. Basic electronic devices used for hardware implementation can be conveniently and efficiently operated in two distinctly different models. For example, a bipolar transistor can be operated in cut-off or in saturation very efficiently.
Circuits needed for performing arithmetic operations such as addition, subtraction, multiplication, division, and so on, are simplified when the data involved is represented in the form 0s and 1s.
The octal number system has a radix of 8 and therefore has eight distinct digits. In the octal system, the valid numbers are 0, 1, 2, 3, 4, 5, 6, and 7.
A subscript 8 indicates that a number is in octal format. For example 237 appear as 2378.
The place values for the different digits in the octal number system are 80, 81, 82, and so forth for the integer part and 8-1, 8-2, 8-3, etc. for the fractional part.
Example:
2378 = 7 x 80 + 3 x 81 + 2 x 82
The hexadecimal number system is a radix-16 number system and its 16 basic digits are: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F. The place values or weights of different digits in a mixed hexadecimal number are 160, 161, 162, etc. for the integer part and 16-1, 16-2, 16-3, 16-4 for the fractional part. The decimal equivalent of A, B, C, D, E and F are 10, 11, 12, 13, 14, 15 respectively.
A subscript 16 or H indicates that a number is in hexadecimal format. For example, hexadecimal number 1F can be written as 1F16 or 1FH.
Example:
The hexadecimal number 2AC16 can be shown as:Â
2AC16 = 12 x 160 + 10 x 161 + 2 x 162
The hexadecimal number system provides a condensed way of representing large binary numbers stored and processed inside the computer. For example, it can be used to represent addresses of different memory locations. Assume we have a machine that has 64K of memory. Such a memory has 64K (=216 = 65 536) memory locations and requires 65 536 different addresses. These addresses can be designated as 0 to 65 535 in the decimal number and 00000000 00000000 to 11111111 11111111 in the binary number system. Since the decimal number system is not typically used in computers, and the binary notation here appears too complex and inconvenient to handle, the best option is to use hexadecimal number system; 65 536 different addresses can be expressed with four digits from 0000 to FFFF. Likewise, the contents of the memory when represented in hexadecimal form are very convenient to handle.
You may also read:
The world of electronics is constantly evolving, allowing designers and manufacturers to push the boundaries…
PIC microcontrollers are fabricated by Microchip Technology. PIC16C84 and PIC16F84 are the two microcontrollers in…
The ADD instruction tells the microcontroller’s CPU to add the source byte to register A…
8-bit microprocessors are limited in their speed (the number of instructions that can be executed…
The 68HC11 (also abbreviated as 6811 or HC11) is an 8-bit microcontroller that was introduced…
Mutual exclusion typically imposes some conditions on access to a given resource by two or…
View Comments