Title: ECE U322 Digital Logic Design
1ECE U322Digital Logic Design
Sept. 14, 2005
- Lecture 4
- Binary numbers
- Boolean Algebra
- Boolean Logic
- Reading Markovitz Section 2-2
lect04.ppt
ECE U322 F05
2Announcements
- HW1 due Thursday, Sept 22
- Assignment will be posted on Blackboard.
3Signed Values
- MSB is sign bit.
- Three methods for interpreting the remaining
(non-sign) bits - sign magnitude
- ones complement
- twos complement
4Representing Signed Values
5To form the 2s complement
- To form the 2s complement of a number
- take the 1s complement (bit by bit complement)
- add 1 (using binary addition)
- ignore carry out of MSB
6Binary Addition
- 0 0 00 1
- 1 0 11 1 10
- The last line means that the sum is 0 and there
is a carry out into the next bit position.
7Addition - Decimal
- Example add 2 decimal numbers together 57
68 - Add 7 8 which is 5 carry 1
- Add 5 6 carry which is 2 carry 1
- The result is .
8Addition - Binary
- Binary addition works the same
- Add 1012 to 1112. Start from LSB. 1 1
which is 0 carry 1, - 1 0 carry 1 which is 0 carry
- 1 1 carry 1 which is
- Result is ( )2
9Form the 2s complement
- of 0011
- of 1101
- of 0100
- of 1100
10Property of 2s complement
- 2s comp(2s comp (A)) A
- 2s comp (0011) 1101
- 2s comp (1101) 0011
- 2s comp (0100) 1100
- 2s comp (1100) 0100
11Represent -12 in 5-bits
- Using sign-magnitude
- 2s complement
12Values of some 5-bit numbers
- What is the value of 01101
- if it is unsigned
- if it is sign magnitude
- if it is 2s complement
13Values of some 5-bit numbers
- What is the value of 11101
- if it is unsigned
- if it is sign magnitude
- if it is 2s complement
14Values of some 5-bit numbers
- What is the value of 10000
- if it is unsigned
- if it is sign magnitude
- if it is 2s complement
15Take twos comp
- What is 2s complement of 10000?
- What does that tell us ?
16Boolean Algebra
- Definition
- A Boolean algebra consists of a set k of 2
elements and 2 operators and . For every a,
b e k, ab e k, a b e k. - Variables are designated by letters.
- Three basic logic operations AND, OR, and NOT.
17Boolean Function
- Consists of a binary variable denoting the
function, an equals sign, and an algebraic
expression formed by using binary variables,
constants 0 and 1, and logic operands. - Example
- F X YZ
- X and YZ are called ______.
- Any Boolean function can be represented by a
truth table
18- Truth table for F X YZ
- There is only one way that a Boolean function can
be represented in a truth table.
___ variables
Number of rows in a truth table is ____.
19- A Boolean function can be transformed into a
circuit diagram X YZ - Gates are interconnected by wires.
- Variables are combined by logical operations.
-
20- F X YZ
- X XYZ XYZ
- XZ XY
- Boolean functions can be expressed in many
_________ algebraic forms. - We can manipulate a Boolean expression using
Boolean algebraic rules to obtain a simpler
expression. - Simpler expression results in _______ gates and
_______ inputs to the gates.
21Boolean Algebra
- Operators
- AND ?
- OR v
- NOT A ?A
- Values
- 1 (true) 0 false
22Boolean Algebra rules
- Rules hold for any boolean value
- a,b, c ... stand for these values
- Identity element
- a 0 a
- a ? a
- and ? are commutative
- a b b a
- a ? b b
23Associative and Distributive
- Associative rules
- a (b c) (a b) c
- a ? (b ? c)
- Distributive rules
- a (b ? c) (a b) ? (a c)
- a ? (b c)
- Note these rules look like algebra !
24Complement (NOT)
- a
- a a 1
- a 0
- Additional rules
- a a a
- a ? a a
25Properties of 0 and 1
26Basic Identities of Boolean Algebra
27Venn Diagram
- You can think of Boolean equations as sets 1 is
everything, and 0 is nothing.
28Absorption Theorem
- a ab a
- a ( a b) a
- Venn Diagram
29An expression is true
- A valid expression is true
- true true
- false false
- x x
- false true
30Absorption Theorem
- a ab a
- Proof
- a ab apply distributive law (14)
- a ab a (1b) apply 3 1 b 1
- a ab a ? 1 apply 2
- a ab
31Dual
- The dual of an algebraic expression is obtained
by interchanging OR and AND operations, and
replacing 1s by 0s and 0s by 1s. - Replace
-
- 1
- 0
32Why do rules come in pairs ?
- Duality Principle
- The duality principle of Boolean algebra states
that a Boolean equation remains valid (true) if
we take the dual of the expression - If an expression is true, its dual is true.
33Proof of second absorption Theorem
- a ( a b) a
- Proof by principle of duality
- a ab a is true we proved it
- Apply duality
34DeMorgans Laws
- (a ? b) a b
- (a b) a ? b
- Replace AND with OR and OR with AND.
- Remove complement from the entire expression and
place over each variable instead. - These laws are duals of one another.
35DeMorgans Laws in Pictures
A
A
B
B
A
A
B
B
A
A
B
B
36- Truth tables can be used to verify expressions.
- Example, verify DeMorgans Theorem
37Algebraic Manipulation
- Ex F XYZ XYZ XZ
- Boolean algebra is a useful tool for simplifying
digital circuits. - Literal single variable within a term that may
or may not be complemented.
38 39- Truth Table
- Truth table for both expressions are equivalent.
- By reducing the number of terms and number of
literals, it is possible to obtain a simpler
circuit.
40Consensus Theorem
- XY XZ YZ XY XZ
- Note Y and Z are associated with X and X, and
appear together in the term that is eliminated. - The dual of the consensus theorem is
redundant
41Proof
42Complement of a Function
- F can be obtained by interchanging 1s to 0s and
0s to 1s for values of F in the truth table. - Can apply DeMorgans theorem as many times as
necessary to find F. - F1 XYZ XYZ
- Obtain F1
- F1 XYZ XYZ
43Lab 2 Seven segment decoder
- Seven Segment display for calculator
- Input to display is 4 bit number
- Unsigned values that can be represented with 4
bits_______________________ - Want to display each of these on the display
44Hex to seven segment display
45Hex to seven segment display
46Hex to Seven-Segment Display Truth Table
47Minimized Boolean Expressions