, Storage, and Retrieval ULM/HHIM Summer Program Project 3, Day 3, Part 3 Digital computers convert the data they process into a digital value. Text Audio Images/Graphics Video Digitizing 00000000... 6/8/20 Paul D. Wiedemeier, Ph.D. 6/8/20 Paul D. Wiedemeier, Ph.D. 2 The digits used by a digital computer to represent data are 0 and. Because we only use two digits to represent all data, this type of representation is called Binary Why don t we just use digits 0-9 (i.e. decimal representation) to represent all data instead of 0 and? Because the two states of an electrical circuits are Low and High voltage. Low voltage on a wire = Off = 0 bit High voltage on a wire = On = bit 6/8/20 Paul D. Wiedemeier, Ph.D. 3 6/8/20 Paul D. Wiedemeier, Ph.D. 4 A bit is a state which is either 0 or (i.e. either Off or On ). The term bit is short for binary digit A bit is the smallest unit of data that a computer can process. A bit is also the smallest unit by which memory and storage media is measured. Since a single bit is either 0 or, it can only represent, at most, two unique pieces of data. Mathematically: 2 = 2 data representations However, a grouping of 8 bits can represent 256 unique pieces of data. Mathematically: 2 8 = 2*2*2*2*2*2*2*2 = 256 data representations 6/8/20 Paul D. Wiedemeier, Ph.D. 5 6/8/20 Paul D. Wiedemeier, Ph.D. 6
A group of 8 bits is called a Byte (B). That is, a byte of memory. A nibble of memory is 4 bits. Kilobyte (KB),024 (2 0 ) Bytes Commonly,000 Bytes 8,92 bits = 8 bits/byte *,024 Bytes A word of memory is 2 bytes or 4 bytes or 2 N bytes depending on the computer architecture used. 6/8/20 Paul D. Wiedemeier, Ph.D. 7 6/8/20 Paul D. Wiedemeier, Ph.D. 8 Megabyte (MB),024 (2 0 ) Kilobytes,048,576 (2 20 ) Bytes Commonly,000,000 Bytes 8,388,608 bits Gigabyte (GB),024 (2 0 ) Megabytes,048,576 (2 20 ) Kilobytes,073,74,824 (2 30 ) Bytes Commonly,000,000,000 Bytes 8,589,934,592 bits 6/8/20 Paul D. Wiedemeier, Ph.D. 9 6/8/20 Paul D. Wiedemeier, Ph.D. 0 Terabyte (TB),024 (2 0 ) Gigabytes,048,576 (2 20 ) Megabytes,073,74,824 (2 30 ) Kilobytes,099,5,627,776 (2 40 ) Bytes Commonly,000,000,000,000 Bytes 8.796093022 * 0 2 bits Data Types 6/8/20 Paul D. Wiedemeier, Ph.D. 6/8/20 Paul D. Wiedemeier, Ph.D. 2 2
Data Types What types of data exist? Text, which includes Characters & Numbers Audio, Images/Graphics, and Video Each requires a unique binary file format in order to be processed by a computer. Data Type Text - Characters Text - Numbers Audio Images/Graphics Video Data Types File Format ASCII, EBCDIC, Unicode Unsigned Binary Integer Two s Complement Integer Binary Coded Decimal IEEE 754 Floating Point WAV, AU, MP3, etc. JPEG, GIV, TIFF, PNG, BMP, PDF, PostScript, TrueType, etc. QuickTime, MPEG-4, etc. 6/8/20 Paul D. Wiedemeier, Ph.D. 3 6/8/20 Paul D. Wiedemeier, Ph.D. 4 Since a byte can represent 256 (i.e. 2 8 ) unique pieces of data, the computer has the ability to represent textual character data. Digits 0-9 Uppercase and lowercase alphabet Foreign characters (i.e. umlauts and tilde) Special characters (i.e. punctuation marks) 6/8/20 Paul D. Wiedemeier, Ph.D. 5 6/8/20 Paul D. Wiedemeier, Ph.D. 6 The process of using a byte to represent character data is called encoding. Widely used encoding schemes include ASCII EBCDIC Unicode ASCII American Standard Code for Information Interchange 7 bit encoding scheme (e.g. 2 7 = 28 encodings) Of the three, ASCII is most popular because it is used primarily by personal computers. 6/8/20 Paul D. Wiedemeier, Ph.D. 7 6/8/20 Paul D. Wiedemeier, Ph.D. 8 3
EBCDIC How the character A is represented in ASCII Extended Binary Coded Decimal Interchange Code 8 bit encoding scheme (e.g. 2 8 = 256 encodings) 0 0 0 0 0 0 ASCII A = 000000 The encoding scheme used primarily by IBM mainframe computers. 6/8/20 Paul D. Wiedemeier, Ph.D. 9 6/8/20 Paul D. Wiedemeier, Ph.D. 20 Data Encoding A Output Device 000000 The word DATA in ASCII A Main Memory 000000.000000.00000.000000 Input Device 000000 6/8/20 Paul D. Wiedemeier, Ph.D. 2 6/8/20 Paul D. Wiedemeier, Ph.D. 22 ASCII is a 7 bit encoding scheme. 28 possible data representation It can easily represent all characters, digits, etc. in the English language. EBCDIC is an 8 bit encoding scheme. 256 possible data representation. What about Foreign Languages? 8 bit encoding schemes won t work! Why? Unicode Three unique encodings: 8 bit - mathematically: 2 8 = 256 encodings 6 bit - mathematically: 2 6 = 65,536 encodings 32 bit - mathematically: 2 32 = 4,294,967,296 encodings Unicode can represent all the characters from all Earth languages. 6/8/20 Paul D. Wiedemeier, Ph.D. 23 6/8/20 Paul D. Wiedemeier, Ph.D. 24 4
Numeric Numeric ASCII, EBCDIC, and Unicode are encoding schemes used to represent character data. Problem + is not equivalent to 2 6/8/20 Paul D. Wiedemeier, Ph.D. 25 6/8/20 Paul D. Wiedemeier, Ph.D. 26 Numeric Unique representations exist for numeric data. Integer Representations Unsigned Binary ***Two s Compliment Binary*** Binary Coded Decimal Number Systems Floating Point Representation ***IEEE 754 Floating Point Standard*** 6/8/20 Paul D. Wiedemeier, Ph.D. 27 6/8/20 Paul D. Wiedemeier, Ph.D. 28 Number Systems The base of a number system indicated how many symbols are used. Each symbol in a specific number system has a value associated with it. Each position in a specific number system has a value associated with it. Number Systems Four commonly used computer system number systems include Decimal Binary Hexadecimal Octal Polynomial Representation 6/8/20 Paul D. Wiedemeier, Ph.D. 29 6/8/20 Paul D. Wiedemeier, Ph.D. 30 5
Decimal Number System Decimal Number System Base 0 Symbols (0,,2,3,4,5,6,7,8,9) 6/8/20 Paul D. Wiedemeier, Ph.D. 3 6/8/20 Paul D. Wiedemeier, Ph.D. 32 Decimal Number System Polynomial Representation 0th - 0 0 = (ones) st - 0 = 0 (tens) 2nd - 0 2 = 00 (hundreds) 3rd - 0 3 = 000 (thousands) and so on Decimal Number System 95 decimal 9*(0 ) + 5*(0 0 ) decimal 90 + 5 decimal 95 decimal 6/8/20 Paul D. Wiedemeier, Ph.D. 33 6/8/20 Paul D. Wiedemeier, Ph.D. 34 Decimal Number System 243 decimal 2*(0 2 ) + 4*(0 ) + 3*(0 0 ) decimal 200 + 40 + 3 decimal 243 decimal 6/8/20 Paul D. Wiedemeier, Ph.D. 35 6/8/20 Paul D. Wiedemeier, Ph.D. 36 6
Base 2 Symbols (0,) Polynomial Representation 0th 2 0 = st 2 = 2 2nd 2 2 = 4 3rd 2 3 = 8 and so on 6/8/20 Paul D. Wiedemeier, Ph.D. 37 6/8/20 Paul D. Wiedemeier, Ph.D. 38 0 binary 0*(2 0 ) decimal 0 decimal binary *(2 0 ) decimal decimal 6/8/20 Paul D. Wiedemeier, Ph.D. 39 6/8/20 Paul D. Wiedemeier, Ph.D. 40 0 binary *(2 ) + 0*(2 0 ) decimal 2 + 0 decimal 2 decimal binary *(2 ) + *(2 0 ) decimal 2 + decimal 3 decimal 6/8/20 Paul D. Wiedemeier, Ph.D. 4 6/8/20 Paul D. Wiedemeier, Ph.D. 42 7
00 binary 0*(2 7 ) + *(2 6 ) + 0*(2 5 ) + *(2 4 ) + *(2 3 ) + *(2 2 ) + *(2 ) + *(2 0 ) decimal 0 + 64 + 0 + 6 + 8 + 4 + 2 + decimal 95 decimal 6/8/20 Paul D. Wiedemeier, Ph.D. 43 00 binary *(2 7 ) + *(2 6 ) + *(2 5 ) + *(2 4 ) + 0*(2 3 ) + 0*(2 2 ) + *(2 ) + *(2 0 ) decimal 28 + 64 + 32 + 6 + 0 + 0 + 2 + decimal 243 decimal 6/8/20 Paul D. Wiedemeier, Ph.D. 44 Decimal to Binary Conversion Decimal to Binary Conversion To convert a decimal number into its binary equivalent. Divide the decimal number by 2 2. The remainder will be a symbol in the binary number at a given position. 3. If the whole part of the division is not zero, then goto step. Otherwise stop. 6/8/20 Paul D. Wiedemeier, Ph.D. 45 6/8/20 Paul D. Wiedemeier, Ph.D. 46 Decimal to Binary Conversion 2 2 2 2 5 2 2 23 2 47 2 95 Remainder 0 6/8/20 Paul D. Wiedemeier, Ph.D. 47 Least Significant Bit (Right-Most Bit) Decimal to Binary Conversion 2 2 3 2 7 2 5 2 30 2 60 2 2 2 243 Remainder 6/8/20 Paul D. Wiedemeier, Ph.D. 48 0 0 Least Significant Bit (Right-Most Bit) 8
Hexadecimal Number System Hexadecimal Number System Base 6 Symbols (0,,2,3,4,5,6,7,8,9,A,B,C,D,E,F) 6/8/20 Paul D. Wiedemeier, Ph.D. 49 6/8/20 Paul D. Wiedemeier, Ph.D. 50 Hexadecimal Number System Hexadecimal Number System Polynomial Representation 0th 6 0 = st 6 = 6 2nd 6 2 = 256 3rd 6 3 = 4096 and so on Binary Decimal Hex 0000 0 0 000 000 2 2 00 3 3 000 4 4 00 5 5 00 6 6 0 7 7 Binary Decimal Hex 000 8 8 00 9 9 00 0 A 0 B 00 2 C 0 3 D 0 4 E 5 F 6/8/20 Paul D. Wiedemeier, Ph.D. 5 6/8/20 Paul D. Wiedemeier, Ph.D. 52 Hexadecimal Number System 5F hex 5*(6 ) + 5*(6 0 ) decimal 80 + 5 decimal 95 decimal Hexadecimal Number System F3 hex 5*(6 ) + 3*(6 0 ) decimal 240 + 3 decimal 243 decimal 6/8/20 Paul D. Wiedemeier, Ph.D. 53 6/8/20 Paul D. Wiedemeier, Ph.D. 54 9
Hexadecimal Number System 49 hex 4*(6 ) + 9*(6 0 ) decimal 64 + 9 decimal 73 decimal Hexadecimal Number System FA hex 5*(6 ) + 0*(6 0 ) decimal 240 + 0 decimal 250 decimal 6/8/20 Paul D. Wiedemeier, Ph.D. 55 6/8/20 Paul D. Wiedemeier, Ph.D. 56 Decimal to Binary Conversion Decimal to Hex Conversion To convert a decimal number into its hexadecimal equivalent. Divide the decimal number by 6 2. The remainder will be a symbol in the hex number at a given position. 3. If the whole part of the division is not zero, then goto step. Otherwise stop. 6/8/20 Paul D. Wiedemeier, Ph.D. 57 6/8/20 Paul D. Wiedemeier, Ph.D. 58 Decimal to Hex Conversion Decimal to Hex Conversion 6 5 6 95 Remainder 5 5 Remainder 5 F Least Significant (Right-Most) 6 5 6 243 Remainder 5 3 Remainder F 3 Least Significant (Right-Most) 6/8/20 Paul D. Wiedemeier, Ph.D. 59 6/8/20 Paul D. Wiedemeier, Ph.D. 60 0
Binary to Hex Conversion Binary to Hex Conversion To convert a binary number into its hexadecimal equivalent. Starting with the least significant binary digit, group bits into groups of four (4) from right to left. 2. For each group of four (4) bits, convert them into their hexadecimal equivalent (see earlier table). 6/8/20 Paul D. Wiedemeier, Ph.D. 6 6/8/20 Paul D. Wiedemeier, Ph.D. 62 Binary to Hex Conversion 0 Binary to Hex Conversion 00 00 00 5F F3 6/8/20 Paul D. Wiedemeier, Ph.D. 63 6/8/20 Paul D. Wiedemeier, Ph.D. 64 Hex to Binary Conversion Hex to Binary Conversion To convert a binary number into its hexadecimal equivalent. Convert each hexadecimal symbol into its four (4) bit binary equivalent (see earlier table). 6/8/20 Paul D. Wiedemeier, Ph.D. 65 6/8/20 Paul D. Wiedemeier, Ph.D. 66
Hex to Binary Conversion 5F Hex to Binary Conversion F3 00 00 00 00 6/8/20 Paul D. Wiedemeier, Ph.D. 67 6/8/20 Paul D. Wiedemeier, Ph.D. 68 Octal Number System Octal Number System Base 8 Symbols (0,,2,3,4,5,6,7) 6/8/20 Paul D. Wiedemeier, Ph.D. 69 6/8/20 Paul D. Wiedemeier, Ph.D. 70 Octal Number System Polynomial Representation 0th 8 0 = st 8 = 8 2nd 8 2 = 64 3rd 8 3 = 52 and so on Octal Number System Binary Decimal Octal 000 0 0 00 00 2 2 0 3 3 00 4 4 0 5 5 0 6 6 7 7 6/8/20 Paul D. Wiedemeier, Ph.D. 7 6/8/20 Paul D. Wiedemeier, Ph.D. 72 2
Octal Number System How would you convert the following? Decimal to Octal Octal to Decimal Converting Between Bases Octal to Binary Binary to Octal Octal to Hexadecimal Hexadecimal to Octal 6/8/20 Paul D. Wiedemeier, Ph.D. 73 6/8/20 Paul D. Wiedemeier, Ph.D. 74 Converting Between Bases Assume N is the number you wish to convert. If N is a decimal number, then. Divide the decimal number by the base you wish to obtain. 2. The remainder will be a symbol in the number at a given position. 3. If the whole part of the division is not zero, then goto step. Otherwise stop. 6/8/20 Paul D. Wiedemeier, Ph.D. 75 Converting Between Bases If N is a hexadecimal or octal number and you wish to obtain a binary number, then. Use the tables shown earlier, or better yet memorize the conversion values. If N is a hexadecimal or octal number and you wish to obtain a decimal number, then. Use polynomial representation. 6/8/20 Paul D. Wiedemeier, Ph.D. 76 Converting Between Bases If N is a hexadecimal or octal number and you wish to obtain an octal or hexadecimal number, then.convert the number to binary. Then, use the tables shown earlier to convert. Converting Between Bases If N is a binary number and you wish to obtain a hexadecimal or octal number, then.use the tables shown earlier, or better yet memorize the conversion values. 2.Of, convert the number to decimal. Then, use polynomial representation. 6/8/20 Paul D. Wiedemeier, Ph.D. 77 6/8/20 Paul D. Wiedemeier, Ph.D. 78 3
Converting Between Bases If N is a binary number and you wish to obtain a decimal number, then Converting Between Bases Hexadecimal. Use polynomial representation. Binary Decimal 2. Or Convert the binary number into a hexadecimal number (using tables or memory). Then, convert the hexadecimal number into a decimal number using polynomial representation. 6/8/20 Paul D. Wiedemeier, Ph.D. 79 Tables Polynomial Rep. Octal Base Division 6/8/20 Paul D. Wiedemeier, Ph.D. 80 4