You are on page 1of 146

LECTURE NOTES # 1

INTRODUCTION TO DIGITAL DESIGN


i.e., 2’s complement number system, floating-point number system, etc.
 Pure if-then-else type constructs can be implemented using
combinational circuits

 Loops generally need to be impl. using sequential circuits,


since the circuit/system needs to “remember” where it is in the loop
GATES
 These small switching networks are called gates
 Useful to implement large logic functions
REVIEW MYS, C1, C2 -225 = 1 0 0 0 1 1 1 1 1 (C2)
+ 76 = 0 0 1 0 0 1 1 0 0 (MyS)
Sumar A= - 225 con B = + 76
1 0 1 1 0 1 0 1 1 (- 107)

- 225 = 1 1 1 1 0 0 0 0 1 (MyS)
MSB indica valor negativo (S)
1 0 0 0 1 1 1 1 0 (C1)
La magnitud es correcta??
1
1 0 0 0 1 1 1 1 1 (C2)

Resultado esperado - 149


1 0 1 1 0 1 0 1 1 (- 107)

1 1 0 0 1 0 1 0 0 C1
1
1 1 0 0 1 0 1 0 1 C2

Resultado esperado - 149


LOGIC GATES
REVIEW OF BOOLEAN ALGEBRA
 Just like Boolean logic
 Variables can only be 1 or 0
 Instead of true / false
REVIEW OF BOOLEAN ALGEBRA
 Not is a horizontal bar above the number
0 =1
1 = 0
 Or is a plus
 0+0 =0
 0+1 = 1
 1+0 = 1
 1+1 = 1
 And is multiplication
 0*0 =0
 0*1 = 0
 1*0 = 0
 1*1 = 1
REVIEW OF BOOLEAN ALGEBRA
 Example: translate (x+y+z)(xyz) to a Boolean
logic expression
 (xyz)(xyz)
 We can define a Boolean function:
 F(x,y) = (xy)(xy)
 And then write a “truth table” for it:
X Y F(X,Y)
1 1 0
1 0 0
0 1 0
0 0 0
BASIC LOGIC GATES
x
 Not x
 And x xy x xyz
y y
 Or z
x x+y x x+y+z
y
 Nand y z
x xy
 Nor y
 Xor x x+y
y
x xÅy
y
ROSEN, §10.3 QUESTION 1
 Find the output of the following circuit

x x+y
y
(x+y)y
y y

 Answer: (x+y)y
 Or (xy)y
ROSEN, §10.3 QUESTION 2
 Find the output of the following circuit

x
x xy xy
y
y
 Answer: xy
 Or (xy) ≡ xy
ROSEN, §10.3 QUESTION 6
 Write the circuits for the following Boolean algebraic
expressions
a) x+y

x
x x+y

y
ROSEN, §10.3 QUESTION 6
 Write the circuits for the following Boolean algebraic
expressions
b) (x+y)x

x x+y
x+y (x+y)x
y
WRITING XOR USING AND/OR/NOT
 p  q  (p  q)  ¬(p  q) x y x y
 x  y  (x + y)(xy) 1 1 0
1 0 1
0 1 1
0 0 0

x x+y (x+y)(xy)
y
xy xy
28
HOW TO ADD BINARY NUMBERS
 Consider adding two 1-bit binary numbers x and y
 0+0 = 0
 0+1 = 1
x y Carry Sum
 1+0 = 1
 1+1 = 10 0 0 0 0
0 1 0 1
1 0 0 1
1 1 1 0
 Carry is x AND y
 Sum is x XOR y

 The circuit to compute this is called a half-adder


THE HALF-ADDER
 Sum = x XOR y
 Carry = x AND y

x Sum
y
Carry
USING HALF ADDERS
 We can then use a half-adder to compute the sum of two
Boolean numbers

1 0 0
1 1 0 0
+1 1 1 0
? 0 1 0
HOW TO FIX THIS
 We need to create an adder that can take a carry
bit as an additional input
 Inputs:x, y, carry in
 Outputs: sum, carry out

 This is called a full adder


 Will add x and y with a half-adder
 Will add the sum of that to the
carry in
THE FULL ADDER
 Full adder (3 bits) vs Half adder (2 bits)
THE FULL ADDER
 The “HA” boxes are half-adders

c X HA S
s
Y C

x X HA S

c
y
Y C
THE FULL ADDER
ADDING BIGGER BINARY NUMBERS
 Just chain full adders together

x0 X HA S
s0
y0 Y C

x1
C

X
FA S
s1
y1 Y C

x2
C

X
FA S
s2
y2 Y C

x3
C

X
FA S
s3
y3 Y C
c
ADDING BIGGER BINARY NUMBERS
 A half adder has 2 logic gates
 A full adder has two half adders plus a OR gate
 Total of 5 logic gates
 To add n bit binary numbers, you need 1 HA and
n-1 FAs
 To add 32 bit binary numbers, you need 1 HA and
31 FAs
 Total of 2+5*31 = 157 logic gates
 Toadd 64 bit binary numbers, you need 1 HA and
63 FAs
 Total of 2+5*63 = 317 logic gates
MORE ABOUT LOGIC GATES
 To implement a logic gate in hardware, you use a
transistor
 Transistors are all enclosed in an “IC”, or integrated
circuit
 The current Cores I3 processors have 160 million
transistors!
00
100
011
Números con longitud de tres bits:
111 • 1 HA
• 2 FA (n-1)
ASSIGNMENT
 Design a circuit for resolve:
 Binary  C1  C2
ÁLGEBRA DE BOOLE
ALGEBRA DE BOOLE
Leyes fundamentales del álgebra
Por ejemplo, la propiedad Conmutativa de la Suma
A+ B =B +A
(A y B son números enteros o reales)

En 1860 George Boole desarrolló un Algebra en la


que los valores de A y B sólo podían ser
“verdadero” o “falso” (1 ó 0). Se llama Algebra
de Boole y se utiliza en Electrónica Digital
OPERACIONES DEL ALGEBRA DE BOOLE

Suma Booleana es la función lógica OR


X=A + B

Multiplicación Booleana es la función lógica AND


X = AB
COMMUTATIVA DE LA SUMA

A+B = B+A
El orden en la OR no importa
CONMUTATIVA DEL PRODUCTO

AB = BA
El orden en la AND no importa
ASOCIATIVA DE LA SUMA

A + (B + C) = (A + B) + C
Agrupar variables en la OR no importa
ASOCIATIVA DEL PRODUCTO

A (B C) = (A B) C
Agrupar variables en la AND no importa
DISTRIBUTIVA
A(B + C) = AB + AC

A
B X=Y
C

X
Y
DISTRIBUTIVA
(A+B)(C+D) = AC + AD + BC + BD

A
B
C
X=Y
D

X
Y
A+0=A
Hacer una operación OR con 0 no cambia nada.

X X=A
A+1=1
Hacer una operación OR con 1 da siempre 1.

X=1
X
A•0=0
Hacer una operación AND con 0 siempre da 0

A X=0

X
A•1 =A
Hacer una operación AND con 1 no cambia nada

X=A
X
A+A = A
Hacer una operación OR consigo mismo da el mismo
resultado

A
A A=A

X
A+A=1
O bien A o A serán 1, luego la salida será 1

A
A

X=1
X
A•A = A
Hacer una operación AND consigo mismo da el mismo
resultado

A
A A=A

X
A•A =0
Bien A o A son 0 luego la salida será 0.

A
A
X=0
X
A=A
Si negamos algo dos veces volvemos al principio

X=A
X
A + AB = A

A
B
X
A + AB = A + B (ABSORCIÓN)
Si A es 1 la salida es 1 Si A es 0 la salida es B

A
B

X
Y X=Y
(A + B)(A + C) = A + BC

A
B
C

X
Y
Tres leyes y doce propiedades en Algebra de Boole
LEYES DE DE MORGAN

De Morgan ayuda a simplificar circuitos digitales usando


NORs y NANDs.

A• B=A+ B

A+B=A•B

Igual para más de 2 variables.


Ambos circuitos tienen la misma salida: De Morgan funciona
A +B +C + D = A • B • C • D
CÁLCULO DE LA EXPRESIÓN ALGEBRAICA
DE SALIDA
(EJEMPLO 1)
(A + B) (CD) = (A + B) + (CD) = A + B + CD

X e Y son
iguales
CÁLCULO DE LA EXPRESIÓN
ALGEBRAICA DE SALIDA
(EJEMPLO 2)
X = (A+B) C + CD + B
= (A+B) C · CD + B
= (A+B) C · (CD + B)
= A B C · (C +D +B)
= A B C C + A B C D +A B C B
=ABCD
Los
circuitos
son
iguales
ANÁLISIS BOOLEANO DE
FUNCIONES LÓGICAS
El propósito de este apartado es obtener expresiones
booleanas simplificadas a partir de un circuito
Se examina puerta a puerta a partir de sus entradas
Se simplifica usando las leyes y propiedades booleanas.
Ejemplo
1

Puerta a puerta a partir de sus entradas

X= AB+(C+D)
X= AB + C+ D
Ejemplo
2

X = (AB)(CD)
X = ABCD
Ejemplo 3
X = ABCD +A
Simplificando:
X = A + BCD
Ejemplo 4
X = (AB+B)BC
Usando la propiedad
distributiva:
X = ABBC +BBC
X = ABC + BBC
En la siguiente X = ABC + 0•C
transparencia se ve
X = ABC + 0
cómo las dos cosas
X = ABC
son lo mismo
Ejemplo 5
X = (A +AB) +(B(C+D))

X = (A + B) + (B(C + D))

X = (A + B) + (BC + BD)

X = A + B + BC + BD

X = A + B + C + BD (sigue en la próxima
X = A + B + BD + C
Los circuitos
son iguales
X=A+B+D+C
EXPRESIONES BOOLEANAS DESDE TABLAS
DE VERDAD

Producto de sumas

Y=(A+B+C)·(D+C)·(E+F)

Suma de productos

Y= A·B·C+B·C·D+A·C·D o directamente
Y= ABC+BCD+ACD
SUMAS DE PRODUCTOS

La función es 1
cuando ABCD=1111
o cuando
Cuando ABCD=1111, el producto ABCD y ABCD=1110
sólo ése es 1.
o cuando
Cuando ABCD=1110, el producto ABCD’ y
sólo ése es 1,… ABCD=1011
…y así sucesivamente… resultando que o cuando
ABCD=0011
ABCD + ABCD’ + AB’CD + A’B’CD
y en ningún otro caso
Productos de sumas
La función es 0
cuando ABCD=0010
o cuando ABCD=0100
o cuando ABCD=0111
Cuando ABCD=0010, la suma A+B+C’+D o cuando ABCD=1010
y sólo ésa es 0.
Cuando ABCD=0100, la suma A+B’+C+D o cuando ABCD=1101
y sólo ésa es 0, …
y en ningún otro caso
…y así sucesivamente… resultando que

(A+B+C’+D)(A+B’+C+D)(A+B’+C’+D’)(A’+B+C’+D)(A’+B’+C+D’)
MINIMIZACIÓN DE FUNCIONES LÓGICAS
Mapas de Karnaugh: se usan para minimizar el número de
puertas requeridas en un circuito digital
Es adecuado en vez de usar leyes y propiedades cuando el
circuito es grande
Se consigue, aplicando adecuadamente el método, el
circuito más simplificado posible
Mapa de Karnaugh
El mapa se hace con una tabla con tantas celdas
como Sumas de Productos posibles, teniendo en
cuenta el número de variables que se utilice.

2 variables, entonces mapa 2x2


3 variables, entonces mapa 4x2
4 variables, entonces mapa 4x4
5 variables, entonces mapa 8x4
Mapa de Karnaugh
Lo interesante del mapa es moverse de una celda a
otra contigua con el cambio de una sola variable.
Los movimientos son arriba-abajo o derecha-
izquierda (nunca en diagonal).
El mapa también se dobla sobre sí mismo con la
misma regla: sólo cambia una variable de la última
columna a la derecha a la primera a la izquierda, o de
la fila de abajo a la de arriba.
Emplearemos un código Gray, que se caracteriza
porque entre dos códigos consecutivos (incluidos los
extremos) sólo hay un bit de diferencia.
B B El mapa va de
0 1
Falso a Verdadero,
A 0
de izquierda a
A 1 derecha y de arriba
abajo
La celda de arriba B B
a la izquierda es A 0 1
B. Si F= A B, A0 1
entonces hay que A1
poner 1 en esa
celda
Esto muestra que F = 1
cuando A=0 y B=0
B0 1B
Si F=AB + AB
A0 1
entonces hay que
poner 1 en las dos A1 1
celdas
Sabemos por el Algebra de Boole que A B + A B
= B
B0 1B
En el mapa de A0 1
Karnaugh podemos
agrupar celdas A1 1
adyacentes y ver
que F = B
MAPAS DE 3 VARIABLES

Código Gray
C C
0 1

AB 00

AB 01

AB 11

AB 10
X =AB C +AB C +AB C +AB C

Código Gray
C C Cada término de 3
0 1
variables es una
AB 00 1 1 celda en un mapa
01 de Karnaugh 4 X 2
AB
AB 11

10 1 1
AB
X =AB C +AB C +AB C +AB C

Código Gray
C C Una
0 1
simplificación
AB 00 1 1 podría ser:
AB 01 X=AB+AB
AB 11

10 1 1
AB
X =AB C +AB C +AB C +AB C

Código Gray
C C Otra
0 1
simplificación
AB 00 1 1 podría ser:
AB 01 X=BC+BC
AB 11 El mapa de
10 Karnaugh se
AB 1 1
dobla
circularmente
X =AB C +AB C +AB C +AB C

Código Gray
C C La mejor
0 1
simplificación
AB 00 1 1 sería
AB 01

AB 11 X =B
10 1 1
AB
VARIABLES
(OTRA FORMA DE
DIBUJARLA)
Código Gray
BC BC BC BC
00 01 11 10

A 0

A 1

Código Gray
BC BC BC BC
00 01 11 10

A 0 mint 0 mint 1 mint 3 mint 2

A 1 mint 4 mint 5 mint 7 mint 6


EN UN MAPA DE 3 VARIABLES

•Una celda a 1 implica a 3 variables

•Dos celdas adyacentes a 1 implican a 2 variables

•Cuatro celdas adyacentes a 1 implican a 1 variable

•Ocho celdas adyacentes a 1 constituyen función de


valor 1
MAPA DE KARNAUGH DE 4 VARIABLES

Código Gray
C00D CD
01
C D 10C
11
D
A B00
A B01
A B11
A B10
SIMPLIFICAR
X =AB CD +AB C D +ABC D +ABC D +
ABCD+ABCD

Código Gray 00 01 11 10
CD CD CD C
00 01 11 10
D
A B00 1 Intentar con
reducciones
A B01 1 1
booleanas
A B11 1 1
A B10 1

X = ABD + ABC + CD
EN UN MAPA DE 4 VARIABLES

•Una celda a 1 implica a 4 variables

•Dos celdas adyacentes a 1 implican a 3 variables

•Cuatro celdas adyacentes a 1 implican a 2 variables

•Ocho celdas adyacentes a 1 implican a 1 variable

•Dieciséis celdas adyacentes a 1 constituyen función de


valor 1
SIMPLIFICAR
Z=BCD+BCD+ CD+BCD+AB
C

CD CD CD C
D00 01 11 10

A B00 1 1 1 1
A B01 1 1 1

A B11 1 1 1
A B10 1 1
X=C +AB +BD
ENCONTRAR OTRO MÁS
SENCILLO USANDO MAPAS
DE KARNAUGH

Primero lo pasamos a Suma de Productos


Y= A + B + B C + ( A + B ) ( C + D)

Y = A B + BC + A B(C+D)

Y=AB+BC+A BC + A B D

Y=AB+BC+A BC ABD
Y = A B + B C + (A + B + C ) ( A + B + D)
Y = A B + B C + A + AB + A D + B + BD + AC + BC + CD
Y = A B + A + B + CD = A + B + B + C D = 1
C00D C01D C
11
D 10
C
D
A B 00 1 1 1 1
A B 01 1 1 1 1
A B 11 1 1 1 1
A B 10 1 1 1 1

Z=1
SIMPLIFICACIÓN POR KARNAUGH
 1) Realizar agrupaciones de 1's, con sus adyacentes, lo mayor
posibles, pero siempre en cantidades potencias de 2.
 2) No dejar ningún 1 sin agrupar. Puede ocurrir que un 1 pertenezca a
más de una agrupación. No se pueden coger agrupaciones dentro de
agrupaciones.
 3) Por cada agrupación de 1's resulta un producto de variables. Cuanto
más 1's se agrupen, más sencilla resultará la expresión de esa agrupación. En
MK de 5 variables, las agrupaciones que tomen 1’s de las dos porciones deben
ser simétricas respecto al eje central.
 4) En cada agrupación, cada una de las variables puede aparecer en
alguno de los siguientes casos:
 a) Si siempre vale 1 -----> Se pone afirmada.
 b) Si siempre vale 0 -----> Se pone negada.
 c) Si cambia de valor (50% de los casos un valor y el otro 50% otro
valor) -----> No se pone.
 5) La expresión de la función booleana será la suma lógica de todos
los productos que hayan salido.
DISEÑAR UN SISTEMA DE ALARMA
Sensores disponibles
1. V = Ventana (V=0 CERRADA, V=1 ABIERTA)
2. P = Puerta (P=0 CERRADA, P=1 ABIERTA)
3. C = Calefacción (C=0 APAGADA,
C=1 ENCENDIDA)
4. A = Aire acondicionado (A=0 APAGADO,
A=1 ENCENDIDO)
5. I = Alarma de proximidad de intruso (I=0 NO HAY
INTRUSO,
I=1 SÍ HAY INTRUSO)
El sistema de alarma debe activarse cuando:
1. La puerta está abierta y la calefacción encendida (P=1,
C=1)
2. La puerta está abierta y el aire acondicionado encendido
(P=1, A=1)
3. La puerta está abierta con una alarma de proximidad de
intruso (P=1, I=1)
4. La ventana está abierta y la calefacción encendida.
(V=1, C=1)
5. La ventana está abierta y el aire acondicionado
encendido (V=1, A=1)
6. La ventana está abierta con una alarma de proximidad
de intruso (V=1, I=1)
RELLENANDO EL MAPA…(P=1, C=1)

CA I CAI CAI CAI CAI CAI CAI C


000
AI 001 011 010 110 111 101 100
V P 00

V P 01 1 1 1 1

11 1 1 1 1
V P
10
V P
RELLENANDO EL MAPA…(P=1, A=1)

CA I CAI CAI CAI CAI CAI CAI C


AI
000 001 011 010 110 111 101 100
V P 00

V P 01 1 1 1 1 1 1

11 1 1 1 1 1 1
V P
10
V P
RELLENANDO EL MAPA…(P=1, I=1)

CA I CAI CAI CAI CAI CAI CAI C


AI
000 001 011 010 110 111 101 100
V P 00

V P 01 1 1 1 1 1 1 1

11 1 1 1 1 1 1 1
V P
10
V P
RELLENANDO EL MAPA…
(V=1, C=1)

CA I CAI CAI CAI CAI CAI CAI C


AI
000 001 011 010 110 111 101 100
V P 00

V P 01 1 1 1 1 1 1 1

11 1 1 1 1 1 1 1
V P
10 1 1 1 1
V P
RELLENANDO EL MAPA…
(V=1, A=1)

CA I CAI CAI CAI CAI CAI CAI C


AI
000 001 011 010 110 111 101 100
V P 00

V P 01 1 1 1 1 1 1 1

11 1 1 1 1 1 1 1
V P
10 1 1 1 1 1 1
V P
RELLENANDO EL MAPA…(V=1, I=1)

CA I CAI CAI CAI CAI CAI CAI C


AI
000 001 011 010 110 111 101 100
V P 00

V P 01 1 1 1 1 1 1 1

11 1 1 1 1 1 1 1
V P
10 1 1 1 1 1 1 1
V P
PODEMOS AGRUPAR ASÍ…

CA I CAI CAI CAI CAI CAI CAI C


A000
I 001 011 010 110 111 101 100
V P 00

01 1 1 1 1 1 1 1
V P
V P 11 1 1 1 1 1 1 1
V P
10 1 1 1 1 1 1 1

X=PA+VA +PC+VC+PI+VI
¿Cuántos chips necesito para esto?
O USANDO LOS CEROS…

CA I CAI CAI CAI CAI CAI CAI C


A000
I 001 011 010 110 111 101 100
V P 00 0 0 0 0 0 0 0 0
V P 01 0 1 1 1 1 1 1 1
V P 11 0 1 1 1 1 1 1 1
V P
10 0 1 1 1 1 1 1 1

X=CA I +V P X=CA I +V P

Sólo dos chips


PATILLAJE DE LOS CIRCUITOS
7404 Y 7454
7404 7454
CONEXIONADO FÍSICO
CIRCUITO DISEÑADO
YA SABES…
 Leyes y propiedades del Algebra de Boole
 Simplificar funciones utilizando el Algebra de Boole
 Analizar circuitos mediante Algebra de Boole y
simplificarlos
 Pasar de una tabla de verdad a Suma de Productos y
Producto de Sumas
 Utilizar Mapas de Karnaugh para simplificar funciones
lógicas
FINAL DEL TEMA 5
EECS 465: DIGITAL SYSTEMS

Lecture Notes # 2
Karnaugh Maps - Two-Level Minimization
2
Karnaugh-Map Based 2-Level Minimization
• Defn: An implicant g of a function is a product term (e.g., g=xyz) s.t. when g=1 
f=1
• Defn: A minterm is an implicant containing all n variables of an n-var. function (in
compl. or uncompl. form)
• Defn: Let g, and h be 2 implicants of a function f. g is said to cover h if h=1  g=1
(e.g., g = xz, h = xyz)
• Defn: Let G = {g1, .., gk) be a set of implicants of func f , and let h be another
implicant of f.
Then G is said to cover h if h=1  g1+ .. + gk =1
•Defn: An SOP or POS expression is also called a 2-level expression
• Defn: A 2-level AND-OR (OR-AND) gate realization of an SOP
(POS) expression is one in which all product terms (OR
terms in POS) in the SOP (POS) expression are implemented
by multiple input AND (OR) gates & the ORing (ANDing)
of the product (OR) terms is realized by a multiple input OR
(AND) gate.
3

E.g. f1 = AB + BC + ACD --- 2-level. (SOP)


f2 = ( B+C )( A+D )( C+D ) --- 2-level (POS)
f3 =AB + AC( B+D ) --- not SOP or POS
level 1 I/Ps --- not 2-level
--- 3 level ( can be realized
directly by 3 levels of gates)
A

A
f3
C

B
level 2
D I/Ps

level 0 level 1 level 2 level 3


I/Ps gates gates gate
125

A
AB + BC + ACD
B
f1
B
C
A
C Level 2
D
Level 1

B
(B + C)(A + D)(C + D)
C
f2
A

C
D
126

•Defn. A gate in a logic circuit is a level-1 gate if all its inputs are
primary inputs (i.e., literals, A, A, B, B, etc.)

A gate is a level-i gate i > 1 if the highest-level gate whose


output feeds the (level-i) gate is a level-(i-1) gate.

•NOTE: If a given expr. is not 2-level, we can convert it to a


2-level one using the distributive law.

• The goal of 2-level minimization is to minimize the number of


literals (a lteral is a var. in complemented or uncompl. form)
in a 2-level logic expr..

• This approx. reduces the total # of inputs over all gates in the
circuit in a 2-level gate realization.
127

E.g. f = ABC + ABC + ABC (non-minimized 9 literals)


A
B
C (12 gate I/Ps)
A = Circuit complexity
f
B
C
A
B
C
f = AB + AC (minimized 4 literals)
A
f
B
(6 gate I/Ps)
= Circuit complexity
A

C
Note: Minimizing # of literals + # of product terms  (approx) minimizing total #
of gate inputs
128
Multilevel Minimization (Example):

f = x1x2x3 + x2x3x4 + x1x5 + x4x5 (2-level minimized)

Apply distributive law (factoring)

f = x2x3(x1 + x4) + x5(x1 + x4)


= (x2x3 + x5)(x1 + x4) -- Multilevel expr.

Gate Impl.:

x2
x3
f
x5

x1 Multilevel
circuit
x4
129

Defn. Two implicants (or product terms) of a function f are said to


be adjacent (logically) if they have the same literals
except in one variable xi which occurs in uncomplemented form
(xi) in one implicant and in complemented form (xi) in the
other. The 2 implicants are said to differ in xi.

E.g. ABC, ABC (adjacent implicants, differ in B)

ABD, ABC (not adjacent)

NOTE: Adjacent implicants can be combined into one implicant


by the combining theorem (ABC + ABC = AC)
130
Karnaugh Maps

2-variable TT outputs

A B Z1 Z2

Binary 0 0 0 0
place-value Physically adjacent
0 1 1 1
ordering but not logically
(Binary 1 0 0 1 adjacent.
ordering) 1 1 1 0
logically adjacent but not physically adjacent
AB + AB
B
Another ordering of inputs ( Gray-code ordering)
A B Z1
0 0 0
0 1 1
1 1 1 Z1 = B
Physically as well as
1 0 0
logically adjacent.
131
n-variable Gray-code ordering

Defn.Gi = i-bit Gray-code ordering


rev(Gi) = reverse order of Gi Gn = 0 Gn-1
1 rev(Gn-1)
G1 = 0
0
Base. A B C
0
1 = 0 0 0
0
G2 = 0 G 1 0 0 1
1
1 rev(G1) 0 1 1
1 0 1 0
G3 = 0 G 2 1 =
1 1 0
1 1 1 1 1
Convert to a 2-dimensional
rev(G2) 0 1 0 1
Gray-code ordered TT 1 0 0
AB x 110
C 00 01 11 10

y 0 •
Throw away variable (A)
1 1 1 • changing across the 2 squares.
We thus obtain BC.
001
132

Example ( 3-var. K-Map)


AB Consensus = BC
Function f: C 00 01 11 10

0 1 1 1
f = AB + AB + AC + BC
1 1 1

Four Prime Implicants AB, BC, AC, AB formed. Not all these PIs
are needed in the expression. Only a minimum set that covers all
minterms is needed.

Defn. A Prime Implicant (PI) of a function f is an implicant of f that


is not covered by any other implicant of f.

Defn. An Essential PI is a PI that covers/includes at least one minterm


that is not covered by any other PI.
133
In the above example, AB & AB are essential PIs. These will need
to be present in any SOP expr. of the function. To form a minimal
set, the PI BC can be used. Thus f = AB + AB + BC is a minimized
expression.

Larger than 2-minterm PIs can also exist:


E.g., AB AB
C 00 01 11 10 C 00 01 11 10

0 1 1 0

1 1 1 1 1 1 1 1

AB AB
B C
B

• 2-minterm implicants (AB, AB in the 1st example above) can


be merged if they are logically adjacent to form a 4-minterm
implicant and so on.
134
• When an implicant can not be “grown” any further, then it is a PI.

• Defn. In a K-map, 2 implicants can be logically adjacent if they


are symmetric,
i.e., if : (1) They are disjoint (no common minterms).
(2) They cover the same # of minterms.
(3) Each minterm in one implicant is adjacent to a
unique minterm in the other implicant.

AB
More Examples: Both PIs
C 00 01 11 10 (A, BC)
AB are
Redrawn 0
C 00 01 11 10 1 1
essential.
0 1 1 1
1 1 1

1
1 1 1 Not symmetric Thus, f = A + BC
is minimized.
Symmetric ( logically adjacent)
2-minterm implicants : Can be “merged” to form
a 4-minterm implicant, which will be a PI.
135

4-variable K-Map:

AB
C 00 01 11 10
D
00 •

01 •

11

10
136
Example: f = AC + D
Instead of starting with 2-minterm
AB
CD 00 01 11 10
implicants & growing them, you
can form larger implicants directly
00 1 1 1 1 by grouping power of 2 (2, 4, 8,
etc.) # of minterms so as to form
01 1 1 a rectangle or square ( a convex
AC
region).
11

10 1 1 1 1 Convex
D
AB Concave
CD 00 01 11 10

00 1 1 Invalid grouping
(region formed is concave)
01 1 1
f = AB + AC + BCD
Valid 1 1 1
11
groupings
10 1
137

Another Example: AB
TT: CD BD
00 01 11 10
A B C D Z
00 1 1
0 0 0 0 1
0 0 0 1 0 ABD
01
0 0 1 0 1 1
0 0 1 1 1
0 1 0 0 0 C
11 1 1 1 1
0 1 0 1 1
0 1 1 0 1 10
Binary 1 1 1 1
0 1 1 1 1
order
1 0 0 0 1
1 0 0 1 0
1 0 1 0 1
1 0 1 1 1
1 1 0 0 0 f = C + BD + ABD
1 1 0 1 0
1 1 1 0 1
1 1 1 1 1
138
Don’t Cares in K-Maps

• Many times certain input combinations are invalid for a function


(E.g. BCD to 7-segment display functions; see pp. 212-214 in
Katz text )

• For such combinations, we do not care what the output is, and
we put an ‘x’ in the o/p column for the TT
AB
CD 00 01 11 10
A B C f
0 0 0 1
0 0 1 0 0 x x 1 0
0 1 0 1
f = BC + AB
0 1 1 x
1 0 0 0 by considering all 1 0 1 1 0
1 0 1 1 x’s as 0s
1 1 0 x
1 1 1 x f=B The x’s can, however, be profitably
by selectively used to make larger PIs & thus
considering the 010 further simplify the function.
cell’s x as 1
• In a K-map, the ‘x’s can be profitably used to form larger 139
implicants (which have fewer literals)

• However, when we need to form a minimal PI cover, we need to


worry only about covering the minterms ( the 1s), and not the Xs.

• Thus as far as x’s are concerned, we can have the cake and eat it too!

Example: f(A,B,C,D) =  m(1,3,5,7,9) +  d(2,6,12,13)


AB MSBs
A B C D
CD 00 01 11 10
0 0 0 0
00 0 4 12 x 8 0 0 0 1
LSBs01 0 0 1 0
1 1 5 1 13 x 9 1 CD 0 0 1 1
3 1 7 1 15 11
11
AD •
10
2 x 6 x 14 10 •
f = CD + AD •
AC or CD + AC If input comb. 2,6 occur
o/p is 0.
If inputs 2,6 occur o/p = 1.
140
STEPS IN K-MAP MINIMIZATION (sop EXPR.)

STEP1: Form all PIs by including the Xs with the 1s to form larger
PIs. (Do not form PIs covering only Xs !)

STEP2: Identify all essential PIs by visiting each minterm (1s) &
checking if it is covered by only one PI. If so, then that
PI is an essential PI.

STEP3: Identify all 1s not covered by essential PIs. Select a minimal- cost set of
PIs S to cover them. This requires some trial-and error (in fact, this is a hard
computational problem).

STEP4: Minimal SOP Expr. for function f:

f=  essential PIs +  Pi
Pi  S

PI Pi is in set S
Minimal POS Expr. from a K-Map : 141

METHOD 1: Obtain minimal SOP expression for the complement


function f, and complement this SOP expression to get a minimal
POS expr. for f (using De-Morgan’s Law)

Big M notation
Example:

F (A,B,C,D) =  M(0,2,4,8,10,11,14,15) •  D(6,12,13)

Xs of F
0s of F
AB F F
CD AB
CD 00 01 11 10
D
00 0 0 x 0 Complement 00 1 1 x 1
0 4 12 8
01 1 1 01
1 5 13 x 9 1 0 0 x 0
11 3 1 11 0 0 1 1
7 1 15 0 11 0
AC
10 2 0 10
6 x 14 0 10 0 1 x 1 1
F =D + AC F = D + AC = D(A +C)
METHOD2 : Direct Method : 142

(1) Obtain all prime implicates(PTs) (largest groups of 0s & Xs


ˆ
of size 2 i, i  0, forming a convex region, that can not be “grown”
any further).

(2) Identify all essential PTs (those that cover at least one 0 not
covered by any other PT).

(3) Choose a minimal set T of PTs to cover the 0s not covered by


the set of essential PTs.

(4) The expression for a PT is an OR term obtained by discarding


all changing variables, & keeping variables complemented if they
are constant at 1 or uncomplemented if they are constant at 0 &
taking the OR (sum) of these literals.

(5) Minimal POS Expr.:

f=  (essential PTs) •  qi
qi  T
143
Example: (Direct Method)

AB
CD (OR terms)
00 01 11 10

00 0 0 x 0 Prime Implicate
( Groups of 0s that cannot
01 1 1 x 1 be grown any further)

11 1 1 0 0 Both D and A + C are


D
Essential Prime Implicates.
10 0 x 0 0

(A + C)

F = D( A + C )

( Product of Prime Implicates )


5-variable K-map: f(A,B,C,D,E)---Juxtapose two 4-var. K-submaps 144
one for the MSB A=0 and the other for A=1:
BC BC
DE 00 01 11 10 DE 00 01 11 10
00 0 4 12 8 00 16 20 28 24
01 1 5 13 9 01 17 21 29 25
11 3 7 15 11 11 19 23 31 27
10 2 6 14 10 10 18 22 30 26
A=0 A=1

4-var. K-submap 4-var. K-submap


Adjacencies of a square: Adjacent squares of the 4-var. K-submap
Example: plus the “corresponding” or “mirror” square in the other 4-var.
K-submap. BC
BC
DE 00 01 11 10 DE 00 01 11 10

00 0 1 4 00 16 20 28 x 24
12 1 8
01 01
1 5 13 1 9 17 21 29 1 25

11 11
3 1 7 1 15 x 11 19 x 23 1 31 x 27

10 10
2 6 14 x 10 18 22 1 30 1 26
A=0 A=1
145
6-variable K-map: f(A,B,C,D,E,F)--Juxtapose two 5-var. K-submaps
one for the MSB A=0 and other for A=1
CD CD
EF 00 01 11 10 EF 00 01 11 10
00 0 4 12 8 00 16 20 28 24

5-var. 01 1 5 13 9 01 17 21 29 25
A=0
K-submap
11 3 7 15 11 11 19 23 31 27
10 2 6 14 10 10 18 22 30 26
B=0 B=1
CD CD
EF 00 01 11 10 EF 00 01 11 10

00 32 00 48 52 60 56
36 44 40
5-var. 01 49
01 33 37 45 41 53 61 57
K-submap A=1
11 35 11
39 47 43 51 55 63 59

10 34 10
38 46 42 50 54 62 58

B=0 B=1
Adjacencies of a square: Adjacent squares of the 5-var.
K-submap plus the “corresponding” or “mirror” square
in the other 5-var. K-submap.
6-variable K-map: f(A,B,C,D,E,F,)---Example: 146

CD CD
EF 00 01 11 10 EF 00 01 11 10
00 0 4 12 8 00 16 20 28 24
01 1 5 13 9 01 17 21 29 25
A=0
11 3 7 15 11 11 19 23 31 27
10 2 6 14 10 10 18 22 30 26
B=0 B=1
CD CD
EF 00 01 11 10 EF 00 01 11 10

00 32 00 48 52 60 56
36 44 40
01 33 01 49 53 61 57
37 45 41
A=1
11 35 11
39 47 43 51 55 63 59

10 34 10
38 46 42 50 54 62 58
B=1
B=0

You might also like