MPO 581 Class 2/27   Jan 24, 2011

Topic: Basics of data in computers

Loose ends from last class:

Computers - get set up
Teams

Today's material:

DATA: Bits, nybbles, bytes, words, numbers, characters, arays, structures, objects, files

A bit: Deep down: hi vs. lo in a bimodal distribution of voltages.
    (aside: energy cost to keeping tails from overlapping!)
Data: A sequence of 0/1 numbers, in a linear order.
3 bits is an octal number (8 values: 0-7)
4 bits is a nybble (16 values; Hexadecimal)
8 bits is a byte B (can take on 256 different values)
16 bits (2B) is a short integer
4B is a long integer, about 4 billion possible values
4B is a single-precision floating point number
8B is a double- ""   "" (IEEE)
8B Complex is 2 floats
16B Complex is 2 doubles

Wikipedia on numbers in computers
.ppt compilation from top 10-15 Googles of "introduction computer bits bytes float ppt"

Math operations: dependence on data type

Computer operations are not quite the same as the mathematics they resemble!

Equal sign is left-assignment
The modulo operation
Integer division
Roundoff error

Arrays of characters or numbers

Arrays (wiki) of numbers: another layer of encoding, more arbitrary conventions

Structures 

Several pieces of data bundled together, for labeling convenience.
Really, it's an array of pointers (memory addresses, which are written as strings of hexidecimal numbers).

Objects

A bundle {} that contains data, plus "methods" to act on the data. Object oriented programming (OOP) is a different way of thinking and takes some getting used to.

Open questions, assignments, and loose ends for next class:

Think more about teams and roles

Testable questions about today's material:

There are ___ kinds of people
what is x==3?
what is x=3?