MIS 2103 Computer Hardware and System Software Lecture 3 PDF

Document Details

FreedRegionalism5994

Uploaded by FreedRegionalism5994

2024

Tags

computer hardware computer software data representation computer science

Summary

These lecture notes cover computer hardware and system software for a course called MIS 2103. They contain information about fractions, data formats, and character representations in computer systems. The notes were presented in Fall 2024.

Full Transcript

MIS 2103 Computer Hardware and System Software Fall 2024 Lecture #3 Fractions § Number point or radix point § Decimal point in base 10 § Binary point in base 2 § No exact relationship between fractional numbers in different number bases § Exact conversion may be impossibl...

MIS 2103 Computer Hardware and System Software Fall 2024 Lecture #3 Fractions § Number point or radix point § Decimal point in base 10 § Binary point in base 2 § No exact relationship between fractional numbers in different number bases § Exact conversion may be impossible 2-2 Decimal Fractions § Move the number point one place to the right § Effect: multiplies the number by the base number § Example: 139.010 139010 § Move the number point one place to the left § Effect: divides the number by the base number § Example: 139.010 13.910 2-3 Fractions: Base 10 and Base 2.258910 Place 10-1 10-2 10-3 10-4 Value 1/10 1/100 1/1000 1/10000 Evaluate 2 x 1/10 5 x 1/100 8 x 1/1000 9 x1/1000 Sum.2.05.008.0009.1010112 = 0.67187510 Place 2-1 2-2 2-3 2-4 2-5 2-6 Value 1/2 1/4 1/8 1/16 1/32 1/64 Evaluate 1 x 1/2 0 x 1/4 1x 1/8 0 x 1/16 1 x 1/32 1 x 1/64 Sum.5 0.125 0.03125 0.015625 2-4 Fractions: Base 10 and Base 2 § No general relationship between fractions of types 1/10k and 1/2k § Therefore a number representable in base 10 may not be representable in base 2 § But: the converse is true: all fractions of the form 1/2k can be represented in base 10 § Fractional conversions from one base to another are stopped § If there is a rational solution or § When the desired accuracy is attained 2-5 Mixed Number Conversion § Integer and fraction parts must be converted separately § Radix point: fixed reference for the conversion § B0 is always 1 regardless of the base 2-6 Data Formats § Computers § Process and store all forms of data in binary format § Human communication § Includes language, images and sounds § Data formats: § Specifications for converting data into computer- usable form § Define the different ways human data may be represented, stored and processed by a computer 3-7 Sources of Data § Binary input § Begins as discrete input § Example: keyboard input such as A 1+2=3 math § Keyboard generates a binary number code for each key § Analog § Continuous data such as sound or images § Requires hardware to convert data into binary numbers Computer A 1+2=3 math Input device 1101000101010101… 3-8 Common Data Representations Type of Data Standard(s) Alphanumeric Unicode, ASCII, EBCDIC Image (bitmapped) §GIF (graphical image format) §TIF (tagged image file format) §PNG (portable network graphics) Image (object) PostScript, JPEG, SWF (Macromedia Flash), SVG Outline graphics and fonts PostScript, TrueType Sound WAV, AVI, MP3, MIDI, WMA Page description PDF (Adobe Portable Document Format), HTML, XML Video Quicktime, MPEG-2, RealVideo, WMV 3-9 Data Types: Numeric § Used for mathematical manipulation § Add, subtract, multiply, divide § Types § Integer (whole number) § Real (contains a decimal point) 3-10 Data Types: Alphanumeric § Alphanumeric: § Characters: b T § Number digits: 7 9 § Punctuation marks: ! ; § Special-purpose characters: $ & § Numeric characters vs. numbers § Both entered as ordinary characters § Computer converts into numbers for calculation p Examples: Variables declared as numbers by the programmer (Salary$ in BASIC) § Treated as characters if processed as text p Examples: Phone numbers, ZIP codes 3-11 Alphanumeric Codes § Arbitrary choice of bits to represent characters § Consistency: input and output device must recognize same code § Value of binary number representing character corresponds to placement in the alphabet p Facilitates sorting and searching 3-12 Representing Characters § ASCII - most widely used coding scheme § EBCDIC: IBM mainframe (legacy) § Unicode: developed for worldwide use 3-13 ASCII § Developed by ANSI (American National Standards Institute) § Represents § Latin alphabet, Arabic numerals, standard punctuation characters § Plus small set of accents and other European special characters § ASCII § 7-bit code: 128 characters 3-14 ASCII Reference Table MSD LSD 0 1 2 3 4 5 6 7 0 NUL DLE SP 0 @ P p 1 SOH DC1 ! 1 A Q a W 2 STX DC2 “ 2 B R b r 3 ETX DC3 # 3 C S c s 4 EOT DC4 $ 4 D T d t 5 ENQ NAK % 5 E U e u 7416 6 ACJ SYN & 6 F V f v 111 0100 7 BEL ETB ‘ 7 G W g w 8 BS CAN ( 8 H X h x 9 HT EM ) 9 I Y i y A LF SUB * : J Z j z B VT ESC + ; K [ k { C FF FS , < L \ l | D CR GS - = M ] m } E SO RS. > N ^ n ~ F SI US / ? O _ o DEL 3-15 EBCDIC § Extended Binary Coded Decimal Interchange Code developed by IBM § Restricted mainly to IBM or IBM compatible mainframes § Conversion software to/from ASCII available § Common in archival data § Character codes differ from ASCII ASCII EBCDIC Space 2016 4016 A 4116 C116 b 6216 8216 3-16 Unicode § Most common 16-bit form represents 65,536 characters § ASCII Latin-I subset of Unicode § Values 0 to 255 in Unicode table § Multilingual: defines codes for § Nearly every character-based alphabet § Large set of ideographs for Chinese, Japanese and Korean § Allows software modifications for local- languages 3-17 2 Classes of Codes § Printing characters § Produced on the screen or printer § Control characters § Control position of output on screen or printer p VT: vertical tab p LF: Line feed § Cause action to occur p DEL: delete current character 3-18 Control Code Definitions 3-19 Keyboard Input § Scan code § Two different scan codes on keyboard p One generated when key is struck (press) and another when key is released § Converted to Unicode, ASCII or EBCDIC by software in terminal or PC § Advantage § Easily adapted to different languages or keyboard layout § Separate scan codes for key press/release for multiple key combinations p Examples: shift and control keys 3-20 Next Week § Data Formats § Representing integer and float numbers Thank you for your participation J

Use Quizgecko on...
Browser
Browser