lecture 1 - why digital

6
8/24/2015 1 Welcome!!! PHGN317 – Digital Electronics August 26, 2015 Brian Huang [email protected] Meet the TAs / Support Staff Steve Hill – Lab Manager Casey Cartwright David Grisham Sarah Dunn Emily Makoutz Michael Young Textbook / Reference Begin review Look for homework problems for each lecture Homework problems are posted for each lecture. Try these the night after the lecture - they will provide you with a direct metric of how well you understood the day’s material. The solutions are also posted. If you struggle with the problems - that is a message to you that you need extra help! A newsletter is sent out via email at the end of each month that summarizes the concepts you should be familiar with at that point in the course.

Upload: brian-huang

Post on 21-Feb-2016

221 views

Category:

Documents


0 download

DESCRIPTION

Lecture Slides on "Why Digital" - First lecture for a digital electronics course.

TRANSCRIPT

Page 1: Lecture 1 - Why Digital

8/24/2015

1

Welcome!!!PHGN317 – Digital Electronics

August 26, 2015

Brian Huang

[email protected]

Meet the TAs / Support Staff

• Steve Hill – Lab Manager

• Casey Cartwright

• David Grisham

• Sarah Dunn

• Emily Makoutz

• Michael Young

Textbook / Reference

Begin review

Look for homework problems for each lecture

• Homework problems are posted for each lecture.

• Try these the night after the lecture - they will provide you with a direct metric of how well you understood the day’s material.

• The solutions are also posted.

• If you struggle with the problems - that is a message to you that you need extra help!

• A newsletter is sent out via email at the end of each month that summarizes the concepts you should be familiar with at that point in the course.

Page 2: Lecture 1 - Why Digital

8/24/2015

2

Extra‐credit ‐do a project that changes the world...

Extra‐credit ‐do a project that changes the world...

We’ll meet next Wednesday 4 to 6 PM in the electronics lab. Come make/hack your own project or help with on going

projects

Quad CoptersAutonomous Vehicles

3D LED displayshttp://youtu.be/6mXM-oGggrM

Hack a DVD player to make laser tweezersGPS systems

????

Announcing the Blaster Hackers/Maker space

Analog vs. DigitalMain Points

• Digital Electronics –

– Emphasizes signals that are either TRUE (1) or FALSE (0).

– Emphasizes logic and decision trees.

• Analog Electronics –

– Emphasizes signals that can cover a range of values.  

– Analog Electronics works with signals that can be any value across a range of values.

I. Why digital?

• CDs / MP3s vs. Cassette Tapes

• “Old School” Over the Air TV vs. Cable

• Film cameras vs. Digital cameras

• Old AM or FM vs. HD Radio

• VHS vs. DVDs

• We can control / Manipulate digital!

1.1 Analog versus Digital

Analog Digital

Continuously variable

Discrete (1 or 0)

Amplification Switching (ON/OFF)

Voltages Numbers

Page 3: Lecture 1 - Why Digital

8/24/2015

3

1.2 Digital logic levels

Logic High

Undefined

Logic Low

Binary system has only two digits, 0 and 1

5 V

2 V

0.8 V

0 V

Thresholds and Margins

1.3 Why we use digital

• Digital is repeatable.

• As scientists and engineers, we want to be able to make quantitative measurements of physical phenomena.

• Digital electronics enables unprecedented control over acquisition and analysis.

• Using our knowledge of analog electronics, this semester we will learn to create effective digital systems useful for general experimentation.

1.4 Binary number system

Binary system uses just two digits / symbols for counting – for us we use 1 and 0 – but, we could use any two symbols…

Each symbol is called a “bit” for Binary digIT. 

In the Decimal system…

• What is the maximum value you can represent

– with 2 digits?

– with 3 digits?

– with 6 digits?

• How many values can you “represent” with your 10 symbols?

1.4 Binary number system

With…

1 bit, we can count 0 to 1 (in decimal)

0, 1

2 bits, we can count 0 to 3 (in decimal)

00, 01, 10, 11

3 bits, we can count 0 to 7 (in decimal)

000, 001, 010, 011, 100, 101, 110, 111

4 bits, we can count 0 to 15 (in decimal)

0000, 0001, 0010, 0011, 0100, 0101, 0110, 0111, 

1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111

With N bits  we can count up to  ‐ ‐ For a total of  total numbers.

For example, with 8 bits, we can count up to28 - 1= 255 for 256 numbers (including 0)

Page 4: Lecture 1 - Why Digital

8/24/2015

4

Review of place value (using 10’s)

2385 ⇒ 2 1000 3 100 8 10 5 1

Written another way:

2385 2 10 3 10 8 10 5 10

We just don’t normally think of this way!

Any number can be written using only two Binary digITS or bits, 0 and 1.

10102 = (1 x 23) + ( 0 x 22) + (1 x 21) + (0 x 20)= 8 + 0 + 2 + 0 = 10

Example:

The most significant bit (msb) is the 1 (the left most bit) and the least significant bit (lsb) is 0 (right most bit)

1.4 Binary number system

Learn your powers of 2

20 = 1

21 = 2

22 = 4

23 = 8

24 = 16

25 = 32

26 = 64

27 = 128

28 = 256

29 = 512

210 = 1024

211 = 2048

212 = 4096

213 = 8192 ...

Decimal to binary conversionSum the powers of 2

Problem: Convert 23 to binary.

How many bits do we need?

Count: 32, 16, 8, 4, 2, 1 we need at least 5 bits.

Start subtracting away “powers of 2” from 23…

23 77 toomuch!7 33 11 0

1 0 1 1 1

2 2 2 2 2

Decimal to binary conversion (your turn)Sum the powers of 2 technique

Problem: Convert 61 to binary.

How many bits do we need? ____

1 1 1 1 0 1

2 2 2 2 2 2

61 2929 1313 55 11 !1 0

5

Decimal‐to‐binary conversionDivide by 2 technique

Problem: Convert 61 to binary.

Technique: Divide successively by 2, ignoring remainders until you have a quotient of 0.

61 / 2 = 30 remainder 1 (LSB)

30 / 2 = 15 remainder 0

15 / 2 = 7 remainder 1

7 / 2 = 3 remainder 1

3 / 2 = 1 remainder 1

1 / 2 = 0 remainder 1 (MSB)

1 1 1 1 0 1

2 2 2 2 2 2

Page 5: Lecture 1 - Why Digital

8/24/2015

5

Read about, and be able to convert using other bases

• Octal (base 8)

• Hexadecimal (base 16) – uses symbols: 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F

• Gray code

• Binary coded decimal (BCD)

https://en.wikipedia.org/wiki/Gray_code

Binary Coded Decimal (BCD)

Some binary machines represent digital numbers other than straight binary, e.g., BCD. In BCD each decimal digit is represented by four binary bits.

Example: convert 390610 to BCD

3 9 0 6

0011 1001 0000 0110

390610 = 0011 1001 0000 0110BCD

Hexidecimal Binary

Octal

decimal

BCD

Conversion flowchartConversion flowchart Arithmetic Review

Adding and Subtracting in Binary

All you need to know is:

00, 01, 10, 11…

Add 111102 and 11002

110011110

+ 1100101010

Carry bits

It seems trivial - but make sure you understand it ! In about 2 weeks you’ll be asked to design a circuit that adds for homework, and then build it in the lab.

Binary additionBinary additionRemember:00, 01, 10, 11…

Subtract 011 from 100

100- 11

1

Check: 410 (= 1002) – 310(=112) = 110

Binary subtractionBinary subtractionRemember:00, 01, 10, 11…

Page 6: Lecture 1 - Why Digital

8/24/2015

6

Subtract 011 from 100

100- 11

1

Check: 410 (= 1002) – 310(=112) = 110

Binary subtractionBinary subtraction

1 10

Remember:00, 01, 10, 11…

Subtract 011 from 1001

1001- 11110

Check: 910 (=> 10012) – 310 (=>112) = 610

Binary subtraction(Your turn)

Binary subtraction(Your turn)

110

Remember:00, 01, 10, 11…

Lecture ExercisesLecture Exercises

Solutions on BlackboardSolutions on BlackboardLON-CAPALON-CAPA

Homework Exercises 1 - 4Homework Exercises 1 - 4