You are on page 1of 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)
Engineering Systems Design Melbourne School of Engineering
2
Outline
Digital Systems
Analog and Digital
Representing binary quantities
Digital circuits
Advantages of digital circuits
Engineering Systems Design Melbourne School of Engineering
3
The Digital Information Age
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
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
Engineering Systems Design Melbourne School of Engineering
4
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
5
Module Learning Objectives
Engineering Systems Design Melbourne School of Engineering
6
Computer built with LEGO
Charles Babbage
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
Engineering Systems Design Melbourne School of Engineering
7
Analog Computers
Engineering Systems Design Melbourne School of Engineering
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.
8
My First Computer: The VZ200
Engineering Systems Design Melbourne School of Engineering
9
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
10
Mobile Phone
Microphone
A/D
converter
Digital
processing
D/A
converter
Antenna
Transmitted
signal
Voice
Speech coding,
error control coding,
modulation
Engineering Systems Design Melbourne School of Engineering
11
Analog versus Digital Modulation
Engineering Systems Design Melbourne School of Engineering
12
Representing Binary Quantities
Figure 1-7
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition
Binary information is represented by voltages (or currents) in a circuit
Exact value of a voltage is not important in digital circuits
Engineering Systems Design Melbourne School of Engineering
13
Digital Circuits
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
Digital circuits are designed to:
This module is an introduction to the analysis design of digital circuits
from the logical perspective.
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
Engineering Systems Design Melbourne School of Engineering
14
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
Figure 7-8
Jay B. Brockman
Introduction to Engineering
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.
When we add error control coding we are in even better shape
(see Lecture D03).
Engineering Systems Design Melbourne School of Engineering
15
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 Melbourne School of Engineering
16
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 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)
Engineering Systems Design Melbourne School of Engineering
2
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
3
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
4
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
5
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
6
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
7
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 r
i
and each
digit can have value 0, 1, , r-1.
The base-r number d
p-1
d
p-2
d
1
d
0
. d
-1
d
-2
d
-n
has decimal (base-10)
representation
1
1 0 1 1
1 0 1 1
... ...
p
i n p
i n p
i n
D d r d r d r d r d r d r

Engineering Systems Design Melbourne School of Engineering


8
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
9
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
10
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 Melbourne School of Engineering
11
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 Melbourne School of Engineering
12
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 Melbourne School of Engineering
13
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 179
10
to binary, octal and hexadecimal.
Engineering Systems Design Melbourne School of Engineering
14
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 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)
Engineering Systems Design Melbourne School of Engineering
2
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
3
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 943
10
is coded using BCD
9 4 3
1001 0100 0011 (BCD)
Question: How many 4-bit decimal codes are there?
Engineering Systems Design Melbourne School of Engineering
4
Summary
Decimal Binary Octal Hexadecimal BCD
0 0 0 0 0000
1 1 1 1 0001
2 10 2 2 0010
3 11 3 3 0011
4 100 4 4 0100
5 101 5 5 0101
6 110 6 6 0110
7 111 7 7 0111
8 1000 10 8 1000
9 1001 11 9 1001
10 1010 12 A 0001 0000
11 1011 13 B 0001 0001
12 1100 14 C 0001 0010
13 1101 15 D 0001 0011
14 1110 16 E 0001 0100
15 1111 17 F 0001 0101
Engineering Systems Design Melbourne School of Engineering
5
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
6
Table 2-4
Tocci, Widmer and Moss
Digital Systems, Ninth Edition
Engineering Systems Design Melbourne School of Engineering
7
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
8
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
9
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
10
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 Melbourne School of Engineering
11
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 Melbourne School of Engineering
12
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 Melbourne School of Engineering
13
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 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)
Engineering Systems Design Melbourne School of Engineering
2
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
3
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
4
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
5
Challenge
Work out how many different 3-input, 1-output Boolean
functions (truth tables) there are.
Engineering Systems Design Melbourne School of Engineering
6
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
7
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
8
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
9
Exercise
Sketch a circuit to implement a 4-input OR gate using only
2-input OR gates.
Engineering Systems Design Melbourne School of Engineering
10
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 Melbourne School of Engineering
11
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 Melbourne School of Engineering
12
Three-Input AND Gate
Figure 3-8
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition
Engineering Systems Design Melbourne School of Engineering
13
A x
A x

or
NOT Operation
Figure 3-11
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition
(NOT A or A-bar or complement of A or inverse of A)
Engineering Systems Design Melbourne School of Engineering
14
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 Melbourne School of Engineering
15
Figure 3-15
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition
Engineering Systems Design Melbourne School of Engineering
16
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 Melbourne School of Engineering
17
Implementing Circuits from Boolean
Expressions
y AC BC A BC
Example: Sketch a digital circuit that implements
the following logic function:
Engineering Systems Design Melbourne School of Engineering
18
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 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)
Engineering Systems Design Melbourne School of Engineering
2
Outline
Boolean theorems
DeMorgans theorems
Simplifying logic circuits
NOR gates and NAND gates
Universality of NAND gates
Engineering Systems Design Melbourne School of Engineering
3
Boolean Theorems
Single Variable Theorems
(1) x . 0 = 0
(2) x . 1 = x
(3) x . x = x
(4) x . x = 0
(5) x + 0 = x
(6) x + 1 = 1
(7) x + x = x
(8) x + x = 1
(9) x = x
Engineering Systems Design Melbourne School of Engineering
4
Exercise: Perfect Induction
Prove (3) using perfect induction.
Engineering Systems Design Melbourne School of Engineering
5
(17) x + x y = x + y
Multivariable Theorems
(14) x (y + z) = x y + x z
(12) x + (y + z) = (x + y)+ z = x + y + z
(11) x y = y x
(10) x + y = y + x
(16) x + x y = x
(13) x (y z) = (x y) z = x y z
Boolean Theorems
commutative
distributive
associative
(15) x + (y z) = (x + y)(x + z)
Engineering Systems Design Melbourne School of Engineering
6
Exercise: Perfect Induction
Prove by perfect induction the distributive law
X + ( Y Z ) = ( X + Y ) ( X + Z )
Engineering Systems Design Melbourne School of Engineering
7
Example
Simplify
) ( ) ( B A B A z
Engineering Systems Design Melbourne School of Engineering
8
(18)
(19)
Proof: Use a truth table
( ) y x y x
( ) y x y x
DeMorgans Theorems
Engineering Systems Design Melbourne School of Engineering
9
Example
Simplify
( ) C A B A C B A z
Engineering Systems Design Melbourne School of Engineering
10
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 Melbourne School of Engineering
11
NOR Operation
x AB
( A NOR B )
Figure 3-19
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition
Engineering Systems Design Melbourne School of Engineering
12
NAND Operation
Figure 3-22
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition
B A x
( A NAND B )
Engineering Systems Design Melbourne School of Engineering
13
Universality of NAND Gates
inverters
inverter
Figure 3-29
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition
Engineering Systems Design Melbourne School of Engineering
14
Exercise: NAND Gates
Implement y = A B + C using NAND gates.
Engineering Systems Design Melbourne School of Engineering
15
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 2
Lecture D06
Digital Systems: Combinational Logic Design (Part 1)
(Sections 4.1 4.5 in ESD 2 text)
Engineering Systems Design Melbourne School of Engineering
2
Simplifying Logic Circuits
Sum-of-Products Form
Algebraic Simplification
Designing Combinational Logic Circuits
Karnaugh Map Method
Outline
Engineering Systems Design Melbourne School of Engineering
3
Simplifying Logic Circuits
Figure 4-1
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition
Engineering Systems Design Melbourne School of Engineering
4
Exercise: Convert to SOP form
Examples:
Implement with AND-OR circuits (or NAND-NAND)
Sum-of-Products Form
ABC A BC
AB A BC C D D
A B CD EF GK HL
) )( ( D C B A
Engineering Systems Design Melbourne School of Engineering
5
Algebraic Simplification
Key Steps:
Obtain the sum-of-products form
Check for common factors to eliminate as many terms
as possible
Exercise: Simplify D D B A B A ) ( ) (
Engineering Systems Design Melbourne School of Engineering
6
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
7
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
8
BC A
ABC
A B C X
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 1
C B A
C AB
Design Example
X ABC ABC ABC ABC
Truth Table
Output Expression
(SOP Form)
Engineering Systems Design Melbourne School of Engineering
9
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
10
Design Example
Implement the circuit for the final expression
Exercise: Redraw this circuit using NAND gates only
Figure 4-7
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition
Engineering Systems Design Melbourne School of Engineering
11
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
In theory, K-map method applies to logic circuits with any
number of input variables, but working by hand (without
computer), limit to 6.
ABC ABC AB
Engineering Systems Design Melbourne School of Engineering
12
Karnaugh Maps
Each pair of adjacent 1s shows a
pair of complementary product terms,
e.g.
0 0
0 1
1 1
0 1
B A
B A
AB
B A
C
C
For design example, there are 3
input variables A,B,C and the K-map
has 8 = 2
3
cells, with rows and
columns labelled in very specific
order.
and ABC ABC
Engineering Systems Design Melbourne School of Engineering
13
Karnaugh Maps
0 0
0 1
1 1
0 1
B A
B A
AB
B A
C
C
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 Melbourne School of Engineering
14
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 2
Lecture D07
Digital Systems: Combinational Logic Design (Part 2)
(Section 4.5 in ESD 2 text)
Engineering Systems Design Melbourne School of Engineering
2
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
3
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
In theory, K-map method applies to logic circuits with any
number of input variables, but working by hand (without
computer), limit to 6.
ABC ABC AB
Engineering Systems Design Melbourne School of Engineering
4
C C
B A
B A
0 0
1 0
1 0
0 0
AB
B A
C C
B A
B A
0 0
1 1
0 0
0 0
AB
B A
C C
B A
B A
1 0
0 0
0 0
1 0
AB
B A
B A
BC A C B A x


C B
C B A C B A x


C B
C AB C B A x


Looping Pairs
Figure 4-12 (a), (b), (c)
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition
Engineering Systems Design Melbourne School of Engineering
5
D C D C
B A
B A
0 0
0 0
0 0
1 0
AB
B A
1 1
0 0
0 0
0 1
CD D C
D B A C B A
D C B A D C B A
D C B A CD B A x



Four Variable Karnaugh Maps and
Looping Pairs
Figure 4-12 (d)
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition
Engineering Systems Design Melbourne School of Engineering
6
Looping Quads
C C
B A
B A
0 1
0 1
0 1
0 1
AB
B A
C x
D C D C
B A
B A
0 0
0 0
1 1
0 0
AB
B A
0 0
0 0
1 1
0 0
CD D C
AB x
D C D C
B A
B A
0 0
0 1
0 1
0 0
AB
B A
0 0
1 0
1 0
0 0
CD D C
BD x
Figure 4-13 (a), (b), (c)
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition
Engineering Systems Design Melbourne School of Engineering
7
Looping Quads
D A x D B x
D C D C
B A
B A
0 0
0 0
1 0
1 0
AB
B A
0 0
0 0
0 1
0 1
CD D C D C D C
B A
B A
1 0
0 0
0 0
1 0
AB
B A
0 1
0 0
0 0
0 1
CD D C
Figure 4-13 (d), (e)
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition
Engineering Systems Design Melbourne School of Engineering
8
Looping Octets
D C D C
B A
B A
0 0
1 1
1 1
0 0
AB
B A
0 0
1 1
1 1
0 0
CD D C
B x
D C D C
B A
B A
1 1
1 1
1 1
1 1
AB
B A
0 0
0 0
0 0
0 0
CD D C
C x
Figure 4-14 (a), (b)
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition
Engineering Systems Design Melbourne School of Engineering
9
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
10
Examples
D C D C
B A
B A
0 1
0 1
1 1
1 1
AB
B A
1 0
0 1
0 0
0 0
CD D C
C C
B A
B A
0 1
1 1
0 0
0 1
AB
B A
Simplify the functions X = F(A,B,C) and Y = G(A,B,C,D)
with K-maps as shown
Engineering Systems Design Melbourne School of Engineering
11
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 Melbourne School of Engineering
12
e.g. ( indicates dont care)
C C
B A
B A
0 0
0
1 1
1
AB
B A
can be treated as either a 1 a 0 to minimise the
number of terms
C C
B A
B A
0 0
0
1 1
1
AB
B A
A z
dont care treated as a 0
dont care treated as a 1
Engineering Systems Design Melbourne School of Engineering
13
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 y
1
y
0
and x
1
x
0
as inputs and that
outputs 1 if an only if y
1
y
0
is greater than x
1
x
0
.
Engineering Systems Design Melbourne School of Engineering
14
Design Example
Truth Table
Engineering Systems Design Melbourne School of Engineering
15
Design Example
Simplify using Karnaugh Map
Engineering Systems Design Melbourne School of Engineering
16
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 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)
Engineering Systems Design Melbourne School of Engineering
2
Outline
Binary addition
Ripple-carry adder
Full adder circuit
Carry propagation
Engineering Systems Design Melbourne School of Engineering
3
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
4
Binary Addition
Lets start by looking at the way that we add numbers by hand.
Add the following 8-bit binary numbers:
1 0 1 1 0 0 1 1
0 1 0 1 1 1 1 1
(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
5
Binary Addition
Figure 6-4
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition
Engineering Systems Design Melbourne School of Engineering
6
Ripple-Carry Adder
Figure 6-5
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition
Engineering Systems Design Melbourne School of Engineering
7
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
8
Exercise
Derive expressions for S in sum-of-products form and
then in terms of XOR operations.
Engineering Systems Design Melbourne School of Engineering
9
Exercise
Derive an expression for C
OUT
in sum-of-products form.
(See also Lecture D06)
Engineering Systems Design Melbourne School of Engineering
10
Full Adder Circuit
Figure 6-7
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition
Engineering Systems Design Melbourne School of Engineering
11
Ripple Carry Adder
Figure 6-5
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition
Engineering Systems Design Melbourne School of Engineering
12
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 Melbourne School of Engineering
13
Next Lecture
Digital Circuits: Tradeoffs, Modularity and PLDs (Part 2)
Binary Comparators
Reading:
Lecture D09 overheads
Engineering Systems Design 2
Lecture D09
Digital Circuits: Tradeoffs, Modularity and PLDs (Part 2)
Engineering Systems Design Melbourne School of Engineering
2
Outline
Comparators
Design of 4-bit Comparator
Cascading Inputs
Engineering Systems Design Melbourne School of Engineering
3
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
4
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
5
Design of 4-bit Comparator
Engineering Systems Design Melbourne School of Engineering
6
Design of 4-bit Comparator
Engineering Systems Design Melbourne School of Engineering
7
Engineering Systems Design Melbourne School of Engineering
8
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
9
Cascading Inputs
Engineering Systems Design Melbourne School of Engineering
10
Cascading Inputs
Engineering Systems Design Melbourne School of Engineering
11
Next Lecture
Digital Circuits: Tradeoffs, Modularity and PLDs (Part 2)
Programmable logic devices
Reading:
Lecture D10 overheads
Engineering Systems Design 2
Lecture D10
Digital Circuits: Tradeoffs, Modularity and PLDs (Part 3)
Engineering Systems Design Melbourne School of Engineering
2
Outline
Programmable Logic Devices
Altera development board
Summary
Engineering Systems Design Melbourne School of Engineering
3
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
4
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
5
Simplified Circuit Diagram
Figure 12-2
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition
O
1
=
O
2
=
O
3
=
O
4
=
Engineering Systems Design Melbourne School of Engineering
6
Programmable Array Logic (PAL)
The simple PLD on the previous slide has a hard-
wired 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
7
Figure 12-4
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition
hard-wired
OR array
programmable
AND array
inputs
outputs
Engineering Systems Design Melbourne School of Engineering
8
High capacity PLDs
Figure 12-30
Ronald J. Tocci and Neal S. Widmer
Digital Systems, Eighth Edition
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 Melbourne School of Engineering
9
Altera Development Board
Engineering Systems Design Melbourne School of Engineering
10
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 Melbourne School of Engineering
11
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