Anda di halaman 1dari 141

Engineering Systems Design 2

Lecture D01
Digital Systems: Bits, Bytes and Codes (Part 1)
(Sections 7.1 7.3 in Brockman, Chapters 1 and 2 in ESD 2 text)

Outline
Digital Systems
Analog and Digital

Representing binary quantities


Digital circuits
Advantages of digital circuits

Engineering Systems Design

Melbourne School of Engineering

The Digital Information Age


theres a total world market for maybe five computers
Thomas. J. Watson Sr., IBM Chairman, 1943
nobody would want to buy a computer for their home
Ken Olsen, DEC President, 1977

Computing and communication have changed remarkably over the


past sixty years

Computers are everywhere and are used for incredibly diverse


applications from weather forecasting, to the bionic ear and speech
coding in your mobile phone
Digital circuits are at the heart of almost all current computing and
communication devices

Engineering Systems Design

Melbourne School of Engineering

Module Learning Objectives


The aim of the digital systems module of the subject is to introduce
you to the digital systems at the heart of modern computing and
communication devices
We will do this from the logical perspective only, dealing with the
abstract quantities 0 and 1 and not with the physical electronics
used to build the circuits
By the end of this module you should be able to analyse and design
digital logic circuits of moderate complexity to perform a variety of
tasks such as adding and comparing binary numbers, error control
coding and decoding, multiplying binary numbers, and so on.
Along the way you will learn about generic engineering concepts
such as design tradeoffs, modularity, and top-down design

Engineering Systems Design

Melbourne School of Engineering

Module Learning Objectives

Engineering Systems Design

Melbourne School of Engineering

Computer built with LEGO


This computer can be used to evaluate polynomials using the method of finite
differences. It is based on the Babbage Difference Engine proposed by Charles
Babbage around 1850

Charles Babbage

Engineering Systems Design

Melbourne School of Engineering

Analog Computers

Engineering Systems Design

Melbourne School of Engineering

My First Computer: The VZ200

The Dick Smith VZ 200 comes complete with 8K RAM (2K for screen, 6K for user
programs) which can be expanded up to 24K bytes. The 16K RAM has a built-in Basic
Interpreter and operating system. Because no computer system is complete without
some form of data or program storage, also included with the computer is an
interconnection lead for a cassette recorder.

The system can be easily expanded by adding plug-in modules, for instance a 16K
expansion RAM module.
Engineering Systems Design

Melbourne School of Engineering

Analog and Digital


Digital circuits use digitised variables that can take a finite
number of distinct values (usually two: hence binary numbers).
Analog circuits use continuous variables that can take an infinite
number of possible values (usually, the real numbers).

Figure 7-7
Jay B. Brockman
Introduction to Engineering

Engineering Systems Design

Melbourne School of Engineering

Mobile Phone
Speech coding,
error control coding,
modulation
Voice

Microphone

A/D
converter

D/A
converter

Engineering Systems Design

Digital
processing

Antenna

10

Transmitted
signal

Melbourne School of Engineering

Analog versus Digital Modulation

Engineering Systems Design

11

Melbourne School of Engineering

Representing Binary Quantities


Binary information is represented by voltages (or currents) in a circuit
Exact value of a voltage is not important in digital circuits

Figure 1-7
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition

Engineering Systems Design

12

Melbourne School of Engineering

Digital Circuits
Digital circuits are designed to:

Accept input voltages that are within the defined 0 and 1 ranges
Process the input signals in a predictable way
Produce output voltages that fall within the prescribed 0 and 1 ranges
Analog devices and systems process time varying signals that can take
on any value across a continuous range so do digital circuits and
systems; the difference is that we can pretend that they dont!
Wakerly, Chapter 1
This module is an introduction to the analysis design of digital circuits
from the logical perspective.
Engineering Systems Design

13

Melbourne School of Engineering

Advantages of Digital Circuits


its easier to build a machine that can reliably distinguish
between two different states than it is to build one that can
accurately determine a value from within a closely spaced range.
Brockman, Section 7.2

Ideal pits and bumps on the surface


of a CD or DVD versus realistic
ones. The information can still be
correctly interpreted even when
there are imperfections.

Figure 7-8
Jay B. Brockman
Introduction to Engineering

When we add error control coding we are in even better shape


(see Lecture D03).
Engineering Systems Design

14

Melbourne School of Engineering

Advantages of Digital Circuits


Easier to design
Information storage is easy
Accuracy and precision are greater
Operation can be programmed
Well-developed mathematical theory
Immunity to effects of noise
Compact integrated circuit (IC) chip

Engineering Systems Design

15

Melbourne School of Engineering

Next Lecture
Digital Systems: Bits, Bytes and Codes (Part 2)
Analog-to-digital conversion
Positional number systems
Decimal and binary numbers
Octal and hexadecimal numbers
Conversion from decimal

Reading:
Lecture D02 overheads
Chapters 1 and 2 in ESD 2 text

Engineering Systems Design

16

Melbourne School of Engineering

Engineering Systems Design 2


Lecture D02
Digital Systems: Bits, Bytes and Codes (Part 2)
(Sections 7.1 7.3 in Brockman, Chapters 1 and 2 in ESD 2 text)

Outline
Analog-to-digital conversion
Positional number systems

Decimal and binary numbers


Octal and hexadecimal numbers
Conversion from decimal

Engineering Systems Design

Melbourne School of Engineering

Getting to Binary
Digital systems are built from circuits that process binary digits however binary digits are not usually the things we deal with in the
real world.
How can we represent real world audio, video, numbers, letters and
other things of interest by 0s and 1s?

Engineering Systems Design

Melbourne School of Engineering

Analog-to-Digital Conversion
The process of converting an analog waveform into a sequence of 0s
and 1s is called analog-to-digital conversion
The basic operations required are sampling and quantization
First we must sample the analog signal periodically at a rate fast
enough so that we do not lose (much) information (we need to sample
faster than the signal varies)

Engineering Systems Design

Melbourne School of Engineering

Analog-to-Digital Conversion
Second we must quantise the sampled values meaning we map the
actual sampled value to the nearest of a finite number of levels.
Each of these levels is then mapped to a unique bit string.
The resultant bit-rate is the product of the sample rate (samples per
second) and the number of bits per sample used in quantisation
(ceiling of base-2 logarithm of the number of quantisation levels)

Engineering Systems Design

Melbourne School of Engineering

Example
An audio signal is sampled at a rate of 44,100 samples per second and
quantised to one of 256 quantisation levels. How much memory is
required to store the Metallica song One which is 7 minutes and 26
seconds long? (Assume there is no other processing of the digital data.)

Engineering Systems Design

Melbourne School of Engineering

Positional Number Systems


Number represented by a string of digits where each digit position
has an associated weight.
In a base-r system, the digit in position i has weight ri and each
digit can have value 0, 1, , r-1.
The base-r number dp-1 dp-2d1 d0 . d-1d-2 d-n has decimal (base-10)
representation
p 1

D di r i d n r n ... d 1r 1 d 0 r 0 d1r1 ... d p 1r p 1


i n

Engineering Systems Design

Melbourne School of Engineering

Decimal Numbers
Composed of 10 numerals or symbols (base-10)

Figure 1-2
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition

Engineering Systems Design

Melbourne School of Engineering

Binary Numbers
Only two symbols (0 and 1) (base-2)
Most important for implementing digital systems

Figure 1-4
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition

Engineering Systems Design

Melbourne School of Engineering

Example
(a) Convert the binary number 110101.101 to decimal.

(b) What is the biggest n-bit binary number? Write the number in
binary and in decimal.

Engineering Systems Design

10

Melbourne School of Engineering

Octal Numbers
Base-8 system using decimal digits 0 to 7
Convenient system for representing multibit (binary) numbers
Example: Convert the octal number 314.15 to decimal.

Example: Convert the binary number 11101001 to octal.

Engineering Systems Design

11

Melbourne School of Engineering

Hexadecimal Numbers
Base-16 system using decimal digits 0 to 9 plus letters A to F
Another convenient system for representing multibit numbers
Example: Convert the hexadecimal number 2BAD to decimal.

Example: Convert the binary number 10111010.01 to hexadecimal.

Engineering Systems Design

12

Melbourne School of Engineering

Conversion from Decimal


Conversion from decimal to binary, octal or hexadecimal (or any
other base) is a little more involved.
Systematic procedure using repeated division (see Brockman p.
334)
Example: Convert 17910 to binary, octal and hexadecimal.

Engineering Systems Design

13

Melbourne School of Engineering

Next Lecture
Digital Systems: Bits, Bytes and Codes (Part 3)
Binary-Coded-Decimal (BCD)
Alphanumeric codes
Source coding and data compression
Error control coding

Reading:
Lecture D03 overheads

Chapters 1 and 2 in ESD 2 text

Engineering Systems Design

14

Melbourne School of Engineering

Engineering Systems Design 2


Lecture D03
Digital Systems : Bits, Bytes and Codes (Part 3)
(Sections 7.1 7.3 in Brockman, Chapters 1 and 2 in ESD 2 text)

Outline
Binary-Coded-Decimal (BCD)
Alphanumeric codes

Source coding and data compression


Error control coding
The (7,4) Hamming code

Engineering Systems Design

Melbourne School of Engineering

Binary-Coded-Decimal
A set of bit strings in which each string represents a different
number or letter or other thing is called a code.

In the BCD code for decimal numbers, each digit of the decimal
number is coded in binary.
Example: Show how 94310 is coded using BCD
9

1001

0100

0011 (BCD)

Question: How many 4-bit decimal codes are there?

Engineering Systems Design

Melbourne School of Engineering

Summary
Decimal

Engineering Systems Design

Binary

Octal

Hexadecimal

BCD

0000

0001

10

0010

11

0011

100

0100

101

0101

110

0110

111

0111

1000

10

1000

1001

11

1001

10

1010

12

0001 0000

11

1011

13

0001 0001

12

1100

14

0001 0010

13

1101

15

0001 0011

14

1110

16

0001 0100

15

1111

17

0001 0101

Melbourne School of Engineering

Alphanumeric Codes
Most information processed by computers is nonnumeric.
Text (strings of characters from some character set) is very
common e.g. keyboard.
ASCII (American Standard Code for Information Interchange)
is a 7-bit alphanumeric code for 128 different characters

Engineering Systems Design

Melbourne School of Engineering

Table 2-4
Tocci, Widmer and Moss
Digital Systems, Ninth Edition

Engineering Systems Design

Melbourne School of Engineering

Example
The Mars Phoenix Lander announced the
end of its five-month mission with a cryptic
message on Twitter, sparking a wave of
heartfelt replies written in computer
language. 01010100 01110010 01101001
01110101 01101101 01110000 01101000
read the final post on the MarsPhoenix
Twitter account.
It is believed Phoenix is now frozen somewhere near the north pole of
Mars without enough sunlight to power itself.
What was the last message sent by the Mars Phoenix Lander?

Engineering Systems Design

Melbourne School of Engineering

Source Coding and Data Compression


The ASCII code is an example of a fixed-length code because each
symbol is coded using the same number of bits
We can be more efficient in terms of the number of bits required if we
use variable-length codes that take into account the probabilities of
the symbols (letters, numbers, etc.)
You will explore Huffman coding in the first assignment, a source
coding scheme that does just this.

Engineering Systems Design

Melbourne School of Engineering

Example
A source of data produces five different characters which we label a, b,
c, d and e. The relative frequency of occurrence of these characters is
0.5, 0.3, 0.1, 0.05 and 0.05 respectively.
(a) Design a fixed-length code for these characters.
(b) Design a variable-length code for these characters that requires
a lower average number of bits per symbol than the fixed-length
code. Be careful to check that you variable length code can be
decoded.

Engineering Systems Design

Melbourne School of Engineering

Error Control Codes


When digital data is transmitted from one place to another or
stored it is possible for some bits to be received or read in error.

Many digital systems employ codes to detect (and even correct)


such errors.
A very simple error detection code results when one additional bit
is added to the existing information bits so that the total number of
ones is even (or odd).
This is the simplest example of a parity check code. The
additional bit is called a parity bit or check bit.

Engineering Systems Design

10

Melbourne School of Engineering

Example
Suppose that we have four information bits to which we add a single
check bit so that the total number of 1s in the codeword is even.
(a) What are the check bits corresponding to the information bits
0110 and 1011?

(b) Which of the following bit strings are (valid) codewords:


10101, 11101, 00000?
(c) What is the minimum number of bit positions in which two
codewords differ?
(d) How many bit errors can be detected using this scheme?
(e) How many bit errors can be corrected using this scheme?

Engineering Systems Design

11

Melbourne School of Engineering

The (7,4) Hamming Code


Another famous example of a parity check code is the (7,4) hamming
code for which each group of 4 information bits has 3 parity check bits
added to give a 7-bit codeword.
There are 128 possible combinations of 7 bits however only 16 are
codewords.
The parity bits are added in such a way that every pair of codewords
differ in at least 3 bit positions (the number of bit positions in which two
codewords differ is called the Hamming distance)
Question: Assuming the decoder chooses the codeword that is closest
to the received bit string, how many errors can the Hamming code
detect and how many can it correct?

Engineering Systems Design

12

Melbourne School of Engineering

Next Lecture
Digital Systems: Truth Tables, Logic Gates and
Boolean Algebra (Part 1)
Truth tables
Logic gates
Simple logic circuits

Reading:
Lecture D04 overheads
Section 7.3 in Brockman
Sections 3.1 3.8 in ESD 2 text

Engineering Systems Design

13

Melbourne School of Engineering

Engineering Systems Design 2


Lecture D04
Digital Systems: Truth Tables, Logic Gates and
Boolean Algebra (Part 1)
(Section 7.3 in Brockman, Sections 3.1 3.8 in ESD 2 text)

Outline
Boolean constants and variables
Truth tables
Logic gates (OR, AND, NOT)
Describing logic circuits
Implementing Boolean expressions

Engineering Systems Design

Melbourne School of Engineering

Boolean Constants and Variables


Boolean constants are 0 and 1
Abstraction of LOW and HIGH voltage levels in a
digital circuit
Boolean variables are quantities that may, at
different times, be equal to either 0 or 1

Engineering Systems Design

Melbourne School of Engineering

Truth Tables
A truth table describes how the output of a digital
circuit depends on its inputs.

Figure 3-1
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition

Engineering Systems Design

Melbourne School of Engineering

Challenge
Work out how many different 3-input, 1-output Boolean
functions (truth tables) there are.

Engineering Systems Design

Melbourne School of Engineering

Logic Operations and Gates


Boolean algebra has three basic operations (logic
operations): OR, AND and NOT.
Digital circuits called logic gates can be constructed
from diodes, transistors and resistors to implement
these basic operations.
Logic gates are the basic elements of complex digital
circuits

Engineering Systems Design

Melbourne School of Engineering

OR Operation
x = A + B ( A OR B )

Figure 3-2
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition

Engineering Systems Design

Melbourne School of Engineering

Three-Input OR Gate

Figure 3-3
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition

Engineering Systems Design

Melbourne School of Engineering

Exercise
Sketch a circuit to implement a 4-input OR gate using only
2-input OR gates.

Engineering Systems Design

Melbourne School of Engineering

Example: Use of OR Gate in Alarm


System

Figure 3-4
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition

Engineering Systems Design

10

Melbourne School of Engineering

AND Operation
x = A B ( A AND B )

Figure 3-7
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition

Engineering Systems Design

11

Melbourne School of Engineering

Three-Input AND Gate

Figure 3-8
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition

Engineering Systems Design

12

Melbourne School of Engineering

NOT Operation
x A
or x A

(NOT A or A-bar or complement of A or inverse of A)

Figure 3-11
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition

Engineering Systems Design

13

Melbourne School of Engineering

Describing Logic Circuits


Any logic circuit, no matter how complex, can be
completely described using Boolean operations.

Figure 3-12, 3-13


Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition

Engineering Systems Design

14

Melbourne School of Engineering

Figure 3-15
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition

Engineering Systems Design

15

Melbourne School of Engineering

Example
Evaluate the output of circuit (b) on the previous slide
when the inputs are:
A = 1, B = 1, C = 0, D = 1 and E = 0.

Engineering Systems Design

16

Melbourne School of Engineering

Implementing Circuits from Boolean


Expressions
Example: Sketch a digital circuit that implements
the following logic function:

y AC BC A BC

Engineering Systems Design

17

Melbourne School of Engineering

Next Lecture
Digital Systems: Truth Tables, Logic Gates and
Boolean Algebra (Part 2)
Boolean algebra and DeMorgans theorems
NOR gates and NAND gates

Reading:
Lecture D05 overheads
Section 7.3 in Brockman
Section 3.9 3.13 in ESD 2 text

Engineering Systems Design

18

Melbourne School of Engineering

Engineering Systems Design 2


Lecture D05
Digital Systems: Truth Tables, Logic Gates and
Boolean Algebra (Part 2)
(Section 7.3 in Brockman, Sections 3.9 3.13 in ESD 2 text)

Outline
Boolean theorems

DeMorgans theorems
Simplifying logic circuits
NOR gates and NAND gates

Universality of NAND gates

Engineering Systems Design

Melbourne School of Engineering

Boolean Theorems
Single Variable Theorems
(1) x . 0 = 0

(5) x + 0 = x

(2) x . 1 = x

(6) x + 1 = 1

(3) x . x = x

(7) x + x = x

(4) x . x = 0

(8) x + x = 1

(9) x = x

Engineering Systems Design

Melbourne School of Engineering

Exercise: Perfect Induction


Prove (3) using perfect induction.

Engineering Systems Design

Melbourne School of Engineering

Boolean Theorems
Multivariable Theorems
(10)

x+y = y+x

commutative
(11)

xy = yx

(12)

x + (y + z) = (x + y)+ z = x + y + z

(13)

x (y z) = (x y) z = x y z

(14)

x (y + z) = x y + x z

(15)

x + (y z) = (x + y)(x + z)

(16)

x+xy = x

(17)

x+xy=x+y

Engineering Systems Design

associative
distributive

Melbourne School of Engineering

Exercise: Perfect Induction


Prove by perfect induction the distributive law

X+(YZ)=(X+Y)(X+Z)

Engineering Systems Design

Melbourne School of Engineering

Example
Simplify

Engineering Systems Design

z ( A B) ( A B)

Melbourne School of Engineering

DeMorgans Theorems
(18)

(x y )

(19)

(x y )

x y

x y

Proof: Use a truth table

Engineering Systems Design

Melbourne School of Engineering

Example
Simplify

Engineering Systems Design

( )

z A BC A B AC

Melbourne School of Engineering

Principle of Duality
Any theorem or identity in switching (Boolean) algebra
remains true if 0 and 1 are swapped and and + are
swapped throughout.

Exercise: Identify dual pairs of theorems from the list of


single and multiple variable theorems on slides 3, 5 and 8.

Engineering Systems Design

10

Melbourne School of Engineering

NOR Operation

x A B
( A NOR B )

Figure 3-19
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition

Engineering Systems Design

11

Melbourne School of Engineering

NAND Operation

x A B

( A NAND B )

Figure 3-22
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition

Engineering Systems Design

12

Melbourne School of Engineering

Universality of NAND Gates


inverter

inverters
Engineering Systems Design

Figure 3-29
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition

13

Melbourne School of Engineering

Exercise: NAND Gates


Implement y = A B + C using NAND gates.

Engineering Systems Design

14

Melbourne School of Engineering

Next Lecture
Digital Systems: Combinational Logic Design (Part 1)
Simplifying Logic Circuits
Designing Combinational Logic Circuits
Karnaugh Map Method

Reading:
Lecture D06 overheads
Sections 4.1 4.5 of ESD 2 text

Engineering Systems Design

15

Melbourne School of Engineering

Engineering Systems Design 2


Lecture D06
Digital Systems: Combinational Logic Design (Part 1)
(Sections 4.1 4.5 in ESD 2 text)

Outline
Simplifying Logic Circuits

Sum-of-Products Form
Algebraic Simplification
Designing Combinational Logic Circuits
Karnaugh Map Method

Engineering Systems Design

Melbourne School of Engineering

Simplifying Logic Circuits

Figure 4-1
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition

Engineering Systems Design

Melbourne School of Engineering

Sum-of-Products Form
Examples:

ABC A BC
AB A BC C D D
A B CD EF GK HL

Implement with AND-OR circuits (or NAND-NAND)

Exercise: Convert ( A B)(C D) to SOP form

Engineering Systems Design

Melbourne School of Engineering

Algebraic Simplification
Key Steps:
Obtain the sum-of-products form

Check for common factors to eliminate as many terms


as possible

Exercise: Simplify ( A B) ( A B D) D

Engineering Systems Design

Melbourne School of Engineering

Designing Combinational Logic


Circuits
1. Problem specification
2. Truth table
3. Sum-of-products expression for output

4. Simplify SOP output expression


Algebraic simplification
Karnaugh map

5. Implement circuit

Engineering Systems Design

Melbourne School of Engineering

Design Example
Circuits to add binary numbers are at the heart of almost
all digital systems from the processor in the bionic ear to
the communications algorithms in your mobile phone.
A basic component in binary adders is the circuit that
adds three bits A, B and C. The output of the circuit is the
2-bit sum which tells us how many of the input bits are 1.
Design a logic circuit X = F(A, B, C) where the output is
the most significant bit of the two-bit sum of A, B and C.

Engineering Systems Design

Melbourne School of Engineering

Design Example
A
0
0
0
0
1
1
1
1

B
0
0
1
1
0
0
1
1

C
0
1
0
1
0
1
0
1

X
0
0
0
1
0
1
1
1

Truth Table

ABC
ABC
ABC
ABC

Output Expression
(SOP Form)

X ABC ABC ABC ABC


Engineering Systems Design

Melbourne School of Engineering

Design Example
Algebraic simplification of output expression

X ABC ABC ABC ABC


ABC ABC ABC ABC ABC ABC
( ABC ABC ) ( ABC ABC ) ( ABC ABC )
BC ( A A) AC ( B B) AB(C C )
BC AC AB

Engineering Systems Design

Melbourne School of Engineering

Design Example
Implement the circuit for the final expression

Figure 4-7
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition

Exercise: Redraw this circuit using NAND gates only


Engineering Systems Design

10

Melbourne School of Engineering

Karnaugh Maps
A Karnaugh map (abbreviated K-map) is an alternative,
more compact representation of the truth table of a logic
circuit.
Gives mechanical method for doing algebraic
simplification on complementary product terms such as

ABC ABC AB
In theory, K-map method applies to logic circuits with any
number of input variables, but working by hand (without
computer), limit to 6.
Engineering Systems Design

11

Melbourne School of Engineering

Karnaugh Maps
For design example, there are 3
input variables A,B,C and the K-map
has 8 = 23 cells, with rows and
columns labelled in very specific
order.

Each pair of adjacent 1s shows a


pair of complementary product terms,
e.g.

AB

AB
AB

AB

ABC and ABC


Engineering Systems Design

12

Melbourne School of Engineering

Karnaugh Maps
The labelling of rows and columns is
quite specific: each cell corresponds to
an input combination that differs from
each of its immediately adjacent
neighbours in exactly one variable
(including wraparound neighbours).

Engineering Systems Design

13

AB

AB
AB

AB

Melbourne School of Engineering

Next Lecture
Digital Systems: Combinational Logic Design (Part 2)
Karnaugh maps (continued)
Design example

Reading:
Lecture D07 overheads
Sections 4.5 in ESD 2 text

Engineering Systems Design

14

Melbourne School of Engineering

Engineering Systems Design 2


Lecture D07
Digital Systems: Combinational Logic Design (Part 2)
(Section 4.5 in ESD 2 text)

Outline
Karnaugh Maps (continued)
Looping pairs
Looping quads
Looping octets
Dont care conditions

Design Example
2-bit comparator circuit

Engineering Systems Design

Melbourne School of Engineering

Karnaugh Maps
A Karnaugh map (abbreviated K-map) is an alternative,
more compact representation of the truth table of a logic
circuit.
Gives mechanical method for doing algebraic
simplification on complementary product terms such as

ABC ABC AB
In theory, K-map method applies to logic circuits with any
number of input variables, but working by hand (without
computer), limit to 6.
Engineering Systems Design

Melbourne School of Engineering

Looping Pairs
C C
AB 0 0

C C
AB 0 0

C C
AB 1 0

AB 1

AB 1

AB 0

AB 1

AB 0

AB 0

AB 0

AB 0

AB 1

x ABC AB C
BC

x ABC ABC

x A BC A BC
BC

AB

Figure 4-12 (a), (b), (c)


Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition

Engineering Systems Design

Melbourne School of Engineering

Four Variable Karnaugh Maps and


Looping Pairs

C D CD CD C D
AB 0 0 1 1
AB 0
AB 0

AB 1

x ABCD ABC D
ABC D ABC D
ABC AB D

Figure 4-12 (d)


Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition

Engineering Systems Design

Melbourne School of Engineering

Looping Quads
C C
AB 0 1

C D CD CD C D
AB 0 0 0 0

AB 0

AB 0

AB 0
AB 1

AB 0

AB 0

xC

x AB

C D CD CD C D
AB 0 0 0 0
1

AB 0
AB 0

AB 0

x BD

Figure 4-13 (a), (b), (c)


Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition

Engineering Systems Design

Melbourne School of Engineering

Looping Quads
C D CD CD C D
AB 0 0 0 0
AB 0
AB 1

AB 1

C D CD CD C D
AB 1 0 0 1
0

AB 0
AB 0

AB 1

x AD

x BD
Figure 4-13 (d), (e)
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition

Engineering Systems Design

Melbourne School of Engineering

Looping Octets
C D CD CD C D
AB 0 0 0 0
AB 1
AB 1

AB 0

C D CD CD C D
AB 1 1 0 0
1

AB 1
AB 1

AB 1

xB

xC
Figure 4-14 (a), (b)
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition

Engineering Systems Design

Melbourne School of Engineering

Karnaugh Maps: Summary


The labelling of rows and columns with minterms is
critically important - adjacent neighbouring cells can
differ in only one bit
In looping pairs, quads or octets, top and bottom rows
are considered to be adjacent
In looping pairs, quads or octets, left and right columns
are considered to be adjacent
Any 1 can be looped as many times as necessary
- not just once

Engineering Systems Design

Melbourne School of Engineering

Examples
Simplify the functions X = F(A,B,C) and Y = G(A,B,C,D)
with K-maps as shown

C C
AB 0 1

C D CD CD C D
AB 0 1 1 0

AB 1

AB 0

AB 0
AB 1

AB 0

AB 1

Engineering Systems Design

10

Melbourne School of Engineering

Dont Care Conditions


Some logic circuits can be designed so that there are
certain input conditions for which there are no specified
output levels
usually because these input conditions will never occur
certain combinations of input levels where we dont
care whether the output is HIGH or LOW.

Engineering Systems Design

11

Melbourne School of Engineering

e.g. ( indicates dont care)

C C

C C
AB

AB

AB

AB

AB

AB

AB

AB

dont care treated as a 0

zA

dont care treated as a 1

can be treated as either a 1 a 0 to minimise the


number of terms
Engineering Systems Design

12

Melbourne School of Engineering

Design Example
Problem Specification
An important building block in digital systems is a
comparator, something that compares the magnitude
of two binary numbers.
Design a combinational circuit that takes two 2-bit
binary numbers y1 y0 and x1 x0 as inputs and that
outputs 1 if an only if y1 y0 is greater than x1 x0 .

Engineering Systems Design

13

Melbourne School of Engineering

Design Example
Truth Table

Engineering Systems Design

14

Melbourne School of Engineering

Design Example
Simplify using Karnaugh Map

Engineering Systems Design

15

Melbourne School of Engineering

Next Lecture
Digital Systems: Tradeoffs, Modularity and PLDs (Part 1)
Binary Adders

Reading:
Lecture D08 overheads

Section 7.3.4 of Brockman


Sections 6.1, 6.10 and 6.11 of Tocci

Engineering Systems Design

16

Melbourne School of Engineering

Engineering Systems Design 2


Lecture D08
Digital Systems: Tradeoffs, Modularity and PLDs (Part 1)
(Section 7.3.4 in Brockman,
Sections 6.1, 6.10 and 6.11 in Tocci)

Outline
Binary addition
Ripple-carry adder
Full adder circuit
Carry propagation

Engineering Systems Design

Melbourne School of Engineering

Binary Addition
Circuits to add two n-bit binary numbers are central to almost all
digital systems from computers (in the arithmetic-logic unit or ALU),
to MP3 players and to the speech processor in your mobile phone.
We cannot use the design approach from Lectures D06 and D07 to
design a circuit to add two 16-bit numbers. The circuit would have
32 inputs and 17 outputs and the truth table would have more than
4.2 billion rows!
We need to look for structure in the problem and break the design
down into smaller, more manageable chunks.

Engineering Systems Design

Melbourne School of Engineering

Binary Addition
Lets start by looking at the way that we add numbers by hand.
Add the following 8-bit binary numbers:

10110011
01011111
(You can check your answer by converting the two binary
numbers and their binary sum to decimal.)

Can we design an adder circuit that uses a similar approach?


Engineering Systems Design

Melbourne School of Engineering

Binary Addition

Figure 6-4
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition

Engineering Systems Design

Melbourne School of Engineering

Ripple-Carry Adder

Figure 6-5
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition

Engineering Systems Design

Melbourne School of Engineering

Design of a Full Adder

Figure 6-6
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition

Engineering Systems Design

Melbourne School of Engineering

Exercise
Derive expressions for S in sum-of-products form and
then in terms of XOR operations.

Engineering Systems Design

Melbourne School of Engineering

Exercise
Derive an expression for COUT in sum-of-products form.
(See also Lecture D06)

Engineering Systems Design

Melbourne School of Engineering

Full Adder Circuit

Figure 6-7
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition

Engineering Systems Design

10

Melbourne School of Engineering

Ripple Carry Adder

Figure 6-5
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition

Engineering Systems Design

11

Melbourne School of Engineering

Carry Propagation

Speed of parallel adder is limited by carry propagation or carry ripple.

In an n-bit adder, the most significant bit will not reach its final value
until after n full-adder propagation delays.

Can be solved by look-ahead carry, at the expense of extra circuitry.

Many integrated-circuit adders use look-ahead carry.

This is an example of the classic tradeoff


between space (how much circuitry) and time
(propagation delay)

Engineering Systems Design

12

Melbourne School of Engineering

Next Lecture
Digital Circuits: Tradeoffs, Modularity and PLDs (Part 2)
Binary Comparators

Reading:
Lecture D09 overheads

Engineering Systems Design

13

Melbourne School of Engineering

Engineering Systems Design 2


Lecture D09
Digital Circuits: Tradeoffs, Modularity and PLDs (Part 2)

Outline
Comparators
Design of 4-bit Comparator
Cascading Inputs

Engineering Systems Design

Melbourne School of Engineering

Comparators
Another important operation in digital systems is that of comparing
two n-bit binary numbers to see which is bigger.
Comparators are used anytime a system uses thresholds to trigger
events e.g. shut off the central heating if the temperature rises
above the set point or increase the dosage of a drug if a patients
blood sugar level drops below a certain point.
Again the task of designing a circuit to compare two 16-bit binary
numbers must be attacked by looking for structure and breaking the
problem down into byte-sized chunks (pun intended).

Engineering Systems Design

Melbourne School of Engineering

Design of 4-bit Comparator


Design a 4-bit comparator that has inputs
A = A3 A2 A1 A0 and B = B3 B2 B1 B0
and outputs A>B, A=B and A<B so that A>B is 1 if and only if A > B,
A=B is 1 if and only A = B, and A<B is 1 if and only if A < B.
Hint: Think about the process you go through to decide which of the
following numbers is larger
0110
0101
and now generalise this to give a procedure for deciding when the
number A3 A2 A1 A0 is greater than B3 B2 B1 B0.

Engineering Systems Design

Melbourne School of Engineering

Design of 4-bit Comparator

Engineering Systems Design

Melbourne School of Engineering

Design of 4-bit Comparator

Engineering Systems Design

Melbourne School of Engineering

Engineering Systems Design

Melbourne School of Engineering

Cascading Inputs
With slight modification, the 4-bit comparator we just designed
could be used as a building block for bigger comparators
For example, a 16-bit comparator could be built using four 4-bit
comparators

For this to work we need to add cascading inputs to our 4-bit


comparator (similar to the carry input of our full adder circuit)

Exercise: Modify the 4-bit comparator design so that it includes three


new (cascading) inputs to enable the 4-bit comparator to be used as
a component in bigger comparators (8-bit, 16-bit etc.).

Engineering Systems Design

Melbourne School of Engineering

Cascading Inputs

Engineering Systems Design

Melbourne School of Engineering

Cascading Inputs

Engineering Systems Design

10

Melbourne School of Engineering

Next Lecture
Digital Circuits: Tradeoffs, Modularity and PLDs (Part 2)
Programmable logic devices

Reading:
Lecture D10 overheads

Engineering Systems Design

11

Melbourne School of Engineering

Engineering Systems Design 2


Lecture D10
Digital Circuits: Tradeoffs, Modularity and PLDs (Part 3)

Outline
Programmable Logic Devices
Altera development board

Summary

Engineering Systems Design

Melbourne School of Engineering

Programmable Logic Devices


Simple Programmable Logic Devices (PLDs) contain a
number of gates and possibly flip-flops.
Internal hardware of PLDs can be reconfigured by
electrically connecting and disconnecting points in the
circuit.
Programmable logic designs have taken over from
MSI-based designs for custom digital system design.
Advantages include less board space, less power,
greater reliability, less inventory and lower cost.

Engineering Systems Design

Melbourne School of Engineering

Example of a PLD

Figure 12-1
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition

Engineering Systems Design

Melbourne School of Engineering

Simplified Circuit Diagram

O1 =
O2 =
O3 =

O4 =

Figure 12-2
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition

Engineering Systems Design

Melbourne School of Engineering

Programmable Array Logic (PAL)


The simple PLD on the previous slide has a hardwired AND array and a programmable OR array.
PAL devices on the other hand, have a
programmable AND array and a hard-wired OR
array.
For most sum-of-products logic expressions the PAL
architecture makes much more efficient use of the
available resources.

Engineering Systems Design

Melbourne School of Engineering

inputs

hard-wired
OR array

programmable
AND array
outputs

Figure 12-4
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition

Engineering Systems Design

Melbourne School of Engineering

High capacity PLDs


A field programmable gate
array (FPGA) consists of
large number of simple logic
blocks surrounded by a
programmable interconnect.

A fairly new FPGA from


Xilinx (XC2V8000) has over
ten thousand logic blocks,
over eight million system
gates and more than one
thousand I/O pins.
Engineering Systems Design

Figure 12-30
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition

Melbourne School of Engineering

Altera Development Board

Engineering Systems Design

Melbourne School of Engineering

Digital Circuits: What we did cover


Bits, Bytes and Codes
Analog-to-digital conversion, number systems, codes

Truth tables, logic gates and Boolean algebra


Combinational logic design
K-maps for simplification

Tradeoffs, Modularity and PLDs


Adders, comparators and more complex designs

You can now design combinational logic circuits of


moderate complexity and you have seen how designs can
be implemented in programmable logic!
Engineering Systems Design

10

Melbourne School of Engineering

Digital Circuits: What we didnt cover


Memory elements (latches and flip-flops)
Sequential logic design
Sequential building blocks
counters and registers

Hardware description languages


Microprocessors and microcontrollers

Engineering Systems Design

11

Melbourne School of Engineering

Anda mungkin juga menyukai