View
219
Download
0
Category
Tags:
Preview:
Citation preview
Chapters 1,2,3, & 4
Quiz # 1
1
2
Analog and Digital Information
Information can be represented in one of two ways: analog or digital
Analog data
A continuous representation, analogous to the actual information it represents
Digital data
A discrete representation, breaking the information up into separate elements
Digitization
Initially transforming data for computer use• Assigning people social security numbers• The creation of telephone numbers
Encoding information became the way to transform the real world into a context that the computer could understand
Information Metamorphosis
•Fitting the real world into the computer•Computer’s world
– Electronic– Fast– Binary
•Real World– Multiple forms of data / information– Imprecise / vague– Non uniform speeds
Information Metamorphosis
•Real World Data Forms– Numeric Data– Character Data– Graphical / Visual Data– Audio Data– Instructional Data
•Methodology needed to transform real world data into computer world (binary)
Binary Number System
•Binary for numeric data•Binary digit = Bit•8 Bits = Byte
– Smallest addressable unit within the computer
•4 Bytes = Word– Basic unit for arithmetic– Contains 32 bits
•Converting from binary
1 0 0 1 1 1 0 1
1 X 128 = 1280 X 64 = 00 X 32 = 01 X 16 = 161 X 8 = 81 X 4 = 40 X 2 = 01 X 1 = 1
157
Numeric Data
•Converting to binary– Repeated division by 2– Remainders are the
important part– Read from bottom up
as if left to right
Character Data
•Binary for Character Data– 8 bit combinations assigned to a symbol– Name for mapping process is ASCII table
@ 0100 0000 P 0101 0000 0110 0000A 0100 0001 Q 0101 0001 a 0110 0001B 0100 0010 R 0101 0010 b 0110 0010C 0100 0011 S 0101 0011 c 0110 0011D 0100 0100 T 0101 0100 d 0110 0100E 0100 0101 U 0101 0101 e 0110 0101F 0100 0110 V 0101 0110 f 0110 0110G 0100 0111 W 0101 0111 g 0110 0111H 0100 1000 X 0101 1000 h 0110 1000I 0100 1001 Y 0101 1001 i 0110 1001J 0100 1010 Z 0101 1010 j 0110 1010K 0100 1011 [ 0101 1011 k 0110 1011L 0100 1100 \ 0101 1100 l 0110 1100M 0100 1101 ] 0101 1101 m 0110 1101N 0100 1110 ^ 0101 1110 n 0110 1110O 0100 1111 _ 0101 1111 o 0110 1111
Graphical Data
•Binary for Graphical Data
Graphical Data
•Binary for Graphical Data
Graphical Data
•Binary for Graphical Data•Each black pixel is represented as a “1”•Each white pixel is represented as a “0”•Pixels are grouped in units of 8 so they can be stored in 1 byte
Graphical Data
A 1” picture scanned at 150 DPI (dots per inch)
Total size = 150 X 150 22,500 dots
Memory required = 22,500 / 8 2,813 bytes
Color requires more bits to represent each dotUsing 8 bits for each dot allows for 256 different colors
The 1” picture now requires 22,500 bytes
Graphical Data
•Printers are rated in DPI for print quality•Scanners are rated in DPI for image resolution•Monitors / displays have display settings for display resolution
–800 X 600–1024 X 768–1280 X 1024–1400 X 1050
Audio Data
•Binary for audio data•Sound as a waveform
–Y-axis represents voltage–X-axis represents time
•Suppose the wave form shown represents 1 second of sound
Audio Data
•Divide Sample into segments
Audio Data
•Divide Sample into more segments
Audio Data
•Divide Sample into even more segments
Audio Data
•The more segments the better the re-created wave form•The given sample was divided into 34 segments (approx)•An Audio CD utilizes 44,000 samples per second of sound
Instructional Data
•Binary for Instructional Data•Instructional Data has not only content but sequence•Driving directions to NJ Aquarium
–Designated number of steps–Sequence of steps is critical to success–Rearranging sequence will not get you to the NJ Acquarium
•Recipe / Directions / Program
20
The Unicode Character Set
Extended ASCII is not enough for international use
One Unicode mapping uses 16 bits per character
How many characters can this mapping represent?
Unicode is a superset of ASCII
The first 256 characters correspond exactly to the extended ASCII character set
21
Keyword Encoding
Replace frequently used words with a single character
22
Run-Length Encoding
A single character may be repeated over and over again in a long sequenceReplace a repeated sequence with
– a flag character – repeated character– number of repetitions
*n8– * is the flag character– n is the repeated character– 8 is the number of times n is repeated
23
Huffman Encoding
In Huffman encoding no character's bit string is the prefix of any other character's bit string
To decode
look for match left to right, bit by bit
record letter when a match is found
begin where you left off,going left to right
24
Digitized Images and Graphics
Digitizing a picture
Representing it as a collection of individual dots called pixels
Resolution
The number of pixels used to represent a picture
Raster Graphics
Storage of data on a pixel-by-pixel basis
Bitmap (BMP), GIF, JPEG, and PNG are raster-
grahics formats
25
Digitized Images and Graphics
Bitmap formatContains the pixel color values of the image from left to right and from top to bottomGIF format (indexed color)Each image is made up of only 256 colorsJPEG formatAverages color hues over short distancesPNG formatLike GIF but achieves greater compression with wider range of color depths
Which is better for line drawings? Pictures?
26
Vector Graphics
Vector graphics A format that describes an image in terms of lines and geometric shapes
A vector graphic is a series of commands that describe a line’s direction, thickness, and color
The file sizes tend to be smaller because not every pixel is described
27
Vector Graphics
The good side and the bad side…
Vector graphics can be resized mathematically and changes can be calculated dynamically as needed
Vector graphics are not good for representing real-world images
28
Computers and Electricity
Gate A device that performs a basic operation onelectrical signalsCircuits Gates combined to perform morecomplicated tasks
29
Computers and Electricity
How do we describe the behavior of gates and circuits?Boolean expressionsUses Boolean algebra, a mathematical notation for expressing two-valued logic Logic diagramsA graphical representation of a circuit; each gate has itsown symbolTruth tablesA table showing all possible input value and the associatedoutput values
30
NOT Gate
A NOT gate accepts one input signal (0 or 1) and returns the opposite signal as output
Figure 4.1 Various representations of a NOT gate
31
AND Gate
An AND gate accepts two input signals
If both are 1, the output is 1; otherwise, the output is 0
Figure 4.2 Various representations of an AND gate
32
OR Gate
An OR gate accepts two input signals
If both are 0, the output is 0; otherwise,the output is 1
Figure 4.3 Various representations of a OR gate
33
XOR Gate
Figure 4.4 Various representations of an XOR gate
An XOR gate accepts two input signals
If both are the same, the output is 0; otherwise,the output is 1
NAND Gate
The NAND gate accepts two input signalsIf both are 1, the output is 0; otherwise,the output is 1
Figure 4.5 Various representations of a NAND gate
35
NOR Gate
Figure 4.6 Various representations of a NOR gate
The NOR gate accepts two input signals
If both are 0, the output is 1; otherwise, the output is 0
36
Combinational Circuits
Gates are combined into circuits by using the output of one gate as the input for another
37
Combinational Circuits
Three inputs require eight rows to describe all possible input combinations
This same circuit using a Boolean expression is (AB + AC)
38
Combinational Circuits
Consider the following Boolean expression A(B + C)
Does this truth table look familiar?
Compare it with previous table
39
Combinational Circuits
Circuit equivalenceTwo circuits that produce the same output for
identical inputBoolean algebra allows us to apply provable
mathematical principles to help design circuits
A(B + C) = AB + BC (distributive law) so circuits must be equivalent
40
Adders
The result of adding two binary digits could produce a carry value
Recall that 1 + 1 = 10 in base two
Half adderA circuit that computes
the sum of two bits and produces the correct carry bit
Truth table
41
Adders
Circuit diagram representing a half adder
Boolean expressions
sum = A Bcarry = AB
42
Adders
Full adder
A circuit that takes the carry-in value into account
Figure 4.10 A full adder
43
Circuits as Memory
The design of this circuit guarantees that the two outputs X and Y are always complements of each other
The value of X at any point in time is considered to be the current state of the circuit
Therefore, if X is 1, the circuit is storing a 1; if X is 0, the circuit is storing a 0
Figure 4.12 An S-R latch
44
Ethical Issues
Email Privacy
Explain why privacy is an illusion.
Who can read your email?
Do you send personal email from work?
Does everyone in your family use email?
Recommended