🎧 New: AI-Generated Podcasts Turn your study notes into engaging audio conversations. Learn more

Module 2 - Intro to Computing.pdf

Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

Document Details

UserReplaceableSurrealism

Uploaded by UserReplaceableSurrealism

Polytechnic University of the Philippines

Tags

data representation computing number systems

Full Transcript

Republic of the Philippines POLYTECHNIC UNIVERSITY OF THE PHILIPPINES LOPEZ QUEZON, BRANCH Module 2. Data Representation Contents Data Representation 1. Number System Operation and Conversion 2. Data Representation 2.1. Numeric...

Republic of the Philippines POLYTECHNIC UNIVERSITY OF THE PHILIPPINES LOPEZ QUEZON, BRANCH Module 2. Data Representation Contents Data Representation 1. Number System Operation and Conversion 2. Data Representation 2.1. Numeric 2.1.1. Signed 2.1.2. Unsigned 2.1.3. Fixed 2.1.4. Floating 2.2. Non-numeric 2.2.1. Character 2.2.2. Image 2.2.3. Sound 2.2.4. Video Objectives To distinguishes the various number system and data representation To understand computer number system operation and conversion. To formulate solutions and Computes binary addition and subtraction. Manipulates various operations and conversions in number system Answers/Practices various operations and conversions. Identify different approach in computing Republic of the Philippines POLYTECHNIC UNIVERSITY OF THE PHILIPPINES LOPEZ QUEZON, BRANCH Introduction Data refers to the symbols that represent people, events, things, and ideas. Data can be a name, a number, the colors in a photograph, or the notes in a musical composition. Data Representation refers to the form in which data is stored, processed, and transmitted. Devices such as smartphones, iPods, and computers store data in digital formats that can be handled by electronic circuitry. Data representation refers to the internal method used to represent various types of data stored on a computer. Computers use different types of numeric codes to represent various forms of data, such as text, number, graphics and sound. All information that is stored on a computer is represented in a sequence of zeros and ones. 1. Number System Operation and Conversion Information is any knowledge that can be communicated, including abstract ideas and concepts such as “the earth is round.” Data is information in a form the computer can use— for example, the numbers and letters making up the formulas that relate the earth’s radius to its volume and surface area. Data can represent many kinds of information, such as sounds, images, video, rocket telemetry, automobile engine functions, weather, global climate, interactions of atomic particles, drug effects on viruses, and so forth. Part of the programming process involves deciding how to represent the information in a problem as data. 2. Data Representation The 0s and 1s used to represent digital data are referred to as binary digits — from this term we get the word bit that stands for binary digit. A bit is a 0 or 1 used in the digital representation of data. A digital file, usually referred to simply as a file, is a named collection of data that exits on a storage medium, such as a hard disk, CD, DVD, or flash drive. Numeric data consists of numbers that can be used in arithmetic operations. Digital devices represent numeric data using the binary number system, also called base two (2). The binary number system only has two digits: 0 and 1. No numeral like 2 exists in the system, so the number “two” is represented in binary as 10 (pronounced “one zero”). Republic of the Philippines POLYTECHNIC UNIVERSITY OF THE PHILIPPINES LOPEZ QUEZON, BRANCH Units of Measurement for Capacity A bit can be used in a very limited way to represent numbers. Depending on whether the bit is turned on or off, it can represent one of two different values. In computer systems, a bit that is turned off represents the number 0 and a bit that is turned on represents the number 1. This corresponds perfectly to the binary numbering system. In the binary numbering system (or binary, as it is usually called) all numeric values are written as sequences of 0s and 1s. Computer deals with “on” and “off” (high-voltage and low-voltage) electrical states, which are represented in the hardware in terms of 0’s and 1’s called bits. Bits are combined in group of eight, called bytes, to hold the equivalent of a character. A character is a single letter, number or special system such as a punctuation mark or a dollar sign. Figure 22 Eight switches representing byte Data Storage Representation A computer’s memory is divided into tiny storage locations known as bytes. One byte is only enough memory to store a letter of the alphabet or a small number. In order to do anything meaningful, a computer has to have lots of bytes. Most computers today have millions, or even billions, of bytes of memory. To furthermore understand the concept of data representation, here’s the list of the data storage. Byte Bytes 1 Kilobyte (Kb) 1000 bytes / 1024 (210) bytes. 1 Megabyte (Mb) 1 million bytes 1 Gigabyte (Gb) 1 billion bytes 1 Terabyte (T or TB) 1 Trillion bytes 1 Petabyte (PB) 1 quadrillion bytes Table 4: Byte representation Number System and Conversion Any piece of data that is stored in a computer’s memory must be stored as a binary number. That includes characters, such as letters and punctuation marks. When a character is stored in memory, it is first converted to a numeric code. The numeric code is then stored in memory as a binary number. Republic of the Philippines POLYTECHNIC UNIVERSITY OF THE PHILIPPINES LOPEZ QUEZON, BRANCH Computer circuits can respond only to binary numbers. Therefore, all data and programs must be coded in binary form. Binary is similar to decimal number system except that the binary digit referred to as bit can only take values of 0 and 1. Meanwhile, the decimal number system can have ten values from 0 through 9. Remember: The base of the number system indicates the valid values for the particular number system. Another word for base is radix. On the other hand, binary digits – also known as ―bits -- are based on powers of 2, where every digit one moves to the left represents another power of 2: ones (20), twos (21), fours (102), eights (103), sixteens (104), etc. Thus, in binary, the number eighteen would be written in Base-2 as 10010, understood arithmetically as the sum of 1 sixteen, 0 eights, 0 fours, 1 two, and 0 ones: Number System Number system is very important in computing data, considering its value in determining whether the value is decimal, binary, octal and hexadecimal. Each number system is pre-determined by its base, base is the number represented to Figure 23. Bits binary representation identify its system. To understand more here’s the list of number system. Number System Base Decimal Number System Base 10 Binary Number System Base 2 Hexadecimal Number System Base 16 Octal Number System Base 8 Table 4: Number System Decimal Number System Decimal digits are based on powers of 10, where every digit one moves to the left represents another power of 10: ones (100), tens (101), hundreds (102), thousands (103), etc. Thus, the decimal number ―two hundred fifty-five‖ is written as ―255, conceiving of it arithmetically as the sum of 2 hundred, 5 tens, and 5 ones. Thus, to store this number, Decimal number system or base 10 system Valid values 0,1,2,3,4,5,6,7,8,9 Republic of the Philippines POLYTECHNIC UNIVERSITY OF THE PHILIPPINES LOPEZ QUEZON, BRANCH Exponential method will be used when converting a number from any base system to decimal system. Binary Number System The term bit stands for binary digit. Computer scientists usually think of bits as tiny switches that can be either on or off. Bits aren’t actual “switches,”. On the other hand, binary digits – also known as ―bits‖ -- are based on powers of 2. Likewise, the number ―two-hundred fifty-five‖ would be written in binary numerals as 11111111, conceived arithmetically as the sum of 1 one-hundred twenty-eight, 1 sixty-four, 1 thirty-two, 1 sixteen, 1 eight, 1 four, 1 two, and 1 one: Figure 24. Binary representation Showing the binary set of number 255 Figure 25. Decimal representation Hexadecimal Number System Hexadecimal numerals are integers written in base 16. The 16 digits used are ‘0’ through ‘9’ plus ‘a’ for the “digit 10”, ‘b’ for the “digit 11”, ‘c’ for the “digit 12”, ‘d’ for the “digit 13”, ‘e’ for the “digit 14”, and ‘f’ for the “digit 15”. For example, the hexadecimal numeral d is the same as base 10 numeral 13 and the hexadecimal numeral 1d is the same as the base 10 numeral 29. Dump is the process of printing the actual content of the memory. Expectedly, the output of a dump would include strings of binary digits. Through hexadecimal notation, a string of bits maybe represented in a shortened form. Base 16 system Valid values 0 thru 9, and letters A thru F Republic of the Philippines POLYTECHNIC UNIVERSITY OF THE PHILIPPINES LOPEZ QUEZON, BRANCH Decimal Hexadecimal Decimal Hexadecimal 0 0 8 8 1 1 9 9 2 2 10 A 3 3 11 B 4 4 12 C 5 5 13 D 6 6 14 E 7 7 15 F Table 5: Decimal to Hexadecimal Representation Octal Number System Any character in your machine is set by specifying its integer value in octal (base-8). Another shorthand notation. A string of 12 bits can be represented by 4 octal symbols. Valid values 0,1,2,3,4,5,6,7 2.1 Numeric Numeric data representation is any numbers used to convert, compute and represent data. The basic requirement to understand the numeric data is by determining the representation of sign, the magnitude, if it’s fractional, and its exponent. In this module you will learn the different representation of numeric data from signed, unsinged, fixed and floating numeric data. In most computer systems, bits are tiny electrical components that can hold either a positive or a negative charge. Computer scientists think of a positive charge as a switch in the on position, and a negative charge as a switch in the off position. See on Figure 23 2.1.1 Signed Binary Number Mathematical numbers are generally made up of a sign and a value (magnitude) in which the sign indicates whether the number is positive, (+) or negative, (–) with the value indicating the size of the number, for example 23, +156 or -274. Presenting numbers is this fashion is called “sign-magnitude” representation since the left most digit can be used to indicate the sign and the remaining digits the magnitude or value of the number. But how do we represent signed binary numbers if all we have is a bunch of one’s and zero’s? For signed binary numbers the most significant bit (MSB) is used as the sign bit. Republic of the Philippines POLYTECHNIC UNIVERSITY OF THE PHILIPPINES LOPEZ QUEZON, BRANCH If the sign bit is “0”, this means the number is positive in value. If the sign bit is “1”, then the number is negative in value. The remaining bits in the number are used to represent the magnitude of the binary number in the usual unsigned binary number format way. Then we can see that the Sign-and-Magnitude (SM) notation stores positive and negative values by dividing the “n” total bits into two parts: 1 bit for the sign and n–1 bit for the value which is a pure binary number. Signed Vs. Unsigned Unsigned can hold a larger positive value, and no negative value. Binary number is unsigned when all the bits can be used to represent the number. Unsigned uses the leading bit as a part of the value, while the signed version uses the left-most-bit to identify if the number is positive or negative. Signed integers can hold both positive and negative numbers. Sign-and-Magnitude (SM) notation For signed binary numbers the most significant bit (MSB) is used as the sign bit. If the sign bit is “0”, this means the number is positive in value. If the sign bit is “1”, then the number is negative in value. The remaining bits in the number are used to represent the magnitude of the binary number in the usual unsigned binary number format way. Figure 26. Positive and Negative Signed Binary Positive Signed Binary Negative Signed Binary Sample of Positive and Negative Signed Binary -12710 (8 bit) 8 bits binary Republic of the Philippines POLYTECHNIC UNIVERSITY OF THE PHILIPPINES LOPEZ QUEZON, BRANCH Binary form in positive: 011111112 (positive 12), in negative: 111111112 (negative 127). The signed bits were zero (0) which is positive to be able to make it negative we need to change the signed bit into one (1). +2310 (6 bit) 6 bits binary Binary form: 101112 (positive 23), in positive: 0101112 (positive 23). If the signed bits were zero (0) it is positive. One’s Complement of a Signed Binary Number: Negative Number Negative numbers however, are represented by taking the one’s complement (inversion, negation) of the unsigned positive number. Since positive numbers always start with a “0”, the complement will always start with a “1” to indicate a negative number. The one’s complement of a negative binary number is the complement of its positive counterpart. So, to take the one’s complement of a binary number, all we need to do is change each bit in turn. Thus, the one’s complement of “1” is “0” and vice versa, then the one’s complement of 100101002 is simply 011010112 as all the 1’s is changed to 0’s and the 0’s to 1’s. Sample of one’s compliment 0010012 (6 bit) Decimal form: +910 (positive 9) Binary form in negative: 1101102 (negative 9). The compliment zero (0) which indicate it’s positive, to be able to make it negative we need to start the complement of bit into one (1). 1111102 (6 bit) Decimal form: -6210 (negative 62). Binary form in positive: 0000012 (positive 62). The compliment bits were one (1) which is negative to be able to make it positive we need to change the compliment bit into zero (0’s). Republic of the Philippines POLYTECHNIC UNIVERSITY OF THE PHILIPPINES LOPEZ QUEZON, BRANCH Two’s Complement of a Signed Binary Number Two’s Complement or 2’s Complement as it is also termed, is another method like the previous sign-magnitude and one’s complement form, which we can use to represent negative binary numbers in a signed binary number system. In two’s complement, the positive numbers are exactly the same as before for unsigned binary numbers. A negative number, however, is represented by a binary number, which when added to its corresponding positive equivalent results in zero. Sample of two’s compliment 0010012 = 1101112 1111102 = 0000102 101110012 = 010001112 00112 = 11012 110011002 = 001101002 Subtraction of Negative Binary Numbers Subtraction of negative binary numbers is performed by adding the two’s compliment of the subtrahend to the minuend and change the sign to + What is the difference of 7 – 13? Addition: Solution: 13 = 1101 7 = 0111 1. Get the binary value of negative digit. 0010 → 1’s Compliment + 13 = 0011 + 1 2. Get the 1’s compliment of the binary digit 1010 0011 → 2’s Compliment 3. Get the 2’s compliment. Therefore, 7 – 13 = 1010 4. Perform addition to get the result. Sample of Subtraction of Negative Binary Numbers Addition: 5 = 0101 10 = 1010 1010 → 1’s Compliment + -5 = 1011 + 1 ______________ __________ 10101 1011 → 2’s Compliment Therefore, 10 + (-5) = 0101 Republic of the Philippines POLYTECHNIC UNIVERSITY OF THE PHILIPPINES LOPEZ QUEZON, BRANCH 2.1.2 Unsigned Binary Number Unsigned numbers don’t have any sign, these can contain only magnitude of the number. So, representation of unsigned binary numbers are all positive numbers only. For example, representation of positive decimal numbers is positive by default. We always assume that there is a positive sign symbol in front of every number. Representation of Unsigned Binary Numbers. Since there is no sign bit in this unsigned binary number, so N bit binary number represent its magnitude only. Zero (0) is also unsigned number. This representation has only one zero (0), which is always positive. Every number in unsigned number representation has only one unique binary equivalent form, so this is unambiguous representation technique. The range of unsigned binary number is from 0 to (2n-1). An unsigned binary integer is a fixed-point system with no fractional digits. Unsigned binary integers are modulo number systems, usually with a modulus which is a power of 2. Example-1: Represent decimal number 92 in unsigned binary number. Simply convert it into Binary number, it contains only magnitude of the given number. It’s 7-bit binary magnitude of the decimal number 92. = (92)10 = (1x26+0x25+1x24+1x23+1x22+0x21+0x20)10 = (1011100)2 Figure 27. Unsigned Binary Integer Ranges Republic of the Philippines POLYTECHNIC UNIVERSITY OF THE PHILIPPINES LOPEZ QUEZON, BRANCH 2.1.3 Fixed Numeric Data In real life, we deal with real numbers -- numbers with fractional part. Most modern computer have native (hardware) support for floating point numbers. However, the use of floating point is not necessarily the only way to represent fractional numbers. This article describes the fixed-point representation of real numbers. The use of fixed-point data type is used widely in digital signal processing (DSP) and game applications, where performance is sometimes more important than precision. As we will see later, fixed point arithmetic is much faster than floating point arithmetic. In computing, a fixed-point data or number is a representation of a real data type for a number that has fixed or exact number of digits after a radix point and decimal point. Fixed-point number representation can be compared to more complicated floating-pint number representation. Fixed numeric data are very useful for representing fractional values, it is usually in base two (2) or base ten (10). Fixed-point data types ensure the predictability of multiplication and division operations, making them the choice for storing monetary values. Firebird implements two fixed-point data types: NUMERIC and DECIMAL. According to the standard, both types limit the stored number to the declared scale (the number of digits after the decimal point). Fixed Point Number Representation The shifting process above is the key to understand fixed point number representation. To represent a real number in computers (or any hardware in general), we can define a fixed-point number type simply by implicitly fixing the binary point to be at some position of a numeral. We will then simply adhere to this implicit convention when we represent numbers. To define a fixed-point type conceptually, all we need are two parameters: width of the number representation, and binary point position within the number, we will use the notation fixed for the rest of this article, where w denotes the number of bits used as a whole (the Width of a number), and b denotes the position of binary point counting from the least significant bit (counting from 0). For example, fixed denotes an 8-bit fixed point number, of which 3 right most bits are fractional. Therefore, the bit pattern: 0 0 0 1 0 1 1 0 represents a real number: 00010.1102 = 1 * 21 + 1 * 2-1 + 1 * 2-1 = 2 + 0.5 + 0.25 Republic of the Philippines POLYTECHNIC UNIVERSITY OF THE PHILIPPINES LOPEZ QUEZON, BRANCH = 2.75 Note that on a computer, a bit patter can represent anything. Therefore, the same bit pattern, if we "cast" it to another type, such as a fixed type, will represents the number: 000.101102 = 1 * 2-1 + 1 * 2-3 + 1 * 2-4 = 0.5 + 0.125 + 0.0625 = 0.6875 If we treat this bit patter as integer, it represents the number: 101102 = 1 * 24 + 1 * 22 + 1 * 21 = 16 + 4 + 2 = 22 Negative Numbers So far, we talked about positive numbers, but we do want to represent negative numbers, don't we? How do we represent fixed point negative numbers then? In computer, we use 2's complement to represent negative numbers. One of the properties of 2's complement numbers is that arithmetic operations of either positive of negative numbers are identical. It includes, addition, subtraction, and not surprisingly, shifting. We can divide negative 2's complement numbers by 2 via a simple 1-bit right shift with sign extension as we can do so with positive numbers. Recall in the beginning of this article we discuss how fixed-point numbers are simply a shifted version of an integer (by setting binary point to a non-zero position). Combining with the observation that shift operation applies to 2's complement negative number as well as positive numbers, we can easily see how we can represent negative number in fixed point: Use 2's complement. Fixed point is a simple yet very powerful way to represent fractional numbers in computer. By reusing all integer arithmetic circuits of a computer, fixed point arithmetic is orders of magnitude faster than floating point arithmetic. This is the reason why it is being used in many game and DSP applications. On the other hand, it lacks the range and precision that floating-point number representation offers. You, as a programmer or circuit designer, must do the tradeoff. Republic of the Philippines POLYTECHNIC UNIVERSITY OF THE PHILIPPINES LOPEZ QUEZON, BRANCH 2.1.4 Floating Numeric Data A floating-point value is represented either as whole plus fractional digits i.e. decimal values or as mantissa plus an exponent. There are two floating point data types, first is float (4- byte) and the other one is float (8-byte). Floating point numbers are stored in four or eight bytes. Internally, an eight-byte numbers are rounded to fifteen decimal digits. The precision of four- byte numbers is processor dependent. 1. To convert the floating point into decimal, we have 3 elements in a 32-bit floating point representation: i) Sign ii) Exponent iii) Mantissa Sign bit is the first bit of the binary representation. '1' implies negative number and '0' implies positive number. Example: 11000001110100000000000000000000 This is negative number. Exponent is decided by the next 8 bits of binary representation. 127 is the unique number for 32-bit floating-point representation. It is known as bias. It is determined by 2k-1 -1 where 'k' is the number of bits in exponent field. There are 3 exponent bits in 8-bit representation and 8 exponent bits in 32-bit representation. Thus bias = 3 for 8-bit conversion (23-1 -1 = 4-1 = 3) bias = 127 for 32-bit conversion. (28-1 -1 = 128-1 = 127) Example: 01000001110100000000000000000000 10000011 = (131)10 131-127 = 4 Mantissa is calculated from the remaining 23 bits of the binary representation. It consists of '1' and a fractional part which is determined by: Example: 01000001110100000000000000000000 The fractional part of mantissa is given by: 1*(1/2) + 0*(1/4) + 1*(1/8) + 0*(1/16) +…= 0.625. The mantissa will be 1 + 0.625 = 1.625. The decimal number hence given as: Sign*Exponent*Mantissa = (-1) *(16) *(1.625) = -26 2. To convert the decimal into floating point, we have 3 elements in a 32-bit floating point representation: i) Sign (MSB) Republic of the Philippines POLYTECHNIC UNIVERSITY OF THE PHILIPPINES LOPEZ QUEZON, BRANCH ii) Exponent (8 bits after MSB) iii) Mantissa (Remaining 23 bits) Sign bit is the first bit of the binary representation. '1' implies negative number and '0' implies positive number. Example: To convert -17 into 32-bit floating point representation Sign bit = 1 Exponent is decided by the nearest smaller or equal to 2n number. For 17, 16 is the nearest 2n. Hence the exponent of 2 will be 4 since 24 = 16. 127 is the unique number for 32-bit floating-point representation. It is known as bias. It is determined by 2k-1 -1 where 'k' is the number of bits in exponent field. Thus bias = 127 for 32 bits. (28-1 -1 = 128-1 = 127) Now, 127 + 4 = 131 i.e. 10000011 in binary representation. Mantissa: 17 in binary = 10001. Move the binary point so that there is only one bit from the left. Adjust the exponent of 2 so that the value does not change. This is normalizing the number. 1.0001 x 24. Now, consider the fractional part and represented as 23 bits by adding zeros. 00010000000000000000000 Thus, the floating-point representation of -17 is 1 10000011 00010000000000000000000 2.2 Non-Numeric Data Numeric data refers to numbers wherein some sort of arithmetic operations can be performed. Say for example, a column is called count of people in family - this is a numeric column as it will have values for the number of people in the household, say 3 or 4 or 5, etc. A non- numeric data refers to a categorical data or varchar data. Example, the rating for a product. This column could have values say - best, good, average, poor, troll. The column having these values is called non - numeric data. On the other hand, non-numerical data, also called categorical, qualitative or Yes/No data, is data that can be observed, not measured. A quantitative variable is naturally measured as a number for which meaningful arithmetic operations make sense. The non-numeric data comprises text or string data types, the Date data types, the Boolean data types that store only two values (true or false). Republic of the Philippines POLYTECHNIC UNIVERSITY OF THE PHILIPPINES LOPEZ QUEZON, BRANCH Non-numeric data types are data that cannot be manipulated mathematically using standard arithmetic operators. The non-numeric data comprises text or string data types, the Date data types, the Boolean data types that store only two values (true or false), Object data type and Variant data type. Non-numerical data is data which is observed, not measured. Non-numerical data deals with descriptions like the smell of a cookie, the feel of bed linens and the type of brush strokes on a painting. 2.2.1 Character Basically, any character that is a number or letter (in upper or lower case) is alphanumeric. Punctuation characters like (@ # & () – [ {}]; ‘? /) and Symbol characters: such as (` ~ $ ^ + = < > “). A character may refer to any of the following: 1. Sometimes abbreviated as char, a character is a single visual object used to represent text, numbers, or symbols. For example, the letter "A" is a single character. With a computer, one character is equal to one byte, which is 8 bits. ASCII - American Standard Code for Information Interchange Over the years, different coding schemes have been developed to represent characters in computer memory. Historically, the most important of these coding schemes is ASCII, which stands for the American Standard Code for Information Interchange. ASCII is a set of 128 numeric codes that represent the English letters, various punctuation marks, and other characters. For example, the ASCII code for the uppercase letter A is 65. When you type an uppercase A on your computer keyboard, the number 65 is stored in memory (as a binary number, of course). The digital devices employ several types of codes to represent character data, including ASCII, Unicode, and their variants. Figure 28 ASCII representation showing the binary set of letters, A a character encoding standard for electronic communication. ASCII codes represent text in computers, telecommunications equipment, and other devices. Republic of the Philippines POLYTECHNIC UNIVERSITY OF THE PHILIPPINES LOPEZ QUEZON, BRANCH Originally based on the English alphabet, ASCII encodes 128 specified characters into seven-bit integers. Ninety-five of the encoded characters are printable: these include the digits 0 to 9, lowercase letters a to z, uppercase letters A to Z, and punctuation symbols. Table 6: ASCII Binary Character Table – Upper Case ASCII Binary ASCII Binary ASCII Binary Letter Letter Letter Code Code Code Code Code Code A 65 01000001 J 74 01001010 S 83 01010011 B 66 01000010 K 75 01001011 T 84 01010100 C 67 01000011 L 76 01001100 U 85 01010101 D 68 01000100 M 77 01001101 V 86 01010110 E 69 01000101 N 78 01001101 W 87 01010111 F 70 01000110 O 79 01001101 X 88 01011000 G 71 01000111 P 80 01010000 Y 89 01011001 H 72 01001000 Q 81 01010001 Z 90 01011010 I 73 01001001 R 82 01010010 SPACE 32 Table 7: ASCII Binary Character Table – Lower Case ASCII Binary ASCII Binary ASCII Binary Letter Letter Letter Code Code Code Code Code Code a 97 01100001 j 106 01101010 s 115 01110011 b 98 01100010 k 107 01101011 t 116 01110100 c 99 01100011 l 108 01101100 u 117 01110101 d 100 01100100 m 109 01101101 v 118 01110110 e 101 01100101 n 110 01101101 w 119 01110111 f 102 01100110 o 111 01101101 x 120 01111000 g 103 01100111 p 112 01110000 y 121 01111001 h 104 01101000 q 113 01110001 z 122 01111010 i 105 01101001 r 114 01110010 Space 32 EBCDIC - Extended Binary Coded Decimal Interchange Code Extended Binary Coded Decimal Interchange Code is an eight-bit character encoding used mainly on IBM mainframe and IBM midrange computer operating systems. It descended from the code used with punched cards and the corresponding six-bit binary-coded decimal code used with most of IBM's computer peripherals of the late 1950s and early 1960s. It is supported Republic of the Philippines POLYTECHNIC UNIVERSITY OF THE PHILIPPINES LOPEZ QUEZON, BRANCH by various non-IBM platforms, such as Fujitsu-Siemens' BS2000/OSD, OS-IV, MSP, and MSP- EX, the SDS Sigma series. an eight-bit character encoding used mainly on IBM mainframe and IBM midrange computer operating systems. It is the code for text files that is used in IBM's OS/390 operating system for its S/390 servers and that thousands of corporations use for their legacy applications and databases. In an EBCDIC file, each alphabetic or numeric character is represented with an 8-bit binary number (a string of eight 0's or 1's). 256 possible characters (letters of the alphabet, numerals, and special characters) are defined. Table 8: EBCDIC character coding 8 9 A B C D E F 1 a j A J 1 2 b k s B K S 2 3 c l t C L T 3 4 d m u D M U 4 5 e n v E N V 5 6 f o w F O W 6 7 g p x G P X 7 8 h q y H Q Y 8 9 i r z I R Z 9 Difference between ASCII and EBCDIC EBCDIC uses 8 bits while ASCII uses 7 before it was extended EBCDIC can accommodate up to 28 characters for a total of 256 while the 27 of ASCII has a maximum of 128 characters. ASCII uses a linear ordering of letters while EBCDIC does not Different versions of ASCII are mostly compatible while different versions of EBCDIC are not EBCDIC isn’t compatible with modern encodings while ASCII is Republic of the Philippines POLYTECHNIC UNIVERSITY OF THE PHILIPPINES LOPEZ QUEZON, BRANCH Multimedia Multimedia means that computer information can be represented through audio, video, and animation in addition to traditional media (i.e., text, graphics drawings, images). Multimedia is the field concerned with the computer-controlled integration of text, graphics, drawings, still and moving images (Video), animation, audio, and any other media where every type of information can be represented, stored, transmitted and processed digitally. A Multimedia Application is an Application which uses a collection of multiple media sources e.g. text, graphics, images, sound/audio, animation and/or video. Hypermedia can be considered as one of the multimedia applications. 2.2.2 Image An image is a picture that has been created or copied and stored in electronic form. An image can be described in terms of vector graphics or raster graphics. An image stored in raster form is sometimes called a bitmap. The GIF uses the 2D raster data type and is encoded in binary. Image is special type of storing data through non-numeric data. An image is a visual representation of something. An image is a picture that has been created or copied and stored in electronic form. An image can be described in terms of vector graphics. There are numerous image file types out there so it can be hard to know which file type best suits your image needs. Some image types such a TIFF is great for printing while others, like JPG or PNG, are best for web graphics. The list below outlines some of the more common file types and provides a brief description, how the file is best used, and any special attributes the file may have. 1. TIFF (.tif,.tiff) TIFF or Tagged Image File Format are lossless images files meaning that they do not need to compress or lose any image quality or information (although there are options for compression), allowing for very high-quality images but also larger file sizes. Compression: Lossless - no compression. Very high-quality images. Best For: High quality prints, professional publications, archival copies Special Attributes: Can save transparencies 2. Bitmap (.bmp) Republic of the Philippines POLYTECHNIC UNIVERSITY OF THE PHILIPPINES LOPEZ QUEZON, BRANCH BMP or Bitmap Image File is a format developed by Microsoft for Windows. There is no compression or information loss with BMP files which allow images to have very high quality, but also very large file sizes. Due to BMP being a proprietary format, it is generally recommended to use TIFF files. Compression: None Best For: High quality scans, archival copies 3. JPEG (.jpg,.jpeg) JPEG, which stands for Joint Photographic Experts Groups is a “lossy” format meaning that the image is compressed to make a smaller file. The compression does create a loss in quality but this loss is generally not noticeable. JPEG files are very common on the Internet and JPEG is a popular format for digital cameras - making it ideal for web use. Compression: Lossy - some file information is compressed or lost Best For: Web Images, Non-Professional Printing, E-Mail, PowerPoint Special Attributes: Can choose amount of compression when saving in image editing programs like Adobe Photoshop or GIMP. 4. GIF (.gif) GIF or Graphics Interchange Format files are widely used for web graphics, because they are limited to only 256 colors, can allow for transparency, and can be animated. GIF files are typically small is size and are very portable. Compression: Lossless - compression without loss of quality Best For: Web Images Special Attributes: Can be Animated, Can Save Transparency 5. PNG (.png) PNG or Portable Network Graphics files are a lossless image format originally designed to improve upon and replace the gif format. PNG files are able to handle up to 16 million colors, unlike the 256 colors supported by GIF. Compression: Lossless - compression without loss of quality Best For: Web Images Special Attributes: Save Transparency 6. EPS (.eps) Republic of the Philippines POLYTECHNIC UNIVERSITY OF THE PHILIPPINES LOPEZ QUEZON, BRANCH An EPS or Encapsulated PostScript file is a common vector file type. EPS files can be opened in many illustration applications such as Adobe Illustrator or CorelDRAW. Compression: None - uses vector information Best For: Vector artwork, illustrations Special Attributes: Saves vector information 7. RAW Image Files (. raw,.cr2,.nef,.orf,.sr2, and more) RAW images are images that are unprocessed that have been created by a camera or scanner. Many digital SLR cameras can shoot in RAW, whether it be a. raw,.cr2, or.nef. These RAW images are the equivalent of a digital negative, meaning that they hold a lot of image information, but still need to be processed in an editor such as Adobe Photoshop or Lightroom. Compression: None Best For: Photography Special Attributes: Saves metadata, unprocessed, lots of information 2.2.3 Sound Audio is a term used to describe any sound or noise that is within a range the human ear is capable of hearing. Measured in hertz, the audio signal on a computer is generated using a sound card and is heard through speakers or headphones. Any digital information with speech or music that can be stored on and played through a computer is known as an audio file or sound file. One of the most common types of audio file formats used today is the MP3. Clicking the triangular button on the following embedded player will play a short MP3 file in your browser. Here’s the list of audio or sound format. 1. M4A Audio File Type The M4A is a mpeg-4 audio file. It is an audio-compressed file used in the modern setting due to increased quality demand as a result of cloud storage and bigger hard drive space in contemporary computers. Its high quality keeps it relevant, as users who need to hear distinct sounds on audio files will need this over more common file types. Republic of the Philippines POLYTECHNIC UNIVERSITY OF THE PHILIPPINES LOPEZ QUEZON, BRANCH 2. FLAC The FLAC audio file is Free Lossless Audio Codec. It is an audio file compressed into a smaller size of the original file. It’s a sophisticated file type that is lesser-used among audio formats. This is because, even though it has its advantages, it often needs special downloads to function. When you consider that audio files are shared often, this can make for quite an inconvenience to each new user who receives one. 3. MP3 The MP3 audio file is an MPEG audio layer 3 file format. The key feature of MP3 files is the compression that saves valuable space while maintaining near-flawless quality of the original source of sound. This compression makes the MP3 very popular for all mobile audio-playing devices, particularly the Apple iPod. 4. MP4 An MP4 audio file is often mistaken as an improved version of the MP3 file. However, this couldn’t be further from the truth. The two are completely different and the similarities come from their namesake rather than their functionality. Also note that the MP4 is sometimes referred to as a video file instead of an audio file. This isn’t an error, as in fact it’s both an audio and video file. 5. WAV A WAV audio file is a Waveform Audio File that stores waveform data. The waveform data stored presents an image that demonstrates strength of volume and sound in specific parts of the WAV file. It is entirely possible to transform a WAV file using compression, though it’s not standard. Also, the WAV is typically used on Windows systems. 6. WMA The WMA (Windows Media Audio) is a Windows-based alternative to the more common and popular MP3 file type. What makes so beneficial is its lossless compression, retaining high audio quality throughout all types of restructuring processes. Even though it’s such a quality audio format, it’s not the most popular due to the fact it’s inaccessible to many users, especially those who don’t use the Windows operating system. 7. AAC The AAC (Advanced Audio Coding) is an audio file that delivers decently high-quality sound and is enhanced using advanced coding. It has never been one of the most popular audio formats, especially when it comes to music files, but the AAC does still serve some purpose for major systems. This includes popular mobile devices and video gaming units, where the AAC is a standard audio component. Republic of the Philippines POLYTECHNIC UNIVERSITY OF THE PHILIPPINES LOPEZ QUEZON, BRANCH 2.2.4 Video Visual multimedia source that combines a sequence of images to form a moving picture. The video transmits a signal to a screen and processes the order in which the screen captures should be shown. Videos usually have audio components that correspond with the pictures being shown on the screen. 1. H.264 - Probably the most common, particularly for HD, is H.264. It’s one of the more efficient codecs, allowing smaller file sizes while retaining high quality as well as offering options for either lossless or lossy compression. It’s compatible with the.MP4 container and can be played on many different players and streaming services. 2. MPEG-4 - Another very common codec for online streaming is the MPEG-4 codec. Newer standards within MPEG-4 (specifically MPEG-4 Part 10) are identical to H.264, while the older MPEG-4 Part 2 is somewhat different. MPEG-4 has a very wide range of compatibility. 3. DivX - DivX, along with the open source version XviD, is a somewhat older codec that is designed to maximize video quality at the expense of having significantly larger file sizes. It’s commonly used in a variety of commercial settings where there is less concern over file size. 4. MPEG-2 - A predecessor to MPEG-4, MPEG-2 was the standard codec for use on DVDs and early Blu-ray discs. It’s not commonly used for streaming video. Professional camera codecs which use MPEG-2 are HDV and XDCAM. 5. HEVC (H.265) - New video codecs are constantly evolving to keep up with modern technology. HEVC, also called H.265, is one such codec designed to offer more efficient compression for 4K video and Blu-ray. It’s the video compression standard widely used by GoPro to capture their level of video content at half the size. 6. MP4 - The.MP4 container is probably the closest thing to a universal standard that currently exists. It can use all versions of MPEG-4 and H.264 and is compatible with a huge range of players. Videos using the.MP4 container can have relatively small file sizes while retaining high quality. Many of the largest streaming services, including YouTube and Vimeo, prefer.MP4. 7. AVI - One of the oldest and most universally accepted video file formats is.AVI. It can use an enormous range of codecs, resulting in a large variety of different file settings. While.AVI videos can be played on a wide range of players, file sizes tend to be large making it less ideal for streaming or downloading. It’s a great option for videos you plan to store on a computer. 8. MOV (QuickTime) - Apple developed the.MOV container to use with its QuickTime player. Videos using.MOV generally have very high quality but also fairly large file sizes. QuickTime videos don’t have as much compatibility with non-QuickTime players, though there are third Republic of the Philippines POLYTECHNIC UNIVERSITY OF THE PHILIPPINES LOPEZ QUEZON, BRANCH party players that will read them. 9. FLV (Flash) - Made for Adobe’s Flash player,.FLV videos were extremely common for a number of years thanks to their very small file size and a wide range of browser plugins and third-party Flash video players. There has been a significant decline in Flash videos recently. 10. WMV (Windows Media) - Windows Media videos tend to have the smallest file size, which makes them a good option if you need to send through email or other methods with file size limits. However, this comes with the tradeoff of having a significant drop in quality. A common use for.WMV is emailing video previews to clients. Republic of the Philippines POLYTECHNIC UNIVERSITY OF THE PHILIPPINES LOPEZ QUEZON, BRANCH References 1. https://www.reference.com/world-view/data-representation-7c6029904c5fcee0 2. Introduction to Computers and Programming 1 3. Problem Solving with C++ TENTH EDITION Walter Savitch: Global edition 4. Introduction to Computing Chapter 1 5. https://www.tutorialspoint.com/unsigned-and-signed-binary-numbers 6. http://www.cs.uwm.edu/classes/cs315/Bacon/Lecture/HTML/ch04s10.html 7. http://www-inst.eecs.berkeley.edu/~cs61c/sp06/handout/fixedpt.html 8. https://www.geeksforgeeks.org/introduction-of-floating-point-representation/ 9. https://users.cs.cf.ac.uk/Dave.Marshall/Multimedia/node10.html 10. https://whatis.techtarget.com/definition/image 11. https://www.computerhope.com/jargon/a/audio.htm

Use Quizgecko on...
Browser
Browser