Вы находитесь на странице: 1из 32

Digital Circuits

BLG231E

Instructor: Dr. Fuat Kucuk

1 BLG231E DIGITAL CIRCUITS by Fuat Kucuk
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 2
n
combinations and
each combination representing one element of the set that is being
coded.

Binary Codes
BLG231E DIGITAL CIRCUITS by Fuat Kucuk 3
For example, four elements of a set can be coded with
2-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 code
2
n
elements 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.

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
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 2
4
-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 0110
2 0010 7 0111
3 0011 8 1000
4 0100 9 1001
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
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 1
11 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
Gray Code and BCD code comparison
BLG231E DIGITAL CIRCUITS by Fuat Kucuk 8
Decimal BCD

Gray

0 000 000

1 001 001
2 010 011
3 011 010
4 100 110
5 101 111
6 110 101
7 111 100
The first and
last terms also
obeys the Gray
code rule.
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. Each
varible 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 of
any 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 xy
0 0 0
0 1 0
1 0 0
1 1 1
AND operation.
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," meaning
that 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.
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 x
0 1
1 0
NOT operation.
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 a
particular digital systems.
Range of Logic 1
Range of Logic 0
volts
5V
3V
1V
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
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
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.


Huntington Postulates for Boolean Algebra (1)
BLG231E DIGITAL CIRCUITS by Fuat Kucuk 16
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.

BLG231E DIGITAL CIRCUITS by Fuat Kucuk 18
Theorems and Properties of Boolean Algebra
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). This
property is called duality.

For example,
x y+1 x+y 0


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



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 duality.
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
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 duality.
Theorem x + 1 = 1 x 0 = 0

x + 1= 1 . (x + 1)
= (x + x')(x + 1)
= x + x' 1
= x + x'
=1
by duality.
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+y
0 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
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 the
logic 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.
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: 2
n
.
For a given function F
1
= x + y'z and F
2
= x'y' z + x'yz + xy'
x y z F
1
F
2
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
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 F
1
,
A literal is single variable within a term that may be
complemented or not.
F1 function has 3 literals.
Function implemenetation by logic gates (2)
BLG231E DIGITAL CIRCUITS by Fuat Kucuk 27
For the case of secon function F
2
, one of possible logic
implementations is

Function implemenetation by logic gates (3)
BLG231E DIGITAL CIRCUITS by Fuat Kucuk 28
If we consider possible simplification in F
2

F
2
= 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.
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 function
BLG231E DIGITAL CIRCUITS by Fuat Kucuk 30
DeMorgan's theorem can be extended to three or more
variables.
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

BLG231E DIGITAL CIRCUITS by Fuat Kucuk 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]

Вам также может понравиться