The Numeric Systems:
Numeric Representation

 

A Bit

As mentioned earlier, a computer (running running on an Intel microprocessor) uses the binary system to represent its data using combinations of 0 or 1 values. Each value is called a bit, which stands for binary digit.

We will illustrate this using a small cup to represent such a value. This cup can have only one of two states. When the cup is empty, we will give it a value of 0. When the cup is full, we give it a value of 1:

Bit 0 Bit 1
0 1

The bit (binary digit) is the most fundamental representation of the computer's counting system.

The Four-Bit Combination

The binary system provides the combination of 4 bits as the second value representation of the system:

Bit 0 Bit 0 Bit 0 Bit 0


To count the bits, we number them starting at 0, followed by 1, 2, and 3. The count starts with the most right bit.
 

Four-Bit Representation

The first bit, on the right side of the group, is called the Low Order bit or LO bit. The last bit, on the left side of the group, is called the High Order bit or HI bit. The other bits are called by their positions: bit 1 and bit 2.

Once again, each bit can have one of two states. Continuing with our illustration, when a cup is empty, it receives a value of 0. Otherwise, it has a value of 1. On a group of four consecutive bits, we can have to following combinations:

Bit 0Bit 0Bit 0Bit 0 Bit 0Bit 0Bit 0Bit 1 Bit 0Bit 0Bit 1Bit 0 Bit 0Bit 0Bit 1Bit 1
Bit 0Bit 1Bit 0Bit 0 Bit 0Bit 1Bit 0Bit 1 Bit 0Bit 1Bit 1Bit 0 Bit 0Bit 1Bit 1Bit 1
Bit 1Bit 0Bit 0Bit 0 Bit 1Bit 0Bit 0Bit 1 Bit 1Bit 0Bit 1Bit 0 Bit 1Bit 0Bit 1Bit 1
Bit 1Bit 1Bit 0Bit 0 Bit 1Bit 1Bit 0Bit 1 Bit 1Bit 1Bit 1Bit 0 Bit 1Bit 1Bit 1Bit 1

This produces the following binary combinations: 0000, 0001, 0010, 0011, 0100, 0101, 0110, 0111, 1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111 = 16 combinations. When using the decimal system, these combinations can be resented as 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, and 15.

This is a system that the computer uses to count bits internally. Sometimes, you will encounter a number less than four bits, such as 10 or 01 or 101. The technique used to complete and fill out the group consists of displaying 0 for each non-represented bit. This makes it easier to recognize. The binary number 10 will be the same as 0010. The number 01 is the same as 0001. The number 101 is the same as 0101. This technique is valuable and allows you to always identify a binary number as a divisor of 4.

When all bits in the group are 0, you have the lowest value, which is 0000. Any of the other combinations has at least one 0 bit, except for the last one. When all bits are 1, this provides the highest value possible for a group of four bits. The lowest value, also considered the minimum value, can be represented in the decimal system as 0. The highest value, also considered the maximum, can be expressed in decimal value as 24 (2 represents the fact that there are two possible states: 0 and 1; 4 represents the fact that there are four possible combinations), which is 16.

As you can see, the binary system can be difficult to read when a value combines various bit representations. To make it a little easier, the computer recognizes the hexadecimal representation of bits. Following the box combinations above, we can represent each 4-bit of the sixteen combinations using the decimal, hexadecimal, and binary systems as follows:

Decimal Hexadecimal Binary
0 0 0000
1 1 0001
2 2 0010
3 3 0011
4 4 0100
5 5 0101
6 6 0110
7 7 0111
8 8 1000
9 9 1001
10 a 1010
11 b 1011
12 c 1100
13 d 1101
14 e 1110
15 f 1111

Table of numeric conversions

When looking at a binary value represented by 4 bits, you can get its decimal or hexadecimal values by referring to the table above. For this reason, you may have to memorize it.

A group of four consecutive bits, has a minimum and maximum values on each system:

  Decimal Hexadecimal Binary
Minimum 0 0x0 0000
Maximum 15 0xf 1111
 

A Byte

Byte

A byte combines 8 consecutive bits. Once again, the bits are counted from left to right starting at 0. The most right bit is called the Low Order bit or LO bit. The most left bit is called the High Order bit or HI bit. The other bits are referred to following their positions:
 

Byte Representation

Using the binary system, you can represent the byte using a combination of 0s and 1s. When all bits have a value of 0, the byte is represented as 00000000 or simply 0. On the other hand, when all bits have a value of 1, the byte is represented as 11111111. When the number grows very large, it becomes difficult to read. To make it easy to read, you can represent bits in groups of four. Instead of writing 00000000, you can write 0000 0000.

If you get the patience to create combinations of bits using the boxes as we did for the nibble, you would find out that there are 256 possible combinations. Another way to find it out is by using the base 2 technique:

    27  + 26 + 25 + 24 + 23 + 22 + 21 + 20

= 128 + 64 + 32 + 16 + 8  + 4   + 2  + 1

= 256

Therefore, the maximum decimal value you can store in a byte is 256.

When a byte is completely represented with 0s, it provides the minimum value it can hold; this is 0000 0000, which is also 0. When all bits have a value of 1, which is 1111 1111, a byte holds its maximum value that we calculated as 255. As done with the group of four bits, you can get the following table:

  Decimal Hexadecimal Binary
Minimum 0 0x0 0000 0000
Maximum 255 0xff 1111 1111
 

A Word

A word is a group of 16 consecutive bits. Again, the bits are counted from left to right starting at 0:

Word

Considered as a group of 16-bit, the most right bit of a word is called the Low Order bit or LO bit. The most left bit is called the High Order bit or HI bit. The other bits are referred to using their positions.: bit 1, bit 2, bit 10, etc.

Considering that a word is made of two bytes, the group of the right 8 bits is called the Low Order byte. The other group is called the High Order byte.

Word

The most fundamental representation of a word in binary format is 0000000000000000. To make it easier to read, you can group bits in 4, like this 0000 0000 0000 0000. Therefore, the minimum binary value represented by a word is 0000 0000 0000 0000. The maximum binary value represented by a word is 1111 1111 1111 1111.

The minimum decimal value of a word is 0. To find out the maximum decimal value of a word, you can use the base 2 formula, filling out each bit (with 1):

 1*215+ 1*214  +1*213 + 1*212 + 1*211 + 1*210 + 1*29 + 1*28 + 1*27 + 1*26 + 1*25 + 1*24 + 1*23 + 1*22 + 1*21 + 20 

= 32768 + 16384 + 8192  + 4096  + 2048   + 1024  + 512   + 256  + 128   + 64    + 32    + 16     + 8     + 4      + 2      + 1

= 65535

The minimum hexadecimal value you can store in a word is 0x0000000000000000. This is also represented as 0x00000000, or 0x0000, or 0x0. All these numbers produce the same value. To find out the maximum hexadecimal number you can represent with a word, replace every group of 4-bits with an f or F:

1111111111111111
1111 1111 1111 1111
f f f f
= 0xffff
= 0Xffff
= 0xFFFF
= 0XFFFF

Counting on base and extending the table we used earlier, we would get:

 
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
215 + 214 + 213 + 212 + 211 + 210 + 29 + 28 + 27 + 26 + 25 + 24 + 23 + 22 + 21 + 20
32768 + 16384 + 8192 + 4096 + 2048 + 1024 + 512 + 256 + 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1
= 65535
 

A Double-Word

A double-word is a group of two consecutive Words. This means a double-word combines 2 words, or 4 bytes, or 32 bits. The bits, counted from left to right start at 0 and end at 31:

Double-Word

The most right bit, bit 0, is called the Low Order bit, or LO bit. The most left bit, bit 31, is called the High Order bit, or HI bit. The other bits are called using their positions.

The group of the first 8 bits (from bit 0 to bit 7), which is the right byte, is called the Low Order Byte, or LO Byte. The group of the last 8 bits (from bit 24 to bit 31), which is the left byte, is called the High Order Byte, or HI Byte. The other bytes are called by their positions.

The group of the right 16 bits, or the right Word, is called the Low Order Word, or LO Word. The group of the left 16 bits, or the left Word, is called the High Order Word, or HI Word.

Double-Word

The minimum decimal value of a double-word is 0. To find out the maximum decimal value of a word, you can use the base 2 formula giving a 1 value to each bit:

1*231 + 1*230 + 1*229 + 1*228 + 1*227 + 1*226 + 1*225 + 1*224 + 1*223 + 1*222 + 1*221 + 1*220  

+ 1*219 + 1*218 + 1*217 + 1*216 + 1*215 + 1*214 + 1*213 + 1*212 + 1*211 + 1*210 + 1*29 + 1*28 + 1*27

+ 1*26 + 1*25 + 1*24 + 1*23 + 1*22 + 1*21 + 20 

= 2,147,483,648 + 1,073,741,824 + 536,870,912 + 268,435,456 + 134,217,728 + 67,108,864 + 33,554,432

+ 16,777,216 + 8,388,608 + 4,194,304 + 2,097,152 + 1,048,576 + 524,288 + 262,144 + 131,072 + 65,536

+ 32,768 + 16,384 + 8,192 + 4,096 + 2,048 + 1,024 + 512 + 256 + 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1

= 4,294,967,295

The minimum hexadecimal value you can store in a double-word is 0x0. To find out the maximum hexadecimal number you can represent with a double-word, replace every group of 4-bits with an f or F:

1111 1111 1111 1111 1111 1111 1111 1111
f f f f f f f f
= 0xffffffff = 0XFFFFFFFF
 

Previous Copyright © 2003-2010 FunctionX Next