1 / 9

CS 101 – Sept. 9

CS 101 – Sept. 9. Finish real numbers Representing information Not just in binary, it has to be organized : Linear Non-linear Network: graph Hierarchy: tree. Real-number rep’n. Also called “Floating-point” Size is 32 or 64 bits. Based on “ binary scientific notation ”

floydjones
Download Presentation

CS 101 – Sept. 9

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS 101 – Sept. 9 • Finish real numbers • Representing information Not just in binary, it has to be organized: • Linear • Non-linear • Network: graph • Hierarchy: tree

  2. Real-number rep’n • Also called “Floating-point” • Size is 32 or 64 bits. • Based on “binary scientific notation” • Only one scheme is used: • 1 bit for sign • 8 bits for exponent • 23 bits for mantissa • Big mantissa  precision

  3. Distribution • 8 bit exponent  256 different exponents • Biggest number ~ 1038. • Smallest (+) number ~ 10–38. • 23 bit mantissa  8 million numbers per power of 2. • Three kinds of numbers can’t be represented. (Where are they?)

  4. Linear organization • Definite begin & end • One logical way to read (forwards) • Used for: text, audio, images, video • One file consists of many “cells” of data • Individual character, musical note, pixel on screen, frame of movie • It’s convenient if each “cell” is a whole number of bytes. 1 byte = 8 bits.

  5. Digitizing data • Text • Break up information into characters • Each character represented by a binary number • How many different binary numbers will we need? • Need to encode formatting commands as well. E.g. some text may be in a different font. • Music/audio • Can break up song into notes • What information is in a “note” ? • How frequently do notes come?  Sampling

  6. Digitizing data (2) • Images • Break up picture into pixels, each becomes a number. • How many pixels do we need? • The pixel values are colors. How many different colors do we want? • Video • A sequence of images.  • How many images per second? • (Also need to include sound on the side.)

  7. Non-linear organization • Either there’s no logical begin/end to information, or many ways to travel thru it. Graph (network) Tree (hierarchy)

  8. Tree example • We use trees to represent mathematical expressions. There’s a hierarchy because of the order of operations. * + – 3 4 7 8

  9. Normally we’d write (3 + 4) * (7 – 8) More efficient to use “postfix” or RPN notation: 3 4 + 7 8 – * Representing a tree * + – 3 4 7 8

More Related