0% found this document useful (0 votes)
58 views7 pages

Router Basics IOS Basics Router Configuration Switching & Bridging Frame Relay

The document discusses number systems and base conversion. It explains that number systems define sets of values to represent quantity, with different bases allowing different numbers of digits. The decimal system uses digits 0-9, while binary uses 0-1, octal uses 0-7, and hexadecimal uses 0-9 and A-F. It then provides instructions for converting between decimal, binary, hexadecimal, and octal notations. This is done by repeatedly taking the remainder of dividing the number by the new base to extract each digit from least to most significant. An example converts 1341 between decimal, binary, and hexadecimal notations.

Uploaded by

Praveen Kumar
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views7 pages

Router Basics IOS Basics Router Configuration Switching & Bridging Frame Relay

The document discusses number systems and base conversion. It explains that number systems define sets of values to represent quantity, with different bases allowing different numbers of digits. The decimal system uses digits 0-9, while binary uses 0-1, octal uses 0-7, and hexadecimal uses 0-9 and A-F. It then provides instructions for converting between decimal, binary, hexadecimal, and octal notations. This is done by repeatedly taking the remainder of dividing the number by the new base to extract each digit from least to most significant. An example converts 1341 between decimal, binary, and hexadecimal notations.

Uploaded by

Praveen Kumar
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 7

Router Basics IOS Basics Router Configuration Switching & Bridging Frame Relay

Number System Introduction Base Conversion Table To Convert from Any Base to Decimal To Convert from Decimal to Any Base

Introduction A number system defines a set of values used to represent quantity. You may regard each digit as a box that can hold a number. In the binary system, there can be only two choices for this number -- either a "0" or a "1". In the octal system, there can be eight possibilities: "0", "1", "2", "3", "4", "5", "6", "7". In the decimal system, there are ten different numbers that can enter the digit box: "0", "1", "2", "3", "4", "5", "6", "7", "8", "9". In the hexadecimal system, we allow 16 numbers:

"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", and "F". As demonstrated by the following table, there is a direct correspondence between the binary system and the Hexa system, with four binary digits translate directly into one hexadecimal digit. In computer usage, hexadecimal notation is especially common because it easily replaces the binary notation, which is too long and human mistakes in transcribing the binary numbers are too easily made. Base Conversion Table BIN HEX DEC ---------------0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 0 1 2 3 4 5 6 7 8 9 B C E 0 1 2 3 4 5 6 7 8 9 11 12 14

----------------

A 10

D 13

1111

15

Convert From Any Base To Decimal Let's think more carefully what a decimal number means. For example, 1234 means that there are four boxes (digits); and there are 4 one's in the right-most box (least significant digit), 3 ten's in the next box, 2 hundred's in the next box, and finally 1 thousand's in the left-most box (most significant digit). The total is 1234: Original Number: | | | How Many Tokens: Value: 1 | 1 2 3 10 4 1 2 3 4

Digit/Token Value: 1000 100

1000 + 200 + 30 + 4 = 1234

or simply, 1*1000 + 2*100 + 3*10 + 4*1 = 1234 Thus, each digit has a value: 10^0=1 for the least significant digit, increasing to 10^1=10, 10^2=100, 10^3=1000, and so forth. Likewise, the least significant digit in a hexadecimal number has a value of 16^0=1 for the least significant digit, increasing to 16^1=16 for the next digit, 16^2=256 for the next, 16^3=4096 for the next, and so forth. Thus, 1234 means that there are four boxes (digits); and there are 4 one's in the right-most box (least significant digit), 3 sixteen's in the next box, 2 256's in the next, and 1 4096's in the left-most box (most significant digit). The total is: 1*4096 + 2*256 + 3*16 + 4*1 = 4660 Example. Convert the hexadecimal number 4B3 to decimal notation.

Solution: Original Number : 4 | | | 3 1 B 3

How Many Tokens : 4 11 Digit/Token Value: 256 16 Value:

1024 +176 + 3 = 1203

Another way is to think of a cash register with different slots, each holding bills of a different denomination Convert From Decimal to Any Base Again, let's think about what you do to obtain each digit. As an example, let's start with a decimal number 1234 and convert it to decimal notation. To extract the last digit, you move the decimal point left by one digit, which means that you divide the given number by its base 10. 1234/10 = 123 + 4/10 The remainder of 4 is the last digit. To extract the next last digit, you again move the decimal point left by one digit and see what drops out. 123/10 = 12 + 3/10 The remainder of 3 is the next last digit. You repeat this process until there is nothing left. Then you stop. In summary, you do the following: Quotient Remainder -----------------------------

1234/10 = 123 123/10 = 12/10 = 1/10 = 12 1 0

4 --------+ 3 ------+ | 2 ----+ | | 1 --+ | | | (Stop when the quotient is 0) |||| 1 2 3 4 (Base 10)

Now, let's try a nontrivial example. Let's express a decimal number 1341 in binary notation. Note that the desired base is 2, so we repeatedly divide the given decimal number by 2. Quotient Remainder ----------------------------1341/2 = 670 670/2 = 335 335/2 = 167 167/2 = 83/2 = 41/2 = 20/2 = 10/2 = 5/2 = 2/2 = 1/2 = 83 41 20 10 5 2 1 0 1 ----------------------+ 0 --------------------+ | 1 ------------------+ | | 1 ----------------+ | | | 1 --------------+ | | | | 1 ------------+ | | | | | 0 ----------+ | | | | | | 0 --------+ | | | | | | | 1 ------+ | | | | | | | | 0 ----+ | | | | | | | | | 1 --+ | | | | | | | | | | (Stop when the ||||||||||| quotient is 0) 1 0 1 0 0 1 1 1 1 0 1 (BIN; Base 2) Let's express the same decimal number 1341 in hexadecimal notation.

Quotient Remainder ----------------------------1341/16 = 83/16 = 5/16 = 0 83 5 13 ------+ 3 ----+ | 5 --+ | | (Stop when the quotient is 0) ||| 5 3 D (HEX; Base 16) Example. Convert the decimal number 3315 to hexadecimal notation. Solution: Quotient Remainder ----------------------------3315/16 = 207 207/16 = 12/16 = 12 0 3 ------+ 15 ----+ | 12 --+ | | (Stop when the quotient is 0) ||| C F 3 (HEX; Base 16) Thus, 3315 (DEC) --> CF3 (HEX) Note that from the Base Conversion Table, you can easily get the binary notation from the hexadecimal number by grouping four binary digits per hexadecimal digit, or from or the octal number by grouping three binary digits per octal digit, and vice versa. HEX 5 3 D

BIN 0101 0011 1101 OCT 2 4 7 5

BIN 010 100 111 101 Note: In 640-801 exam there is one question to convert a number from one base to others.

OSI Reference Model Introduction & Advantages of Layered Model Application Layer Presentation Layer Session Layer Transport Layer Multiplexing & De-multiplexing Sequencing - Acknowledgements - Flow Control (Windowing) Network Layer Data-Link Layer Process of finding hosts on the same network segment - ARP Physical Layer

You might also like