Administrivia New students? No class Thursday 9/27 Lab Problem Set Favorite browser and why Favorite search engine and why Questions??

Slides:



Advertisements
Similar presentations
CMSC 150 DATA REPRESENTATION CS 150: Mon 30 Jan 2012.
Advertisements

Number Representation and Logic Design CS 3220 Fall 2014 Hadi Esmaeilzadeh Georgia Institute of Technology Some slides adopted from.
Administrivia Any new students?
Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates Invitation to Computer Science, Java Version, Third Edition.
Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates Invitation to Computer Science, C++ Version, Third Edition.
Computer Structures Lecture 2: Working with 0’s and 1’s.
Administrivia Assignments Labs Questions?? Class questions – –Goes to dpd and the TA’s Hand in lab assignments.
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Lecture 3 Dr. Shi Dept. of Electrical and Computer Engineering.
Binary Representation
CS 61C L02 Number Representation (1) Garcia, Spring 2004 © UCB Lecturer PSOE Dan Garcia inst.eecs.berkeley.edu/~cs61c CS61C.
Midterm Review October 23, 2001.
Addition : _________________ Binary Numbers (contd)
Chapter 1 Data Storage. 2 Chapter 1: Data Storage 1.1 Bits and Their Storage 1.2 Main Memory 1.3 Mass Storage 1.4 Representing Information as Bit Patterns.
Review: Our Friend the Logic Puzzle
Codes and number systems Introduction to Computer Yung-Yu Chuang with slides by Nisan & Schocken ( ) and Harris & Harris (DDCA)
ASCII and Unicode. ASCII Inside a computer, EVERYTHING is a number – that includes music, sound, and text. In the early days of computers, every manufacturer.
Dr. Bernard Chen Ph.D. University of Central Arkansas
(2.1) Fundamentals  Terms for magnitudes – logarithms and logarithmic graphs  Digital representations – Binary numbers – Text – Analog information 
BR 8/99 Digital Devices Integrated Circuits that operate on Digital Data are in 95% of every electrical powered device in the U.S. The theory of operation.
Binary Numbers. Why Binary? Maximal distinction among values  minimal corruption from noise Imagine taking the same physical attribute of a circuit,
 Value, Variable and Data Type  Type Conversion  Arithmetic Expression Evaluation  Scope of variable.
Logic and data representation Revision. AND gate A B A B All inputs have to be true ( i.e 1) for the output of the gate to be high, in all other cases.
1 CS 502: Computing Methods for Digital Libraries Lecture 4 Text.
Computer Science 1000 Digital Circuits. Digital Information computers store and process information using binary as we’ve seen, binary affords us similar.
Binary Numbers.
Click to edit Master title style Click to edit Master text styles –Second level Third level –Fourth level »Fifth level 1 Today’s Topics How information.
Pengantar Teknologi Informasi dan Ilmu Komputer Information Technology and Data Representation PTIIK- UB.
EX_01.1/46 Numeric Systems. EX_01.2/46 Overview Numeric systems – general, Binary numbers, Octal numbers, Hexadecimal system, Data units, ASCII code,
ECEN2102 Digital Logic Design Lecture 1 Numbers Systems Abdullah Said Alkalbani University of Buraimi.
10-Sep Fall 2001: copyright ©T. Pearce, D. Hutchinson, L. Marshall Sept Representing Information in Computers:  numbers: counting numbers,
Text and Graphics September 26, Unit 3.
CSC Intro. to Computing Lecture 5: Boolean Logic, Gates, & Circuits.
Binary Numbers. Why Binary? Maximal distinction among values  minimal corruption from noise Imagine taking the same physical attribute of a circuit,
Chapter 1: Digital Computers and Information Illustration at beginning of each Chapter Base 10 Binary Base 2 Octal Base 8 Hex bas
CMSC 104, Lecture 051 Binary / Hex Binary and Hex The number systems of Computer Science.
COMP 1321 Digital Infrastructure Richard Henson University of Worcester October 2013.
Chapter 1 Data Storage © 2007 Pearson Addison-Wesley. All rights reserved.
Computer Science Binary. Binary Code Remember the power supply that is inside your computer and how it sends electricity to all of the components? That.
Data Representation Conversion 24/04/2017.
Data Representation, Number Systems and Base Conversions
COMP 1321 Digital Infrastructure Richard Henson University of Worcester October 2015.
Data Storage © 2007 Pearson Addison-Wesley. All rights reserved.
Computer Science I Storing data. Binary numbers. Classwork/homework: Catch up. Do analysis of image types.
Data Storage © 2007 Pearson Addison-Wesley. All rights reserved.
1 Digital Logic Design Engr. Kashif Shahzad. 2 What’s Course About?  Digital logic, focusing on the design of computers  Stay above transistor level.
09/06/ Data Representation ASCII, Binary Denary Conversion, Integer & Boolean data types.
1 Review of Boolean algebra Not is a horizontal bar above the number –0 = 1 –1 = 0 Or is a plus –0+0 = 0 –0+1 = 1 –1+0 = 1 –1+1 = 1 And is multiplication.
Nat 4/5 Computing Science Data Representation Lesson 3: Storing Text
Binary Representation in Text
Binary Representation in Text
Binary and Hard Disk PEOPLE Program
3 – Boolean Logic and Logic Gates 4 – Binary Numbers
Invitation to Computer Science, C++ Version, Fourth Edition
Chapter 3 - Binary Numbering System
Object Oriented Programming
COMP 1321 Digital Infrastructure
Fundamentals & Ethics of Information Systems IS 201
Invitation to Computer Science, Java Version, Third Edition
BEE1244 Digital System and Electronics BEE1244 Digital System and Electronic Chapter 2 Number Systems.
Chapter 1 Data Storage.
CISC101 Reminders Your group name in onQ is your grader’s name.
Data Representation Conversion 05/12/2018.
COMP 1321 Digital Infrastructure
Logic Gates.
Number Systems Lecture 2.
Data Binary Conversion.
Binary Numbers.
LO1 – Understand Computer Hardware
UNIT – 3 & 4. Data Representation and Internal
Presentation transcript:

Administrivia New students? No class Thursday 9/27 Lab Problem Set Favorite browser and why Favorite search engine and why Questions??

Collaboration Policy On Problem Sets / Labs: Allowed (actually, encouraged): Talk with friends (or strangers) about problems, but write up on your own Not Allowed: Copying verbatim On Exams: Obviously, no collaboration allowed. Exams will be open notes

Big Ideas in Computer Science

The secret lives of 0’s and 1’s

A Simple Logic Puzzle Frank will go to the party if Ed goes AND Dan does NOT. Dan will go if Bob does NOT go OR if Carole goes. Ed will go to the party if Alice AND Bob go. Alice and Bob decide to go, but Carol stays home. Will Frank go to the party?

AND Gate (cont.) AND W Y Z X W X Y Z

OR OR Gate (cont.) W Y Z X W X Y Z 000? 001? 010? 011? 100? 101? 110? 1 11?

NOT Gate “Yanni will go to the party if Xena does NOT go.” X Y Truth Table NOT X Y Shorthand: X Y

OR AND Logic Puzzle Circuit AND Ed Dan Frank Carole Alice Bob

Modified AND Gate AND A C F B A B C F

Can realize any Truth Table by the Universal Method AND A C B A C A C B B A B C F

OR Universal Method AND A C B A C A C B B Combine AND gates with an OR gate. F Build an AND gate for each 1 in the truth table

Universality For ANY Truth Table we can write down, we can make a circuit for it using only 3 Logic Gates: AND, OR, NOT In real life, make AND/OR/NOT gates out of Transistors

Our First Abstract Tool Universal Method: Circuits for ANY Truth Table Computers We are here Universal Method 0’s & 1’s

Next Time: Why are 0’s and 1’s all we need?

Limits of the Universal Method For how large a circuit can we realistically expect to use the Universal Method? What do we do for larger circuits?

Numeracy How large do circuits get? How large do truth tables get?

Numeracy (cont.) X Y input Truth Table 2 rows

Numeracy (cont.) X Y input Truth Table 2 rows X Y Z input Truth Table 4 rows

Numeracy (cont.) 3-input Truth Table: 8 rows A B C F

Numeracy (cont.) InputsRows in truth table ?? 5 Arbitrary N??

Numeracy (cont.) Each input can be 0 or 1 : 2 possibilities. So if there are 4 inputs, that is a total of 2 * 2 * 2 * 2 = 16 possible input values.

Numeracy (cont.) InputsRows in truth table ?? Arbitrary N??

Numeracy (cont.) InputsRows in truth table Arbitrary N??

Numeracy (cont.) Each input can be 0 or 1 : 2 possibilities. In general, if there are n inputs, there will be 2 n possible input values.

Numeracy (cont.) InputsRows in truth table Arbitrary N2N2N

Powers of 2 2 n comes up a lot in Computer Science. Numbers to memorize: 2 1 = 2, 2 2 = 4, 2 3 = 8, 2 4 = 16, 2 5 = 32, 2 6 = 64, 2 7 = 128, 2 8 = 256, 2 9 = 512, 2 10 = 1024

Powers of 2 (cont.) 2 10 = 1, = 1,048, = 1,073,741, = 1,099,511,627, = 1,125,899,906,842, = 1,152,921,504,606,846,976

Powers of 2 (cont.) Some rough numbers: 2 10 = 1,024  1,000 (10 3 ) 2 20 = 1,048,576  1,000,000 (10 6 ) 2 30  1,000,000,000 (10 9 ) 2 40  1,000,000,000,000 (10 12 ) 2 50   10 18

Powers of 2 (cont.) Some rough numbers: 2 10  1,000 (10 3 ) kilo 2 20  1,000,000 (10 6 ) mega RAM 2 30  10 9 giga disk 2 40  teraBIG disk 2 50  peta 2 60  exa knowledge

Sidebar on Exabytes It's taken the entire history of humanity through 1999 to accumulate 12 exabytes of information. By the middle of 2002 the second dozen exabytes will have been created 1 exabytes = 50,000 times the library of congress Floppys to make 1 exabyte would stack 24 million miles high.

Powers of 2 (cont.) 16 inputs means Truth Table has 2 16 = 2 10 * 2 6 = 1,024 * 64  64,000 rows Circuit could have 64,000 or more gates

Universal Method (cont.) What about 100 inputs: Is it reasonable to use Universal Method on Truth Table with 100 inputs?

Universal Method (cont.) What about 100 inputs: Is it reasonable to use Universal Method on Truth Table with 100 inputs?  Each AND/OR/NOT gate uses at least 1 transistor. This is way beyond current technology, in fact...

Numeracy (cont.) State-of-the-art transistors are about.1 micrometer (mm) on a side: Lined end-to-end, you could fit 10,000,000 transistors in 1 m. (  3 f.) In a 1 m. by 1 m. square, you could fit 100,000,000,000,000 transistors That’s still 999,999,999,999,999, 900,000,000,000,000 too few for 100 input Truth Table !

No good? How sad should we be?

No good? How sad should we be? Not very. You just need to use many Truth Tables each having fewer inputs. Can make an entire computer using only 16- input Truth Tables and the Universal Method! On the other hand, must realize that in some cases, we need more efficient special purpose circuits than the Universal Method. (We won’t cover these.)

Our First Abstract Tool Universal Method: Circuits for ANY Truth Table Computers We are here Universal Method 0’s & 1’s

So what? We can deal with 0’s and 1’s now, but why should we? Answer: Because we can represent so many things with 0’s and 1’s.

Meaning In Logic, we thought of 0 and 1 as meaning True and False. Now, we remove these connotations. Definition: a bit is just a single variable that can be 0 or 1.

Representing Information Information in the world comes in many forms – letters, numbers, pictures, sounds… How can we represent these things with 0’s and 1’s? Start with numbers.

Representing Numbers Before computers, in devices, numbers typically represented continuously. e.g. Clocks:

Binary Numbers How do we count normally? 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, … 19, 20, … 99, 100, … 999, 1000, … Suppose we only had two numerals – 0 and 1. Then how would we count? 0, 1, 10, 11, 100, 101, 110, …

Binary Numbers (cont.)

Binary Numbers (cont.) Addition : _______________

Binary Numbers (cont.) Addition – Our “basic” addition table is really easy now: = = = = 10

Binary Numbers (cont.) Addition – just like usual: _______________ = = = =10

Binary Numbers (cont.) Addition – just like usual: _______________ = = = =10

Binary Numbers (cont.) Addition – just like usual: _______________ = = = =10

Binary Numbers (cont.) Addition – just like usual: _______________ = = = =10

Binary Numbers (cont.) If (10) 10 is called 10, what do we call (10) 2 ? Can we convert between binary and decimal? (123) 10 = 2* = 2 2 * *1 + (2 0 * )1 = 2 3 *15 + 0* *1 + (2 0 * )1 = ……. = ( ) 2 (101101) 2 = = = 45

Binary Numbers (cont.) Can also do: Subtraction, Multiplication, etc Negative Numbers Fractions Great, where do Logic Circuits fit in?

Binary Numbers (cont.) For Addition on small numbers, can make a truth table: X Y Z Problem: Output can be 2 bits sometimes

Binary Numbers (cont.) Addition Truth Table with Multiple Outputs: X Y AB

Binary Numbers (cont.) Same as 2 Truth Tables: X Y A X Y B

Binary Numbers (cont.) Same as 2 Truth Tables: Now we can convert into 2 circuits! X Y A X Y B

Binary Numbers (cont.) X Y B OR B AND X Y X Y A X Y X Y A

Binary Numbers (cont.) X Y B OR B AND X Y X Y This is often called the eXclusive OR (XOR) circuit We say that B is the exclusive OR of X and Y. We write B = X Y.

A Logic Puzzle? Bob will go to the party if Ed goes OR Dan goes. Dan will go if Xena does NOT go AND Yanni goes. Ed will go if Xena goes AND Yanni does NOT go. This is addition without the carry Bob goes if the XOR of Xena and Yanni go.

A Simple Breakthrough We can represent information by bits. (So we interpret bits to mean things like numbers.) Then we re-interpret those bits as Logical True/False values. Finally we use Universal Method to construct circuits for operations on information (like Addition).

Intermission Questions?? How are we going to build a circuit for addition?

Addition X1X2Y1Y2Z1Z2C X1 X2 Y1 Y2 ========= C Z1 Z2 C is the carry bit

Addition X1X2Y1Y2Z1Z2C X1 X2 Y1 Y2 ========= C Z1 Z2 C is the carry bit Could have 3 circuits 16 inputs each 2 w/ 8 ANDs, 1 OR 1 w 6 ANDs, 1 OR 25 gates

Addition X1 X2 Y1 Y2 ========= C Z1 Z2 Rewrite as X2X1 Y2Y1 ====C2 C2 Z2 ======== C Z1

Addition X2 Y2 ==== C2 Z2 X1 Y1 C2 ==== C Z1 2 circuits total of 4 gates X1Y1C2CZ circuits total of 10 gates

Addition Z2 C2 X1 Y1 Universal Circuit For Z1 and carry Universal Circuit For Z2 and carry Z1 Carry X2 Y2

Inside the box Z2 C2 Universal Circuit For Z2 and carry X2 Y2 AND OR Z2 AND C2 X2 Y2

Addition We can use 2 building blocks to add numbers of any length. Actually we need only 1 building block ith bit of X ith bit of Y carry bit ith bit of Z carry bit out Abstraction in action -- This is a piece of a carry-ripple adder

Carry-Ripple Adder Z0 C0 Universal Circuit X0 Y0 Z1 C1 Universal Circuit For Z2 and carry X1 Y1 Z2 C2 Universal Circuit For Z2 and carry X2 Y2 X2 X1 X0 Y2 Y1 Y0 ============ C2 Z2 Z1 Z0 0 Fixed at 0

Representing information How do we represent characters? –How many characters might we want to represent? –What characters might we want to represent?

Representing information How do we represent characters? –How many characters might we want to represent? –What characters might we want to represent? A-Z 26 A-Z and a-z 52 All the keys on my keyboard 104 Maybe a power of 2? 128 Maybe an even power of 2? 256 Maybe an even bigger power of 2?65536

Representing characters ASCII is the American Standard Code for Information Interchange. It is a 7-bit code. Many 8-bit codes contain ASCII as their lower half The ASCII standard was published by the United States of America Standards Institute (USASI) in 1968.

Unicode Universal Character Set (UCS) contains all characters of all other character set standards. It also guarantees round-trip compatibility, i.e., conversion tables can be built such that no information is lost when a string is converted from any other encoding to UCS and back. UCS contains the characters required to represent almost all known languages. This includes apart from the many languages which use extensions of the Latin script also the following scripts and languages: Greek, Cyrillic, Hebrew, Arabic, Armenian, Gregorian, Japanese, Chinese, Hiragana, Katakana, Korean, Hangul, Devangari, Bengali, Gurmukhi, Gujarati, Oriya, Tamil, Telugu, Kannada, Malayam, Thai, Lao, Bopomofo, and a number of others. Work is going on to include further scripts like Tibetian, Khmer, Runic, Ethiopian, Hieroglyphics, various Indo-European languages, and many others. It’s intended to use 31 bits (32768 possible characters)

What do we do in practice Problems –Bits represent too little – too many are needed –Decimal numbers don’t translate well into bits So, –Group into blocks of 4 and 8 bits 8 bits = 256 characters, holds ASCII 8 bits make 1 byte – things are organized into bytes 4 bits make 1 nibble

Shorthand: Hexadecimal ABCDEF89ABCDEF

Hexadecimal We can add numbers –1+1=2, 2+2=4, 4+4=8, 4+8=C, 2+8=A, … We can combine 2 hexadecimal numbers to make a byte. It’s easier to read than 0’s and 1’s In ASCII –hex 41 through 5A represent A to Z –Hex 61 through 7A represent a to z

Summary Review of gates and the Universal Method Show that the universal method can lead to very big circuits Fix the problem Demonstrate the fix –Carry-ripple adder (a meaty example) Representing characters –Hexadecimal –Bytes, nibbles

Next Time: Memory Now that we can represent it, how do we store it??