Encoding and Representing Data: Integers, Floating Points, Text, and Unicode, Slides of Computer Science

Various methods for encoding and representing different types of data, including integers, floating points, text, and unicode. It covers topics such as integer representation, handling negative numbers, floating point representation, text encoding, and unicode. The document also touches upon the importance of saving space and using efficient encoding schemes.

Typology: Slides

2012/2013

Uploaded on 03/22/2013

dhirendra
dhirendra 🇮🇳

4.3

(78)

268 documents

1 / 63

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Encoding Things for Computers
Section 17.1
Chapter 3
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f

Partial preview of the text

Download Encoding and Representing Data: Integers, Floating Points, Text, and Unicode and more Slides Computer Science in PDF only on Docsity!

Encoding Things for Computers

Section 17.

Chapter 3

Standards

  • A very old idea.
  • Sometimes there aren’t any.
  • But they’re very common.
  • And there’s a general trend in the direction of standards.

Wishing for Standards

http://www.sheldonbrown.com/tire-sizing.html

Integers

The first step is obvious:

Integers

The first step was obvious:

But what about this:

sign bit

But What Happens Now?

Another Problem

What should we do about:

Another Problem

What should we do about:

If we always want two places after. : Then we could write:

And then always treat it as though the decimal point were there.

Floating Point

We’ll do it in decimal:

Number Floating Point

4.32 4.32e

456.2 4.56e+

Multiply by 10 2

Floating Point

We’ll do it in decimal:

Number Floating Point

4.32 4.32e

456.2 4.56e+

.0004 4.0e-

Multiply by 10 -

Floating Point

We’ll do it in decimal:

Number Floating Point

4.32 4.32e

456.2 4.56e+

.0004 4.0e-

56784657846352*34526251 1960561349752268586352

1960561349752268586352/2 9.802806748761343e+

Rounding Error

int(_) 4388

Where did the .664 cents go?

We can force Python to round instead of truncate.

Our balance is $1,567.38 and the interest rate is 2.8%:

Text

Computers have revolutionized our world. They have changed the course of our daily lives, the way we do science, the way we entertain ourselves, the way that business is conducted, and the way we protect our security.

Text

Computers have revolutionized our world. They have changed the course of our daily lives, the way we do science, the way we entertain ourselves, the way that business is conducted, and the way we protect our security.

Les ordinateurs ont révolutionné notre monde. Ils ont changé le cours de notre vie quotidienne, notre façon de faire la science, la façon dont nous nous divertissons, la façon dont les affaires sont menées, et la façon dont nous protégeons notre sécurité.