Saturday, November 7, 2009

Four-octet dotted decimal representation of 32-bit binary numbers / Hexadecial / Boolean or binary logic


Four-octet dotted decimal representation of 32-bit binary numbers
1.2.7 This will explain how binary numbers are represented in dotted decimal notation.


Currently, addresses assigned to computers on the Internet are 32-bit binary numbers. To make it easier to work with these addresses, the 32-bit binary number is broken into a series of decimal numbers. First the binary number is split into four groups of eight binary digits. Then each group of eight bits, or octet, is converted into its decimal equivalent. This conversion can be performed as shown on the previous page.

When written, the complete binary number is represented as four groups of decimal digits separated by periods. This is called dotted decimal notation and provides a compact and easy way to refer to 32-bit addresses. This representation is used frequently later in this course, so it is necessary to understand it. For dotted decimal to binary conversions, remember that each group of one to three decimal digits represents a group of eight binary digits. If the decimal number that is being converted is less than 128, zeros will be needed to be added to the left of the equivalent binary number until there are a total of eight bits.

Try the following conversions for practice:
Convert 200.114.6.51 to its 32-bit binary equivalent.
Convert 10000000 01011101 00001111 10101010 to its dotted decimal equivalent.

The next will introduce the hexadecimal number system.


Hexadecimal
1.2.8 This page will teach about the hexadecimal number system. Students will also learn how hexadecimal is used to represent binary and decimal numbers.


The hexadecimal or Base 16 number system is commonly used to represent binary numbers in a more readable form. Computers perform computations in binary. However, there are several instances when the binary output of a computer is expressed in hexadecimal to make it easier to read.

The configuration register in Cisco routers often requires hexadecimal to binary and binary to hexadecimal conversions. Cisco routers have a configuration register that is 16 bits long. The 16-bit binary number can be represented as a four-digit hexadecimal number. For example, 0010000100000010 in binary equals 2102 in hexadecimal. A hexadecimal number is often indicated with a 0x. For example, the hexadecimal number 2102 would be written as 0x2102.

Like the binary and decimal systems, the hexadecimal system is based on the use of symbols, powers, and positions. The symbols that hexadecimal uses are the digits 0 through 9 and the letters A through F.

All combinations of four binary digits can be represented with one hexadecimal symbol. These values require one or two decimal symbols. Two hexadecimal digits can efficiently represent any combination of eight binary digits. This would require up to four decimal digits. The use of two decimal digits to represent four bits could cause confusion. For example, the eight bit binary number 01110011 would be 115 if converted to decimal digits. It is unclear if this is 11 and 5 or 1 and 15. If 11-5 is used, the binary number would be 1011 0101, which is not the number originally converted. The hexadecimal conversion is 1F, which always converts back to 00011111.

An eight-bit binary number can be converted to two hexadecimal digits. This reduces the confusion of reading long strings of binary numbers and the amount of space it takes to write binary numbers. Remember that 0x may be used to indicate a hexadecimal value. The hexadecimal number 5D might be written as 0x5D.

To convert to binary, simply expand each hexadecimal digit into its four-bit binary equivalent.

The next page will discuss Boolean logic.

Boolean or binary logic
1.2.9 This page will introduce Boolean logic and explain how it is used.


Boolean logic is based on digital circuitry that accepts one or two incoming voltages. Based on the input voltages, output voltage is generated. For computers the voltage difference is represented as an ON or OFF state. These two states are associated with a binary 1 or 0.

Boolean logic is a binary logic that allows two numbers to be compared and makes a choice based on the numbers. These choices are the logical AND, OR, and NOT. With the exception of the NOT, Boolean operations have the same function. They accept two numbers, which are 1 and 0, and generate a result based on the logic rule.

The NOT operation takes the value that is presented and inverts it. A 1 becomes a 0 and a 0 becomes a 1. Remember that the logic gates are electronic devices built specifically for this purpose. The logic rule that they follow is whatever the input is, the output is the opposite.

The AND operation compares two input values. If both values are 1, the logic gate generates a 1 as the output. Otherwise it outputs a 0. There are four combinations of input values. Three of these combinations generate a 0, and one combination generates a 1.

The OR operation also takes two input values. If at least one of the input values is 1, the output value is 1. Again there are four combinations of input values. Three combinations generate a 1 and the fourth generates a 0.

The two networking operations that use Boolean logic are subnetwork and wildcard masking. The masking operations are used to filter addresses. The addresses identify the devices on the network and can be grouped together or controlled by other network operations. These functions will be explained in depth later in the curriculum.

The next page will explain how network masks are used.

No comments:

Post a Comment