![]() ![]() If the number you are about to write is greater than the number being converted stop writing. To the left, double that value (so, "2") and continue moving toward the left of the paper doubling the last value. Starting on the right of a sheet of paper, write the number "1". Say that we want to convert the number 218 to binary. It's just simple steps and easy math.Ĭonverting decimal to binary is just as easy and is the same basic algorithm, run in reverse. Now, add some symbols and compute the answer to the problem: 64 | 32 | 16 | 8 | 4 | 2 | 1 |ĭoing all the math, you should come up with: 64 | 32 | 16 | 8 | 4 | 2 | 1 | Transcribe the bits from the binary number below the slots, like so: 64 | 32 | 16 | 8 | 4 | 2 | 1 | So, you should have the following on your paper in your little slots. I'm alright up to 131,072 in my head but I usually need a calculator or paper after that). (You'll end up memorizing these numbers, which are the powers of 2, as you do this more and more. In the next slot to the left enter double the value in the slot to the right (so, "2" in the next one, "4" in the next one) and continue until all the slots are full. In the rightmost slot, enter the number "1", because we'll always start with "1". Make 7 divisions on a sheet of paper (in your mind, in a text file, etc) and begin filling them in from right to left. Start by counting the number of bits in the binary number. A bit is a bnary dig it.Ĭonverting a binary number like, say, "1101011" to decimal is a simple process with a handy little algorithm. That's "b" from "binary" and "it" from "digit". It's easier to learn a little algorithm to do it faster.Ī quick aside: Each digit in a binary number is known as a "bit". You could do it, but it wouldn't be very efficient. When all that counting and rolling is done, the last number you say aloud would be the decimal representation of the binary number the odometer started with.Ĭonverting values between binary and decimal this way would be very tedious. To convert a binary number displayed on the odometer back to decimal you could roll the odometer back one tick at a time, counting aloud until the odometer reads "00000000". Since you understand how the odometer rolls forward you'll also understand how it rolls backward, too. Whatever is displayed on the odometer after all that counting and rolling would be the binary representation of the decimal number you counted up to. To convert a decimal number to binary you could roll the odometer forward, tick by tick, counting aloud until you've rolled it a number of times equal to the decimal number you want to convert to binary. It's exactly the same as a traditional decimal odometer's operation, except that each digit can only be "0" or "1" on our fictional "binary odometer". You can memorize all of that if you want, but you really only need to understand how the little odometer "rolls over" as the number it's counting gets bigger. That's the binary representation of the decimal number 4. The number "11", in binary notation, is the same as the decimal number 3.įinally, when you've driven your fourth mile both digits (which were reading "1" at the end of the third mile) roll back over to zero position, and the 3rd digit rolls up to the "1" position, giving us "00000100". When you've driven the third mile the odometer reads "00000011", since the first digit of the odometer turns again. This looks like the number 10 in decimal notation, but it's actually 2 (the number of miles you've driven the car so far) in binary notation. When you've driven your second mile the first digit of the odometer rolls back over to "0" (since its maximum value is "1") and the second digit of the odometer rolls over to "1", making the odometer read "00000010". When you've driven your first mile the odometer reads "00000001". When the car is fresh from the factory the odometer reads "00000000". Think of a car's "odometer", except that unlike a traditional odometer each digit can only count up to 1 from 0. You really should know how to do it.Ĭounting in binary is so simple because you only have to know how to count to 1! It's really, really easy to learn to count in binary, and to learn shortcuts to convert binary to decimal and back. If you are already fluent in binary (base 2) notation you can skip this section.įor those of you who are left: Shame on you for not being fluent in binary notation! Understand how those decisions work, and you can understand how to plan IP subnets. Simply put, though, IP routers use your IP subnets to make routing decisions. ![]() You can use IP subnets to break up larger networks for logical reasons (firewalling, etc), or physical need (smaller broadcast domains, etc). IP subnets exist to allow routers to choose appropriate destinations for packets.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |