chapter 1...examples of digital logic design • digital logic is the basis of electronic systems,...

42
WELCOME TO ENGR 303 – Introduction to Logic Design Chapter 1 Hello my name is Dr. Chuck Brown Please sign in and then find a seat. The person next to you will be your lab partner for the course so choose wisely and introduce yourself. Please place your name card it on top your PC …this will help me learn your names.

Upload: others

Post on 25-Jul-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Chapter 1...Examples of Digital Logic Design • Digital Logic is the basis of electronic systems, such as computers, cell phones, and numerous other high-tech systems. • Digital

WELCOME TO

ENGR 303 – Introduction to Logic Design

Chapter 1

Hello my name is Dr. Chuck Brown

Please sign in and then find a seat. The person next to you will be your lab partner for the course so choose wisely and introduce yourself.

Please place your name card it on top your PC …this will help me learn your names.

Page 2: Chapter 1...Examples of Digital Logic Design • Digital Logic is the basis of electronic systems, such as computers, cell phones, and numerous other high-tech systems. • Digital

ENGR 303 – Introduction to Logic Design Lecture 1

Dr. Chuck BrownEngineering and Computer Information Science

Folsom Lake College

Page 3: Chapter 1...Examples of Digital Logic Design • Digital Logic is the basis of electronic systems, such as computers, cell phones, and numerous other high-tech systems. • Digital

<3>

• Objective of the course

• Course Material

• Course/Lab policies

• High-level overview of the course

• Number Systems

• Logic Gates

Outline for Todays Lecture

ENGR 303

Page 4: Chapter 1...Examples of Digital Logic Design • Digital Logic is the basis of electronic systems, such as computers, cell phones, and numerous other high-tech systems. • Digital

<4> ENGR 303

Examples of Digital Logic Design

• Digital Logic is the basis of electronic systems, such as computers, cell phones, and numerous other high-tech systems.

• Digital Logic is rooted in binary code, a series of zeroes and ones each having an opposite value.

• Digital Logic facilitates computing, robotics and other electronic applications.

• Digital Logic Design is used to develop hardware, such as circuit boards and microchip processors.

Page 5: Chapter 1...Examples of Digital Logic Design • Digital Logic is the basis of electronic systems, such as computers, cell phones, and numerous other high-tech systems. • Digital

<5>

• Identify common digital components such as – logic gates, flip-flops, counters, registers, state

machines, and programmable logic devices (PLDs)

• Analyze a digital design problem using – combinational logic, binary number system,

conversion between number systems, Boolean algebra, and Karnaugh maps.

• Design and build a digital logic system including– combinatorial logic, sequential state machines and

basic computer micro-architecture elements using schematic entry and Verilog or VHDL design tools

Objective of Course

ENGR 303

Page 6: Chapter 1...Examples of Digital Logic Design • Digital Logic is the basis of electronic systems, such as computers, cell phones, and numerous other high-tech systems. • Digital

<6>

• Text Book: – Digital Design and Computer Architecture, Second

Edition– August 7, 2012, by David Harris and Sarah Harris ISBN-13: 978-0123944245

• A USB memory stick is required for lab to store your design files

• Altera Quartus II version 13.0sp1 design software will be available for download (Windows only)– https://www.flc.losrios.edu/about-us/faculty-and-staff-

directory/dr-chuck-brown– Altera DE2 FGPA Development Board will be provided for

in lab use

Course Material

ENGR 303

Page 7: Chapter 1...Examples of Digital Logic Design • Digital Logic is the basis of electronic systems, such as computers, cell phones, and numerous other high-tech systems. • Digital

<7>

• Prerequisites: – Apply algebra concepts in a problem-solving setting

– Manipulate algebraic expressions and solve simple algebraic equations

– Some previous exposure to a programming language and be able to interpret and modify supplied hardware descriptive language code segments

• Grading:– Attendance (5%), Problem Sets (10%)

– Lab Assignments (50 %)

– Midterm (15 %) and Final Exam (20 %)

Course Policies

ENGR 303

Page 8: Chapter 1...Examples of Digital Logic Design • Digital Logic is the basis of electronic systems, such as computers, cell phones, and numerous other high-tech systems. • Digital

<8>

• Work in groups of two

• Lab handout will be provided prior or at the start of the lab

• Lab report

– one lab report per lab team is due typically one week after the completion of each lab

– most labs have a demonstration requirement to verify your design

• Save all your work to a USB drive

Lab Policies

ENGR 303

Page 9: Chapter 1...Examples of Digital Logic Design • Digital Logic is the basis of electronic systems, such as computers, cell phones, and numerous other high-tech systems. • Digital

<9>

• Number systems, logic gates, combinatorial logic, Boolean equations, Karnaugh maps

• Digital Building blocks - multiplexers, decoders, adder, multipliers

• Sequential logic - latches, flip-flops, registers, counters, finite state machines

• Hardware Descriptive Language and FPGA implementation

• Computer microarchitecture – data path, ALU, instruction decoder

Class Outline

ENGR 303

Page 10: Chapter 1...Examples of Digital Logic Design • Digital Logic is the basis of electronic systems, such as computers, cell phones, and numerous other high-tech systems. • Digital

<10>

• Breaking the details

into more manageable

parts

focu

s o

f th

is c

ou

rse

programs

device drivers

instructions

registers

datapaths

controllers

adders

memories

AND gates

NOT gates

amplifiers

filters

transistors

diodes

electrons

Abstraction

ENGR 303

Page 11: Chapter 1...Examples of Digital Logic Design • Digital Logic is the basis of electronic systems, such as computers, cell phones, and numerous other high-tech systems. • Digital

<11>

• Most physical variables are continuous

– Voltage on a wire

– Frequency of an oscillation

– Position of a mass

• Digital abstraction considers discrete

subset of values

The Digital Abstraction

ENGR 303

Page 12: Chapter 1...Examples of Digital Logic Design • Digital Logic is the basis of electronic systems, such as computers, cell phones, and numerous other high-tech systems. • Digital

<12>

• Two discrete values:

– 1’s and 0’s

– 1, TRUE, HIGH

– 0, FALSE, LOW

• 1 and 0: voltage levels, rotating gears, fluid levels, etc.

• Digital circuits use voltage levels to represent 1 and 0

• Bit: Binary digit

Digital Discipline: Binary Values

ENGR 303

Page 13: Chapter 1...Examples of Digital Logic Design • Digital Logic is the basis of electronic systems, such as computers, cell phones, and numerous other high-tech systems. • Digital

<13>

• Born to working class parents

• Taught himself mathematics and

joined the faculty of Queen’s

College in Ireland

• Wrote An Investigation of the Laws

of Thought (1854)

• Introduced binary variables

• Introduced the three fundamental

logic operations: AND, OR, and

NOT

George Boole, 1815-1864

ENGR 303

Page 14: Chapter 1...Examples of Digital Logic Design • Digital Logic is the basis of electronic systems, such as computers, cell phones, and numerous other high-tech systems. • Digital

<14>

537410

=

10

's c

olu

mn

10

0's

co

lum

n

10

00

's c

olu

mn

1's

co

lum

n

11012 =

2's

co

lum

n

4's

co

lum

n

8's

co

lum

n

1's

co

lum

n

• Decimal numbers

• Binary numbers

Number Systems

ENGR 303

Page 15: Chapter 1...Examples of Digital Logic Design • Digital Logic is the basis of electronic systems, such as computers, cell phones, and numerous other high-tech systems. • Digital

<15>

537410

= 5 × 103 + 3 × 102 + 7 × 101 + 4 × 100

five

thousands

10

's c

olu

mn

10

0's

co

lum

n

10

00

's c

olu

mn

three

hundreds

seven

tens

four

ones

1's

co

lum

n

11012 = 1 × 23 + 1 × 22 + 0 × 21 + 1 × 20 = 13

10one

eight

2's

co

lum

n

4's

co

lum

n

8's

co

lum

n

one

four

no

two

one

one1

's c

olu

mn

• Decimal numbers

• Binary numbers

Number Systems

ENGR 303

Page 16: Chapter 1...Examples of Digital Logic Design • Digital Logic is the basis of electronic systems, such as computers, cell phones, and numerous other high-tech systems. • Digital

<16>

• 20 =

• 21 =

• 22 =

• 23 =

• 24 =

• 25 =

• 26 =

• 27 =

• 28 =

• 29 =

• 210 =

• 211 =

• 212 =

• 213 =

• 214 =

• 215 =

ENGR 303

International Electrotechnical Commission Standard… Powers of Two

Page 17: Chapter 1...Examples of Digital Logic Design • Digital Logic is the basis of electronic systems, such as computers, cell phones, and numerous other high-tech systems. • Digital

<17>

• 20 = 1

• 21 = 2

• 22 = 4

• 23 = 8

• 24 = 16

• 25 = 32

• 26 = 64

• 27 = 128

• Handy to memorize up to 29

• 28 = 256

• 29 = 512

• 210 = 1024

• 211 = 2048

• 212 = 4096

• 213 = 8192

• 214 = 16384

• 215 = 32768

ENGR 303

International Electrotechnical Commission Standard… Powers of Two

Page 18: Chapter 1...Examples of Digital Logic Design • Digital Logic is the basis of electronic systems, such as computers, cell phones, and numerous other high-tech systems. • Digital

<18> ENGR 303

GigaByte vs. GibiByteInternational Electrotechnical Commission standard:kibi = 210, Mebi = 220, Gibi 230, etc. are binary based

1 GibiByte = 2030 bytes = 1.073741824 x 109 Gib

International System of Quantities:kilo = 103, Mega = 106), Giga = 109), etc. are decimal based

1 GigaByte = 1 x 109 GB

Aside: Storage is marketed in GB, although Windows OS sees GiB

128GB Drive; Windows displays as 119.2 GB (actual GiB)

Page 19: Chapter 1...Examples of Digital Logic Design • Digital Logic is the basis of electronic systems, such as computers, cell phones, and numerous other high-tech systems. • Digital

<19>

• Decimal to binary conversion:– Convert 100112 to decimal

• Decimal to binary conversion:– Convert 4710 to binary

Number Conversion

ENGR 303

Page 20: Chapter 1...Examples of Digital Logic Design • Digital Logic is the basis of electronic systems, such as computers, cell phones, and numerous other high-tech systems. • Digital

<20>

• Decimal to binary conversion:– Convert 100112 to decimal

– 16×1 + 8×0 + 4×0 + 2×1 + 1×1 = 1910

• Decimal to binary conversion:– Convert 4710 to binary

– 32×1 + 16×0 + 8×1 + 4×1 + 2×1 + 1×1 = 1011112

Number Conversion

ENGR 303

Page 21: Chapter 1...Examples of Digital Logic Design • Digital Logic is the basis of electronic systems, such as computers, cell phones, and numerous other high-tech systems. • Digital

<21>

• N-digit decimal number – How many values? – Range? – Example: 3-digit decimal number:

• N-bit binary number– How many values? – Range:– Example: 3-digit binary number:

Binary Values and Range

ENGR 303

Page 22: Chapter 1...Examples of Digital Logic Design • Digital Logic is the basis of electronic systems, such as computers, cell phones, and numerous other high-tech systems. • Digital

<22>

• N-digit decimal number – How many values? 10N

– Range? [0, 10N - 1]– Example: 3-digit decimal number:

• 103 = 1000 possible values• Range: [0, 999]

• N-bit binary number– How many values? 2N

– Range: [0, 2N - 1]– Example: 3-digit binary number:

• 23 = 8 possible values• Range: [0, 7] = [0002 to 1112]

Binary Values and Range

ENGR 303

Page 23: Chapter 1...Examples of Digital Logic Design • Digital Logic is the basis of electronic systems, such as computers, cell phones, and numerous other high-tech systems. • Digital

<23>

Hex Digit Decimal Equivalent Binary Equivalent

0 0

1 1

2 2

3 3

4 4

5 5

6 6

7 7

8 8

9 9

A 10

B 11

C 12

D 13

E 14

F 15

Hexadecimal Numbers – Base 16

ENGR 303

Page 24: Chapter 1...Examples of Digital Logic Design • Digital Logic is the basis of electronic systems, such as computers, cell phones, and numerous other high-tech systems. • Digital

<24>

Hex Digit Decimal Equivalent Binary Equivalent

0 0 0000

1 1 0001

2 2 0010

3 3 0011

4 4 0100

5 5 0101

6 6 0110

7 7 0111

8 8 1000

9 9 1001

A 10 1010

B 11 1011

C 12 1100

D 13 1101

E 14 1110

F 15 1111

Hexadecimal Numbers – Base 16

ENGR 303

Page 25: Chapter 1...Examples of Digital Logic Design • Digital Logic is the basis of electronic systems, such as computers, cell phones, and numerous other high-tech systems. • Digital

<25>

• Hexadecimal to binary conversion:– Convert 4AF16 (also written 0x4AF) to binary

• Hexadecimal to decimal conversion:– Convert 0x4AF to decimal

Hexadecimal to Binary Conversion

ENGR 303

Page 26: Chapter 1...Examples of Digital Logic Design • Digital Logic is the basis of electronic systems, such as computers, cell phones, and numerous other high-tech systems. • Digital

<26>

• Hexadecimal to binary conversion:– Convert 4AF16 (also written 0x4AF) to binary

– 0100 1010 11112

• Hexadecimal to decimal conversion:– Convert 4AF16 to decimal

– 162×4 + 161×10 + 160×15 = 119910

Hexadecimal to Binary Conversion

ENGR 303

Page 27: Chapter 1...Examples of Digital Logic Design • Digital Logic is the basis of electronic systems, such as computers, cell phones, and numerous other high-tech systems. • Digital

<27>

• Bits

• Bytes & Nibbles

• Bytes in HEX

10010110nibble

byte

CEBF9AD7least

significant

byte

most

significant

byte

10010110least

significant

bit

most

significant

bit

Bits, Bytes, Nibbles…

ENGR 303

Page 28: Chapter 1...Examples of Digital Logic Design • Digital Logic is the basis of electronic systems, such as computers, cell phones, and numerous other high-tech systems. • Digital

<28>

• 210 = 1 kilo ≈ 1000 (1024)

• 220 = 1 mega ≈ 1 million (1,048,576)

• 230 = 1 giga ≈ 1 billion (1,073,741,824)

Large Powers of Two

ENGR 303

Page 29: Chapter 1...Examples of Digital Logic Design • Digital Logic is the basis of electronic systems, such as computers, cell phones, and numerous other high-tech systems. • Digital

<29>

• What is the value of 224?

• How many values can a 32-bit variable represent?

Estimating Powers of Two

ENGR 303

Page 30: Chapter 1...Examples of Digital Logic Design • Digital Logic is the basis of electronic systems, such as computers, cell phones, and numerous other high-tech systems. • Digital

<30>

• What is the value of 224?

24 × 220 ≈ 16 million

• How many values can a 32-bit variable represent?

22 × 230 ≈ 4 billion

Estimating Powers of Two

ENGR 303

Page 31: Chapter 1...Examples of Digital Logic Design • Digital Logic is the basis of electronic systems, such as computers, cell phones, and numerous other high-tech systems. • Digital

<31>

• Perform logic functions:

– inversion (NOT), AND, OR, NAND, NOR, etc.

• Single-input:

– NOT gate, buffer

• Two-input:

– AND, OR, XOR, NAND, NOR, XNOR

• Multiple-input

Logic Gates

ENGR 303

Page 32: Chapter 1...Examples of Digital Logic Design • Digital Logic is the basis of electronic systems, such as computers, cell phones, and numerous other high-tech systems. • Digital

<32>

NOT

Y = A

A Y0

1

A Y

BUF

Y = A

A Y0

1

A Y

Single-Input Logic Gates

ENGR 303

Page 33: Chapter 1...Examples of Digital Logic Design • Digital Logic is the basis of electronic systems, such as computers, cell phones, and numerous other high-tech systems. • Digital

<33>

NOT

Y = A

A Y0 1

1 0

A Y

BUF

Y = A

A Y0 0

1 1

A Y

Single-Input Logic Gates

ENGR 303

Verilog Assign Y = ~A;or

not (y,a);

Assign Y = A;or

buf (y,a);

Page 34: Chapter 1...Examples of Digital Logic Design • Digital Logic is the basis of electronic systems, such as computers, cell phones, and numerous other high-tech systems. • Digital

<34>

AND

Y = AB

A B Y0 0

0 1

1 0

1 1

AB

Y

OR

Y = A + B

A B Y0 0

0 1

1 0

1 1

AB

Y

Two-Input Logic Gates

ENGR 303

Page 35: Chapter 1...Examples of Digital Logic Design • Digital Logic is the basis of electronic systems, such as computers, cell phones, and numerous other high-tech systems. • Digital

<35>

AND

Y = AB

A B Y0 0 0

0 1 0

1 0 0

1 1 1

AB

Y

OR

Y = A + B

A B Y0 0 0

0 1 1

1 0 1

1 1 1

AB

Y

Two-Input Logic Gates

ENGR 303

“Any Ones”“All Ones”

Verilog Assign Y = A & B;or

and (Y A, B);

Assign Y = A | B;or

or (Y, A, B);

Page 36: Chapter 1...Examples of Digital Logic Design • Digital Logic is the basis of electronic systems, such as computers, cell phones, and numerous other high-tech systems. • Digital

<36>

XNOR

Y = A + B

A B Y0 0

0 1

1 0

1 1

AB

Y

XOR NAND NOR

Y = A + B Y = AB Y = A + B

A B Y0 0

0 1

1 0

1 1

A B Y0 0

0 1

1 0

1 1

A B Y0 0

0 1

1 0

1 1

AB

YAB

YAB

Y

More Two-Input Logic Gates

ENGR 303

Page 37: Chapter 1...Examples of Digital Logic Design • Digital Logic is the basis of electronic systems, such as computers, cell phones, and numerous other high-tech systems. • Digital

<37>

XNOR

Y = A + B

A B Y0 0

0 1

1 0

1 1

AB

Y

XOR NAND NOR

Y = A + B Y = AB Y = A + B

A B Y0 0 0

0 1 1

1 0 1

1 1 0

A B Y0 0 1

0 1 1

1 0 1

1 1 0

A B Y0 0 1

0 1 0

1 0 0

1 1 0

AB

YAB

YAB

Y

1

0

0

1

More Two-Input Logic Gates

ENGR 303

“Same”“Different” “Not Zeros”“Not Ones”

Verilog Assign Y = A ^ B;or

xor (Y, A, B);

Assign Y = A ~& B;or

nand (Y, A, B);

Assign Y = A ~| B;or

Nnor (Y, A, B);

Assign Y = A ~^ B;or

xnor (Y, A, B);

Page 38: Chapter 1...Examples of Digital Logic Design • Digital Logic is the basis of electronic systems, such as computers, cell phones, and numerous other high-tech systems. • Digital

<38>

NOR3

Y = A+B+C

B C Y0 0

0 1

1 0

1 1

AB YC

A0

0

0

0

0 0

0 1

1 0

1 1

1

1

1

1

Multiple-Input Logic Gates

AND3

Y = ABC

AB YC

B C Y0 0

0 1

1 0

1 1

A0

0

0

0

0 0

0 1

1 0

1 1

1

1

1

1

ENGR 303

Page 39: Chapter 1...Examples of Digital Logic Design • Digital Logic is the basis of electronic systems, such as computers, cell phones, and numerous other high-tech systems. • Digital

<39>

NOR3

Y = A+B+C

B C Y0 0

0 1

1 0

1 1

AB YC

A0

0

0

0

0 0

0 1

1 0

1 1

1

1

1

1

1

0

0

0

0

0

0

0

Multi-input XOR: Odd parity generator

Multiple-Input Logic GatesAND3

Y = ABC

AB YC

B C Y0 0

0 1

1 0

1 1

A0

0

0

0

0 0

0 1

1 0

1 1

1

1

1

1

0

0

0

0

0

0

0

1

ENGR 303

Verilog Assign Y = A & B & C;Assign Y = ~( A | B | C );

Page 40: Chapter 1...Examples of Digital Logic Design • Digital Logic is the basis of electronic systems, such as computers, cell phones, and numerous other high-tech systems. • Digital

<42> ENGR 303

Example Prototype of Logic FunctionF= A & (B+C)

ABC

F

+5VDC

GNDAB C F

Build with TTL Chips

74

08

74

32

Verilog Assign Y = A & ( B | C );

Page 41: Chapter 1...Examples of Digital Logic Design • Digital Logic is the basis of electronic systems, such as computers, cell phones, and numerous other high-tech systems. • Digital

<43> ENGR 303

Truth TableF= A(B+C)

ABC

F

Inputs Output

A B C B+C F LED

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 42: Chapter 1...Examples of Digital Logic Design • Digital Logic is the basis of electronic systems, such as computers, cell phones, and numerous other high-tech systems. • Digital

<44> ENGR 303

Truth TableF= A(B+C)

ABC

F

Inputs Output

A B C B+C F LED

0 0 0 0 0 OFF

0 0 1 1 0 OFF

0 1 0 1 0 OFF

0 1 1 1 0 OFF

1 0 0 0 0 OFF

1 0 1 1 1 ON

1 1 0 1 1 ON

1 1 1 1 1 ON