Presentation is loading. Please wait.

Presentation is loading. Please wait.

Representation of Data How is data (numbers, characters) represented so that it can be used in a Computer ?

Similar presentations


Presentation on theme: "Representation of Data How is data (numbers, characters) represented so that it can be used in a Computer ?"— Presentation transcript:

1 Representation of Data How is data (numbers, characters) represented so that it can be used in a Computer ?

2 Positional Systems Calculation could not be “automated” until the “invention” of a positional number system, one in which the value of a number-symbol was based on its “position” in the number being represented

3 The Positional Decimal System Analyze the number 2,473 2,473 = 2 * 1000 + 4 * 100 + 7 * 10 + 3 *1 2,473 = 2 * 10 3 + 4 * 10 2 + 7 * 10 1 + 3 * 10 0 Each position in a number represents a different power of 10 Decimal is a base 10 system

4 Binary as Base 2 10101010 = 1*2 7 + 0*2 6 + 1*2 5 + 0* 2 4 + 1* 2 3 + 0* 2 2 + 1* 2 1 +0* 2 0, so 10101010 = 1*128 + 1*32 + 1*8 + 0*4 + 1*2 10101010 = 128 + 32 + 8 + 2 10101010 = 170 (decimal)

5 Decimal to Binary Divide by 2 and keep track of the remainders. 39 (decimal) = 100111 (binary) 39/2 =19Rem 1 19/2 =9Rem 1 9/2 =4Rem 1 4/2 =2Rem 0 2/2 =1Rem 0 1/2 =0Rem 1

6 Exercise Convert 89 (decimal) to binary 89 (decimal) = 1011001 (binary) 89/2 =44R 1 44/2 =22R 0 22/2 =11R 0 11/2 =5R 1 5/2 =2R 1 2/2 =1R 0 1/2 =0R 1

7 Why use binary? Binary uses more digits than decimal, so why do we use it? Electronic hardware can either be ‘on’ or ‘off’ - nothing in between. Binary fits this pattern - ‘on’ state is 1 in binary and ‘off’ state is 0 in binary.

8 Bits and Bytes A single binary “digit” (0 or 1) is called a bit Most computers do not deal with information at the “bit level” – they are designed to move data in packages called bytes : 1 byte = 8 bits Since there are two choices for each bit (0 or 1), a byte (such as 10101010) offers the possibility to represent 256 different values (2 8 = 256)

9 Numeric Representation of Letters and Digits In a computer, all data (letters and digits) are represented by numeric codes. One such code might use the number 1 to represent A, 2 to represent B, etc. ABCDEFGHIJKLM 12345678910111213 NOPQRSTUVWXYZ 14151617181920212223242526

10 Numeric Codes Codes such as A=1, B=2, etc would give ABCDEFGHIJKLM 12345678910111213 NOPQRSTUVWXYZ 14151617181920212223242526 The name ART would then be represented by the numeric expression 1 18 20

11 Numeric Codes (binary representation) The word ART, represented by the sequence of numbers 1 18 20, would be represented internally in a computer in binary form as: 00000001 00010010 00010100

12 ASCII The most common code used in computers is ASCII (American Standard Code for Information Interchange). ASCII provides codes for letters, digits, punctuation marks, and other special characters. ASCII was invented in the early 1960’s in order to standardize the interchange of data between different machines The ASCII code for A is 65 = 01000001

13 ASCII Codes Sp!“#$%&‘()*+,- 3233343536373839404142434445./0123456789:; 4647484950515253545556575859 <=>?@ABCDEFGHI 6061626364656667686970717273 JKLMNOPQRSTUVW 7475767778798081828384858687 XYZ[\]^_`abcde 888990919293949596979899 100101 fghijklmnopqrs 102103104 105106107108109110111112113114115 tuvw xyz{|}~ 116117118 119120121 123124125126

14 ASCII representation of Text Since the ASCII codes for ART are 65, 82, and 84, the three bytes representing the word ART would be 01000001 0101010 01010100 Nearly all software which deals with text (Notepad, WordPerfect, Word) use the ASCII codes to represent such text, though they may use proprietary codes to deal with fonts, etc.


Download ppt "Representation of Data How is data (numbers, characters) represented so that it can be used in a Computer ?"

Similar presentations


Ads by Google