Presentation is loading. Please wait.

Presentation is loading. Please wait.

ASCII, Binary, and Data Storage A MATLAB Tutorial.

Similar presentations


Presentation on theme: "ASCII, Binary, and Data Storage A MATLAB Tutorial."— Presentation transcript:

1 ASCII, Binary, and Data Storage A MATLAB Tutorial

2 How is data stored? ASCII is a system whereby numbers are associated with characters Binary is how data is stored on a computer, whereby a series of ones and zeros represent base 10 numbers Table from Lab 10 Table from Lab 12

3 How are they related? ASCII numbers can be represented in binary For example, capital “A” is 65 in ASCII. In binary, it is: So, a capital “A” binary could be represented by 1000001 Binary1000001 Power Number6432168421

4 Something new: signed and unsigned integers Adding another wrinkle to this complex system of numbers are signed and unsigned integers “Signed” and “unsigned” refer to whether or not an integer can be negative If it is “signed,” then is can possess a negative sign If it is “unsigned,” then it cannot be negative because it cannot have a negative sign Commonly used when discussing processors and operating systems (32 and 64 bit)

5 An example: Lab 12 In Lab 12, unsigned 8-bit values are modified by adding or subtracting 1s and 0s (binary code) to encode a message How is “mixing” binary and integers possible? The answer is that they aren’t truly getting “mixed;” the new number is still an unsigned integer, albeit just slightly changed In Lab 12, the unsigned integers represents a shade of gray. Since the human eye cannot tell the difference between a 200 or a 201, for example, the encoding works 200+1=201 Unsigned 8-bitBinary Still unsigned 8-bit!

6 A quick review TypeWhat is it?Constraints? ASCII Regular base 10 numbers that represent characters None Binary System of 1s and 0s used to store data in computers; uses base 2 Can only be a 1 or 0 Signed and unsigned integers System of storing integers based on powers of 2 Can only be positive if unsigned; can only run between certain lower and upper bounds depending on number of bits The big takeaway: know your datatype!


Download ppt "ASCII, Binary, and Data Storage A MATLAB Tutorial."

Similar presentations


Ads by Google