Читать книгу Networking All-in-One For Dummies - Lowe Doug, Doug Lowe - Страница 157
Working with the binary Windows Calculator
ОглавлениеThe Calculator program that comes with all versions of Windows has a special Programmer mode that many users don’t know about. When you flip the Calculator into this mode, you can do instant binary and decimal conversions, which can occasionally come in handy when you’re working with IP addresses.
To launch the Calculator, press the Windows key, type Calculator into the search bar, and then press Enter. When the Calculator is open, you can switch to Programmer mode by clicking the menu icon in the upper-left corner of the Calculator and choosing Programmer. In Programmer mode, you can do calculations in decimal (base 10), hexadecimal (base 16), octal (base 8), or binary (base 2). Figure 3-1 shows the Programmer mode for the latest version of the Calculator (as of this writing).
In the middle left of the Calculator window, you can see the current value displayed by the Calculator in hexadecimal (HEX), decimal (DEC), octal (OCT), and binary (BIN). You can also tell which base the main display shows, because it’s highlighted with a bar. In Figure 3-1, the current mode is DEC, so the decimal value 100 is shown in large text in the upper-middle part of the display. You can switch the main display to hexadecimal, octal, or binary by clicking HEX, OCT, or BIN, respectively.
You can also see the current value in all four bases. Thus, in the figure, you can see that decimal 100 is 64 in hexadecimal, 144 in octal, and 01100100 in binary.
Here are a few other things to note about the Programmer mode of the Calculator:
Although you can convert decimal values to binary values with the programmer Calculator, the Calculator can’t handle the dotted-decimal IP address format that’s described later in this chapter. To convert a dotted-decimal address to binary, just convert each octet separately. For example, to convert 172.65.48.120 to binary, first convert 172; then convert 65; then convert 48; and finally, convert 120.
The Programmer Calculator has several features that are designed specifically for binary operations, such as AND, OR, XOR, and so on.
The Programmer Calculator also has many other cool features for working with binary values. Spend some time exploring it when you have a few minutes!
FIGURE 3-1: The Windows Calculator in Programmer mode.