ECED2200 Digital Circuits Introduction, Gates, Number Systems - - PowerPoint PPT Presentation

eced2200 digital circuits
SMART_READER_LITE
LIVE PREVIEW

ECED2200 Digital Circuits Introduction, Gates, Number Systems - - PowerPoint PPT Presentation

ECED2200 Digital Circuits Introduction, Gates, Number Systems 05/07/2012 Colin OFlynn - CC BY-SA 1 General Notes See updates to these slides: www.newae.com/teaching These slides licensed under Creative Commons


slide-1
SLIDE 1

ECED2200 – Digital Circuits

Introduction, Gates, Number Systems

05/07/2012 Colin O’Flynn - CC BY-SA 1

slide-2
SLIDE 2

General Notes

  • See updates to these slides: www.newae.com/teaching
  • These slides licensed under ‘Creative Commons Attribution-ShareAlike 3.0

Unported License’

  • These slides are not the complete course – they are extended in-class
  • You will find the following references useful, see

www.newae.com/teaching for more information/links:

– The book “Bebop to the Boolean Boogie” which is available to Dalhousie Students – Course notes (covers almost everything we will discuss in class) – Various websites such as e.g.: www.play-hookey.com – The book “Contemporary Logic Design”, which was used in previous iterations of the class and you may have already

05/07/2012 Colin O’Flynn - CC BY-SA 2

slide-3
SLIDE 3

INTRODUCTION, BINARY, AND GATES

05/07/2012 Colin O’Flynn - CC BY-SA 3

slide-4
SLIDE 4

Analog vs. Digital

Analog (Infinite Values) Digital (Discrete Values) time time

05/07/2012 Colin O’Flynn - CC BY-SA 4

slide-5
SLIDE 5

Digital Systems

05/07/2012 Colin O’Flynn - CC BY-SA 5

slide-6
SLIDE 6

Binary

Off False Low On True 1 High

05/07/2012 Colin O’Flynn - CC BY-SA 6

slide-7
SLIDE 7

Binary – Waveforms in Time

1

1 1 1

05/07/2012 Colin O’Flynn - CC BY-SA 7

slide-8
SLIDE 8

GATES

Input #1 Input #2 Output

05/07/2012 Colin O’Flynn - CC BY-SA 8

slide-9
SLIDE 9

OR Gate – Truth Table

Input #1 Input #2 Output 1 1 1 1 1 1 1

05/07/2012 Colin O’Flynn - CC BY-SA 9

slide-10
SLIDE 10

OR Gate

05/07/2012 Colin O’Flynn - CC BY-SA 10

slide-11
SLIDE 11

OR Gate

1 1

05/07/2012 Colin O’Flynn - CC BY-SA 11

slide-12
SLIDE 12

OR Gate

1 1

05/07/2012 Colin O’Flynn - CC BY-SA 12

slide-13
SLIDE 13

OR Gate

1 1 1

05/07/2012 Colin O’Flynn - CC BY-SA 13

slide-14
SLIDE 14

OR Gate

A B Y 1 1 1 1 1 1 1

Y=A+B

05/07/2012 Colin O’Flynn - CC BY-SA 14

slide-15
SLIDE 15

AND Gate

A B Y 1 1 1 1 1

Y=A B

  • 05/07/2012

Colin O’Flynn - CC BY-SA 15

slide-16
SLIDE 16

NOT Gate

A Y 1 1

Y=A

05/07/2012 Colin O’Flynn - CC BY-SA 16

slide-17
SLIDE 17

Example!

IN1 IN2 OUT 1 1 1 1 1 IN1 OUT 1 1 IN1 IN2 OUT 1 1 1 1 1 1 1 AND NOT OR A B Y 1 1 1 1

Fill in this table:

05/07/2012 Colin O’Flynn - CC BY-SA 17

slide-18
SLIDE 18

Example!

What is the Boolean function of the above schematic?

05/07/2012 Colin O’Flynn - CC BY-SA 18

slide-19
SLIDE 19

Example!

Y=A•B+A•B

05/07/2012 Colin O’Flynn - CC BY-SA 19

slide-20
SLIDE 20

Little Circles

05/07/2012 Colin O’Flynn - CC BY-SA 20

slide-21
SLIDE 21

Not AND = NAND Gate

A B Y 1 1 1 1 1 1 1

Y=A B

  • 05/07/2012

Colin O’Flynn - CC BY-SA 21

slide-22
SLIDE 22

Not OR = NOR Gate

A B Y 1 1 1 1 1

Y=A+B

05/07/2012 Colin O’Flynn - CC BY-SA 22

slide-23
SLIDE 23

Supergates

All basic logic operations can be formed with NAND gates (or NOR gates).

05/07/2012 Colin O’Flynn - CC BY-SA 23

slide-24
SLIDE 24

Example!

A B Y 1 1 1 1 1 1 1 A B Y 1 1 1 1 1 1 1

05/07/2012 Colin O’Flynn - CC BY-SA 24

slide-25
SLIDE 25

Example!

A B Y 1 1 1 1 1 1 1

A B Y 1 1 1 1 1 1 1

If we inverted each of the A & B inputs to the NAND gate, note we get the same truth table as the OR gate!

05/07/2012 Colin O’Flynn - CC BY-SA 25

slide-26
SLIDE 26

Example!

A B Y 1 1 1 1 1 1 1

Y=A•B=A+B

05/07/2012 Colin O’Flynn - CC BY-SA 26

slide-27
SLIDE 27

Example!

A B Y 1 1 1 1 1 1 1

Y=A•B=A+B

05/07/2012 Colin O’Flynn - CC BY-SA 27

slide-28
SLIDE 28

Why Do you Care?

05/07/2012 Colin O’Flynn - CC BY-SA 28

slide-29
SLIDE 29

Example – AND Gate

05/07/2012 Colin O’Flynn - CC BY-SA 29

slide-30
SLIDE 30

Exclusive OR (X-OR) Gate

A B Y 1 1 1 1 1 1

Y=A B ⊕

05/07/2012 Colin O’Flynn - CC BY-SA 30

slide-31
SLIDE 31

XOR Gate Implementation

A B=(A+B)•(A•B)=A•B+A•B ⊕

05/07/2012 Colin O’Flynn - CC BY-SA 31

slide-32
SLIDE 32

Exclusive NOR (X-NOR) Gate

A B Y 1 1 1 1 1 1

Y=A B 

05/07/2012 Colin O’Flynn - CC BY-SA 32

slide-33
SLIDE 33

Section Summary – 1/3

Gates have inputs & outputs. Inputs are binary (Boolean) variables with two possible values ‘1’ (True) or ‘0’ (False). The ‘Truth Table’ is a table showing every possible input & the resulting output. Different gates have different truth tables.

05/07/2012 Colin O’Flynn - CC BY-SA 33

slide-34
SLIDE 34

Section Summary – 2/3

The following are the basic gates:

05/07/2012 Colin O’Flynn - CC BY-SA 34

slide-35
SLIDE 35

Section Summary – 3/3

Based on the truth tables, one can make any of the gates with NAND (or NOR) gates. E.g. making an OR gate with NAND gates:

A B Y 1 1 1 1 1 1 1

Y=A•B=A+B

05/07/2012 Colin O’Flynn - CC BY-SA 35

slide-36
SLIDE 36

References / Reading

  • ECED2200 Notes, “Digital Circuits” section
  • Bebop to the Boolean Boogie, Chapter 5
  • CLD, Chapter 1

05/07/2012 Colin O’Flynn - CC BY-SA 36

slide-37
SLIDE 37

PHYSICAL GATE IMPLEMENTATION

05/07/2012 Colin O’Flynn - CC BY-SA 37

slide-38
SLIDE 38

Switch Logic

OR Gate AND Gate NOT Gate

05/07/2012 Colin O’Flynn - CC BY-SA 38

slide-39
SLIDE 39

Switch NOT

05/07/2012 Colin O’Flynn - CC BY-SA 39

slide-40
SLIDE 40

Switch NOT

05/07/2012 Colin O’Flynn - CC BY-SA 40

slide-41
SLIDE 41

Switch NOT

05/07/2012 Colin O’Flynn - CC BY-SA 41

slide-42
SLIDE 42

Field Effect Transistor Switch

05/07/2012 Colin O’Flynn - CC BY-SA 42

slide-43
SLIDE 43

FET Logic Gates – Inverter (NOT)

05/07/2012 Colin O’Flynn - CC BY-SA 43

slide-44
SLIDE 44

FET Logic Gates – Inverter (NOT)

PMOS NMOS

CMOS = Complementary MOS (e.g.: uses both positive & negative MOS)

05/07/2012 Colin O’Flynn - CC BY-SA 44

slide-45
SLIDE 45

FET Logic Gates - NAND

Source: http://commons.wikimedia.org/wiki/File:NAND_gate_(CMOS_circuit).PNG

05/07/2012 Colin O’Flynn - CC BY-SA 45

slide-46
SLIDE 46

FET Logic Gates - NOR

http://commons.wikimedia.org/wiki/File:NOR_gate_%28CMOS_circuit%29.PNG

05/07/2012 Colin O’Flynn - CC BY-SA 46

slide-47
SLIDE 47

Logic Families (Types)

  • 1. Diode Logic (DL)
  • 2. Resistor-Transistor Logic (RTL)
  • 3. Diode-Transistor Logic (DTL)
  • 4. Transistor-Transistor Logic (TTL)
  • 5. Metal-Oxide Semiconductor (MOS)
  • 6. Complementary MOS (CMOS)
  • 7. Emitter-Coupled Logic (ECL)
  • 8. BiCMOS

05/07/2012 Colin O’Flynn - CC BY-SA 47

slide-48
SLIDE 48

Characteristics of Logic Types

  • Fan-in
  • Fan-out
  • Speed
  • Noise Margin
  • Power
  • Size

05/07/2012 Colin O’Flynn - CC BY-SA 48

slide-49
SLIDE 49

Section Summary

  • Bebop to the Boolean Boogie Chapter 6
  • ECED2200 Notes “Electric Switches + Logic

Classifications”

05/07/2012 Colin O’Flynn - CC BY-SA 49

slide-50
SLIDE 50

NUMBER SYSTEMS

05/07/2012 Colin O’Flynn - CC BY-SA 50

slide-51
SLIDE 51

Binary to Decimal

1110 1011 1 1 1 1 1 1 128 + 64 + 32 + + 8 + + 2 + 1 = 235 Decimal

05/07/2012 Colin O’Flynn - CC BY-SA 51

slide-52
SLIDE 52

Let’s Do a Hand-out: INTRO-1 (Top)

05/07/2012 Colin O’Flynn - CC BY-SA 52

slide-53
SLIDE 53

Decimal to Binary

216 Decimal

216 – 128 = 88 (1 in 27 position)

1 1

88 – 64 = 24 (1 in 26 position) 24 – 32 < 0, so 0 in 25 position

1

24 – 16 = 8 (1 in 24 position) 8 – 8 = 0 (1 in 23 position) 0 in remaining positions

1

05/07/2012 Colin O’Flynn - CC BY-SA 53

slide-54
SLIDE 54

Let’s Do a Hand-out: INTRO-1 (Bottom)

05/07/2012 Colin O’Flynn - CC BY-SA 54

slide-55
SLIDE 55

Number Notation

There are 10 kinds of people in the word – those that understand binary, and those that don’t.

05/07/2012 Colin O’Flynn - CC BY-SA 55

slide-56
SLIDE 56

Number Notation

Ambiguity unacceptable - we are engineers not comics. 102 = 10B = 210 (2 decimal) 1010 = 10D = 10102 (1010 binary) e.g.: Conversion: 47210 = 111011000

05/07/2012 Colin O’Flynn - CC BY-SA 56

slide-57
SLIDE 57

How to Check your Conversions

Windows Calculator (Windows 7 version shown)

05/07/2012 Colin O’Flynn - CC BY-SA 57

slide-58
SLIDE 58

How to Check your Conversions

Stand Alone Calculator

05/07/2012 Colin O’Flynn - CC BY-SA 58

slide-59
SLIDE 59

Other Number Systems: Hex & Octal

05/07/2012 Colin O’Flynn - CC BY-SA 59

slide-60
SLIDE 60

Cheat Sheet

Decimal Binary Hexadecimal (0x) Octal (0) 0000 1 0001 1 1 2 0010 2 2 3 0011 3 3 4 0100 4 4 5 0101 5 5 6 0110 6 6 7 0111 7 7 8 1000 8 10 9 1001 9 11 10 1010 A 12 11 1011 B 13 12 1100 C 14 13 1101 D 15 14 1110 E 16 15 1111 F 17 05/07/2012 Colin O’Flynn - CC BY-SA 60

slide-61
SLIDE 61

Advantages of Hex (and Octal)

1010 1000 1101 1111 1011 00102 This is only 24 bits – but long/hard to write… Equivalent to 1106731410 Easier to write, but conversion is error-prone, plus we are normally lazy…

05/07/2012 Colin O’Flynn - CC BY-SA 61

slide-62
SLIDE 62

Advantages of Hex

1010 1000 1101 1111 1011 00102 A 8 D F B 2 = 0xA8DFB2 Much easier to write, easy to convert!

05/07/2012 Colin O’Flynn - CC BY-SA 62

slide-63
SLIDE 63

Advantages of Octal

101 010 001 101 111 110 110 0102 5 2 1 5 7 6 6 2 = 052157662 in Octal Easy to write (longer than hex though), still easy to convert!

05/07/2012 Colin O’Flynn - CC BY-SA 63

slide-64
SLIDE 64

Binary Coded Decimal

05/07/2012 Colin O’Flynn - CC BY-SA 64

slide-65
SLIDE 65

Section Summary

  • Bebop to the Boolean Boogie: Chapter 7
  • ECED2200 Notes: “Number Systems”

05/07/2012 Colin O’Flynn - CC BY-SA 65

slide-66
SLIDE 66

ADDING & SUBTRACTING IN BINARY

05/07/2012 Colin O’Flynn - CC BY-SA 66

slide-67
SLIDE 67

Adding in Binary

05/07/2012 Colin O’Flynn - CC BY-SA 67

slide-68
SLIDE 68

Subtracting in Binary

05/07/2012 Colin O’Flynn - CC BY-SA 68

slide-69
SLIDE 69

Positive & Negative Numbers

05/07/2012 Colin O’Flynn - CC BY-SA 69

slide-70
SLIDE 70

Number Wheel

05/07/2012 Colin O’Flynn - CC BY-SA 70

0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111

slide-71
SLIDE 71

Disadvantage of Sign Magnitude

  • Two Zeros
  • Positive & Negative numbers require different

processing or else addition is wrong: (-5) + (+1) = 1101 + 0001 = 1110 = -6 (-3) + (-2) = 1011 + 1010 = 0101 = +5

05/07/2012 Colin O’Flynn - CC BY-SA 71

slide-72
SLIDE 72

Two Zeros? Where did Zero even come from?

05/07/2012 Colin O’Flynn - CC BY-SA 72

slide-73
SLIDE 73

Rules of Brahmagupta (628 AD):

– The sum of zero and a negative number is negative. – The sum of zero and a positive number is positive. – The sum of zero and zero is zero. – The sum of a positive and a negative is their difference; or, if their absolute values are equal, zero.

05/07/2012 Colin O’Flynn - CC BY-SA 73

slide-74
SLIDE 74

Complementary Numbers

05/07/2012 Colin O’Flynn - CC BY-SA 74

slide-75
SLIDE 75

Diminished Radix Complement

05/07/2012 Colin O’Flynn - CC BY-SA 75

slide-76
SLIDE 76

Radix Complement

05/07/2012 Colin O’Flynn - CC BY-SA 76

slide-77
SLIDE 77

2’s Complement

1 1 0 1 0 0 0 1 0 0

05/07/2012 Colin O’Flynn - CC BY-SA 77

slide-78
SLIDE 78

Instructions

  • 1. Form 1’s complement by inverting all bits
  • 2. Add 1 to 1’s complement to get 2’s

complement

05/07/2012 Colin O’Flynn - CC BY-SA 78

slide-79
SLIDE 79

2’s Complement

1 1 0 1 0 0 0 1 0 0

05/07/2012 Colin O’Flynn - CC BY-SA 79

slide-80
SLIDE 80

Bit Notations

05/07/2012 Colin O’Flynn - CC BY-SA 80

slide-81
SLIDE 81

Instructions:

  • 1. Starting from Least Significant Bit (LSB)

working towards Most Significant Bit (MSB), copy number one bit at a time.

  • 2. Continue copying until you reach the first ‘1’.

Copy this ‘1’ bit as-is

  • 3. For remaining bits invert them (0->1, 1->0)

05/07/2012 Colin O’Flynn - CC BY-SA 81

slide-82
SLIDE 82

Some Examples

1 0 1 0 0 1 0 1 0 1 1 0 0 0 1 1 1 1 1 1 0 0 0 1

05/07/2012 Colin O’Flynn - CC BY-SA 82

slide-83
SLIDE 83

05/07/2012 Colin O’Flynn - CC BY-SA 83

slide-84
SLIDE 84

Number Wheel

05/07/2012 Colin O’Flynn - CC BY-SA 84

0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111

slide-85
SLIDE 85

Section Summary

  • Bebop to the Boolean Boogie: Chapter 8
  • Contemporary Logic Design:
  • ECED Notes: “Number Systems”

05/07/2012 Colin O’Flynn - CC BY-SA 85