Lab2 (1130221)
Текст из файла
Лабораторная работа № 2. Двоичная система счисления
Objectives:
This lab will focus on your ability to accomplish the following tasks:
-
Identify the positions in a binary number and know the value of each
-
Identify the positions in a decimal number and know the value of each
-
Work with base 10 exponents (powers of 10) and understand how position defines value
-
Work with base 2 exponents (powers of 2) and understand how position defines value
-
Manually convert simple binary numbers and decimal numbers
-
Manually convert 32-bit binary IP addresses and dotted decimal IP addresses
-
Use the Windows Scientific Calculator to check your answers (go to the View Menu in the calculator window and select the Scientific option)
-
Describe the differences between binary and decimal numbering systems
Step 1 - Decimal Numbers.
Explanation: We are most familiar with "decimal" numbers (base 10). The decimal numbering system is based on the powers of 10. This exercise will help develop an understanding of the exponentiation or "powers" of numbers using the base 10 number system which is what our arithmetic and money system is based on. With base 10, the right-most position has a value of 1 (same as base 2). Each position moving to the left is worth 10 times more. 10 to the zero power (10^0) is one, 10 to the first power (10^1 or 10 x 1) is 10, 10 to the second power (10^2 or 10 x 10) is 100 and 10 to the third power (10^3 or 10 x 10 x 10) is 1,000 etc. Just multiply the number in each position times the value of each position (e.g. 400 = 4 x 10^2 or 4 x 100). Remember any number to the zero power is 1.
Decimal Number Conversion Example.
The following chart shows how the decimal number system represents the number 352,481. This will help in understanding the binary numbering system.
Exponent | 106 | 105 | 104 | 103 | 102 | 101 | 100 |
Position | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
Value | 1000000 | 100000 | 10000 | 1000 | 100 | 10 | 1 |
Number | 0 | 3 | 5 | 2 | 4 | 8 | 1 |
0 x 1,000,000 | 3 x 100,000 | 5 x 10,000 | 2 x 1,000 | 4 x 100 | 8 x 10 | 1 x 1 |
The number 352,481 if read from right to left would be (1 x 1) + (8 x 10) + (4 x 100) + (2 x 1,000) + (5 x 10,000) + (3 x 100,000) for a total of 352,481 (a six-digit number).
Here is another way to look at it that makes it easier to add up the decimal number values:
Position of digit (from right) | Value of bit position (10^X or ten to the power of) | Number value from 0 to 9 | Calculation | Decimal Value |
1st Decimal Digit | 10^ 0 or 1 | 1 | 1 x 1 | 1 |
2nd Decimal Digit | 10^ 1 or 10 | 8 | 8 x 10 | 80 |
3rd Decimal Digit | 10^ 2 or 100 | 4 | 4 x 100 | 400 |
4th Decimal Digit | 10^ 3 or 1000 | 2 | 2 x 1,000 | 2,000 |
5th Decimal Digit | 10^ 4 or 10000 | 5 | 5 x 10,000 | 52,000 |
6th Decimal Digit | 10^ 5 or 100000 | 3 | 3 x 100,000 | 300,000 |
Decimal Value (Total of 6 digits) | 352,481 |
Step 2 - Binary Numbers
Explanation: Binary means "two" and each digit in a binary number can only have two values (zero or one). It is also called a base 2 numbering system. Binary numbers are the key to understanding how routers work and how packets get from one workstation (host) to another server (host) on a TCP/IP network. Internet addresses are made up of 32 bits or 4 groups of eight bits known as "OCTETS". Each bit of each octet has a value based on its position. Of the 8 bits in an octet, the left-most bit is worth 128 (2^7) and the right most bit is worth 1 (2^0). The value of each bit is based on the powers of two.
The binary numbering system is based on the powers of 2. This exercise will help develop an understanding of exponentiation or "powers" of numbers using the base 2 number system which is what all computers and data communications use. With base 2, the right-most position has a value of 1 as with base 10. Each position moving to the left is worth 2 times more. 2 to the zero power (2^0) is one, 2 to the first power (2^1 or 2 x 1) is 2. 2 to the second power (2^2 or 2 x 2) is 4 and 2 to the third power (2^3 or 2 x 2 x 2) is 8 etc. Just multiply the number in each position (either a 0 or a 1) times the value of each position (e.g. 8 = 1 x 2^3 or 1 x 8) and add up the total. Remember any number to the zero power is 1. Convert the following binary numbers to decimal numbers. In the first exercise you will convert a binary number to a decimal number. Starting from the right, the first binary digit is a ZERO which is calculated as zero times 2^0 (two to the zero power or 0 x 1 – anything to the zero power is 1). The second position from the left is also a ZERO so this is zero times 2^1 (or 0 x 2). The third binary number from the right is a ONE. This is 1 times 2^2 (two to the 2nd power or 4).
Binary Number Conversion Example.
The following table shows the detail calculations (starting from the right side) to convert the binary number 10011100 into a decimal number.
Position of digit (from right) | Value of bit position (two to the power of) | Is bit a One (on) or a Zero (Off) | Calculation | Decimal Value |
1st Decimal Digit | 2^ 0 or 1 | 0 | 0 x 1 | 0 |
2nd Decimal Digit | 2^ 1 or 2 | 0 | 0 x 2 | 0 |
3rd Decimal Digit | 2^ 2 or 4 | 1 | 1 x 4 | 4 |
4th Decimal Digit | 2^ 3 or 8 | 1 | 1 x 8 | 8 |
5th Decimal Digit | 2^ 4 or 16 | 1 | 1 x 16 | 16 |
6th Decimal Digit | 2^ 5 or 32 | 0 | 0 x 32 | 0 |
7th Decimal Digit | 2^ 6 or 64 | 0 | 0 x 64 | 0 |
8th Decimal Digit | 2^ 7 or 128 | 1 | 1 x 128 | 128 |
Decimal Value (Total of 8 digits) | 156 |
Step 3 - Binary to Decimal Practice Exercises.
Task: Practice converting the 4 binary octets of an IP address to the dotted decimal equivalent.
Explanation: Look at the Binary number bit status. If there is a ONE in a position add the value shown. If there is a ZERO in a position then do not add it. Note that 8 bits cannot represent a decimal number greater than 255 (If all 8 positions are ones then 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255).
1. Solve for the 1st , 2nd , 3rd and 4th octet Decimal value
Exponent | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 |
Bit Position | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
Value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
Binary Number Bit Status | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 |
1st Octet Decimal Value: ________________
Exponent | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 |
Bit Position | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
Value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
Binary Number Bit Status | 1 | 1 | 1 | 0 | 0 | 0 | 1 | 1 |
2nd Octet Decimal Value: ________________
Exponent | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 |
Bit Position | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
Value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
Binary Number Bit Status | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 |
3rd Octet Decimal Value: ________________
Exponent | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 |
Bit Position | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
Value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
Binary Number Bit Status | 1 | 1 | 0 | 1 | 1 | 0 | 1 | 0 |
4th Octet Decimal Value: ________________
-
Enter the Dotted Decimal octet values for all four octets for the above IP address:
10011100 . 11100011 . 01110000 . 11011010
_______ ___ __________ __________ ___________
Характеристики
Тип файла документ
Документы такого типа открываются такими программами, как Microsoft Office Word на компьютерах Windows, Apple Pages на компьютерах Mac, Open Office - бесплатная альтернатива на различных платформах, в том числе Linux. Наиболее простым и современным решением будут Google документы, так как открываются онлайн без скачивания прямо в браузере на любой платформе. Существуют российские качественные аналоги, например от Яндекса.
Будьте внимательны на мобильных устройствах, так как там используются упрощённый функционал даже в официальном приложении от Microsoft, поэтому для просмотра скачивайте PDF-версию. А если нужно редактировать файл, то используйте оригинальный файл.
Файлы такого типа обычно разбиты на страницы, а текст может быть форматированным (жирный, курсив, выбор шрифта, таблицы и т.п.), а также в него можно добавлять изображения. Формат идеально подходит для рефератов, докладов и РПЗ курсовых проектов, которые необходимо распечатать. Кстати перед печатью также сохраняйте файл в PDF, так как принтер может начудить со шрифтами.