lect2_blg231e_2013_02_28
DESCRIPTION
digital signalTRANSCRIPT
-
5/25/2018 Lect2_BLG231E_2013_02_28
1/32
Digital Circuits
BLG231E
Instructor: Dr. Fuat Kucuk
1BLG231E DIGITAL CIRCUITS by Fuat Kucuk
-
5/25/2018 Lect2_BLG231E_2013_02_28
2/32
Binary Codes
BLG231E DIGITAL CIRCUITS by Fuat Kucuk 2
A binary code is a match representing each set of element with
binary values.
Since digital systems can only manipulate binary signals, physical
quantities (voltage, temperature, etc) and any other kinds of data
(sound, letter, decimal numbers) must be converted to binary form or
code.
Binary codes only change the symbols of sets of elements that is
used to represent information, not the meaning of information itself.
Each elements must be assigned to a unique binary bit
combination. If two or more elements can have the same value, the
code assignment will be ambiguous.
An n-bit binary code is a group of n-bits with 2ncombinations and
each combination representing one element of the set that is being
coded.
-
5/25/2018 Lect2_BLG231E_2013_02_28
3/32
Binary Codes
BLG231E DIGITAL CIRCUITS by Fuat Kucuk 3
For example, four elements of a set can be coded with2-bits as: 00, 01,10,11.
A set of 8 elements requires at least 3-bit code.
Although the minimum number of bits required to code2nelements is n, there is no upper limit for bits for binary
coding.
That is, 8 elements can also be coded with 4-bits or
more. The more bits you use, the more sensitivity you get.
-
5/25/2018 Lect2_BLG231E_2013_02_28
4/32
Binary Codes
BLG231E DIGITAL CIRCUITS by Fuat Kucuk 4
As example, seven colors of rainbow can be coded with 3
bits as follows:
Colour Binary Code
Red 000
Orange 001
Yellow 010
Green 011
Blue 101
Indigo 110
Violet 111
-
5/25/2018 Lect2_BLG231E_2013_02_28
5/32
BCD Code
BLG231E DIGITAL CIRCUITS by Fuat Kucuk 5
Most people are more accustomed to the decimal system,
To make arithmetic operations in a digital systems, the decimal
numbers is first converted to binary. After performing all arithmetic
calculations in binary, the results is converted back to decimal.
For 10-decimal digits must be coded at least 4 bits although 24-10=6
combinations are not used.
This type of coding is called binary coded decimal (BCD).
symbol code symbol code
0 0000 5 0101
1 0001 6 01102 0010 7 0111
3 0011 8 1000
4 0100 9 1001
-
5/25/2018 Lect2_BLG231E_2013_02_28
6/32
BCD Code
BLG231E DIGITAL CIRCUITS by Fuat Kucuk 6
Consider decimal 185 and its corresponding value in BCD and
binary:(185)10= (0001 1000 0101)BCD= (10111001)2
The BCD value has 12 bits, but the equivalent binary number
needs only 8 bits. It is obvious that a BCD number needs more
bits than its equivalent binary value.
Although BCD requires more bits, it presents advantages at
places that people interfere.
0001 1000 0101
-
5/25/2018 Lect2_BLG231E_2013_02_28
7/32
Gray Code
BLG231E DIGITAL CIRCUITS by Fuat Kucuk 7
In Gray code, only one bit in the code group changes when
going from one number to the next.
One-bit
code
Two-bit
code
Three-bit
code
0 00 0 0 0
1 01 0 0 111 0 1 1
10 0 1 0
1 1 0
1 1 1
1 0 1
1 0 0
Two-bit code
Two-bit code in
reverse order
-
5/25/2018 Lect2_BLG231E_2013_02_28
8/32
Gray Code and BCD code comparison
BLG231E DIGITAL CIRCUITS by Fuat Kucuk 8
Decimal BCD Gray0 000 000
1 001 001
2 010 011
3 011 010
4 100 110
5 101 111
6 110 1017 111 100
The first andlast terms also
obeys the Gray
code rule.
-
5/25/2018 Lect2_BLG231E_2013_02_28
9/32
Binary Logic
BLG231E DIGITAL CIRCUITS by Fuat Kucuk 9
Binary logic deals with binary variables operations that has
logical meaning.
The variables are shown by letters such as A,B,C,x,y,z, etc. Eachvarible can take only two possible values: 0 and 1.
There are three basic logical operations: AND, OR, and NOT.
AND: This operation is denoted by a dot or by the absence ofany operator. For example, x y = z or xy = z is read "x AND y is
equal to z. The logical operation AND outputs z=1 if and only if
both input variables are x,y=1; otherwise z = 0.
x y xy0 0 0
0 1 0
1 0 0
1 1 1
AND operation.
-
5/25/2018 Lect2_BLG231E_2013_02_28
10/32
Binary Logic
BLG231E DIGITAL CIRCUITS by Fuat Kucuk 10
OR: This operation is denoted by a plus sign. For example, x + y =
z is read "x OR y is equal to z. The logical operation OR outputs
z=0 if and only if both input variables are x,y=0; otherwise z = 1.
NOT: This operation is represented by a prime (sometimes by an
overbar). For example, x' = z is read "not x is equal to z," meaningthat z is what x is not. The logical operation NOT outputs z=0 if
input variable is x=1 and z=1 if input variables are x=0. This is also
referred to as complement operation.
x y x+y
0 0 0
0 1 1
1 0 1
1 1 1
OR operation.
-
5/25/2018 Lect2_BLG231E_2013_02_28
11/32
Binary Logic
BLG231E DIGITAL CIRCUITS by Fuat Kucuk 11
Although similarities availeble, binary logic should not be con-
fused with binary arithmetic.
In binary arithmetic, one variable may includes many digits.
However, a logic variable is always either 1 or 0. for example,
In binary arithmetic, 1 + 1 = 10 ("one plus one is equal to two").
In binary logic 1 + 1 =1 ("one OR one is equal to one").
x x0 1
1 0
NOT operation.
-
5/25/2018 Lect2_BLG231E_2013_02_28
12/32
Logic Gates
BLG231E DIGITAL CIRCUITS by Fuat Kucuk 12
A logic gate is an electronic circuit that operates with one or
more input signals and produces specific output signal.
Combinations of logic gates form digital circuits. These are
voltage-operated circuits and respond to two separate voltage
levels that represent a binary variable 0 or 1.
As an example, logic 0 and 1 may be defined as 0Vand 5V for aparticular digital systems.
Range of Logic 1
Range of Logic 0
volts
5V
3V
1V
-
5/25/2018 Lect2_BLG231E_2013_02_28
13/32
Symbols of the logic gates
BLG231E DIGITAL CIRCUITS by Fuat Kucuk 13
Two-input AND gate
Two-input OR gate
NOT gate or inverter
Four-input OR gate
Three-input AND gate
-
5/25/2018 Lect2_BLG231E_2013_02_28
14/32
Representation of input-output signals of gates
BLG231E DIGITAL CIRCUITS by Fuat Kucuk 14
x 1 1 0 1 0 1
y 0 1 1 1 0 0
AND: xy 0 1 0 1 0 0
OR: x+y 1 1 1 1 0 1
NOT: x 0 0 1 0 1 0
-
5/25/2018 Lect2_BLG231E_2013_02_28
15/32
Boolean Algebra
BLG231E DIGITAL CIRCUITS by Fuat Kucuk 15
Boolean algebra is the algebra of truth values 0 and 1.
It was developed in 1854 by an English mathematician
and philosopher, Goerge Boole.
Boolean algebra has constructed on the set B={0,1}
Boolean algebra is an algebraic structure defined by a set
of elements, B, together with two binary operators AND ()
and OR (+)
Although there are some similarities, boolean algebra
should not be confused with ordinary arithmetic.
-
5/25/2018 Lect2_BLG231E_2013_02_28
16/32
Huntington Postulates for Boolean Algebra (1)
BLG231E DIGITAL CIRCUITS by Fuat Kucuk 16
-
5/25/2018 Lect2_BLG231E_2013_02_28
17/32
Huntington Postulates for Boolean Algebra (2)
BLG231E DIGITAL CIRCUITS by Fuat Kucuk 17
The axioms are independent; none can be proved
from the others.Associativity is not included, since it can be derived
(for both operators) from the given axioms.
In ordinary algebra, +is not distributive over .No subtraction or division operations in Boolean
algebra.
Complement is not available in ordinary algebra.Set B is defined as {0,1}, which means two-valued
Boolean Algebra.
-
5/25/2018 Lect2_BLG231E_2013_02_28
18/32BLG231E DIGITAL CIRCUITS by Fuat Kucuk 18
Theorems and Properties of Boolean Algebra
-
5/25/2018 Lect2_BLG231E_2013_02_28
19/32
Duality of Boolean Algebra
BLG231E DIGITAL CIRCUITS by Fuat Kucuk 19
A dual of logic expression can be obtained by replacing
() with (+), (+) with () , (0) with (1) and (1) with (0). Thisproperty is called duality.
For example,
x y+1x+y 0
-
5/25/2018 Lect2_BLG231E_2013_02_28
20/32
Precedence order of operators
BLG231E DIGITAL CIRCUITS by Fuat Kucuk 20
From higher to lower precedence
1)Parenthesis
2) Complement (NOT)
3) AND
4) OR
h d f l l b
-
5/25/2018 Lect2_BLG231E_2013_02_28
21/32
Theorems and Properties of Boolean Algebra
BLG231E DIGITAL CIRCUITS by Fuat Kucuk 21
Theorem x + 1 = 1 x 0 = 0
x + 1= 1 . (x + 1)
= (x + x')(x + 1)
= x + x' 1
= x + x'
=1
by duali ty.
Theorem x + x = x x x = x
x + x = (x + x) 1
= (x + x)(x + x')
= x + xx'
=x
xx=xx+0=xx+xx'
= x(x + x')
= x 1
=x
h d i f l l b
-
5/25/2018 Lect2_BLG231E_2013_02_28
22/32
Theorems and Properties of Boolean Algebra
BLG231E DIGITAL CIRCUITS by Fuat Kucuk 22
Theorem x + xy = x x(x + y) = x
x+xy=x1+xy
= x(1 + y)
= x(y + 1)
=x 1
=x
by duali ty.
Theorem x + 1 = 1 x 0 = 0
x + 1= 1 . (x + 1)
= (x + x')(x + 1)
= x + x' 1
= x + x'
=1
by duali ty.
Th d P i f B l Al b
-
5/25/2018 Lect2_BLG231E_2013_02_28
23/32
Theorems and Properties of Boolean Algebra
BLG231E DIGITAL CIRCUITS by Fuat Kucuk 23
Theorem (x+y)'=x'y' (xy)'=x'+y'
De Morgan
They can also proved by the truth table.
x y x y' (x+y) xy' (xy) x+y0 0 1 1 1 1 1 1
0 1 1 0 0 0 1 1
1 0 0 1 0 0 1 1
1 1 0 0 0 0 0 0
B l F i
-
5/25/2018 Lect2_BLG231E_2013_02_28
24/32
Boolean Functions
BLG231E DIGITAL CIRCUITS by Fuat Kucuk 24
A Boolean function described by an algebraic
expression consists of binary variables (0 and 1) and thelogic operation symbols.
For a given value of the binary variables, the function
can be equal to either 1 or 0.
A boolean function expresses the logical relationship
between the variables.
It can be evaluated by determining all possible values
of variables.
A boolean function can be represented in a truth table.
B l F ti
-
5/25/2018 Lect2_BLG231E_2013_02_28
25/32
Boolean Functions
BLG231E DIGITAL CIRCUITS by Fuat Kucuk 25
The number of rows in a truth table is found by calculconsidering
all possible values of variables: 2n.
For a given function F1= x + y'z and F2= x'y' z + x'yz + xy'
x y z F1 F2
0 0 0 0 0
0 0 1 1 1
0 1 0 0 0
0 1 1 0 1
1 0 0 1 1
1 0 1 1 1
1 1 0 1 0
1 1 1 1 0
F ti i l t ti b l i t (1)
-
5/25/2018 Lect2_BLG231E_2013_02_28
26/32
Function implementation by logic gates (1)
BLG231E DIGITAL CIRCUITS by Fuat Kucuk 26
A Boolean function can be transformed from an algebraic
expression into a circuit diagram composed of logic gates.
The logic-circuit diagram for F1,
A literal is single variable within a term that may becomplemented or not.
F1 function has 3 literals.
F ti i l t ti b l i t (2)
-
5/25/2018 Lect2_BLG231E_2013_02_28
27/32
Function implemenetation by logic gates (2)
BLG231E DIGITAL CIRCUITS by Fuat Kucuk 27
For the case of secon function F2, one of possible logic
implementations is
F ti i l t ti b l i t (3)
-
5/25/2018 Lect2_BLG231E_2013_02_28
28/32
Function implemenetation by logic gates (3)
BLG231E DIGITAL CIRCUITS by Fuat Kucuk 28
If we consider possible simplification in F2
F2= x'y'z + x'yz + xy' = x'z(y' + y )+ xy= x'z+ xy'
Therefore, F2 function has reduced from 3 terms, 8
literals to 2 terms 4 literals.
Si lifi ti f b l i
-
5/25/2018 Lect2_BLG231E_2013_02_28
29/32
Simplification of boolean expression
BLG231E DIGITAL CIRCUITS by Fuat Kucuk 29
There is often a possibility to reduce number of terms
and the literals in a logical function .
The aim of simplification of a boolean expression is to
obtain a simpler logic circuit.
This process offers to use less logic gates two implement.
Complement of a f nction
-
5/25/2018 Lect2_BLG231E_2013_02_28
30/32
Complement of a function
BLG231E DIGITAL CIRCUITS by Fuat Kucuk 30
DeMorgan's theorem can be extended to three or more
variables.
Examples on simplifications
-
5/25/2018 Lect2_BLG231E_2013_02_28
31/32
Examples on simplifications
BLG231E DIGITAL CIRCUITS by Fuat Kucuk 31
Example 1:
AC + ABC + AC= AC + AC + ABC
= C(A+ A) + ABC
= C1 + ABC
= C + ABC
= (C+ AB)(C+C)
= AB + C
-
5/25/2018 Lect2_BLG231E_2013_02_28
32/32
Example 2:
(xy+z) + z + xy + wz = (xy+z) + z + wz + xy
= (xy+z) + z(1+ w) + xy
= (xy+z) + z + xy
= (x + y)z + z + xy => De Morgan
= (z + (x + y)) (z + z) + xy =>distributive
= (z + (x + y)) 1 + xy
= x + y + z + xy
= x + y + z [absorption]