Vannevar Bush: As We May Think 1. What is the context in which As We May Think was written? 2. What is the Memex? 3. In basic terms, how was the Memex intended to work? 4. In what ways does personal computing using the Internet as we know it differ from the Memex as envisioned? 5. Do you think that Bush s vision actually influenced the development of personal computing and the Internet? Why or why not? 6. Did you notice anything about gender roles in the article?
Data Representation John K. Bennett IWKS 2300/5350 Fall 2017
Counting Systems quantity decimal binary 3-bit register 0 0 000 1 1 001 2 10 010 3 11 011 4 100 100 5 101 101 6 110 110 7 111 111 8 1000 overflow 9 1001 overflow 10 1010 overflow
Number Representation 19 2 1 2 1 2 0 2 0 2 1 (10011) 0 1 2 3 4 two i n i i b n n b x x x x 0 0 1 )... ( 9038 10 8 10 3 10 0 10 9 (9038) 0 1 2 3 ten General Case: Base 10: Base 2:
Binary Representation of Numeric Values Sign Magnitude (e.g., -2 = 1010) We just flip the sign bit to get a negative number 5 = 0101-5 = 1101 0 = 0000-0 = 1000 Sign Magnitude Subtraction + 0 1 0 0 0 1 1 1 0 1 0 = 3 = -2 1 1 0 1 = -5 Two zeros: 0!= -0
Binary Representation of Numeric Values Sign Magnitude (e.g., -2 = 1010) One s Complement (invert: e.g., -2 = 1101) 5 = 0101-5 = 1010 0 = 0000-0 = 1111 Sign Magnitude + 0 1 0 0 0 1 1 1 0 1 0 = 3 = -2 1 1 0 1 = -5 Two zeros: 0!= -0 One s Complement + 1 1 1 0 0 1 1 1 1 0 1 = 3 = -2 0 0 0 0 = 0 Two zeros: 0!= -0
Binary Representation of Numeric Values Sign Magnitude (e.g., -2 = 1010) One s Complement (invert: e.g., -2 = 1101) Sign Magnitude + 1 1 0 0 0 1 1 1 0 1 0 = 3 = -2 Two s Complement (invert and add 1: e.g., -2 = 1101) 1 1 0 1 = -5 Two zeros: 0!= -0 Two s Complement One s Complement + 1 1 1 1 0 0 1 1 1 1 0 1 = 3 = -2 0 0 0 0 = -1 Two zeros: 0!= -0 1 1 1 0 0 0 1 1 1 1 1 0 + 0 0 0 1 = 3 = -2 = 1 Only one zero: 0 = -0 Invertible: --n = n
Representing 2 s Complement Negative Numbers (4-bit system) 0 0000 0000-0 1 0001 1111-1 2 0010 1110-2 3 0011 1101-3 4 0100 1100-4 5 0101 1011-5 6 0110 1010-6 7 0111 1001-7 The representation of all positive numbers begins with a 0 The representation of all negative numbers begins with a 1 To convert a two s comp. number: Inside CPU: complement number and add 1 (easy to do with full adders) On Paper: leave all trailing 0 s and first 1 from right intact, then flip all the remaining bits moving left Example: 2-5 = 2 + (-5) = 0 0 1 0 + 1 0 1 1 1 1 0 1 = -3
Overflow in 2 s Complement Binary Addition Assuming 4-bit numbers (3 bits plus sign): 0 0 0 1 1 0 0 1 0 1 0 1 + = -7 = 5 1 1 1 1 1 0 1 1 0 1 1 1 + = -5 = 7 1 1 1 0 = -2 0 0 1 0 = 2 No overflow How it works: Like decimal addition When signs are opposite, carry into or out of sign bit can be ignored When signs are the same, carry into sign bit that changes sign indicates overflow (that must be handled) Overflow (but we don t care) 0 1 1 1 0 1 0 1 0 1 1 1 + 1 1 0 0 = 5 = 7 = -4 Overflow into sign bit (we do care)
Floating Point Representation Scientific notation uses a floating decimal point: 256.78 is written as +2.5678 x 10 2 0.00345678 is written as +3.45678 x 10-3 base -256789.123 is written as -2.56789123 x 10 2 sign bit mantissa exponent We will use the same principle to represent floating point numbers in a computer, i.e.: sign mantissa exponent The base (2) is implied
Floating Point Representation If I want high precision, e.g.: 0.0345678344875903847503420209345809 x 10-3 What do I do? What do I give up? If I want very large or very small numbers, e.g.: 5.03 x 10-38344875903 2.345 x 10 38344875903 What do I do? What do I give up?
Special Exponents and Numbers e s m Represents 0 all zeros all zeros 0 1 all zeros all zeros -0 0 all ones all zeros 1 all ones all zeros 0 or 1 all ones non-zero NaN
What else do we need to be able to represent? Characters and text Does language matter? True and False Why? Sound How? Images How? Video How? What else?
Representing ASCII (American Standard Code for Information Interchange) Text
ASCII and Unicode ASCII was designed to only represent English language text How can we fix? Answer: Unicode Unicode is a standard for the consistent encoding, representation, and handling of text expressed in most of the world's writing systems. Developed in conjunction with the Universal Coded Character Set (UCS) standard and published as The Unicode Standard, the latest version of Unicode contains a repertoire of 136,755 characters covering 139 modern and historic scripts, as well as multiple symbol sets. Unicode takes the role of providing a unique code point a number, not a glyph for each character. In other words, Unicode represents a character in an abstract way and leaves the visual rendering (size, shape, font, or style) to other software Originally only 16 bits (so ~64000 characters could be defined), Unicode now a codespace of 1,114,112 code points in the range 0 hex to 10FFFF hex. This codespace is divided into 17 planes.
Other Kinds of Encoding Huffman Encoding a way to assign binary codes to symbols that reduces the overall number of bits used to encode a typical string of those symbols. Example: 00 A 01 E 100 L 110 O 111 R 1010 B 1011 D
Run-length Encoding Other Kinds of Encoding a way to assign binary codes to symbols that reduces the overall number of bits used to encode a typical string of those symbols. Example: consider a screen containing plain black text on a solid white background. There will be many long runs of white pixels in the blank space, and many short runs of black pixels within the text. A hypothetical scan line, with B (= 0) representing a black pixel and W (= 1) representing white, might read as follows: WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWBWWWWWWWWWWWWWW With a run-length encoding (RLE) data compression algorithm applied to the above hypothetical scan line, it can be rendered as follows: 12W1B12W3B24W1B14W or 01010 1 00001 0 01010 1 00011 0 11000 1 00001 0 01110 1
Keyword Encoding Other Kinds of Encoding Replace frequently used words with a single character, e.g.: We hold # truths to be self-evident, $ all men are created equal, $ ~y are endowed by ~ir Creator with certain unalienable Rights, $ among # are Life, Liberty + ~ pursuit of Happiness. $ to secure # rights, Governments are instituted among Men, deriving ~ir just powers from ~ consent of ~ governed, $ whenever any Form of Government becomes destructive of # ends, it is ~ Right of ~ People to alter or to abolish it, + to institute new Government, laying its foundation on such principles + organizing its powers in such form, ^ to ~m shall seem most likely to effect ~ir Safety + Happiness.
What Does it Mean to be Digital? An Analog Signal...
Frequency and Amplitude Audio Signals
Digital Representation It s just numbers...
How fast do we have to sample? Nyquist Sampling Theorem: lots of math, the gist of which is: If a function x(t) contains no frequencies higher than B hertz, it is completely determined by giving its ordinates at a series of points spaced 1/(2B) seconds apart, a sufficient sample-rate is at least 2B samples/second. In English, sample at at least twice the highest frequency of interest.
Example: An Audio Compact Disc 44,100 samples per second (how did we arrive at this number?) Each sample is a 16-bit number 2 channels (L+R) =>176,400 bytes per second 72 minutes capacity, => 762MB data
What Are the Advantages of Digital Representation of Analog Data? Noise immunity in storage and transmission Ease of storage/manipulation/transformation Uniformity -- It's all just bits!
What About Video? How does video work? Still based on cathode ray tube (CRT) design:
How fast do we have to scan? The human eye is a pretty good integrator But also has a pretty fast response time We don t want the screen to appear to flicker, or have interference patterns Need to be above ~37 hertz to avoid objectionable flicker; making the refresh rate 60 Hz (synched to power line) avoids interference patterns.
What is RGB? Why do we use it? It has to do with the way human eyes work 24 bits of color 8 Red; 8 Green; 8 Blue Sometimes 8 bits for alpha => 32 bits / color pixel
A Brief Sidequest Into Color
Color Hue, Saturation and Value Hue is the most obvious characteristic of color, representing what we perceive to be the actual color. Value (also called brightness or luminosity ) is measure of how bright we perceive the color to be. Saturation (also called chroma ) is the purity of a color. It is a measurement of how different from pure grey we perceive the color to be. Highly saturated colors look rich and full. Low saturation colors look dull and grayish.
Human Perception of Color Receptors (cones) for med and high-brightness color vision** Sensitivity peaks in Short (blue), Middle (green), Long (red) wavelengths. Thus, three parameters, corresponding to levels of stimulus to the three types of cone cell, can in principle describe any color sensation. **Also low-brightness, monochromatic "night-vision" rods (peak sensitivity around 490 495 nm).
Human Perception of Emitted Light We do not usually refer to colors using the LMS space defined by the cone spectral sensitivities. Instead, we use these tristimulus values conceptualized as various amounts of three primary colors in an additive color model Most wavelengths of light will not stimulate only one type of cone cell, because the sensitivity curves of the three cone cells overlap. To have a single component that describes the perceived brightness, imaginary primary colors and corresponding color-matching functions were formulated. The resulting tristimulus values are defined by the CIE* 1931 color space, in which they are denoted X, Y, and Z. The CIE XYZ color space is intended to encompass all color sensations that an average person can experience. * International Commission on Illumination
The Visible Color Gamut: CIE 1931 The CIE 1931 XYZ color space was created by the International Commission on Illumination (CIE) in 1931. It was derived from a series of experiments done in the late 1920s by William David Wright and John Guild. Their experimental results were combined into the specification of the CIE RGB color space, from which the CIE XYZ color space was derived.
How To Interpret a Gamut
The Meaning of X, Y, and Z When judging the relative luminance (brightness) of different colors in well-lit situations, humans tend to perceive light within the green parts of the spectrum as brighter than red or blue light of equal power. The luminosity function that describes the perceived brightness of different wavelengths is thus roughly analogous to the frequency response of M cones. The CIE model capitalizes on this fact by defining Y as luminance (or brightness ). Z is roughly equal to blue stimulation, or the S cone response, and X is a mix (a linear combination) of cone response curves chosen to be nonnegative. The XYZ tristimulus values are thus analogous to, but not equal to, the LMS cone responses of the human eye. Defining Y as luminance has the useful result that for any given Y value, the XZ plane will contain all possible chromaticities at that luminance.
We Can Only Approximate the Human Gamut
What s Wrong With CIE 1931 An equal mixture of two equally bright colors will not generally lie on the midpoint of that line segment. Thus, a given distance on the xy chromaticity diagram does not correspond to the degree of difference between two colors. In the early 1940s, David MacAdam studied the nature of visual sensitivity to color differences, and summarized his results in the concept of a MacAdam ellipse. Based on the work of MacAdam, the CIE 1960, CIE 1964, and CIE 1976 color spaces were developed, with the goal of achieving perceptual uniformity (have an equal distance in the color space correspond to equal differences in color).
MacAdam Ellipses MacAdam compared perception of color differences at 25 points on the chromaticity diagram. He found that the size and orientation of the ellipses of equivalent perception on the diagram varied widely depending on the test color. These 25 ellipses measured by MacAdam, for a particular observer are shown here.
How to Avoid These Distortions? A number of attempts have been made to define a color space that is not as distorted as the CIE XYZ space. The most notable of these are the CIELUV and CIELAB color spaces. Although both of these spaces are less distorted than the CIE XYZ space, they are not completely free of distortion. This means that the MacAdam ellipses become nearly (but not exactly) circular in these spaces. The CIE 1976 (L*, u*, v*) color space, commonly known by its abbreviation CIELUV, is a simple-tocompute transformation of the 1931 CIE XYZ color space that attempts perceptual uniformity.
Computing CIELUV (if you care) CIELUV attempts to define an encoding with uniformity in the perceptibility of color differences. The non-linear relations for L*, u*, and v* are given below: The quantities u n and v n are the (u, v ) chromaticity coordinates of a specified white object which may be termed the white point and Yn is its luminance.
The CIE 1936 and 1976 LUV Gamuts
Emitted (Additive) Color Mixing Combine Red + Green Red + Blue Green + Blue Red + Green + Blue Perceived As Yellow Magenta Cyan White
Reflected (Substractive) Color We do not perceive only emitted light. Most light that we perceive is reflected off of objects. When light is reflected, what we actually perceive is the light that is not absorbed, i.e., if all colors of light except those of the red wavelengths are absorbed, we perceive a red object.
Subtractive Color Mixing When the source of color is pigment or dye, the result of combining colors is different from when the source of color is light. Subtractive color mixing occurs when light is reflected off a surface or is filtered through a translucent object. For example, a red pigment or filter only appears red because it absorbs (subtracts) all of the light that is not red and only reflects or allows the red light. Similarly, a green pigment only reflects green light and a green filter only passes green light. Combine Absorbs Leaves Cyan + Magenta Red + Green Blue Cyan + Yellow Red + Blue Green Magenta + Yellow Green + Blue Red Cyan + Magenta + Yellow Red + Green + Blue Black
CMYK Colors With reflected (subtractive) color we are basically mixing pigments to absorb different colors of light rather than mixing light colors. The black created by mixing Cyan, Magenta and Yellow is not generally satisfactory, so we usually add an actual black.
It s the Same Color Wheel; We are just mixing it differently End of color sidequest
A Few Examples of RGB colors White = 255, 255, 255 Black = 0, 0, 0 Purple = 157, 95, 82
Video Compression Temporal just pass the differences between frames Spatial remove redundant information in single frame Do both Why do we care? 1280 x 1024 x 24 x 60 = 235,929,600 bits/sec If your basic technology operates at 1MHz, 236MHz is a pretty big leap
Video Compression Techniques Run-length encoding Difference encoding Reduce size of image (fewer pixels) Reduce color granularity Modern processors/gpus are fast enough that this is less of a concern, but, we are making displays higher resolution, e.g., 4K displays 4K x 4K x 32 x 60 = 32 GHz 4K x 4K x 32 x 72 = 38.5 GHz