Review multiplying powers - PowerPoint PPT Presentation

About This Presentation
Title:

Review multiplying powers

Description:

Alphanumeric. Standards. Type of Data. ITEC 1011. Introduction to Information Technologies ... Alphanumeric Data ... Standard Alphanumeric Formats. BCD. ASCII ... – PowerPoint PPT presentation

Number of Views:130
Avg rating:3.0/5.0
Slides: 88
Provided by: jimmy50
Category:

less

Transcript and Presenter's Notes

Title: Review multiplying powers


1
Review multiplying powers
  • For common bases, add powers

ab ? ac abc
26 ? 210 216 65,536 or 26 ? 210 64 ? 210
64k
2
Binary Addition (1 of 2)
  • Two 1-bit values

two
pp. 36-38
3
Binary Addition (2 of 2)
  • Two n-bit values
  • Add individual bits
  • Propagate carries
  • E.g.,

1
1
10101 11001
4
Binary Addition (2 of 2)
  • Two n-bit values
  • Add individual bits
  • Propagate carries
  • E.g.,

1
1
10101 21 11001 25
5
Binary Addition (2 of 2)
  • Two n-bit values
  • Add individual bits
  • Propagate carries
  • E.g.,

1
1
10101 21 11001 25 46
6
Binary Addition (2 of 2)
  • Two n-bit values
  • Add individual bits
  • Propagate carries
  • E.g.,

1
1
10101 21 11001 25 101110 46
7
Multiplication (1 of 3)
  • Decimal (just for fun)

35x 105 175 000 35 3675
pp. 39
8
Multiplication (2 of 3)
  • Binary, two 1-bit values

9
Multiplication (3 of 3)
  • Binary, two n-bit values
  • As with decimal values
  • E.g.,

1110 x 1011 1110 1110 0000
111010011010
10
Fractions
  • Decimal to decimal (just for fun)

3.14 gt 4 x 10-2 0.04 1 x 10-1 0.1 3 x
100 3 3.14
pp. 46-50
11
Fractions
  • Binary to decimal

10.1011 gt 1 x 2-4 0.0625 1 x 2-3
0.125 0 x 2-2 0.0 1 x 2-1 0.5 0 x 20
0.0 1 x 21 2.0 2.6875
pp. 46-50
12
Fractions
  • Decimal to binary

.14579x 20.29158x 20.58316x
21.16632x 20.33264x 20.66528x
21.33056 etc.
3.14579
11.001001...
p. 50
13
Exercise Convert ...
Skip answer
Answer
14
Exercise Convert
Answer
15
2. Data Formats
Chapt. 3
16
Introduction
  • Examples

Input device
pp. 59.-61
17
Format must be appropriate
  • The internal representation must be appropriate
    for the type of processing to take place (e.g.,
    text, images, sound)

18
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 PostScript, Apple Quick Time)
  • Committee is struck to solve a problem (Motion
    Pictures Experts Group, MPEG)

pp. 61-62
19
Standards Organizations
  • ISO International Organization for
    Standardization
  • CSA Canadian Standards Association
  • ANSI American National Standards Institute
  • Founded in 1918 and member of the ISO
  • Works within the industries to coordinate and set
    standards in the United States
  • ASCII is one of the ANSI standards
  • IEEE Institute for Electrical and Electronics
    Engineers
  • Etc.

20
Examples of Standards
21
Why Standards?
  • Standard are arbitrary
  • They exist because they are
  • Convenient
  • Efficient
  • Flexible
  • Appropriate
  • Etc.

22
Alphanumeric Data
  • Problem Distinguishing between the number 123
    (one hundred and twenty-three) and the characters
    123 (one, two, three)
  • Four 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

pp. 63-69
23
Standard Alphanumeric Formats
Next 2 slides
  • BCD
  • ASCII
  • EBCDIC
  • Unicode

24
Binary-Coded Decimal (BCD)
  • Four bits per digit

Note the following bit patterns are not
used 1010 1011 1100 1101 1110 1111
25
Example
  • 709310 ? (in BCD)

7 0 9 3 0111 0000 1001 0011
26
Standard Alphanumeric Formats
  • BCD
  • ASCII
  • EBCDIC
  • Unicode

Next 22 slides
27
The Problem
  • Representing text strings, such as Hello,
    world, in a computer

28
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 X3.4-1977

29
ASCII Features
  • 7-bit code
  • 8th bit is unused (or used for a parity bit)
  • 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)

30
Hint
Memorize codes for blank space, period,
digit zero (0), capital A, small
a, carriage return (CR)
/Kc
31
ASCII Chart
32
(No Transcript)
33
Most significant bit
Least significant bit
34
e.g., a 1100001
35
95 Graphic codes
36
33 Control codes
37
Alphabetic codes
38
Numeric codes
39
Punctuation, etc.
40
Hello, world Example
41
Common Control Codes
  • CR 0D carriage return
  • LF 0A line feed
  • HT 09 horizontal tab
  • DEL 7F delete
  • NULL 00 null

Hexadecimal code
42
(No Transcript)
43
Terminology
  • Learn the names of the special symbols
  • brackets
  • braces
  • ( ) parentheses
  • _at_ commercial at sign
  • ampersand
  • tilde

44
(No Transcript)
45
Standard Alphanumeric Formats
  • BCD
  • ASCII
  • EBCDIC
  • Unicode

Next 1 slides
46
EBCDIC
  • Extended BCD Interchange Code (pronounced
    ebb-se-dick)
  • 8-bit code
  • Developed by IBM
  • Rarely used today
  • IBM mainframes only

47
Standard Alphanumeric Formats
  • BCD
  • ASCII
  • EBCDIC
  • Unicode

Next 2 slides
48
Unicode
  • 16-bit standard
  • Developed by a consortia
  • Intended to supercede older 7- and 8-bit codes

49
Unicode Version 2.1
  • 1998
  • Improves on version 2.0
  • Includes the Euro sign (20AC16 )
  • 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
50
Keyboard Input
  • Key (scan) codes are converted to ASCII
  • ASCII code sent to host computer
  • Received by the host as a stream of data
  • Stored in buffer
  • Processed
  • Etc.

pp. 69
51
Keyboard to binary
Figure 3.7 Keyboard operation
52
Shift Key
  • inhibits bit 5 in the ASCII code

a
a
Shift
53
Control Key
  • inhibits bits 5 6 in the ASCII code

c
c
Ctrl
Controlcode
54
Data Input Devices
  • OCR optical character recognition
  • Bar code readers
  • Voice/audio input
  • Punched cards
  • Images / objects
  • Pointing devices

pp. 69-86
55
OCR
  • Hello, world

Optical scan
10110110
Page of text
Computer file
56
Data Input Devices
  • OCR optical character recognition
  • Bar code readers
  • Voice/audio input
  • Punched cards
  • Images / objects
  • Pointing devices

pp. 69-86
57
Bar Codes
  • An automatic identification (Auto ID) technology
    that streamlines identification and data
    collection
  • See
  • http//www.digital.net/barcoder/barcode.html

58
Data Input Devices
  • OCR optical character recognition
  • Bar code readers
  • Voice/audio input
  • Punched cards
  • Images / objects
  • Pointing devices

pp. 69-86
59
Voice/audio Input
  • Input device microphone
  • Audio input is digitized and stored
  • Processed in two ways
  • As is (no recognition)
  • Recognized and converted to alphanumeric data
    (ASCII)

Digitize
10110010
60
Audio data formats
  • MIDI
  • Used for storing instrument sound
  • WAV
  • Used to store sound snippets
  • MP3
  • Derived from MPEG-2
  • High quality

61
WAV data format
Figure 3.16 .WAV sound format
62
Video images
  • Require large amounts of data
  • Example 640 x 480 x 30 frames/s x 3 colors bits
    27.65 Mb/s 1.6 GB / minute
  • Solutions
  • Reduce Size, colors, sampling frequency
  • Compress
  • Complication real-time streaming

63
Data Input Devices
  • OCR optical character recognition
  • Bar code readers
  • Voice/audio input
  • Punched cards
  • Images / objects
  • Pointing devices

pp. 69-86
64
Punched Cards
  • Invented by Herman Hollerith (founder of IBM)
  • Each card holds 80 characters

65
Data Input Devices
  • OCR optical character recognition
  • Bar code readers
  • Voice/audio input
  • Punched cards
  • Images / objects
  • Pointing devices

pp. 69-86
66
Images
  • Typically images are pictures that are optically
    scanned and saved as a bit map or in some other
    format
  • Many formats
  • gif, jpeg,

67
Typical Save As Dialog
68
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.)

69
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)

70
GIF format
Figure 3.10 GIF screen layout
71
GIF image format
Figure 3.11 GIF file format layout
72
Objects
  • Images made of geometrically definable shapes
  • Offer efficiency, flexibility, small size, etc.

73
Object images Postscript, PDF
  • Postscript
  • Set of graphical statements
  • Includes scalable fonts
  • Advantages
  • PDF

74
Data Input Devices
  • OCR optical character recognition
  • Bar code readers
  • Voice/audio input
  • Punched cards
  • Images / objects
  • Pointing devices

pp. 69-86
75
Pointing Devices
  • Originally used for specifying coordinates (x, y)
    for graphical input
  • Today used as general purpose device for
    graphical user interfaces (GUIs)

76
Data compression
  • Many algorithms
  • Types lossless, lossy
  • Example of algorithm (compression 35, not good
    for streaming)
  • Store repeated characters as (char, of
    occurrences)
  • Replace repeated sequences by one value
  • Examples ZIP, GIF (losslessly), Z, .gz, .tgz
  • Losssy algorithms
  • Can reduce the size by 10 times
  • Example MPEG2 (compression ratio 1001)

77
Representing Integer Data
477
666
( Subject has no point !! )
1
A99ACF
11011011011011
7652993002
3419
Book Chapter 4
78
Representing Integers
  • Basic definition
  • Positive integers
  • Adding binary numbers
  • Turning addition into subtraction
  • Twos complement
  • Example

79
Basic Definition
  • An integer is a number which has no fractional
    part.

Examples -2022 -213 0 1 666 54323434565
434
80
32-bit Data Word
Figure 4.1 Storage of a 32-bit data word
81
Ranges for Data Formats
82
Positive Integers Examples
  • All data must be stored as binary numbers
  • Positive integers have direct conversion
  • 000 0 001 1 010 2 011 3
  • 100 4 101 5 110 6 111 7

83
In General (binary)
Remember !!
84
Signed Integers
  • Previous examples were for unsigned integers
    (positive values only!)
  • Must also have a mechanism to represent signed
    integers (positive and negative values!)
  • E.g., -510 ?2
  • Two common schemes 1) sign-magnitude
    2) twos complement

85
Sign-Magnitude
  • Extra bit on left to represent sign
  • 0 positive value
  • 1 negative value
  • E.g., 6-bit sign-magnitude representation of 5
    and 5

86
Ranges (revisited)
87
In General (revisited)
Write a Comment
User Comments (0)
About PowerShow.com