Presentation is loading. Please wait.

Presentation is loading. Please wait.

Number systems. Binary system. Bits and bytes. Modern computers “speak” in a digital language composed of 2 digits. The machine language of modern computers.

Similar presentations


Presentation on theme: "Number systems. Binary system. Bits and bytes. Modern computers “speak” in a digital language composed of 2 digits. The machine language of modern computers."— Presentation transcript:

1 Number systems. Binary system. Bits and bytes

2 Modern computers “speak” in a digital language composed of 2 digits. The machine language of modern computers is written in Binary Code. A BIT is short for Binary Digit. İf n = number of digits, the number of potential values 2^(n-1) 1 bit can represent up to 2 values

3 1 bit = 0, 1 1 bit 1 bit = can represent 4 values 0,1,2,3 3 bits can represent 8 possible values 2^3 = 8 0,1,2,3,4,5,6,7 A single bit can only hold 2 values, but the number of values increases exponentially with every digit you add. 22 2 2 22

4 2^x10^x 0000 * (2^0)0 0011*(2^0)1 0101*(2^1)+0*(2^0)2 0111*(2^1)+1*(2^0)3 1001*(2^1)+0*(2^0)+0*(2^0)4 1011*(2^1)+0*(2^0)+1*(2^0)5 1101*(2^1)+1*(2^0) )+0*(2^0)6

5 DecimalBinaryOctalBinaryHexadecimal 000 000 00000000 0 100 000 0011 1 200 000 0102 2 300 000 0113 3 400 000 1004 4 500 000 1015 5 600 000 1106 6 700 000 1117 7 800 001 000100000 10008 900 001 001110000 10019 1000 001 010120000 1010a 1100 001 011130000 1011b 1200 001 100140000 1100c 1300 001 101150000 1101d 1400 001 110160000 1110e 1500 001 111170000 1111f 1600 010 000200001 000010 2600 011 010320001 10101a 3600 100 100440010 010024 4600 101 110560010 11102e 5600 111 000700011 100038 6601 000 0101020100 001042

6 The binary (base two) numeral system has two possible values, often represented as 0 or 1, for each place-value. In contrast, the decimal (base ten) numeral system has ten possible values (0,1,2,3,4,5,6,7,8, or 9) for each place-value. To avoid confusion while using different numeral systems, the base of each individual number may be specified by writing it as a subscript of the number. For example, the binary number 10011100 may be specified as "base two" by writing it as 10011100 2. The decimal number 156 may be written as 156 10 and read as "one hundred fifty-six, base ten". Base 2 Numbering System

7 Computers recognize and process data using the binary, or base 2, numbering system. The binary numbering system uses only two symbols (0 and 1) instead of the ten symbols in the decimal numbering system. The position, or place, of each digit represents the number 2 (the base number) raised to the power (exponent), based on its position. Examples 2º = 1 2¹ = 2 2² = 4 2³ = 8 2 4 = 16 2 5 = 32 2 6 = 64 2 7 = 128

8 1 BYTE = 8 Bit 1 Bit can represent 0 or 1. 1 BYTE 1 character 1024 BYTE = 1 KiloByte (KiloByte = KB) 1024 KB = 1 MegaByte (MegaByte = MB) 1024 MB = 1 GigaByte (GigaByte = GB) 1024 GB = 1 TeraByte (TeraByte = TB) You might hear an advertisement that says, "This computer has a 32-bit Pentium processor with 64 megabytes of RAM and 2.1 gigabytes of hard disk space"

9

10 Converting From Binary to Decimal Numbers The positional value concept is simple: With both binary and decimal numbers, the actual value of each digit depends on its position (how "far to the left") within the number. For example, in the decimal number 124, the digit '4' represents the value "four," but the digit '2' represents the value "twenty," not "two." The '2' represents a larger value than the '4' in this case because it lies further to the left in the number. Likewise in the binary number 1111011, the rightmost '1' represents the value "one," but the leftmost '1' represents a much higher value ("sixty-four" in this case). In mathematics, the base of the numbering system determines how much to value digits by position. For base-ten decimal numbers, multiply each digit on the left by a progressive factor of 10 to calculate its value. For base-two binary numbers, multiply each digit on the left by a progressive factor of 2. Calculations always work from right to left.

11 In the above example, the decimal number 123 works out to: 3 + (10 * 2) + (10*10 * 1) = 123 and the binary number 1111011 converts to decimal as: 1 + (2 * 1) + (2*2 * 0) + (4*2 * 1) + (8*2 * 1)+ (16*2 * 1) + (32*2 * 1) = 123 Therefore, the binary number 1111011 is equal to the decimal number 123.

12 Converting From Decimal to Binary Numbers To convert numbers in the opposite direction, from decimal to binary, requires successive division rather than progressive multiplication. To manually convert from a decimal to a binary number, start with the decimal number and begin dividing by the binary number base (base "two"). For each step the division results in a remainder of 1, use '1' in that position of the binary number. When the division results in a remainder of 0 instead, use '0' in that position. Stop when the division results in a value of 0. The resulting binary numbers are ordered from right to left.

13 For example, the decimal number 109 converts to binary as follows: 109 / 2 = 54 remainder 1 54 / 2 = 27 remainder 0 27 / 2 = 13 remainder 1 13 / 2 = 6 remainder 1 6 / 2 = 3 remainder 0 3 / 2 = 1 remainder 1 1 / 2 = 0 remainder 1 Therefore the decimal number 109 equals the binary number 1101101.

14 In the example below, the decimal number, 253, is converted into a binary number with a remainder, r, by successive division by 2. The binary number for 253 is 11111101 253/2 = 126 r 1 126/2 = 63 r 0 63/2 = 31 r 1 31/2 = 15 r 1 15/2 = 7 r 1 7/2 = 3 r 1 3/2 = 1 r 1 1/2 = 0 r 1

15 Procedure to Converting a Decimal Number to a Binary Number There are about five steps involved in converting the number 35 to a binary number. 1. First you need to determine the greater power of 2 that is less than or equal to 35. So, starting with the largest number, 2 to the 5 (32) is smaller than 35. Place a "1" in that column and, then, calculate how much is left over by subtracting 32 from 35. The result is 9. 2. Next, you'll want to check to see if 16 (the next lower power of 2) that fits into 3. Because it does not, an "0" is placed in that column. The value of the next number is 8, which is larger than 3, so an "0" is placed in that column too. 3. The next value that we'll work with is 4, which is still larger than 3. So, again, we'll make this a "0." 4. Okay, our next value will be 2, which is smaller than 3. And, because it is, we'll place a "1" into the column. Now, you'll need to subtract 2 from 3, and the result will be 1. 5. The value of the last number is 1, which still works with the remaining number. Therefore, we'll place a "1" in the last column. Now we see that the binary number for the decimal number 35 is 100011.

16 Example 1 Decimal to Binary Conversion 10001 11001100 111000 10101 11110 1010101 110011

17 Example 2 Decimal to Binary Conversion 68 24 13 75 122 45 32 57


Download ppt "Number systems. Binary system. Bits and bytes. Modern computers “speak” in a digital language composed of 2 digits. The machine language of modern computers."

Similar presentations


Ads by Google