Inside The Box 1 Computing Devices Old and

Inside “The Box” 1

Computing Devices – Old and New “The Box” CRT Display CD-ROM Drive Floppy Disk Drive Keyboard Mouse 2

Motherboard 3

CPU (Central Processing Unit) 4

SIMM (Single Inline Memory Module) 5

HDD (Hard Disk Drive) 6

Power Supply 7

Schematic Diagram of a Personal Computer. . . 8

Schematic Diagram of a Personal Computer. . . bus Printer Mouse Ports Keyboard Modem CPU RAM Disk controller Graphics card Monitor Sound card Speakers Network card Computer

Data Formats Textbook: Chapter 4 10

Data input Figure 3. 1 Data conversion and representation 11

Introduction • Examples (discreet, continuous) Computer Real World Data Input device Data Dear Mom: Keyboard 10110010… Digital camera 10110010… 12

Format must be Appropriate • The internal representation must be appropriate for the type of processing to take place (e. g. , text, images, sound) • Problem: Since computers store everything in binary code, how does it know what a particular stored item is? 13

Rules/Conventions • Proprietary formats – Unique to a product or company – E. g. , Microsoft Word, Corel Word Perfect, IBM Lotus Notes • Standards – Evolve two ways: • Proprietary formats become de facto standards (e. g. , Adobe Post. Script, Apple Quick Time) • Committee is struck to solve a problem (Motion Pictures Experts Group, MPEG) Text : pg 63 -64 14

Standards Organizations • ISO – International Standards Organization • CSA – Canadian Standards Association • ANSI – American National Standards Institute • IEEE – Institute for Electrical and Electronics Engineers Rv. kc 15

Examples of Standards Type of Data Standards Alphanumeric ASCII, EBCDIC, Unicode Image JPEG, GIF, PCX, TIFF Motion picture MPEG-2, Quick Time, MP 4 Sound Blaster, WAV, AU, MP 3 Post. Script, True. Type, PDF Outline graphics/fonts Hint - Learn What kind is which! 16

Why Standards? • Standards are “arbitrary” • They exist because they are: – Convenient – Efficient – Flexible – Appropriate Plus, they provide some consistency and predictability for applications. Rv. kc 17

Alphanumeric Data • Problem: Distinguishing between the number 123 (one hundred twenty-three) and the characters “ 123” (one, two, three) • In software: data is given a type • Four Main standards for representing letters (alpha) and numbers – BCD – Binary-coded decimal – ASCII – American standard code for information interchange – EBCDIC – Extended binary-coded decimal interchange code – Unicode 18

Standard Alphanumeric Formats • • BCD (Binary Coded Decimal) ASCII EBCDIC Unicode 19

Standard Alphanumeric Formats • • BCD ASCII EBCDIC Unicode Next slides 20

The Problem • Representing text strings, such as “Hello, world”, in a computer After all, computers store binary digits, not letters! 21

Codes and Characters • Each character is coded as a byte • Most common coding system is ASCII (Pronounced ass-key) • ASCII = American National Standard Code for Information Interchange • Defined in ANSI document X 3. 4 -1977 22

ASCII Features • 7 -bit code • 8 th bit is unused (or used for a parity bit or to indicate “extended” character set) • 27 = 128 codes • Two general types of codes: – 95 are “Graphic” codes (displayable on a console) – 33 are “Control” codes (control features of the console or communications channel) R/kc 23

Hint Memorize codes for: blank space, period, digit zero (0), capital A, small a, carriage return (CR) +/Kc 24

ASCII chart 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 NULL SOH STX EDT ENQ ACK BEL BS HT LF VT FF CR SO SI 1 DLE DC 1 DC 2 DC 3 DC 4 NAK SYN ETB CAN EM SUB ESC FS GS RS US 2 ! " # $ % & ' ( ) * + , . / 3 0 1 2 3 4 5 6 7 8 9 : ; < = > ? 4 @ A B C D E F G H I J K L M N O 5 P Q R S T U V W X Y Z [ ] ^ _ 7 p q r s t u v w x y z { | } ~ DEL 6 ` a b c d e f g h i j k l m n o 25

Example: character ‘a’ 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 NULL SOH STX EDT ENQ ACK BEL BS HT LF VT FF CR SO SI 1 DLE DC 1 DC 2 DC 3 DC 4 NAK SYN ETB CAN EM SUB ESC FS GS RS US 2 ! " # $ % & ' ( ) * + , . / 3 0 1 2 3 4 5 6 7 8 9 : ; < = > ? 4 @ A B C D E F G H I J K L M N O 5 P Q R S T U V W X Y Z [ ] ^ _ 7 p q r s t u v w x y z { | } ~ DEL 6 ` a b c d e f g h i j k l m n o e. g. , ‘a’ = 1100001 26

Code types: 95 graphic codes 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 NULL SOH STX EDT ENQ ACK BEL BS HT LF VT FF CR SO SI 1 DLE DC 1 DC 2 DC 3 DC 4 NAK SYN ETB CAN EM SUB ESC FS GS RS US 2 ! " # $ % & ' ( ) * + , . / 3 0 1 2 3 4 5 6 7 8 9 : ; < = > ? 4 @ A B C D E F G H I J K L M N O 5 P Q R S T U V W X Y Z [ ] ^ _ 7 p q r s t u v w x y z { | } ~ DEL 6 ` a b c d e f g h i j k l m n o 27

Code types: 33 control codes 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 NULL SOH STX EDT ENQ ACK BEL BS HT LF VT FF CR SO SI 1 DLE DC 1 DC 2 DC 3 DC 4 NAK SYN ETB CAN EM SUB ESC FS GS RS US 2 ! " # $ % & ' ( ) * + , . / 3 0 1 2 3 4 5 6 7 8 9 : ; < = > ? 4 @ A B C D E F G H I J K L M N O 5 P Q R S T U V W X Y Z [ ] ^ _ 7 p q r s t u v w x y z { | } ~ DEL 6 ` a b c d e f g h i j k l m n o See text page 69 / 71 for details 28

Code types: alphabetic codes 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 NULL SOH STX EDT ENQ ACK BEL BS HT LF VT FF CR SO SI 1 DLE DC 1 DC 2 DC 3 DC 4 NAK SYN ETB CAN EM SUB ESC FS GS RS US 2 ! " # $ % & ' ( ) * + , . / 3 0 1 2 3 4 5 6 7 8 9 : ; < = > ? 4 @ A B C D E F G H I J K L M N O 5 P Q R S T U V W X Y Z [ ] ^ _ 7 p q r s t u v w x y z { | } ~ DEL 6 ` a b c d e f g h i j k l m n o 29

Code types: numeric codes 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 NULL SOH STX EDT ENQ ACK BEL BS HT LF VT FF CR SO SI 1 DLE DC 1 DC 2 DC 3 DC 4 NAK SYN ETB CAN EM SUB ESC FS GS RS US 2 ! " # $ % & ' ( ) * + , . / 3 0 1 2 3 4 5 6 7 8 9 : ; < = > ? 4 @ A B C D E F G H I J K L M N O 5 P Q R S T U V W X Y Z [ ] ^ _ 7 p q r s t u v w x y z { | } ~ DEL 6 ` a b c d e f g h i j k l m n o 30

Code types: punctuation codes, etc 3. 4 1 2 5 6 0 0 1 2 3 4 5 6 7 8 9 A B C D E F NULL SOH STX EDT ENQ ACK BEL BS HT LF VT FF CR SO SI DLE DC 1 DC 2 DC 3 DC 4 NAK SYN ETB CAN EM SUB ESC FS GS RS US ! " # $ % & ' ( ) * + , . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ ] ^ _ ` a b c d e f g h i j k l m n o 31 7 p q r s t u v w x y z { | } ~ DEL

“Hello, world” Example H e l l o , w o r l d Hexadecimal 48 = 65 = 6 C = 6 F = 2 C = 20 = 77 = 67 = 72 = 6 C = 64 = = = = Decimal 72 101 108 111 44 32 119 103 114 108 100 32

Common Control Codes • • • CR LF HT DEL NULL 0 A 09 7 F 00 0 D carriage return line feed horizontal tab delete null Hexadecimal code 33

Common control codes in the table 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 NULL SOH STX EDT ENQ ACK BEL BS HT LF VT FF CR SO SI 1 DLE DC 1 DC 2 DC 3 DC 4 NAK SYN ETB CAN EM SUB ESC FS GS RS US 2 ! " # $ % & ' ( ) * + , . / 3 0 1 2 3 4 5 6 7 8 9 : ; < = > ? 4 @ A B C D E F G H I J K L M N O 5 P Q R S T U V W X Y Z [ ] ^ _ 7 p q r s t u v w x y z { | } ~ DEL 6 ` a b c d e f g h i j k l m n o 34
![Terminology • Names of special symbols • [ ] brackets • { } braces Terminology • Names of special symbols • [ ] brackets • { } braces](http://slidetodoc.com/presentation_image/e41bb424f6f3fc61d13faca44ef02be9/image-35.jpg)
Terminology • Names of special symbols • [ ] brackets • { } braces • ( ) parentheses • @ commercial ‘at’ sign • & ampersand • ~ tilde 35

Special symbols in the table 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 NULL SOH STX EDT ENQ ACK BEL BS HT LF VT FF CR SO SI 1 DLE DC 1 DC 2 DC 3 DC 4 NAK SYN ETB CAN EM SUB ESC FS GS RS US 2 ! " # $ % & ' ( ) * + , . / 3 0 1 2 3 4 5 6 7 8 9 : ; < = > ? 4 @ A B C D E F G H I J K L M N O 5 P Q R S T U V W X Y Z [ ] ^ _ 7 p q r s t u v w x y z { | } ~ DEL 6 ` a b c d e f g h i j k l m n o 36

Escape Sequences • Extend the capability of the ASCII code set • For controlling terminals and formatting output • Defined by ANSI in documents X 3. 41 -1974 and X 3. 64 -1977 • The escape code is ESC = 1 B 16 • An escape sequence begins with two codes: ESC [ 1 B 16 5 B 16 37

Examples • Erase display: • Erase line: ESC [ 2 J ESC [ K 38

Standard Alphanumeric Formats • • BCD ASCII EBCDIC Unicode Next slides 39

Unicode • 16 -bit standard • Developed by a consortia • Intended to supercede older 7 - and 8 -bit codes 40

Unicode Version 2. 1 • • 1998 Improves on version 2. 0 Includes the Euro sign (20 AC 16 = From the standard: ) …contains 38, 887 distinct coded characters derived from the supported scripts. These characters cover the principal written languages of the Americas, Europe, the Middle East, Africa, India, Asia, and Pacifica. http: //www. unicode. org 41

Keyboard Input • • • Key (“scan”) codes are converted to ASCII code sent to host computer Received by the host as a “stream” of data Stored in buffer Processed Etc. 42

Keyboard to binary Figure 3. 7 Keyboard operation 43

Shift Key • inhibits bit 5 in the ASCII code 6 5 4 3 2 1 0 Character Key(s) a Shift 1 1 0 0 1 a 1 0 0 0 1 A a 44

Control Key • inhibits 5 & 6 in the ASCII code 6 5 4 3 2 1 0 Character Key(s) c 1 1 0 0 0 1 1 Ctrl c c 0 0 0 1 1 ETX Control code 45

Data Input Devices • • • OCR – optical character recognition Bar code readers Voice/audio input Punched cards Images / objects Pointing devices pp. Old: 69 -86 Rev: 72 -89 46

OCR Hello, world Page of text Optical scan 10110110… Computer file 47

Data Input Devices • • • OCR – optical character recognition Bar code readers Voice/audio input Punched cards Images / objects Pointing devices pp. 69 -86 48

Bar Codes • An automatic identification (Auto ID) technology that streamlines identification and data collection • See: http: //www. digital. net/barcoder/barcode. html 49

Data Input Devices • • • OCR – optical character recognition Bar code readers Pointing devices Punched cards Voice/audio input Images / objects pp. 69 -86 50

Pointing Devices • Originally used for specifying coordinates (x, y) for graphical input • Today used as general purpose device for “graphical user interfaces” (GUIs) 51

Data Input Devices • • • OCR – optical character recognition Bar code readers Pointing devices Punched cards Voice/audio input Images / objects pp. 69 -86 52

Punched Cards • Invented by Herman Hollerith (founder of IBM) • Each card holds 80 characters 53

Image data • Typically images are pictures that are optically scanned and saved as a “bit map” or in some other format • Many formats – gif, jpeg, … Note: animated gifs often used on www 54

Typical “Save As” Dialog 55

Types of images • Bitmaps (raster images) – Examples: photographs, pointing devices – Continuous variation of color, shape, texture – Entered via a scanner or video camera • Object images – Created with specialized drawing programs – Set of graphical objects (lines, rectangles, etc. ) 56

Bitmap images • Made of pixels • Require a lot of memory (600 x 800 x 3 = 1. 4 MB) • Resolution – defines the detail level of the image • Involve little processing • Formats – GIF (limited to 256 colors) – JPEG (up to 16 Million of colors; use compression) 57

Bitmap Images • Used for realistic images with continuous variations in shading, color, shape and texture • Preferred when image contains large amount of detail and processing requirements are fairly simple • Input devices: – Scanners – Digital cameras and video capture devices – Graphical input devices like mice and pens • Managed by photo editing software or paint software 4 -58
![Bitmap Images • Each individual pixel, for pi[x]cture element, in a graphic is stored Bitmap Images • Each individual pixel, for pi[x]cture element, in a graphic is stored](http://slidetodoc.com/presentation_image/e41bb424f6f3fc61d13faca44ef02be9/image-59.jpg)
Bitmap Images • Each individual pixel, for pi[x]cture element, in a graphic is stored as a binary number – Pixel: A small area with an associated coordinate location – Example: each point below represented by a 4 -bit code corresponding to 1 of 16 shades of gray 4 -59

Bitmap Display • Monochrome: black or white – 1 bit per pixel • Gray scale: black, white or 254 shades of gray – 1 byte per pixel • Color graphics: 16 colors, 256 colors, or 24 -bit true color (16. 7 million colors) – 4, 8, and 24 bits respectively 4 -60

GIF format Figure 3. 10 GIF screen layout 61

GIF image format Figure 3. 11 GIF file format layout 62

JPEG (Joint Photographers Expert Group) • Allows more than 16 million colors • Suitable for highly detailed photographs and paintings • Employs lossy compression algorithm that – Discards data to decreases file size and transmission speed – May reduce image resolution, tends to distort sharp lines 4 -63

Bitmap vs. Object Images Bitmap (Raster) Object (Vector) Pixel map Geometrically defined shapes Photographic quality Complex drawings Paint software Drawing software Larger storage requirements Higher computational requirements Enlarging images produces jagged Objects scale smoothly edges Resolution of output limited by resolution of image Resolution of output limited by output device 4 -64

Video Images • Require massive amount of data – Video camera producing full screen 1024 x 768 pixel true color image at 30 frames/sec 70. 8 MB of data/sec – 1 -minute film clip 4. 25 GB storage • Options for reducing file size: decrease size of image, limit number of colors, or reduce frame rate • Video format determined by a codec, encoder/decoder Copyright 2013 John Wiley & Sons, Inc. 4 -65

Video Images • Best known codec standards: MPEG-2, MPEG -4, and H. 264 – Data may be compressed to 10 -60 MB or less of data per minute • Container serves as a superstructure to encode, decode, hold and stream the video – Examples: Quicktime from Apple, Web. M from Google, and Flash Video from Adobe • Streaming video: video displayed in real time as it is downloaded from the Web server Copyright 2013 John Wiley & Sons, Inc. 4 -66

Audio Data • Transmission and processing requirements less demanding than those for video • Analog Waveform: digital representation of sound • Analog sound converted to digital values by A-to. D converter • MIDI (Musical Instrument Digital Interface): instructions to recreate or synthesize sounds Copyright 2013 John Wiley & Sons, Inc. 4 -67

Waveform Audio Sampling rate normally 50 KHz Copyright 2013 John Wiley & Sons, Inc. 4 -68

Sampling Rate • Number of times per second that sound is measured during the recording process. – 1000 samples per second = 1 KHz (kilohertz) – Example: Audio CD sampling rate = 44. 1 KHz • Height of each sample saved as: – 8 -bit number for radio-quality recordings – 16 -bit number for high-fidelity recordings – 2 x 16 -bits for stereo Copyright 2013 John Wiley & Sons, Inc. 4 -69

Audio Formats • MP 3 – predominant digital audio data format – Derivative of MPEG-2 (ISO Moving Picture Experts Group) – Uses psychoacoustic lossy compression techniques to reduce storage requirements • WAV – Developed by Microsoft as part of its multimedia specification – General-purpose format for storing and reproducing small snippets of sound – Non-compressed 8 - or 16 -bit sound samples Copyright 2013 John Wiley & Sons, Inc. 4 -70

Audio Data Formats WAV file Copyright 2013 John Wiley & Sons, Inc. 4 -71

Data Compression • Compression: recoding data so that it requires fewer bytes of storage space. • Compression ratio: the amount file size is reduced • Lossless: inverse algorithm restores data to exact original form – Examples: GIF, PCX, TIFF, ZIP • Lossy: trades off data degradation for file size and download speed – Much higher compression ratios, often 10 to 1 – Example: JPEG, MP 3 – Common in multimedia • H. 264: uses both forms for ratios of 1000: 1 Copyright 2013 John Wiley & Sons, Inc. 4 -72
- Slides: 72