Presentation is loading. Please wait.

Presentation is loading. Please wait.

+ Binary Numbers. + + Why Binary? The smallest piece of information in a computer is a bit which stands for binary digit. (Portmanteau: smoke+fog = smog)

Similar presentations


Presentation on theme: "+ Binary Numbers. + + Why Binary? The smallest piece of information in a computer is a bit which stands for binary digit. (Portmanteau: smoke+fog = smog)"— Presentation transcript:

1 + Binary Numbers

2 +

3 + Why Binary? The smallest piece of information in a computer is a bit which stands for binary digit. (Portmanteau: smoke+fog = smog) A byte is a sequence of bits; usually eight bits equal one byte. (32 bits = 4 bytes That is, in a single memory location the computer can store a 1 or a 0. Why do computers use the binary system instead of the decimal system? Because in electronics it is easier to distinguish between two voltage levels (high, low) or (on, off) or (1, 0), than to distinguish among 10 voltage levels.

4 + Storing Information in Memory External – way information is represented by humans and the way it is entered at a keyboard or displayed on a printer or screen. Internal representation of information is the ay it is stored in the memory of a computer.

5 + Decimal Number System Base 10 positional numbering system Positional numbering systems – the value or “worth” of a digit depends not only on its absolute value but also on its specific position within a number. 10 unique digits {0,1,2,3,4,5,6,7,8,9} Value of the positions in a decimal number is based on powers of 10. 2,359 = (2x10 3 ) + (3x10 2 ) + (5x10 1 ) +(9x10 1 ) = 2000 + 300 + 50 + 9 = 2359

6 + Binary Number System Base 2 positional numbering system Positional numbering systems – the value or “worth” of a digit depends not only on its absolute value but also on its specific position within a number. 2 unique digits {0,1} Value of the positions in a decimal number is based on powers of 2. 1001 = (1x2 3 ) +(0x2 2 )+(0x2 1 )+(1x2 0 ) = 8 + 0 + 0 + 1

7 + Convert Binary to Decimal Memorize the powers of 2 ….. 111001 = 32 + 16 +8 + 0+ 0 + 1 = 57 10111 = 16 + 0 + 4 + 2 + 1 = 23 128 64 32 16 8 4 2 1 2 7 2 6 2 5 2 4 2 3 2 2 2 1 2 0

8 + Takes more digits 57 in decimal = 2 digits 57 in binary = 6 digits

9 + Convert Decimal to Binary Based on Successive divisions by 2. Dividing the original decimal value by 2 produces a quotient and a remainder, which must be either a 0 or a 1. Record the remainder digit and divide the quotient by 2 again, getting a new quotient and a second remainder digit. Convert the value 19 to binary: 19 /2 = 9 remainder 1 9/2 = 4 remainder 1 4/2 = 2 remainder 0 2/2 = 1 remainder 0 1/2 = 0 remainder 1 Order for reading the remainder digits.

10 + A Not So Basic Base Why base 10? 10 fingers and 10 toes? Nothing Special about base 10: Addition, Subtraction, Multiplication and Division work just fine in other bases, such as base 2 Computer science makes frequent use of octal (base 8) and hexadecimal (base 16) Native American Yuki tribe (base 4 – counting spaces between fingers) Pre-Columbian Mayans of Mexico and Central America use a vegesimal system, (base 20) Ancient Babylonians employed sexagesimal (base 60)

11 + Arithmetic in Binary Easy because we only have 2 digits to deal with rather than 10. Rules: 0+0=0 0+1=1 1+0=1 1+1=10 (that is 0 with a carry of 1) 00111 (binary value 7) 01110 (binary value 14) 10101 (binary value 21)


Download ppt "+ Binary Numbers. + + Why Binary? The smallest piece of information in a computer is a bit which stands for binary digit. (Portmanteau: smoke+fog = smog)"

Similar presentations


Ads by Google