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

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

  • View
    214

  • Download
    0

Embed Size (px)

Citation preview

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

Administrivia

• New students?

• No class Thursday 9/27

• Lab

• Problem Set

• Favorite browser and why

• Favorite search engine and why

• Questions??

Page 2: 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

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

Big Ideas in Computer Science

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

The secret lives of 0’s and 1’s

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

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?

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

AND Gate (cont.)

ANDW

Y

ZX W X Y Z

0 0 0 0

0 0 1 0

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 0

1 1 0 0

1 1 1 1

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

OR

OR Gate (cont.) W

Y

ZX W X Y Z

0 0 0 ?

0 0 1 ?

0 1 0 ?

0 1 1 ?

1 0 0 ?

1 0 1 ?

1 1 0 ?

1 1 1 ?

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

NOT Gate • “Yanni will go to the party if Xena does NOT

go.”

X Y

Truth Table

NOT

X Y

Shorthand:

X Y

0 1

1 0

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

OR

AND

Logic Puzzle Circuit

AND

Ed

Dan

Frank

Carole

Alice

Bob

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

Modified AND Gate

ANDA

C

FB A B C F

0 0 0 0

0 0 1 0

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 0

1 1 0 1

1 1 1 0

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

Can realize any Truth Table by the Universal Method

ANDA

C

B

ANDA

C

ANDA

C

B

B

A B C F

0 0 0 0

0 0 1 1

0 1 0 1

0 1 1 0

1 0 0 0

1 0 1 0

1 1 0 1

1 1 1 0

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

OR

Universal Method

ANDA

C

B

ANDA

C

ANDA

C

B

BCombine AND gates with an OR gate.

F

Build an AND gatefor each 1 in thetruth table

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

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 gatesout of Transistors

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

Our First Abstract ToolUniversal Method: Circuits for ANY Truth Table

Computers

We are here

UniversalMethod

0’s&1’s

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

Next Time:Why are 0’s and 1’s all

we need?

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

Why are 0’s and 1’s allwe need?

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

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?

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

Numeracy• How large do circuits get?

• How large do truth tables get?

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

Numeracy (cont.)

X Y

0 1

1 0

1-input Truth Table

2 rows

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

Numeracy (cont.)

X Y

0 1

1 0

1-input Truth Table

2 rows

X Y Z

0 0 0

0 1 1

1 0 1

1 1 1

2-input Truth Table

4 rows

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

Numeracy (cont.)

3-input Truth Table: 8 rows

A B C F

0 0 0 0

0 0 1 1

0 1 0 1

0 1 1 0

1 0 0 0

1 0 1 0

1 1 0 1

1 1 1 0

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

Numeracy (cont.)

Inputs Rows in truth table

1 2

2 4

3 8

4 ??

5 ??

Arbitrary N ??

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

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.

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

Numeracy (cont.)

Inputs Rows in truth table

1 2

2 4

3 8

4 16

5 ??

Arbitrary N ??

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

Numeracy (cont.)

Inputs Rows in truth table

1 2

2 4

3 8

4 16

5 32

Arbitrary N ??

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

Numeracy (cont.)• Each input can be 0 or 1 : 2 possibilities.

• In general, if there are n inputs,

there will be 2n possible input values.

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

Numeracy (cont.)

Inputs Rows in truth table

1 2

2 4

3 8

4 16

5 32

Arbitrary N 2N

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

Powers of 2

• 2n comes up a lot in Computer Science.

• Numbers to memorize:

• 21 = 2, 22 = 4, 23 = 8,

• 24 = 16, 25 = 32, 26 = 64,

• 27 = 128, 28 = 256, 29 = 512,

• 210 = 1024

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

Powers of 2 (cont.)

210 = 1,024

220 = 1,048,576

230 = 1,073,741,824

240 = 1,099,511,627,776

250 = 1,125,899,906,842,624

260 = 1,152,921,504,606,846,976

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

Powers of 2 (cont.)• Some rough numbers:

210 = 1,024 1,000 (103 )

220 = 1,048,576 1,000,000 (106 )

230 1,000,000,000 (109 )

240 1,000,000,000,000 (1012 )

250 1015

260 1018

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

Powers of 2 (cont.)• Some rough numbers:

210 1,000 (103 ) kilo

220 1,000,000 (106 ) mega

RAM

230 109 giga

disk

240 1012 tera BIG

disk

250 1015 peta

260 1018 exa

knowledge

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

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.

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

Powers of 2 (cont.)

• 16 inputs means Truth Tablehas 216 = 210 * 26 = 1,024 * 64 64,000 rows

• Circuit could have 64,000 or more gates

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

Universal Method (cont.)• What about 100 inputs:

• Is it reasonable to use Universal Method on Truth Table with 100 inputs?

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

Universal Method (cont.)• What about 100 inputs:

• Is it reasonable to use Universal Method on Truth Table with 100 inputs?

• 2100 1030

• Each AND/OR/NOT gate uses at least 1 transistor.

• This is way beyond current technology,in fact . . .

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

Numeracy (cont.)• State-of-the-art transistors are about

.1 micrometer (mm) on a side:

• Lined end-to-end, you could fit10,000,000 transistors in 1 m. ( 3 f.)

• In a 1 m. by 1 m. square, you could fit100,000,000,000,000 transistors

• That’s still 999,999,999,999,999, 900,000,000,000,000too few for 100 input Truth Table !

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

No good?• How sad should we be?

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

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 efficientspecial purpose circuits than the UniversalMethod. (We won’t cover these.)

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

Our First Abstract ToolUniversal Method: Circuits for ANY Truth Table

Computers

We are here

UniversalMethod

0’s&1’s

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

So what?• We can deal with 0’s and 1’s now,

but why should we?

• Answer: Because we canrepresent so many thingswith 0’s and 1’s.

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

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.

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

Representing Information• Information in the world comes in many

forms – letters, numbers, pictures, sounds…

• How can we represent these thingswith 0’s and 1’s?

• Start with numbers.

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

Representing Numbers• Before computers, in devices,

numbers typically represented continuously.

• e.g. Clocks:

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

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, …

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

Binary Numbers (cont.)

0

1

2

3

4

5

6

7

8

0

1

1 0

1 1

1 0 0

1 0 1

1 1 0

1 1 1

1 0 0 0

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

Binary Numbers (cont.)• Addition :

1 0 1

+ 1 1 1

_______________

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

Binary Numbers (cont.)• Addition – Our “basic” addition table

is really easy now:

• 0 + 0 = 0

• 0 + 1 = 1

• 1 + 0 = 1

• 1 + 1 = 10

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

Binary Numbers (cont.)• Addition – just like usual:

1 0 1

+ 1 1 1

_______________

0 + 0 =0

0 + 1 = 1

1 + 0 = 1

1 + 1 =10

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

Binary Numbers (cont.)• Addition – just like usual:

1

1 0 1

+ 1 1 1

_______________

0

0 + 0 =0

0 + 1 = 1

1 + 0 = 1

1 + 1 =10

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

Binary Numbers (cont.)• Addition – just like usual:

1 1

1 0 1

+ 1 1 1

_______________

0 0

0 + 0 =0

0 + 1 = 1

1 + 0 = 1

1 + 1 =10

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

Binary Numbers (cont.)• Addition – just like usual:

1 1

1 0 1

+ 1 1 1

_______________

1 1 0 0

0 + 0 =0

0 + 1 = 1

1 + 0 = 1

1 + 1 =10

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

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*61 + 1

= 22*30 + 21 *1 + (20 * )1

= 23*15 + 0* 22 + 21 *1 + (20 * )1

= 26+ 25 + 24 + 23 + 21 + 20

……. = (1111011)2

(101101) 2 = 25 + 23 + 22 + 20 = 32 + 8 + 4 + 1 = 45

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

Binary Numbers (cont.)• Can also do:

• Subtraction, Multiplication, etc

• Negative Numbers

• Fractions

• Great, where do Logic Circuits fit in?

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

Binary Numbers (cont.)• For Addition on small numbers,

can make a truth table:

X Y Z

0 0 0

0 1 1

1 0 1

1 1 10

Problem:Output canbe 2 bits

sometimes

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

Binary Numbers (cont.)• Addition Truth Table with Multiple

Outputs:

X Y AB

0 0 0 0

0 1 0 1

1 0 0 1

1 1 1 0

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

Binary Numbers (cont.)• Same as 2 Truth Tables:

X Y A

0 0 0

0 1 0

1 0 0

1 1 1

X Y B

0 0 0

0 1 1

1 0 1

1 1 0

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

Binary Numbers (cont.)• Same as 2 Truth Tables:

• Now we can convert into 2 circuits!

X Y A

0 0 0

0 1 0

1 0 0

1 1 1

X Y B

0 0 0

0 1 1

1 0 1

1 1 0

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

Binary Numbers (cont.)

X Y B

0 0 0

0 1 1

1 0 1

1 1 0

ORB

ANDX

Y

ANDX

Y

AAND

X

Y

X Y A

0 0 0

0 1 0

1 0 0

1 1 1

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

Binary Numbers (cont.)

X Y B

0 0 0

0 1 1

1 0 1

1 1 0

ORB

ANDX

Y

ANDX

Y

This is often called the eXclusive OR (XOR) circuitWe say that B is the exclusive OR of X and Y.

We write B = X Y.

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

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.

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

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).

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

Intermission

• Questions??

• How are we going to build a circuit for addition?

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

AdditionX1 X2 Y1 Y2 Z1 Z2 C

0 0 0 0 0 0 0

0 0 0 1 0 1 0

0 0 1 0 1 0 0

0 0 1 1 1 1 0

0 1 0 0 0 1 0

0 1 0 1 1 0 0

0 1 1 0 1 1 0

0 1 1 1 0 0 1

1 0 0 0 1 0 0

1 0 0 1 1 1 0

1 0 1 0 0 0 1

1 0 1 1 0 1 1

1 1 0 0 1 1 0

1 1 0 1 0 0 1

1 1 1 0 0 1 1

1 1 1 1 1 0 1

X1 X2 Y1 Y2 ========= C Z1 Z2

C is the carry bit

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

AdditionX1 X2 Y1 Y2 Z1 Z2 C

0 0 0 0 0 0 0

0 0 0 1 0 1 0

0 0 1 0 1 0 0

0 0 1 1 1 1 0

0 1 0 0 0 1 0

0 1 0 1 1 0 0

0 1 1 0 1 1 0

0 1 1 1 0 0 1

1 0 0 0 1 0 0

1 0 0 1 1 1 0

1 0 1 0 0 0 1

1 0 1 1 0 1 1

1 1 0 0 1 1 0

1 1 0 1 0 0 1

1 1 1 0 0 1 1

1 1 1 1 1 0 1

X1 X2 Y1 Y2 ========= C Z1 Z2

C is the carry bit

Could have 3 circuits16 inputs each

2 w/ 8 ANDs, 1 OR1 w 6 ANDs, 1 OR

25 gates

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

Addition X1 X2 Y1 Y2 ========= C Z1 Z2

Rewrite as

X2 X1

Y2 Y1

==== C2

C2 Z2 ========

C Z1

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

Addition X2

Y2

====

C2 Z2

X1

Y1

C2

====

C Z1

2 circuits

total of 4 gates

X1 Y1 C2 C Z1

0 0 0 0 0

0 0 1 0 1

0 1 0 0 1

0 1 1 1 0

1 0 0 0 1

1 0 1 1 0

1 1 0 1 0

1 1 1 1 1

3 circuits

total of 10 gates

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

Addition

Z2

C2

X1

Y1

UniversalCircuitFor Z1 and carry

UniversalCircuitFor Z2 and carry

Z1

Carry

X2

Y2

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

Inside the boxZ2

C2

UniversalCircuitFor Z2 and carry

X2

Y2AND

AND

ORZ2

ANDC2

X2

X2

X2

Y2

Y2

Y2

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

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

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

Carry-Ripple Adder

Z0

C0

UniversalCircuit

X0

Y0

Z1

C1

UniversalCircuitFor Z2 and carry

X1

Y1

Z2

C2

UniversalCircuitFor Z2 and carry

X2

Y2

X2 X1 X0 Y2 Y1 Y0============C2 Z2 Z1 Z0

0

Fixed at 0

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

Representing information

• How do we represent characters?– How many characters might we want to

represent?– What characters might we want to represent?

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

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

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

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.

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

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)

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

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

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

Shorthand: Hexadecimal

0

1

2

3

4

5

6

7

0 0 0 0

0 0 0 1

0 0 1 0

0 0 1 1

0 1 0 0

0 1 0 1

0 1 1 0

0 1 1 1

8

9

A

B

C

D

E

F

1 0 0 0

1 0 0 1

1 0 1 0

1 0 1 1

1 1 0 0

1 1 0 1

1 1 1 0

1 1 1 1

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

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

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

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

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

Next Time:Memory

Now that we can represent it, how do we store it??