Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Fluency Binary Systems. Humans Decimal Numbers (base 10) Decimal Numbers (base 10) Sign-Magnitude (-324) Sign-Magnitude (-324) Decimal Fractions.

Similar presentations


Presentation on theme: "Computer Fluency Binary Systems. Humans Decimal Numbers (base 10) Decimal Numbers (base 10) Sign-Magnitude (-324) Sign-Magnitude (-324) Decimal Fractions."— Presentation transcript:

1 Computer Fluency Binary Systems

2 Humans Decimal Numbers (base 10) Decimal Numbers (base 10) Sign-Magnitude (-324) Sign-Magnitude (-324) Decimal Fractions (23.27) Decimal Fractions (23.27) Letters for text Letters for text

3 Computers Binary Numbers (base 2) Binary Numbers (base 2) Two’s complement and sign-magnitude Two’s complement and sign-magnitude Binary fractions and floating point Binary fractions and floating point ASCII codes for characters (A  65) ASCII codes for characters (A  65)

4 Why binary? Computers are ‘electronic’ and use the presence or absence of electricity to provide values Computers are ‘electronic’ and use the presence or absence of electricity to provide values Using decimal would require 10 distinct and reliable voltage levels for each digit. Using decimal would require 10 distinct and reliable voltage levels for each digit. This is not feasible with reasonable reliability and financial constraints. This is not feasible with reasonable reliability and financial constraints. Everything in computer is stored using binary: numbers, text, programs, pictures, sounds, videos,... Everything in computer is stored using binary: numbers, text, programs, pictures, sounds, videos,...

5 Transistor A transistor is an electronic switch (on/off) and is the basic unit of modern computer processors A transistor is an electronic switch (on/off) and is the basic unit of modern computer processors Two steady states based on voltage levels Two steady states based on voltage levels As of 2015, the highest transistor count in a commercially available CPU (in one chip) is over 4.3 billion transistors, in Intel's 15-core Xeon Ivy Bridge-EX. As of 2015, the highest transistor count in a commercially available CPU (in one chip) is over 4.3 billion transistors, in Intel's 15-core Xeon Ivy Bridge-EX. Change states in billionth of sec Change states in billionth of sec Intel Makes the 3D Transistor Intel Makes the 3D Transistor Intel Makes the 3D Transistor Intel Makes the 3D Transistor

6 Binary Representations Binary values are represented abstractly by: Binary values are represented abstractly by: digits 0 and 1 digits 0 and 1 words (symbols) False (F) and True (T) words (symbols) False (F) and True (T) words (symbols) Low (L) and High (H) words (symbols) Low (L) and High (H) and words Off and On. and words Off and On. OR …..OR …..

7 Morse Code Morse Code Binary communications are not a new concept

8 Decimal: Non-negatives Base 10 Base 10 Uses decimal digits: 0,1,2,3,4,5,6,7,8,9 Uses decimal digits: 0,1,2,3,4,5,6,7,8,9 Positional System - position gives power of the base Positional System - position gives power of the base Example: 3845 = 3x10 3 + 8x10 2 + 4x10 1 + 5x10 0 Example: 3845 = 3x10 3 + 8x10 2 + 4x10 1 + 5x10 0 Positions: …543210 Positions: …543210

9 Binary: Non-negatives Base 2 Base 2 Uses binary digits (bits): 0,1 Uses binary digits (bits): 0,1 Positional system Positional system Example: 1101 = 1x2 3 + 1x2 2 + 0x2 1 + 1x2 0 Example: 1101 = 1x2 3 + 1x2 2 + 0x2 1 + 1x2 0

10 Powers of 2: 2 n n2n2n 0 1 2 3 4 5 6 7 8 9 10 1 2 4 8 16 32 64 128 256 512 1024 It will be convenient to remember these powers

11 Base Two The important details about base 2 are that the symbols that you use are 0 and 1. The place values in base 2 are (going from smallest to largest): 2 0 (1) 2 1 (2)2 (4) 2 3 (8) 2 4 (16) 2 5 (32) Change the base 2 number 110011 2 to a base 10 (decimal) number. 110011 2 1  1 = 1 1  2 = 2 0  4 = 0 0  8 = 0 1  16 = 16 1  32 = 32 51 Change the base 10 (decimal) number 47 to a base 2 (binary) number. 47  2 = 23 remainder 1 23  2 = 11 remainder1 11  2 = 5 remainder1 5  2 = 2 remainder1 2  2 = 1 remainder0 1  2 = 0 remainder1 47 = 101111 2 Binary Point

12 Conversions ExternalInternal (Human) (Computer) 25 11001 A01000001 ExternalInternal (Human) (Computer) 25 11001 A01000001 Humans want to see and enter numbers in decimal. Humans want to see and enter numbers in decimal. Computers must store and compute with bits. Computers must store and compute with bits.

13 Binary to Decimal Conversion Algorithm: Algorithm: Expand binary number using positional scheme.Expand binary number using positional scheme. Perform computation using decimal arithmetic.Perform computation using decimal arithmetic. Example: 11001 2  1x2 4 + 1x2 3 + 0x2 2 + 0x2 1 + 1x2 0 = 2 4 + 2 3 + 2 0 = 16 + 8 + 1 = 25 10 Example: 11001 2  1x2 4 + 1x2 3 + 0x2 2 + 0x2 1 + 1x2 0 = 2 4 + 2 3 + 2 0 = 16 + 8 + 1 = 25 10

14 Binary Addition One bit numbers: + 0 1 0 | 0 1 1 | 1 10 One bit numbers: + 0 1 0 | 0 1 1 | 1 10 Example 1111 1 110101 (53) + 101101 (45) 1100010 (98) Example 1111 1 110101 (53) + 101101 (45) 1100010 (98)

15 Special Powers of 2 2 10 (=1024) is Kilo, denoted "K" 2 20 (=1,048,576) is Mega, denoted "M" 2 30 (1,073, 741,824) is Giga, denoted "G" 2 40 (1,099,511,627,776 ) is Tera, denoted “T" Reminder: 8 bits (b) are also called a byte (B) Exercise: what is the most memory (RAM) a 32-bit processor can access? 1111 1111 1111 1111 1111 1111 1111 1111 equals what in decimal?

16 Octal Numbers Base 8 Digits 0,1,2,3,4,5,6,7 Base 8 Digits 0,1,2,3,4,5,6,7 Number does not have so many digits as binary Number does not have so many digits as binary Easy to convert to and from binary Easy to convert to and from binary Often used by people who need to see the internal representation of data, programs, etc. Often used by people who need to see the internal representation of data, programs, etc.

17 Octal Conversions Octal to Binary Octal to Binary Simply convert each octal digit to a three bit binary number. Simply convert each octal digit to a three bit binary number. Example: 536 8 = 101 011 110 2 Example: 536 8 = 101 011 110 2 Binary to Octal Binary to Octal Starting at right, group into 3 bit sections Starting at right, group into 3 bit sections Convert each group to an octal digit Convert each group to an octal digit Example 11011111101010 2 = 011 011 111 101 010 = 33752 8 Example 11011111101010 2 = 011 011 111 101 010 = 33752 8

18 Hexadecimal Base 16 Digits 0,…,9,A,B,C,D,E,F Base 16 Digits 0,…,9,A,B,C,D,E,F Hexadecimal  Binary Hexadecimal  Binary Just like Octal, only use 4 bits per digit. Just like Octal, only use 4 bits per digit. Example: 98C3 16 = 1001 1000 1100 0011 2 Example: 98C3 16 = 1001 1000 1100 0011 2 Example 11010011101011 2 = 0011 0100 1110 1011 = 34EB Example 11010011101011 2 = 0011 0100 1110 1011 = 34EB

19 ASCII Character Codes American Standard Code for Information Interchange (ASCII) American Standard Code for Information Interchange (ASCII) This code is a standard used to represent information sent as character-based data. The Extended ASCII set uses 8-bits to represent: This code is a standard used to represent information sent as character-based data. The Extended ASCII set uses 8-bits to represent: 224 Graphic printing characters.224 Graphic printing characters. 32 Non-printing characters32 Non-printing characters Some non-printing characters are used for text format (e.g. BS = Backspace, CR = carriage return) Some non-printing characters are used for text format (e.g. BS = Backspace, CR = carriage return) ASCII Table - http://www.ascii-code.com/ ASCII Table - http://www.ascii-code.com/http://www.ascii-code.com/


Download ppt "Computer Fluency Binary Systems. Humans Decimal Numbers (base 10) Decimal Numbers (base 10) Sign-Magnitude (-324) Sign-Magnitude (-324) Decimal Fractions."

Similar presentations


Ads by Google