Khác biệt giữa bản sửa đổi của “Cố Viêm Võ”

Bách khoa toàn thư mở Wikipedia
Nội dung được xóa Nội dung được thêm vào
Dòng 85: Dòng 85:
| 256 || 16 || 1
| 256 || 16 || 1
|- || ||
|- || ||
| || ||
| x || x || x
|}
|}
_________________________________________________________________________ <br>
_________________________________________________________________________ <br>
1. Convert the following hexadecimal number to decimal: 1c <p>
1. Convert the following hexadecimal number to decimal: 1c <p>
{| border="1"
{| border="1"
Dòng 100: Dòng 100:
| 256 || 16 || 1
| 256 || 16 || 1
|- || ||
|- || ||
| || f ||
| || f || 1
1|}
|}
There are fifteen units of 16 and 1 unit of 1. <p>
There are fifteen units of 16 and 1 unit of 1. <p>
240 + 1 = 241 <p>
240 + 1 = 241 <p>
Dòng 112: Dòng 112:
|}
|}
There are two units of 256, ten units of 16, and nine units of 1. 512 + 160 + 9 = 681 <p>
There are two units of 256, ten units of 16, and nine units of 1. 512 + 160 + 9 = 681 <p>
_________________________________________________________________________ <p>
_________________________________________________________________________ <p>
4. Convert the following hexadecimal number to decimal: 14b <p>
4. Convert the following hexadecimal number to decimal: 14b <p>
{| border="1"
{| border="1"
Dòng 129: Dòng 129:
|}
|}
There are three units of 256, fourteen units of 16, and four units of 1. 768 + 224 + 4 = 996 <p>
There are three units of 256, fourteen units of 16, and four units of 1. 768 + 224 + 4 = 996 <p>
________________________________________________________________________ <br>
________________________________________________________________________ <br>
6. Convert the following decimal to hexadecimal: 13 <p>
6. Convert the following decimal to hexadecimal: 13 <p>
When converting decimal to hex, work with the same chart from left to right. Are there any units of 256 in the decimal 13? No. <p>
When converting decimal to hex, work with the same chart from left to right. Are there any units of 256 in the decimal 13? No. <p>
{| border="1"
{| border="1"
| 256 || 16 || 1
| 256 || 16 || 1
Dòng 227: Dòng 227:
|}
|}
_________________________________________________________________________ <br>
_________________________________________________________________________ <br>

===continued…===
===continued…===

Phiên bản lúc 23:48, ngày 22 tháng 3 năm 2012

Mastering Binary Math

Cisco certification candidates, from the CCNA to the CCIE, must master binary math. This includes basic conversions, such as binary-to-decimal and decimal-to-binary, as well as more advanced scenarios involving subnetting and VLSM.

There’s another conversion that might rear its ugly head on your Cisco exam, though, and that involves hexadecimal numbering.

Newcomers to hexadecimal numbering are often confused as to how a letter of the alphabet can possibly represent a number. Worse, they may be intimidated – after all, there must be some incredibly complicated formula involved with representing the decimal 11 with the letter “b”, right?

Wrong.

The numbering system we use every day, decimal, concerns itself with units of ten. Although we rarely stop to think of it this way, if you read a decimal number from right to left, the number indicates how many units of one, ten, and one hundred we have. That is, the number “15” is five units of one and one unit of ten. The number “289” is nine units of one, eight units of ten, and two units of one hundred. Simple enough!

Units Of 100 Units Of 10 Units Of 1
The decimal “15” 0 1 5
The decimal “289” 2 8 9

Hex numbers are read much the same way, except the units here are units of 16. The number “15” in hex is read as having five units of one and one unit of sixteen. The number “289” in hex is nine units of one, eight units of sixteen, and two units of 256 (16 x 16).

Units Of 256 Units Of 16 Units Of 1
The decimal “15” 0 1 5
The decimal “289” 2 8 9

Since hex uses units of sixteen, how can we possibly represent a value of 10, 11, 12, 13, 14, or 15? We do so with letters. The decimal “10” is represented in hex with the letter “a”; the decimal 11 with “b”; the decimal “12” with “c”, “13” with “d”, “14” with “e”, and finally, “15” with “f”. (Remember that a MAC address of “ffff.ffff.ffff” is a Layer 2 broadcast.)

Practice Your Conversions for Exam Success

Now that you know where the letters fall into place in the hexadecimal numbering world, you’ll have little trouble converting hex to decimal and decimal to hex – if you practice.

How would you convert the decimal 27 to hex? You can see that there is one unit of 16 in this decimal; that leaves 11 units of one. This is represented in hex with “1b” – one unit of sixteen, 11 units of one.

Work From Left To Right To Perform Decimal – Hexadecimal Conversions.

Units of 256 Units of 16 Units of 1 Hexadecimal Value
Decimal Number “27” 0 1 B (11) 1b

Converting the decimal 322 to hex is no problem. There is one unit of 256; that leaves 66. There are four units of 16 in 66; that leaves 2, or two units of one. The hex equivalent of the decimal 322 is the hex figure 142 – one unit of 256, four units of 32, and 2 units of 2.

Units of 256 Units of 16 Units of 1 Hexadecimal Value
Decimal Number “322” 1 4 2 142

Hex-to-decimal conversions are even simpler. Given the hex number 144, what is the decimal equivalent? We have one unit of 256, four units of 16, and four units of 4. This gives us the decimal figure 324.

Units of 256 Units of 16 Units of 1 Decimal Value
Hexadecimal Number “144”” 1 4 4 256 + 64 + 4 = 324

What about the hex figure c2? We now know that the letter “c” represents the decimal number “12”. This means we have 12 units of 16, and two units of 2. This gives us the decimal figure 194.

Units of 256 Units of 16 Units of 1 Decimal Value
Hexadecimal Number “c2” 0 12 2 192 + 2 = 194


Tips for Exam Day

Practice your binary and hexadecimal conversions over and over again before you take your CCNA exams. Binary math questions come in many different forms; make sure you have practiced all of them before exam day. The number one reason CCNA candidates fail their exam is that they’re not prepared for the different types of binary math questions they’re going to be asked, and that they aren’t ready for hexadecimal questions at all.

As you can see, hexadecimal conversions are actually simple. You have to practice them, though!

You don’t have time to learn how to do in on exam day. You’ve got to be ready before you go into the exam room, and the only way to be ready is a lot of practice.

Finally, make sure you read the question carefully. You’ve got hex, decimal, and binary numbers to concern yourself with on your CCNA and CCNP exams. Make sure you give Cisco the answer in the format they’re looking for.

I have written 20 practice questions that will help you practice your hexadecimal conversion skills. Once you practice with these questions, and know exactly how each answer was arrived at, you’ll have no problem with hexadecimal conversions on your Cisco exams.

Best of luck!
To your success,

1. Convert the following hexadecimal number to decimal: 1c

2. Convert the following hexadecimal number to decimal: f1

3. Convert the following hexadecimal number to decimal: 2a9

4. Convert the following hexadecimal number to decimal: 14b

5. Convert the following hexadecimal number to decimal: 3e4

6. Convert the following decimal number to hexadecimal: 13

7. Convert the following decimal number to hexadecimal: 784

8. Convert the following decimal number to hexadecimal: 419

9. Convert the following decimal number to hexadecimal: 1903

10. Convert the following decimal number to hexadecimal: 345

11. Convert the following hex number to binary: 42

12. Convert the following hex number to binary: 12

13. Convert the following hex number to binary: a9

14. Convert the following hex number to binary: 3c

15. Convert the following hex number to binary: 74

16. Convert the following binary string to hex: 00110011

17. Convert the following binary string to hex: 11001111

18. Convert the following binary string to hex: 01011101

19. Convert the following binary string to hex: 10011101

20. 20.Convert the following binary string to hex: 11010101

Answers begin on the next page. No peeking!
Before we go through the answers and how they were achieved, let's review the meaning of letters in hexadecimal numbering:

A = 10, B = 11, C = 12, D = 13, E = 14, F = 15. (And remember that ffff.ffff.ffff is a Layer 2 broadcast!)

Examination

Conversions involving hexadecimal numbers will use this chart:

256 16 1
x x x

_________________________________________________________________________

1. Convert the following hexadecimal number to decimal: 1c

256 16 1
1 c

There is one unit of 16 and twelve units of 1. 16 + 12 = 28.

_________________________________________________________________________
2. Convert the following hexadecimal number to decimal: f1

256 16 1
f 1

There are fifteen units of 16 and 1 unit of 1.

240 + 1 = 241

_________________________________________________________________________
3. Convert the following hexadecimal number to decimal: 2a9

256 16 1
2 a 9

There are two units of 256, ten units of 16, and nine units of 1. 512 + 160 + 9 = 681

_________________________________________________________________________

4. Convert the following hexadecimal number to decimal: 14b

256 16 1
1 4 b

There is one unit of 256, four units of 16, and 11 units of 1. 256 + 64 + 11 = 331

_________________________________________________________________________
5. Convert the following hexadecimal number to decimal: 3e4

256 16 1
3 e 4

There are three units of 256, fourteen units of 16, and four units of 1. 768 + 224 + 4 = 996

________________________________________________________________________
6. Convert the following decimal to hexadecimal: 13

When converting decimal to hex, work with the same chart from left to right. Are there any units of 256 in the decimal 13? No.

256 16 1
0

Are there any units of 16 in the decimal 13? No.

256 16 1
0 0

Are there any units of 1 in the decimal 13? Sure. Thirteen of them. Remember how we express the number "13" with a single hex character?

256 16 1
0 0 d

The answer is "d". It's not necessary to have any leading zeroes when expressing hex value.

_________________________________________________________________________
7. Convert the following decimal to hexadecimal: 784

Are there any units of 256 in the decimal 784? Yes, three of them, for a total of 768. Place a "3" in the 256 slot, and subtract 768 from 784.

256 16 1
3

784 - 768 = 16

Obviously, there's one unit of 16 in 16. Since there is no remainder, we can place a "0" in the remaining slots.

256 16 1
3 1 0

The final result is the hex number "310".

_________________________________________________________________________
8. Convert the following decimal to hexadecimal: 419

Are there any units of 256 in the decimal 419? Yes, one, with a remainder of 163.

256 16 1
1

Are there any units of 16 in the decimal 163? Yes, ten of them, with a remainder of three.

256 16 1
1 a

Three units of one take care of the remainder, and the hex number "1a3" is the answer.

256 16 1
1 a 3

_________________________________________________________________________

9. Convert the following decimal to hexadecimal: 1903

Are there any units of 256 in the decimal 1903? Yes, seven of them, totaling 1792. This leaves a remainder of 111.

256 16 1
7

Are there any units of 16 in the decimal 111? Yes, six of them, with a remainder of 15.

256 16 1
7 6

By using the letter "f" to represent 15 units of 1, the final answer "76f" is achieved.

256 16 1
7 6 f

_________________________________________________________________________

10. Convert the following decimal to hexadecimal: 345

Are there any units of 256 in 345? Sure, one, with a remainder of 89.

256 16 1
1

Are there any units of 16 in 89? Yes, five of them, with a remainder of 9.

256 16 1
1 5

Nine units of nine give us the hex number "159".

256 16 1
1 5 9

_________________________________________________________________________

continued…