Welcome to Comp 411! 2) Course Objectives. 1) Course Mechanics. 3) Information. I thought this course was called Computer Organization

Similar documents
Lecture 1: Shannon s Theorem

Lecture 11: Information theory THURSDAY, FEBRUARY 21, 2019

1. Basics of Information

6.02 Fall 2011 Lecture #9

CprE 281: Digital Logic

An introduction to basic information theory. Hampus Wessman

6.02 Fall 2012 Lecture #1

Discrete Mathematics and Probability Theory Fall 2013 Vazirani Note 12. Random Variables: Distribution and Expectation

Probability (Devore Chapter Two)

Information and Entropy. Professor Kevin Gold

Roll No. :... Invigilator's Signature :.. CS/B.TECH(ECE)/SEM-7/EC-703/ CODING & INFORMATION THEORY. Time Allotted : 3 Hours Full Marks : 70

Discrete Mathematics and Probability Theory Fall 2014 Anant Sahai Note 15. Random Variables: Distributions, Independence, and Expectations

Information in Biology

20. Combinational Circuits

Discrete Mathematics and Probability Theory Fall 2012 Vazirani Note 14. Random Variables: Distribution and Expectation

CPSC 121 Midterm 1 Tuesday, October 11th, 2011

Information in Biology

1 Ex. 1 Verify that the function H(p 1,..., p n ) = k p k log 2 p k satisfies all 8 axioms on H.

CpE358/CS381. Switching Theory and Logical Design. Summer

Information & Correlation

Decision Trees. Nicholas Ruozzi University of Texas at Dallas. Based on the slides of Vibhav Gogate and David Sontag

Course Review. Kin 304W Week 14: April 9, 2013

Computer Science. 19. Combinational Circuits. Computer Science COMPUTER SCIENCE. Section 6.1.

Applications. Smartphone, tablet, game controller, antilock brakes, microprocessor, Wires

Lecture 7: DecisionTrees

We are here. Assembly Language. Processors Arithmetic Logic Units. Finite State Machines. Circuits Gates. Transistors

Class Website:

Discrete Mathematics and Probability Theory Spring 2016 Rao and Walrand Note 16. Random Variables: Distribution and Expectation

Decision Trees. CSC411/2515: Machine Learning and Data Mining, Winter 2018 Luke Zettlemoyer, Carlos Guestrin, and Andrew Moore

Shannon's Theory of Communication

CprE 281: Digital Logic

Entropies & Information Theory

Example: sending one bit of information across noisy channel. Effects of the noise: flip the bit with probability p.

1. Counting. Chris Piech and Mehran Sahami. Oct 2017

EE 229B ERROR CONTROL CODING Spring 2005

Sequential Logic (3.1 and is a long difficult section you really should read!)

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Digital Logic

CS6375: Machine Learning Gautam Kunapuli. Decision Trees

Entropy as a measure of surprise

E40M. Binary Numbers. M. Horowitz, J. Plummer, R. Howe 1

Probability (Devore Chapter Two)

Digital communication system. Shannon s separation principle

Computer Science. 20. Combinational Circuits. Computer Science COMPUTER SCIENCE. Section

Designing Information Devices and Systems I Fall 2018 Lecture Notes Note Introduction to Linear Algebra the EECS Way

UNIT I INFORMATION THEORY. I k log 2

Digital Communications III (ECE 154C) Introduction to Coding and Information Theory

Massachusetts Institute of Technology

L14. 1 Lecture 14: Crash Course in Probability. July 7, Overview and Objectives. 1.2 Part 1: Probability

Lecture 1. Introduction

Software Testing Lecture 2

Massachusetts Institute of Technology. Solution to Problem 1: The Registrar s Worst Nightmare

S C F F F T T F T T S C B F F F F F T F T F F T T T F F T F T T T F T T T

Logic. Combinational. inputs. outputs. the result. system can

! Where are we on course map? ! What we did in lab last week. " How it relates to this week. ! Compression. " What is it, examples, classifications

Memory, Latches, & Registers

Physical Layer and Coding

Counting. 1 Sum Rule. Example 1. Lecture Notes #1 Sept 24, Chris Piech CS 109

Math 1313 Experiments, Events and Sample Spaces

Practice Second Midterm Exam I

Information Theory. Week 4 Compressing streams. Iain Murray,

What s the Deal? MULTIPLICATION. Time to multiply

CS173 Lecture B, November 3, 2015

STA Module 4 Probability Concepts. Rev.F08 1

Binary addition example worked out

Announcements Wednesday, September 20

God doesn t play dice. - Albert Einstein

ASTR 4 Solar System Astronom y

Discrete Probability and State Estimation

Optimisation and Operations Research

Building a Computer Adder

Probabilistic Systems Analysis Spring 2018 Lecture 6. Random Variables: Probability Mass Function and Expectation

Intro to Information Theory

Decision Trees. CSC411/2515: Machine Learning and Data Mining, Winter 2018 Luke Zettlemoyer, Carlos Guestrin, and Andrew Moore

Probability and Inference. POLI 205 Doing Research in Politics. Populations and Samples. Probability. Fall 2015

Discrete Mathematics for CS Spring 2006 Vazirani Lecture 22

Announcements Monday, September 18

PAST EXAM PAPER & MEMO N3 ABOUT THE QUESTION PAPERS:

4.8 Huffman Codes. These lecture slides are supplied by Mathijs de Weerd

9. Distance measures. 9.1 Classical information measures. Head Tail. How similar/close are two probability distributions? Trace distance.

Lecture 1: September 25, A quick reminder about random variables and convexity

Bits. Chapter 1. Information can be learned through observation, experiment, or measurement.

CPE100: Digital Logic Design I

STAT/SOC/CSSS 221 Statistical Concepts and Methods for the Social Sciences. Random Variables

We set up the basic model of two-sided, one-to-one matching

Discrete Mathematics and Probability Theory Spring 2016 Rao and Walrand Note 14

XOR - XNOR Gates. The graphic symbol and truth table of XOR gate is shown in the figure.

U Logo Use Guidelines

Using Microsoft Excel

CSCI 2570 Introduction to Nanocomputing

Physics 162a Quantum Mechanics

Probability Experiments, Trials, Outcomes, Sample Spaces Example 1 Example 2

Module 2. Basic Digital Building Blocks. Binary Arithmetic & Arithmetic Circuits Comparators, Decoders, Encoders, Multiplexors Flip-Flops

UCSD CSE 21, Spring 2014 [Section B00] Mathematics for Algorithm and System Analysis

MATH 3C: MIDTERM 1 REVIEW. 1. Counting

ECE321 Electronics I

Math 381 Midterm Practice Problem Solutions

Chapter 14. From Randomness to Probability. Copyright 2012, 2008, 2005 Pearson Education, Inc.

Math 31 Lesson Plan. Day 5: Intro to Groups. Elizabeth Gillaspy. September 28, 2011

MATH STUDENT BOOK. 12th Grade Unit 9

Solutions for week 1, Cryptography Course - TDA 352/DIT 250

Transcription:

Welcome to Comp 4! I thought this course was called Computer Organization David Macaulay ) Course Mechanics 2) Course Objectives 3) Information L - Introduction

Meet the Crew Lectures: Leonard McMillan (SN-258) Office Hours T 2-3 TA: TBA (We ll find out next Monday) Book: Patterson & Hennessy Computer Organization & Design 3 rd Edition, ISBN: -5586-64- (However, you won t need it for the next couple of weeks) L - Introduction 2

Course Mechanics Grading: Best 8 of problem sets 4% 2 Quizzes 3% Final Exam 3% Problem sets will be distributed on Wednesdays and are due back on the next Wednesday *lecture* (before it begins). Usually you will have one week to complete each set. Late problem sets will not be accepted, but the lowest two problem-set scores will be dropped. I will attempt to make Lecture Notes, Problem Sets, and other course materials available on the web Before Class on the day they are given. L - Introduction 3

Comp 4: Course Website Announcements, corrections, etc. On-line copies of all handouts http://www.unc.edu/courses/27fall/comp/4/ L - Introduction 4

Goal : Demystify Computers Strangely, most people (even some computer scientists) are afraid of computers. We are only afraid of things we do not understand! I do not fear computers. I fear the lack of them. - Isaac Asimov (92-992) Fear is the main source of superstition, and one of the main sources of cruelty. To conquer fear is the beginning of wisdom. - Bertrand Russell (872 97) L - Introduction 5

Goal 2: Power of Abstraction Define a function, develop a robust implementation, and then put a box around it. Abstraction enables us to create unfathomable systems (including computers). Why do we need ABSTRACTION Imagine a billion ---,,, L - Introduction 6

The key to building systems with >G components Personal Computer: Hardware & Software Circuit Board: 8 / system -2G devices Integrated Circuit: 8-6 / PCB.25M-6M devices Module: 8-6 / IC K devices MOSFET Scheme for representing information Gate: 2-6 / Cell 8 devices Cell: K-K / Module 6-64 devices L - Introduction 7

What do we See in a Computer? Structure hierarchical design: Interfaces limited complexity at each level reusable building blocks Key elements of system engineering; typically outlive the technologies they interface Isolate technologies, allow evolution Major abstraction mechanism What makes a good system design? Bang for the buck : minimal mechanism, maximal function reliable in a wide range of environments accommodates future technical improvements Wait! I think I see a bug in the DIV logic. Got that one off the web. Sure hope it works. L - Introduction 8

Computational Structures What are the fundamental elements of computation? Can we define computation independent of implementation or the substrate that it built upon)? L - Introduction 9

Our Plan of Attack Understand how things work, by alternating between low-level (bottom-up) and high level (top-down) concepts Encapsulate our understanding using appropriate abstractions Study organizational principles: hierarchy, interfaces, APIs. Roll up our sleeves and design at each level of hierarchy Learn engineering tricks - from a historical perspective - using systematic design approaches - diagnose, fix, and avoid bugs L - Introduction

What is Computation? Computation is about processing information - Transforming information from one form to another - Deriving new information from old - Finding information associated with a given input - Computation describes the motion of information through time - Communication describes the motion of information through space L - Introduction

What is Information? information, n. Knowledge communicated or received concerning a particular fact or circumstance. Problem sets, 2 quizzes, and a final! Tarheels won! Are you sure? It is football season A Computer Scientist s Definition: Information resolves uncertainty. Information is simply that which cannot be predicted. The less predictable a message is, the more information it conveys! L - Introduction 2

Real-World Information Why do unexpected messages get allocated the biggest headlines? because they carry the most information. L - Introduction 3

What Does A Computer Process? Toasters processes bread and bagels Blenders processes smoothies and margaritas What does a computer process? 2 allowable answers: Information Bits How does information relate to bits? L - Introduction 4

Quantifying Information (Claude Shannon, 948) Suppose you re faced with N equally probable choices, and I give you a fact that narrows it down to M choices. Then you ve been given: log 2 (N/M) bits of information Information is measured in bits (binary digits) = number of / s required to encode choice(s) Examples: information in one coin flip: log 2 (2/) = bit roll of a single die: log 2 (6/) = ~2.6 bits outcome of a Football game: bit (well, actually, they won may convey more information than they lost ) L - Introduction 5

Example: Sum of 2 dice 2 3 4 5 6 7 8 9 2 i 2 = log 2 (36/) = 5.7 bits i 3 = log 2 (36/2) = 4.7 bits i 4 = log 2 (36/3) = 3.585 bits i 5 = log 2 (36/4) = 3.7 bits i 6 = log 2 (36/5) = 2.848 bits i 7 = log 2 (36/6) = 2.585 bits i 8 = log 2 (36/5) = 2.848 bits i 9 = log 2 (36/4) = 3.7 bits i = log 2 (36/3) = 3.585 bits i = log 2 (36/2) = 4.7 bits i 2 = log 2 (36/) = 5.7 bits The average information provided by the sum of 2 dice: Entropy i 2 M i ave = log 2 ( N ) = p i log 2 ( p N M i ) = i i = 2 i 3. 274 bits L - Introduction 6

Show Me the Bits! Can the sum of two dice REALLY be represented using 3.274 bits? If so, how? The fact is, the average information content is a strict *lower-bound* on how small of a representation that we can achieve. In practice, it is difficult to reach this bound. But, we can come very close. L - Introduction 7

Variable-Length Encoding Of course we can use differing numbers of bits to represent each item of data This is particularly useful if all items are *not* equally likely Equally likely items lead to fixed length encodings: Ex: Encode a particular roll of 5? {(,4), (2,3), (3,2), (4,)} which are equally likely if we use fair dice Entropy = bits 4 p( roll 5)log ( ( 5)) iroll = 2 p rolliroll = = log 2( ) = 4 4 i = i= (,4), (2,3), (3,2), (4,) Back to the original problem. Let s use this encoding: 2-3 - 4-5 - 6-7 - 8-9 - - - 2-4 2 L - Introduction 8

Variable-Length Encoding Taking a closer look 2-3 - 4-5 - 6-7 - 8-9 - - - 2 - Unlikely rolls are encoded using more bits More likely rolls use fewer bits Decoding 2 5 3 6 5 8 3 Example Stream: L - Introduction 9

Huffman Coding A simple *greedy* algorithm for approximating an entropy efficient encoding. Find the 2 items with the smallest probabilities 2. Join them into a new *meta* item whose probability is the sum 3. Remove the two items and insert the new meta item 4. Repeat from step until there is only one item 36/36 Huffman decoding tree 5/36 2/36 7/36 /36 8/36 /36 9 4/36 5 4/36 4/36 4 3/36 5/36 7 6/36 8 5/36 6 5/36 2/36 3 2/36 3/36 2/36 2 /36 2 /36 L - Introduction 2

Converting Tree to Encoding Once the *tree* is constructed, label its edges consistently and follow the paths from the largest *meta* item to each of the real item to find the encoding. 2-3 - 4-5 - 6-7 - 8-9 - - - 2-5/36 36/36 Huffman decoding tree 2/36 9 4/36 8/36 5 4/36 2/36 4/36 7/36 3 2/36 4 3/36 3/36 5/36 2 /36 /36 2/36 7 6/36 2 /36 8 5/36 /36 6 5/36 L - Introduction 2

Encoding Efficiency How does this encoding strategy compare to the information content of the roll? b ave = 36 5 + 36 2 4 + 3 36 3 + 36 4 3 + 5 36 3 + 6 36 3 + 5 36 3 + 36 4 3 + 3 36 4 + 36 2 4 + 36 5 b ave = 3. 36 Pretty close. Recall that the lower bound was 3.274 bits. However, an efficient encoding (as defined by having an average code size close to the information content) is not always what we want! L - Introduction 22

Encoding Considerations - Encoding schemes that attempt to match the information content of a data stream remove redundancy. They are data compression techniques. - However, sometimes our goal in encoding information is increase redundancy, rather than remove it. Why? - Make the information easier to manipulate (fixed-sized encodings) - Make the data stream resilient to noise (error detecting and correcting codes) -Data compression allows us to store our entire music collection in a pocketable device -Data redundancy enables us to store that *same* information *reliably* on a hard drive L - Introduction 23

Error detection using parity Sometimes we add extra redundancy so that we can detect errors. For instance, this encoding detects any single-bit error: 2-3- 4-5- 6-7- 8-9- - - 2-4 ex: 4 6* 7 : 4 9* 7 2: 4 * 7 3: 4 2* 5 4: Same bitstream w/4 possible interpretations if we allow for only one error There s something peculiar about those codings L - Introduction 24

Property : Parity The sum of the bits in each symbol is even. (this is how errors are detected) 2- = + + + + + + = 4 3- = + + + + + + = 6 4- = + + + = 2 5- = + + + = 2 6- = + + + = 2 7- = + + + = 8- = + + + = 2 9- = + + + = 2 - = + + + = 2 - = + + + + + + = 6 2- = + + + + + + = 6 How much information is in the last bit? L - Introduction 25

Property 2: Separation Each encoding differs from all others by at least two bits in their overlapping parts 3 4 5 6 7 8 9 2 2 xx xx xx xx xxxx xx xx xx xx xx 3 xx xx xx xxxx xx xx xx xx xx 4 xx xx xx xx xx xxxx xx xx 5 xx xx xx xxxx xx xx xx 6 xx xxxx xx xx xx xx 7 xx xx xx xxxx xxxx 8 xx xx xx xx 9 xx xx xx xx xx This difference is called xx the Hamming distance A Hamming distance of one-bit is needed to uniquely identify an encoding L - Introduction 26

Error correcting codes We can actually correct -bit errors in encodings separated by a Hamming distance of three. This is possible because the sets of bit patterns located a Hamming distance of from our encodings are distinct. However, attempting error correction with such a small separation is dangerous. Suppose, we have a 2-bit error. Our error correction scheme will then misinterpret the encoding. Misinterpretations also occurred when we had 2-bit errors in our -bit-error-detection (parity) schemes. A safe -bit error correction scheme would correct all -bit errors and detect all 2-bit errors. What Hamming distance is needed between encodings to accomplish this? This is just a voting scheme L - Introduction 27

An alternate error correcting code We can generalize the notion of parity in order to construct error correcting codes. Instead of computing a single parity bit for an entire encoding we can allow multiple parity bits over different subsets of bits. Consider the following technique for encoding 25 bits. This approach is easy to implement, but it is not optimal in terms of the number of bits used. -bit errors will cause both a row and column parity error, uniquely identifying the errant bit for correction. An extra parity bit allows us to detect -bit errors in the parity bits. Many 2-bit errors can also be corrected. However, 2-bit errors involving the same row or column are undetectable. L - Introduction 28

Summary Information resolves uncertainty Choices equally probable: N choices down to M log 2 (N/M) bits of information Choices not equally probable: choice i with probability p i log 2 (/p i ) bits of information average number of bits = Σp i log 2 (/p i ) use variable-length encodings Next time: Technology and Abstraction What makes a computer tick L - Introduction 29