Beruflich Dokumente
Kultur Dokumente
words on a screen
and type words on a keyboard and run a programming language that could play games. And I did all this myself.!
!
Steve Wozniak!
SISTEMAS DIGITAIS
INTRODUO AOS
1
Ateno!
Todo o contedo deste documento pode conter
alguns erros de sintaxe, cientficos, entre
outros No estudes apenas a partir desta
fonte. Este documento apenas serve de apoio
leitura de outros livros, tendo nele contido todo o
programa da disciplina de Introduo aos
Sistemas Digitais, tal como foi lecionada, no ano
!!!
letivo de 2013/2014, na Universidade de Aveiro.
Este documento foi realizado por Rui Lopes.
INTRODUO AOS SISTEMAS DIGITAIS 2
!
Nos dias que correm, poucos so os momentos em que ns, seres humanos, no
interagimos com ambientes digitais. Hoje o mundo digital um espao muito vasto e mundo digital
que compreende praticamente todas as aes humanas, tanto a nvel social, como
mental e at mesmo fsico. Este chamado mundo tem levado uma grande
transformao desde os ltimos quarenta anos, produto do desenvolvimento de altas
velocidades de circuitos integrados. Neste tempo conseguimos passar das vlvulas de
vcuo aos chips, este, que pode conter dezenas de milhes de transstores (componente vlvulas de vcuo, chips,
eletrnico que serve como amplificador e interruptor de sinais eltricos) que podem ser transstores
programados de modo a criarem um sistema integrado num chip que, utilizando
tecnologias do passado, conseguem conter vrios circuitos flip-flop e portas num
pequeno espao fsico.
!
1. Ambiente Digital
Para se poder compreender como que um computador ou outra mquina
com potencialidades digitais funciona, temos que compreender como que tais
sistemas se sustentam: qual a sua base. Para tal, precisamos de estudar desde o
bsico, de modo a que, no final, se possa construir, nem que atravs de um esquema,
todo um sistema digital.
!
Analgico versus Digital
Entre vrios aparelhos que possamos ter e usar, eles podem ser analgicos ou
digitais. Um aparelho analgico trabalha baseado num contnuo intervalo de valores de aparelhos analgicos
voltagem, ou outra quantidade. Um aparelho digital tambm, s com uma ligeira aparelhos digitais
diferena: o intervalo de valores descontnuo e varia entre apenas dois estados, aos
quais damos o nome de 0 e 1 (significando o mesmo se fosse baixo e alto, preto 0e1
e branco, etc...). A estes nmeros damos o nome de smbolos, e no valores! smbolos
A era digital avanou, principalmente, atravs dos computadores, estes, que
entraram no comrcio pblico a partir da dcada de 60. Mas s nos ltimos dez a
vinte anos que a era digital se focou tambm noutros aspetos da vida. Como
exemplos, podemos tomar a cmara fotogrfica, que outrora se utilizava usando uma
fita onde, mecanicamente eram gravados os registos (informao), ou, em alguns locais,
os semforos, que costumavam funcionar atravs de um relgio e hoje em dia
funcionam atravs de controladores e sensores na estrada que avaliam a densidade de
trfego. Mas porque que hoje em dia h uma to grande necessidade de utilizarmos
aparelhos digitais? Por vrios aspetos, entre eles:
!
Eficcia e rendimento na produo de resultados - Dados os mesmos inputs
que em analgico, um circuito digital efetua os mesmos clculos, embora sem
depender de muitos fatores fsicos como a temperatura, voltagem, entre
outros...;
Facilidade de idealizao - O processo-base da criao destes circuitos a
lgica, no necessitando de grandes habilidades matemticas, sendo que o
comportamento dos pequenos circuitos pode muito bem ser mentalmente
visualizado sem a compreenso de componentes eletrnicos como transstores,
condensadores, ...;
Flexibilidade e funcionalidade - A partir do momento em que um problema
foi implementado num raciocnio em ambiente digital, este, pode ser resolvido
em pequenos passos lgicos.
3 INTRODUO AOS SISTEMAS DIGITAIS
Programabilidade - Grande parte dos produtos digitais so criados, hoje em
dia, gerando programas, tambm, em linguagens de hardware descritivas
(HDL). Estas linguagens permitem ambas estrutura e funo de um circuito HDL
que sejam especficas ou modeladas. Para alm de um compilador, um HDL
tpico tambm vem com sistemas de sntese e simulao. Estas ferramentas so
usadas para testar o comportamento do hardware, antes deste ser realizado, e
s depois que sujeito a uma sntese num circuito de testes particular.
Velocidade - Os aparelhos digitais vencem a nvel de velocidade. Transstores
individuais e circuitos integrados podem funcionar em menos de 10ps
(picossegundos), e examinar inputs e produzir outputs em menos de 1ns
(nanossegundo). Isto significa que estes materiais so capazes de produzir
cerca de um bilio de resultados ou mais, por segundo.
Mais econmico - Os circuitos digitais podem fornecer imensa funcionalidade
num curto espao fsico. Estes circuitos costumam estar integrados em chips, o
que proporciona mais espao para mais semelhantes, aumentando o
rendimento da mquina.
!
lgebra de Boole
inputs
output
0 0 0Inputs
Inputs Output 0
Output
0 0Inputs
Inputs Output
Output representaes simblicas
0 1 0 0 1 1 das portas AND, OR e
1 0 0 1 0 1
1 1 1 1 1 1
NOT, seus inputs e outputs
input
InputsandOutput
Inputs output
Output input
Inputs
Inputs or output
Output
Output
000000 00
0 0000
00 0
01 0 01
00 1
100011 00
0 00 1
101 11 1
XOR 111100 00
1 NOT 1110
10 1
11
1 11 1 11 1 11 1 11
output
input
XOR
XOR input not NOT
NOT
output
Inputs Output Inputs Output
0
0
0
1
0
Inputs
1 Inputs
Output
Output 1
1
!
0
0 !
11
Inputs
00 Inputs
Output
Output
1 0 1
1 1 0
Inputs
Inputs Output
Output Inputs
Inputs Output
Output
! 0 00 0 00 00 11
Na pgina 1 1encontra-se um circuito sequencial
0 01 seguinte
1 1 1 (circuito
0 0 eletrnico cujo circuito sequencial
1 0 1
comportamento 1 automaticamente
0 1 afetado por entradas do passado) simbolicamente
1 11 00
representado por1operaes booleanas. A isto se chama de flip-flop. Um flip-flop , flip-flop
ento, um circuito que produz um valor resultado de 0 ou 1, o qual permanece
constante at ocorrer um pulso (mudana temporria de valor) de um outro circuito
5 INTRODUO AOS SISTEMAS DIGITAIS
que provoca a alterao do output. Por outras palavras, o output alternar-se- entre
dois valores sobre o feedback de um circuito externo. Por outro lado, existe um outro
tipo de circuitos cujo comportamento no afetado por entradas passadas, mas sim
por entradas atuais.
Neste circuito abaixo, enquanto ambos os inputs permaneam 0, o output
(quer seja 0 ou 1) nunca mudar. No entanto, se temporariamente colocarmos um 1 no
input superior, o resultado ser 1, enquanto que se colocarmos um 1 no input inferior,
o resultado, forosamente, ser 0.
Vejamos com mais detalhe. Sem ter conhecimento do atual estado do1.1output,
Bits and Their Storage 23
imaginemos que o input superior igual a 1, enquanto que o inferior igual a 0. Isto
far com que o resultado da porta OR seja 1, seja qual for o valor atribudo para o
Figure 1.3 A simple flip-flop circuit
figura 2
Input
input
Output
output um simples circuito flip-flop
(sequencial)
Input
input
outro input desta porta. Assim, ambos os inputs da porta AND sero 1, dado que a
outra porta perfaz o valor de 1 (a porta NOT traduz de 0 para 1). Por conseguinte, a
the OR gate will now be 1 (Figure 1.4b). This guarantees that the output of the
porta AND resolve a operao e finaliza-a com 1, o que significa que o segundo input
OR gate will remain 1, even when the upper input to the flip-flop is changed
para a porta
back OR ser
to 0 (Figure 1. Isto
1.4c). garante que
In summary, theoflip-flops
output daoutput
porta has
OR become
permanea 1, mesmo
1, and this
queoutput
o input superior seja alterado para 0. Em suma,
value will remain after the upper input returns to 0. o output do flip-flop torna-se 1, e
o mesmo manter-se- independentemente do valor do input.
In a similar manner, temporarily placing the value 1 on the lower input will
force O thepropsito
flip-flopsdooutput
estudotodos
beflip-flops
0, and this importante
output will dado trs after
persist pontos.
thePrimeiro,
input
demonstra como toos0.aparelhos dos dias de hoje podem ser construdos, todos, atravs
value returns
destas pequenas portas e circuitos, um processo hoje designado por design de circuitos
digitais,
Figurerea
1.4 de grande
Setting the relevo daaengenharia
output of flip-flop to 1 informtica.
Segundo, o conceito de flip-flop introduz-nos o conceito do abstrato e como
podea.ser
1 istil na on
placed computao e arquitetura
the upper input. b. Thisde computadores.
causes the output of the OR gate to be 1 and,
Terceiro, porque, atualmente, inoturn, usothede flip-flops
output gate
of the AND um tomtodo
be 1. para o
armazenamento de bits, ou seja, o valor do output corresponde ao valor do bit, o qual
1
o flip-flop guarda. Outros circuitos podem 1 ajustar este valor enviando pulsos, e receber
1
com input o output do primeiro. Assim, podem ser criados imensos circuitos no interior
de um computador, e cada um guarda, assim, um bit de dados. A 1 esta tecnologia d-se
1
o nome de integrao de larga escala (very large-scale integration (VLSI)), que permite VLSI
que vrios circuitos eletrnicos sejam contrudos numa s placa, chamada chip. Os chip
chips so placas com ferramentas abstratas dado que contm milhes de flip-flops.
! 1
2. Sistemas numricos e cdigos
0
0
1
INTRODUO AOS SISTEMAS DIGITAIS 6
aprender como que vrias unidades, mais especificamente, vrias bases, se relacionam
entre si e como que os dados podem ser representados em informao.
!
Elementos de um sistema de numerao
Um sistema de numerao composto por vrios elementos. Primeiro, de
forma a se poderem representar num papel, ou noutra via de escrita, um sistema
precisa de um alfabeto. Um alfabeto , ento, um conjunto de smbolos usados para alfabeto
representar valores, neste caso, numricos. Tais valores numricos tm uma lgica
adjacente, essa chamada de base. A base de um sistema corresponde variao de um base
algoritmo da relao entre os valores presentes. Aqui, iremos considerar,
principalmente, as bases binria, octadecimal, decimal e hexadecimal (2, 8, 10 e 16,
respetivamente), embora hajam muitas outras, entre as quais, as bases 24, 60 e
complexa, que ns usamos frequentemente nos nossos relgios (base 24) e na
trigonometria (base 60).
A representao de um sistema tambm necessita de algumas regras - notao
posicional. Estas regras variam de sistema para sistema, sendo que basta que o notao posicional
comprimento de representao1 - nmero de smbolos - seja alterado, para que estas
comprimento de
mudem. representao
Se analisarmos, agora, a notao posicional podemos considerar que a uma
determinada quantidade X podemos associa uma lista ordenada de smbolos ou dgitos
dk:
equao 1
!X = (dn1 ,dn2 r n2 ,...,d0 ,d1 ,...,d p )r quantidade de smbolos dk
!
O valor de X resulta de a cada smbolo estar associado um peso dependente da
respetiva posio:
! n1 equao 2
!X = dr k
k
= dn1r n1
+ dn2 r n2 1
+ ...+ d0 + d1r + ...+ d p r p
valor de X por peso
!
k= p
com dk sendo o alfabeto (intervalo {0, ..., r-1}, n+p os smbolos e r a base.
8 8 (octadecimal) 0,1,2,3,4,5,6,7
10 10 (decimal) 0,1,2,3,4,5,6,7,8,9
16 16 (hexadecimal) 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
Atravs deste tlimo clculo, podemos prever qual ser o nosso alfabeto das
bases que pretendemos estudar (base 2, 8, 10 e 16).
Para exemplificar, podemos fragmentar um nmero, de acordo com o clculo
anterior, e assim, convert-lo para uma base decimal:
! DACA116 = 13 16 4 + 10 16 3 + 12 16 2 + 10 161 + 1 16 0 = 896161
1 Na prtica temos um conjunto finito de smbolos de representao e devem existir restries gama de representao.
7 INTRODUO AOS SISTEMAS DIGITAIS
!
Se nos dirigirmos s bases 8 e 16, podemos comprovar que ambas tm uma
relao direta com a base binria (2). Essa relao consiste no facto de um dgito octal relao direta
ser coincidente com trs dgitos binrios (bits), enquanto que um dgito hexadecimal trs dgitos binrios
coincidente com quatro dgitos binrios (nibble). quatro dgitos binrios
1 1 1 1
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
8 8
9 9
432 2
400 216 2
32 200 108 2
20 16 100 54 2
12 16 8 40 27 2
!
12 0 8 14 20 13 2
0 0 14 7 12 6 2
0 6 1 6 3 2
1 0 2 1
1
! 43210 = 110110000 2
!
Ou at mesmo com a base 8:
!
1462 8
800 182 8
662 160 22 8
! 640 22 16 2
22 16 6
16 6
6
! 146210 = 2666 8
!
Adio e Subtrao binria
Tal como na base 10, na base binria tambm podemos efetuar certas
operaes, tais como a adio e a subtrao. Para fazermos a adio e a subtrao adio e subtrao binria
temos que seguir a tabela abaixo e ter ateno a somas do gnero 1+1.
tabela 3
0 1
adio e subtrao binria
0 0 1 (11 com transporte)
1 1 0
11101 11001
+11001 101
! e !
110110 10100
!
INTRODUO AOS SISTEMAS DIGITAIS 10
Multiplicao binria
Na multiplicao tambm temos uma tabela qual devemos obedecer. Tal multiplicao binria
como na multiplicao de base 10, na de base 2, sempre que se multiplica por zero o
resultado zero. Na mesma, usamos a tcnica shift and add - algoritmo usualmente
usado para efetuar as multiplicaes em bases decimais (multiplicar algarismo a
algarismo e depois somar.
tabela 4
x 0 1
multiplicao binria
0 0 0
1 0 1
10111
1101
00000
10111
010111
00000 -
!
0010111
10111 --
01110011
10111 - - -
100101011
!
Representao de quantidades negativas
O sistema de notao posicional, por si, no capaz de representar
quantidades negativas. Em alternativa, usam-se outras convenes para as suas
representaes. Entre elas, o sinal e mdulo e os cdigos de complemento. sinal e mdulo, cdigos de
A conveno de sinal e mdulo tem uma consistncia muito prpria com a complemento
notao posicional, embora tenha a necessidade de mais um bit, este, para representar
o sinal. Infelizmente, este sistema natural para os humanos, mas impraticvel nos
sistemas digitais, dado que existem ambiguidades prprias e o seu tamanho n bits
mais 1 (para o sinal).
Por sua vez, os cdigos de complemento, sendo usados mais frequentemente, o
complemento para um e para dois, traduzem-se num subconjunto da gama de
representao absoluta que codifica as quantidades negativas. Este sistema j se torna
possvel e praticvel em sistemas digitais, pois no necessita de um smbolo adicional
para a representao do sinal. Outra vantagem deste sistema que ele permite
facilmente o processamento integrado da soma algbrica, ao contrrio do sinal e
mdulo.
!
Sinal e mdulo
Como dito anteriormente, o sinal e mdulo consiste numa representao
numrica, em base 2, que permite a representao no s de nmeros positivos como
11 INTRODUO AOS SISTEMAS DIGITAIS
de negativos. Este sistema, tambm como referido anteriormente, contm certas
ambiguidades que fazem com que o processamento de dados com o prprio se torne
catico e cclico: o zero tem duas representaes.
Em suma, o sistema traduz-se da seguinte forma:
!
! nmero = sinal mdulo
! sinal 0 quando "+"; 1 quando "-"
! mdulo representao posicional do nmero
! 6 = 00110 ! 6 = 10110
! 0 = 00000 = 10000
!
Complemento para a base r
Com n dgitos e base r, define-se o complemento para a base r de uma complemento para a base r
quantidade X, como
equao 5
! RC(X) = r X
n
definio de complemento
! para a base r
onde RC significa complemento para a base (radix complement).
O que se pretende com este clculo substuir uma quantidade M - X pela
soma M + RC(X) = M + rn - X. Este procedimento produz resultados vlidos desde
que:
equao 6
rn rn
! M X 1 generalizao da definio de
2 2 complemento para a
! base r
! M X = (M X)mod r (3)
n
! X = (X ...X ) + 1
' '
! n1 0
!
!
!
3 A operao mod deve ser entendida como o resto da diviso inteira.
INTRODUO AOS SISTEMAS DIGITAIS 12
Overow
Quando o resultado de uma soma de dois nmeros positivos d negativo ou a
soma de dois negativos d positivo, d-se o nome de overflow. Geralmente isto ocorre overflow
porque a operao excedeu a gama de representao.
3 1101
+ 6 +1 0 1 0
!
9 1 0 1 1 1 = +7
!
Em suma, podemos criar a seguinte tabela:
representao
tabela 5
representao de nmeros
1 - Sinal e mdulo 1 bit para sinal (0 para positivo, 1 para negativo) + x bits binrios
para nmero em notao posicional
-0 1000 1111
-8 1000
13 INTRODUO AOS SISTEMAS DIGITAIS
Adio algbrica em complemento para um
Nesta operao podem ser realizadas atravs das regras de adio bsicas
binrias. Os transportes para alm do bit mais significativo devem ser sinalizados e
somados ao resultado, contando apenas os primeiros quatro dgitos.
!
Adio algbrica em complemento para dois
Nesta operao tambm podem ser realizadas atravs das regras de adio
bsicas binrias. Os transportes para alm do bit mais significativo no so sinalizados
nem somados ao resultado, contando apenas os primeiros quatro dgitos.
!
3. Cdigos
Um cdigo uma sequncia de n bits, em que cada sequncia representa um
determinado valor. Esse determinado valor tambm chamado de palavra de cdigo. palavra de cdigo
O comprimento n de um determinado cdigo com m valores a codificar calculado
atravs da seguinte expresso:
! equao 9
comprimento de uma palavra
! n log 2 (m) (4)
! de cdigo
3 0011
!
4 0100 ! 25 = 0010 0101
10
! BCD
5 0101
!
6 0110
!
!
!
7 0111
8 1000
!
9 1001 !
!
!
4 A operao teto (ceil) significa o valor inteiro imediatamente superior.
INTRODUO AOS SISTEMAS DIGITAIS 14
Cdigo AIKEN e Excess-3 (XS3)
O cdigo AIKEN um cdigo BCD autocomplementar, ou seja, o AIKEN, cdigo
complemento para nove de cada dgito decimal obtm-se, simplesmente, subtraindo por autocomplementar
nove. Foi criado por Howard Hathaway Aiken, digital designer do computador Harvard
Mark I, da IBM.
Por sua vez o Excess-3 (XS3) um cdigo autocomplementar que se obtm Excess-3 (XS3)
pelo excesso de trs.
2 0010 2 0101
3 0011 3 0110
4 0100 4 0111
5 1011 5 1000
6 1100 6 1001
7 1101 7 1010
8 1110 8 1011
9 1111 9 1100
!
Cdigo de Gray
O cdigo de Gray um cdigo no ponderado, regular, contnuo, cclico, no
redundante e refletido, com uma distncia de Hamming de 1. A distncia de Hamming distncia de Hamming
a distncia entre palavras consecutivas, logo, o nmero de bits que diferem duas
palavras de cdigo consecutivas.
O cdigo de Gray de um bit constitudo apenas por duas palavras: 0 e 1.
Num cdigo de Gray de n bits, as primeiras 2n-1 palavras so iguais s do cdigo de
Gray de n-1 bits precedidas de um zero (0) - na posio do bit mais significativo. As
ltimas 2n-1 palavras so iguais s do cdigo de Gray de n-1 bits, escritas pela ordem
inversa e precedidas de um um (1) - na posio do bit mais significativo.
Se pretendermos obter uma palavra de um cdigo de Gray de n bits a partir
da palavra correspondente do cdigo binrio de n bits:
!
Adicionamos palavra do cdigo binrio um bit esquerda e atribumos-lhe
o valor 0;
Numeramos todos os bits do cdigo binrio da direita para a esquerda;
Atribumos o valor 1 ao bit i do cdigo de Gray se os bits i e i+1 da palavra
binria so diferentes;
Atribumos o valor 0 ao bit i do cdigo de Gray se os bits i e i+1 da palavra
binria so iguais.
!
15 INTRODUO AOS SISTEMAS DIGITAIS
Se pretendermos obter uma palavra de cdigo binrio de n bits a partir da
palavra correspondente do cdigo de Gray de n bits:
!
Numeramos todos os bits do cdigo de Gray da esquerda para a direita;
Atribumos o valor do bit um do cdigo de Gray ao bit um do cdigo
binrio;
O bit i (i=2,3, ..., n) do cdigo binrio igual soma exclusiva (XOR) do
bit i-1 do cdigo binrio do bit i do cdigo de Gray.
!
Deteo de erros em sistemas digitais
Um erro em sistemas digitais corresponde corrupo de dados de um valor
correto, para um valor diferente. Estes erros podem ocorrer tanto em sistemas de
transmisso de informao digital (sob forma de rudo), como em sistemas de
armazenamento (como memria, discos rgidos).
Os erros podem ser categorizados em dois tipos: erros singulares, quando s erros singulares
um bit de dados corrompido; os erros mltiplos, quando dois ou mais bits de dados erros mltiplos
so corrompidos. Este ltimo tipo de erro muito menos frequente que o primeiro.
Os erros so detetveis. Um cdigo permite a deteo de erros, caso a
corrupo de uma palavra resulte numa nova palavra que no faz parte do mesmo
cdigo. Deve-se ter por conveno que um sistema que permite a deteo de erros s
gera, transmite e guarda palavras de cdigo vlidas. Assim, se uma sequncia de bits
uma palavra vlida de cdigo, assumida como correta, caso contrrio, se uma
sequncia de bits no for uma palavra de cdigo, esta assumida como no-vlida.
possvel detetar todos os erros singulares caso a distncia mnima entre todas os
possveis pares de palavras de cdigo seja menor ou igual a dois. A tal cdigo d-se o
nome de cdigo de distncia 2. cdigo de distncia 2
Para detetar erros mltiplos so necessrios cdigos de distncia maior que 2.
De forma a criar um cdigo de distncia maior que 2, necessrio utilizar mais que um
bit de paridade. Por exemplo, um cdigo de distncia 3 permite a deteo de 2 erros.
A palavra invlida 1001011 (com um erro), est mais prxima da palavra 0001011 do
que qualquer outra palavra de cdigo. Torna-se assim possvel corrigir o erro
modificando a palavra recebida para a palavra mais prxima no cdigo.
De uma forma geral, um cdigo de distncia m permite a correo de c erros.
! equao 10
m 1
!c = correo de erros por
2
! distncia de Hamming
!
0
consenso na prtica
! YZ F
! 1
! 0 Z
!
! X
!
Operadores compostos
Existem outros operadores, compostos, como so exemplo os dois que vamos
estudar a seguir: o operador XOR e o operador implicao. operador XOR, operador
implicao
!
Outros conjuntos completos de operadores, a partir dos quais se pode
representar toda e qualquer relao booleana, so, por exemplo, os seguintes:
!
{+, . , };
{+, };
{ . , };
NAND: a.b+c.d = (a.b+c.d) = ((a.b).(c.d));
NOR: (a+b).(c+d) = [(a+b).(c+d)] = ((a+b)+(c+d)).
!
Funes booleanas
Uma funo booleana uma regra (correspondncia) que associa um elemento funo booleana
do conjunto B={0,1} a cada uma das 2n combinaes possveis que n variveis
independentes podem assumir. Tanto o domnio como o contradomnio so conjuntos
enumerveis e finitos de vetores binrios.
Vejamos uma generalizao das leis de De Morgan:
! equao 23
! f (x0 ,..., xn1 ,0,1,+,.)' = f (x '0 ,..., x 'n1 ,1,0,.,+) generalizao das leis de De
! Morgan
Assim, como exemplos, tenhamos os seguintes:
! equao 24
! f (x, y, z) = x.y(z '+ y + x ') + z. x(y + z ')
exemplo de aplicao
! f (x, y, z)' = [ (x '+ y'+ z.y' x)].(z '+ x + y'. z)
!
Tomemos tambm uma aplicao do princpio da dualidade, mas a funes:
! equao 25
! f (x0 ,..., xn1 ,0,1,+,.)D = f (x '0 ,..., x 'n1 ,1,0,.,+) aplicao do princpio da
! dualidade
Assim, como exemplos, tenhamos os seguintes:
!
! f (x, y, z) = x.y(z '+ y + x ') + z. x(y + z ') equao 26
exemplo de aplicao
! f (x, y, z)D = [ (x + y + z '.y. x ')].(z + x '+ y. z ')
!
INTRODUO AOS SISTEMAS DIGITAIS 20
Como podemos reparar, existe uma forte relao entre complementaridade e
dualidade:
! f (x0 ,..., xn1 ,0,1,+,.)' = f (x0 ,..., xn1 ,0,1,+,.)D equao 27
! relao entre
Essa relao de igualdade pode ser usada como no seguinte exemplo: complementaridade e
! dualidade
f (x, y, z) = x.y'+ x '.y + y'. z
! equao 28
! f (x ', y', z ') = x '.y + x.y'+ y. z ' demonstrao da relao
! f (x ', y', z ')D = (x '+ y). (x + y'). (y + z ') anterior
! = f (x, y, z)'
!
A representao de funes booleanas feita atravs de tabelas e nica. representao
Uma dada funo f tem uma nica tabela de verdade. Do mesmo modo, uma dada tabela de verdade
funo booleana admite mltiplas representaes algbricas. Uma representao representaes algbricas
algbrica inclui frequentemente, termos redundantes. A eficincia na implementao
tcnica destas funes obrigar, automaticamente, ao uso de processos de
simplificao.
Formas cannicas
Para passarmos de uma representao tabular para uma representao
algbrica podemos e devemos dar uso a um novo conceito - o de formas cannicas. formas cannicas
Para definirmos uma forma cannica, podemos, para j, dizer que se trata de uma
forma, no mnima, de representar funes booleanas. Uma forma cannica, entre
quatro tipos possveis, uma soma ou um produto de termos mnimos ou termos termos mnimos
mximos. Um termo mnimo, ou produto cannico de ordem k, mk o produto lgico termos mximos
das n variveis booleanas independentes, em que cada uma delas aparece uma e uma
s vez, com o seu prprio valor ou complementada consoante toma valores 1 ou 0,
respetivamente, na k-sima combinao das variveis independentes. Por outro lado,
um termo mximo, ou soma cannica de ordem k, Mk a soma lgica das n variveis
booleanas independentes, em que cada uma delas aparece uma e uma s vez, com o
seu prprio valor ou complementada consoante toma valores 0 ou 1, respetivamente,
na k-sima combinao das variveis independentes.
Recorrendo definio dos termos cannicos, temos que a 1 forma cannica 1 forma cannica
(soma de produtos - SOP), ou forma disjuntiva normal dada pela seguinte forma:
! 2 n 1 equao 29
! f ( xn1 , xn2 ,..., x0 ) = mk . fk primeira forma cannica
!
k=0
! revisitada
k=0
21 INTRODUO AOS SISTEMAS DIGITAIS
Mais uma vez, recorrendo s definies de termos cannicos temos que a 2
forma cannica (produto de somas - POS), ou forma conjuntiva normal, dada pela 2 forma cannica
seguinte igualdade:
2 n 1 equao 31
! f ( xn1 , xn2 ,..., x0 ) = ( M k + fk ) segunda forma cannica
!
k=0
! = mk . fk ''
como dupla negao da
k=0 primeira
2 1
n
! = m 'k '
k=0
!
Partindo da segunda forma cannica e aps dupla negao, temos que:
!
! f ( xn1 , xn2 ,..., x0 ) = f (...)'' equao 34
quarta forma cannica
2 1
n
! = ( M k + fk ) '
como dupla negao da
k=0 segunda
2 1
n
! = M 'k '
k=0
!
Admitindo uma especificao completa da tabela de verdade, a lista dos
produtos cannicos implica a lista das somas cannicas. Por exemplo,
!
! f (x2 , x1 , x0 )' = m(3, 4,5, 7) = M (0,1,2,6) equao 35
figura 4
um sistema combinatrio
x1 y1
X= Y=f(x) Y =
xn ym
! = z (xy + y ) + z(y + xy ) =
! = z (x + y ) + z(y + x) =
! = zx + zy + zy + zx
!
Mais uma vez, expresses irredutveis podem no ser mnimas. Pode existir
mais que uma expresso mnima. Vejamos o exemplo seguinte, com a mesma funo
que a anterior:
! f = xyz + xyz + xyz + xyz + xyz + xyz = equao 39
exemplo de soluo (2 de 3)
!= xz (y + y ) + xy(z + z ) + yz(x + x ) =
! = xz + xy + yz
!
, assim, conveniente desenvolver processos que produzam o conjunto de todas
as expresses mnimas para seleo segundo outros critrios. Vejamos um terceiro
exemplo, no qual se experimenta uma outra soluo do nosso exerccio:
!
! f = xyz + xyz + xyz + xyz + xyz + xyz = equao 40
! = xy(z + z ) + xz(y + y ) + yz (x + x ) = exemplo de soluo (3 de 3)
! = xy + xz + yz
!
Adjacncia e simplicao
Como processo de seleo para simplificao de funes booleanas, vejamos
um fundamento, o teorema da adjacncia, muito usado nos trs exemplos dados teorema da adjacncia
anteriormente. Aqui, para todo o x e y pertencentes ao nosso conjunto B, xy+xy=x.
Para presenciar este passo, demonstremo-lo com dois simples exemplos:
!
! f = ab'+ ab = a(b'+ b) = a equao 41
! g = a'b'+ ab' = b'(a'+ a) = b' aplicao do teorema da
! adjacncia
Cubos Booleanos
Uma tcnica para identificar quando que se pode aplicar o teorema da
adjacncia usando cubos booleanos. Esta tambm uma forma alternativa tabela cubos booleanos
de verdade. Assim, um cubo de n variveis cada vrtice, adjacente a n vrtices, isto
, para cada termo mnimo existem outros n termos mnimos que partilham n-1
variveis e diferindo, portanto, apenas numa varivel.
De forma a fazermos o mapeamento das tabelas de verdade em cubos
booleanos, identificamos trs tipos de geometria de vrtices: ON-set - vrtices a cheio;
OFF-set - vrtices vazios; DC-set - vrtices tipo X.
INTRODUO AOS SISTEMAS DIGITAIS 24
Para j vejamos trs tipos de cubos, por nmero n de variveis por vrtice:
!
! 011 111 figura 5
! 01 11 001
cubos booleanos: cubo-1,
! 101 cubo-2 e cubo-3
! x
!
y z 010
0 1 y 110
! x
! 00 10 000 x 100
!
Agora vejamos exemplos de geometria de vrtices dos cubos:
!
! figura 6
! 01 11 01 11
anlise de cubo-2
!
! B B
! 00 A 10
! 00 A 10
!
No primeiro cubo-2 existem duas variveis, designadas por A e por B. A
varivel A est constante e igual a 1, enquanto que no segundo cubo-2 a varivel B
constante e sempre 0. J os valores de B e de A, para os primeiro e segundo cubo-2,
respetivamente, circulam perante um loop. A estes cubos d-se-lhes o nome de cubos
de dimenso n-1 ou subcubos. cubos de dimenso n-1
J os cubos-3 so diferentes. Vejamos os seguintes exemplos:
!
!
011 111 011
! 111 011 111
figura 7
001 001
! 001 101 anlise de cubo-2
101
! 101
z 010 z 010
! z 010
y 110 y
! 110 y 110
!
Analisemos exemplo a exemplo. No primeiro caso impossvel explorar a
adjacncia (teorema), dado que as formas cannicas so irredutveis. Fazendo uma
tabela de verdade, podemos, mais facilmente, comprovar que a funo do primeiro
cubo-3 igual a xyz. No segundo caso existem trs casos de adjacncia, os quais se
podem comprovar atravs da contiguidade dos pontos em 101, 111, 011 e 110. J o
terceiro caso tem uma adjacncia sucessiva em quatro vrtices (geometricamente
formando um plano). Aqui apenas se mantm o x, y e z so eliminadas.
Ento j podemos dizer que um subcubo n-m um agrupamento de 2n subcubo n-m
vrtices, cada um deles adjacente a m vrtices na coleo. Por exemplo, um subcubo
3-0, um vrtice gera um mintermo (produto), com trs literais; um subcubo 3-1, uma
aresta, gerando um produto com dois literais; um subcubo 3-2, uma face, gerando um
produto com um literal; um subcubo 3-3, um cubo, gerando a constante 1. Em geral,
um subcubo-m dentro de um cubo-n (m<n) gera um produto com n-m limites.
!
!
!
25 INTRODUO AOS SISTEMAS DIGITAIS
Mtodos dos mapas de Karnaugh (K-map)
Para n>3 praticamente impossvel a utilizao grfica dos cubos booleanos
para identificar quando se pode aplicar o teorema da adjacncia. Assim, surge uma
outra alternativa grfica de visualizao da tabela de verdade: os mapas de Karnaugh. mapas de Karnaugh
Aquio objetivo continua a ser identificar quando se pode aplicar o teorema da
adjacncia.
Os mapas de Karnaugh so isomorfos aos cubos booleanos. Tendo uma
abordagem fundamentalmente heurstica, este mtodo til para n6.
Em cada dimenso, para garantir a adjacncia, a evoluo das coordenadas
binrias de cada termos mnimo obedece ao cdigo de Gray. Assim, apresentamos os
mapas de Karnaugh para duas, trs e quatro variveis:
!
!
! A A figura 8
! mapas de Karnaugh de 2, 3 e
! b 0 1 c 00 01 11 10 cd 00 01 11 10
4 variveis
! 0 0 00
!
0 2 0 2 6 4 0 4 12 8
! 1 1 3 1 1 3 7 5 01 1 5 13 9
!
D
B 11
!
3 7 15 11
C
! 10 2 6 14 10
! B B
!
As adjacncias num K-map (abreviatura de mapa de Karnaugh) podem-se ver
como no seguinte exemplo, onde tambm podemos comprovar o isomorfismo de que
falvamos atrs.
!
!
! y 011 111 figura 9
! 00 01 11 10 001 isomorfismo entre K-Map e
! x
101 cubo booleano
! 0 000 001 011 010
! z 010
y 110
! 1 100 101 111 110
! z 000
x 100
!
Vejamos, assim, alguns exemplos acompanhados das suas funes, com o K-
-map.
!
! y x figura 10
exemplos de aplicao de
! b 0 1 x 00 01 11 10 z 00 01 11 10
mapas de Karnaugh
! 0 0 1 0 0 0 1 0 0 0 0 1 1
!
! 1 0 1 1 0 1 1 1 1 0 0 1 1
! z y
!
! f=a f = yz+xz+xy f=x
!
INTRODUO AOS SISTEMAS DIGITAIS 26
Ao ter mapas com trs variveis, os seguintes exemplos ou seus semelhantes,
podem acontecer.
! figura 11
! exemplos de aplicao de
! x
! z 00 01 11 10
mapas de Karnaugh com
! f = m(0, 4,5,6) = zy + zx + xy
trs variveis
! 0 1 0 1 1
! 1
!
0 0 0 1
! y
!
! x
!
! z 00 01 11 10
! 0 1 0 1 1 f = m(0,1, 4,5,6, 7) = x + y
!
! 1 1 0 1 1
! y
!
Do mesmo modo, ao ter mapas com quatro variveis, o seguinte exemplo ou
seus semelhantes, podem acontecer.
!
! figura 12
!
x
exemplo de aplicao de
! zw 00 01 11 10
mapas de Karnaugh com
! 00
! quatro variveis
1 0 0 1
! 01 0 1 0 0
f = m(0,2, 3,5,6, 7,8,10,11,14,15) =
! w
! z
11 1 1 1 1
= z + yw + xyw
! 10 1 1 1 1
!
!
B y
exemplo de aplicao de
! zw 00 01 11 10 f = m(0,2, 3,5,6, 7,8,10,11,14,15) =
! = M (1, 4,9,12,13)
minimizao com maxtermos
! 00 1 0 0 1
! 01 0 1 0 0
f = (x + y + z)(z + w + y )(z + w + y)
! w
! 11 1 1 1 1
f = m(1, 4,9,12,13) = xyz + zwy + zwy
!
z
10 1 1 1 1
= (x + y + z)(z + w + y )(z + w + y)
!
!
!
27 INTRODUO AOS SISTEMAS DIGITAIS
Minimizao com don t care s
Os dont cares" (termo ingls para no interessa, desprezvel) podem ser
tratados como 0s ou 1s, conforme seja mais til simplificao da funo booleana.
Eles so sinalizados com um x. Assim, tomemos o seguinte exemplo:
!
!
! A figura 14
! 00 01 11 10
f = m(1, 3,5, 7,9) + d(6,12,13)
exemplo de aplicao de
!
cd
minimizao com dont cares
! 00 0 0 x 0
f = AD + CDB (sem don't care's)
! 01 1 1 x 1
! C
10 0 x 0 0
!
! B B
!
Estratgia de cobertura
De modo a efetuarmos uma boa estratgia de cobertura de uma mapa de
Karnaugh, devemos antes conceitualizar trs termos no conhecidos at ao momento.
Um implicante um termo do ON-set ou qualquer grupo de termos que possam ser implicante
combinados num mapa de Karnaugh - em suma, uma associao de termos mnimos
(o mesmo que subcubos). Um implicante primo (IP) um implicante que no pode ser implicante primo (IP)
combinado com outro implicante de forma a eliminar um termo. Um implicante primo
essencial (IPE) um implicante que, se um termo do ON-set estiver coberto por um implicante primo essencial
nico implicante, ento essencial - h pelo menos um termo mnimo que coberto (IPE)
apenas e s por este implicante.
Quando se lida com o OFF-set, as associaes de 0 no mapa de Karnaugh
designam-se por implicados. implicados
Vejamos o seguinte exemplo, onde podemos encontrar seis implicantes primos
{! BC,CA, AB, ABD, ACD, BCD }. A sua expresso incluir todos os implicantes
primos essenciais que assegurem a cobertura total do ON-set.
!
!
!
! figura 15
! A
exemplo de estratgia de
! cd 00 01 11 10
cobertura
!
! 00 0 1 1 0
! 01 1 1 1 0 f = BC + CA + ABD
! D
! 11 1 0 1 1
!
C
10 0 0 1 1
! B B
!
!
!
INTRODUO AOS SISTEMAS DIGITAIS 28
Vejamos outro exemplo:
!
!
! A figura 16
! 00 01 11 10
exemplo de estratgia de
! cd
00 0 0 1 0 5 Implicantes Primos
cobertura
! 11 0 1 1 1
!
Descodicadores (decoders)
Um descodificador um circuito combinatrio que permite, para uma palavra descodificador
em cdigo entrada, ativar uma e uma s sada da funo de descodificao. O
descodificador mais comum de todos o descodificador para o cdigo binrio natural.
A estrutura genrica de um descodificador a seguinte: estrutura genrica
!
! Decoder
figura 17
! estrutura genrica de um
!
!
!
Como podemos reparar temos um dado nmero de entradas para um dado
nmero de sadas. Tipicamente esses nmeros so n entradas (cdigo) para 2n sadas,
como so o caso os descodificadores 2:4, 3:8, 4:16, etc
Na pgina seguinte podemos ver um descodificador 2 para 4 (2:4) e a sua
tabela de verdade. Devemo-nos lembrar que o valor x corresponde a um dont care,
valor a ser desprezado.
!
22 Chapter 1 Data Storage
INTRODUO AOS SISTEMAS DIGITAIS 30
!
! 22 Chapter 1 Data Storage
form, as shown in Figure 1.2. Note that the AND, OR, XOR, and NOT gates are
represented by distinctively shaped symbols, with the input18values entering on
figura
22 Chapter 1 Data Storage
one side
inputs and the output exiting outputson the other.
form, as shown in Figure 1.2. Note that the AND, OR, XOR, and NOT
descodificador 2:4 gates
e are
Gates provide
represented by the building
distinctively blocks
shaped from which
symbols, with computers
the input are constructed.
values entering on
EN
One
I1
important
I0
step
Y3
in this
Y2
direction
Y1 Y0
is depicted respetiva
in the circuit tabela 1.3.
in Figure de verdade
This is
22 Chapter
2:4 decoder 1 Data Storage
one side and the output exiting on the other.
form, as shown in Figure 1.2. Note that the AND, OR, XOR, and NOT gates are
0a particular example 0 from a 0 collection 0 circuits known as a flip-flop. A flip-flop
offrom
Gates
represented
x
provide
x
by the
distinctively building blocks
shaped
0
symbols, whichthe computers are constructed.
I0 Y0 is
Onea circuit
important that produces
step in andirection
this output value is of 0 orwith
depicted 1, the
in which input
remains
circuit in
values
Figure
entering
constant untilon
1.3. This a
is
I1 Y1 1one
form,
pulse side0
as
(a and
shown0 the
temporary output
in 0
Figure
change exiting
0
1.2.
to a 1on
Note0 the
thatthatother.
1
the
returns AND,
to 0) OR,
from XOR,
anotherand NOT
circuit gates
causes areit
Y2 a particular
Gates example
provide the from a collection
building blocks offrom
circuitswhichknown as a flip-flop.
computers A flip-flop
are between
constructed.
EN
represented
1to
is ashift 0 to the
circuit by
that distinctively
1other
producesvalue.
0 an In shaped
other
0 output symbols,
1 words,
value the
0 of 0 or with
output
1, the
whichwillinput
flip or
remainsvalues
flop entering
constant on
two
until a
Y3 One important step inofthis direction is depicted in as
thebothcircuit in Figure 1.3. This is
one
values
pulse side
(a and
under the
temporary output
control change exiting
external
to a 1on the
stimuli.
that other.
As
returns long
to 0) from inputs
another in the
circuit circuit
causes init
1a particular
FigureGates1
1.3 example
provide
remain
0
0, 0 from
the a1 collection
thebuilding
output blocks
(whether
0 offrom
0 circuits
1) known
0 orwhich notas
willcomputers a flip-flop.
change. are A flip-flop
constructed.
However, tem-
to
is ashift
circuitto the
that other
producesvalue. an Inoutput
other words,
value the
of 0 output
or 1, whichwill flip or flop
remains between
constant two
until a
One
porarilyimportant
placing
1values1 under1 control
step
a 1 in
on this
the direction
upper
1 of external
0
input is
stimuli.
0
depicted
will force in the
the circuit
output in
to beFigure
0 As long as both inputs in the circuit in
1, 1.3.
whereas This
tem-is
pulse (a
a particular temporary
example change
from to
alower a 1 that
collection
inputof returns
circuits to 0) from another circuit
flip-flop. causes it
1) known notas ato A flip-flop
! porarily
Figure
to
is ashift
values
circuit
Let
porarily
placing
1.3
to
us
under
remain
the
that
consider
placing
a 10,on
other
produces
a 1
control
the
value.
this
on of
theoutput
an Inoutput
claim
the
other
upper
external
in
(whether
morewords,
value
input
stimuli.
will 0force
the
of
detail.
willAs
0
oroutput
or
the
1,
Without
force
long
willoutput
which
the
as
will
output
both
change.
flip
remains
knowing to
inputs
be 0.However,
orthe
be
flop between
constant
1,
in
current
whereas
the
tem-
two
until
output
circuittem-
in
a
Como nos foi designada, estapulse
of a
the
porarily tabela
(a
circuit de
temporary
placingin verdade
Figure
a 10,onchange de
1.3,
the um
to a
supposedescodificador
1 that
lower(whether thatreturns
the
input will0force 2:4
to
upper 0)e from
input another
is changed circuit
to 1 causes
while theit
Figure
to shift
lower 1.3
to
input remain
the other
remains the
value. output
In other
0 (Figure 1.4a).words,
This the
will 1) the
oroutput
causewilloutput
notoutput
will flip
to be 0.However, tem-
change.
ortheflop between two
esquerda encontra-se uma estrutura genrica
Let us do mesmo
consider this bloco
claim in combinatrio.
more detail. Mas the
Without knowing of current
the OR gate
output to
porarily
values
be 1, placing
under
regardless aof1 the
control onofthe
other upper
external inputinput
stimuli.
to willAs
this force
long
gate. the
In as output
both
turn, to inputs
inputs
both be in1, whereas
the
to circuit
the tem-
ANDin
qual o seu diagrama lgico? E o que of a
porarily
entrada
the circuitplacing
EN?
in Figure
a1,10,since
on 1.3,
the suppose
lower inputthatwill
theforce
upperthe input
output is changed
to be to 1 while the
0.However,
A entrada EN, de nome enable, Figure
gate
lower will
tal 1.3 remain
now
como
input be
o
remains nome the
0 output
the
indica,
(Figure (whether
other
pode
1.4a). input
ser
This 0 this
vista orcomo
towill 1)gate
causewillthe not
isenablechange.
already
output 1of(the
the output
OR gate tem-
pro-
to
duced Letby
porarily us consider
placing
the NOT a 1 this
on
gate claim
the upper
whenever in more
input
the detail.
will
lower Without
force
input the
of knowing
output
the to
flip-flop the
be 1,
is current
whereas
at 0). output
The tem-
out-
um interruptor, para ns, indicando be qual
of 1,
the regardless
a lgica
circuit que of
in Figureo the other
sistema
1.3, input
em
suppose to
questo this
usa.
thatwill gate.
thewhich In
Neste
upperthe turn,
input both
is inputs
changed to the AND
porarily
put
gate ofwilltheplacing
AND
now beagate
1,1 since
on thethe
will lower
then input
become
other input 1, force
towill means
thiscause
gate output that
is already tothe
be 0. to output
second
1of(the
1 while
input the
to
pro-
caso, quando o EN est a zero, quaisquerlower Let que
input
us sejam
remains
consider os I10
this o I0,
(Figure
claim o valor
1.4a).
in more de Y0,
This
detail.Y1, Y2,
Without the output
knowing the the
currentOR gate
output to
Y3 sempre 0, logo o nosso sistema duced
be
of active
1, byhigh.
the NOT
regardless
the circuit of gate
the whenever
other input theto lower
this input
gate. In ofturn,
the flip-flop
both is at to
inputs 0). the
TheANDout-
Figure
put 1.2 A in Figure
pictorial 1.3,thensuppose
representation of that
AND,1,the
OR, upper
XOR, and input
NOT is changed
gates as well to
as1their
while the
input
gateof
O diagrama lgico deste descodificador
lower willthenow
input
AND
remains
gate
obeseguinte:
1, sincewill the other
0 (Figure
become
1.4a).input
which
Thistowill
means
thiscause
gate that
isdiagrama
the already the
output1lgico
second
of(the
theoutput
input
OR gate
to
pro-
to
! and output
duced by
values
the NOT gate whenever the lower input
be 1, regardless of the other input to this gate. In turn, both inputs to the AND of the flip-flop is at 0). The out-
! Figure 1.2
put
gateof willthenow A pictorial
AND begate
representation
1, sincewill the
then of AND,1,OR,
become
other input towhich
XOR, and
thisOR means
gate
NOT that
gatesthe
is already
as well as their
second
1 (the
inputto
input
output pro-
! and output
duced
AND
I0 I0 by
values
theENNOT gate whenever the lower input of the
I1 I1 figura 19
flip-flop is at 0). The out-
! I0
Figure
put of 1.2
the A pictorial
AND gate representation
will then of AND,1,OR,
become XOR, and
which means NOT that
gatestheas well as their
second
diagrama lgico de um
inputto
input
! and output ANDvalues
Inputs Y0 Output
OR
Inputs
descodificador 2:4
Output
! Figure 1.2 A pictorial representation of AND, OR, XOR, and NOT gates as well as their input
! ANDvalues
and output
Inputs Y1Output
OR
Inputs Output
! AND
Inputs 0 0 0 Y2Output
OR
Inputs 0 0 0 Output
! Inputs
0 1 Output
0 Inputs
0 1 Output
1
! 0
Inputs 0
1 Output
0 Y3
1 0
1 0
Inputs
1 0
0
1 0
1
Output
! EN Output
0 0 1
1
Inputs
1
Inputs
0 1
0
1
Output
1
! 1 0
0
1 0
0 1
1
Inputs
0
0
1
Output
0por exemplo, 4:16, atravs
1 0
0
1 01
Inputs
0 1
1
0
1
Output
possvel, de forma a construir um descodificador, 1
1 0 0 1 0 1
em cascata.
de dois descodificadores 3:8, agrupando-os XOR 0
1 01 0
1 NOT cascata
0
1 10 0
1
Podemos recorrer a um bloco de decodificaro
0 1 para0 obter os termos mnimos 0 1 1
1 0 0 1 0 1
necessrios implementao de uma funoXOR booleana genrica.
! Inputs 1 1 1 Output NOT
Inputs 1 1 1 Output
0 x x 0 multiplexer 2:1
1 sada 1 0 0 I0
2n entradas 1 0 1 I1
1 1 0 I2
1 1 1 I3
!
A funo booleana que parte destes dispositivos muito prpria. Um
multiplexer 2:1 tem a seguinte expresso:
! equao 42
! Y = (I S ) + (I S) equao de um mux 2:1
0
! 1
1 entrada
!
!
A equao geral de um demux - abreviatura de demultiplexer - a seguinte,
considerando Ok como as nossas sadas e Din como entrada:
! equao 44
! Ok = EN. Din . mk (S) k = 0,...,2 n 1 equao geral de um demux
! 1:2n
possvel hierarquizar multiplexers. A chamada hierarquia de multiplexagem hierarquizar
existe muitas vezes por causa da falta de maiores multiplexers. Assim, conseguimos,
INTRODUO AOS SISTEMAS DIGITAIS 32
por exemplo, criar um mux 8:1 a partir de quatro 2:1 e um 4:1, como podemos ver a
seguir:
! figura 22
! mux 8:1 a partir de quatro
!
! muxs 2:1 e um 4:1
D1
S0
EN
D0
D1
S0
EN
D0
D1
S0
EN
D0
D1
S0
EN
D0
!
!
Q
Q
Q
!
!
! D0
! D1
! D2
D3
! Q
! S0
!
S1
! EN
!
Buers 3-state
Um multiplexer pode ser construido atravs de buffers tri-state - dispositivos buffers tri-state
lgicos que exibem trs estados possveis. Dois dos estados que estes podem criar j
so usados: a lgica 1 e a lgica 0. O terceiro estado, porm, denominado de alta-
-impedncia (Hi-Z) e neste que a lgica se comporta como um circuito aberto, isto , alta-impedncia
parecendo que a sada est, de certo modo, desligada, como se no tivesse significado
lgico. Um buffer tri-state pode ser usado ao invs das portas AND e NAND, sendo
que mais preferida, at mesmo por motivos econmicos.
! A OUT L H Hi-Z
! H L L
!
! H H H
!
O conceito de alta-impedncia pode ser traduzido, por enquanto, como uma
resistncia praticamente infinita, sem ligao. Atravs de buffers tri-state tambm
podemos criar estratgias diferentes de multiplexagem. Vejamos este exemplo de
multiplexagem revisitada, num multiplexer 2:1.
!
!
! figura 24
! buffers tri-state
!
!
!
form, as shown in Figure 1.2. Note that the AND, OR, XOR, and NOT gates are
in this
gate
output direction
whenever
exiting ontheis depicted
the lower
other.inputOne um
in theof
of
important
the
circuit
the circuito
instep
flip-flop
gate
Figure quewill
isinatthis
1.3.soma thendois
0). direction
Thisout-
The
become
is half-adder
1, which means that the second input to
is depicted in the circuit in Figure 1.3. T
operandos
aputFigure
deGates
ofum1.2
particularthebit cada,
example
A pictorial
AND
provide ethe
gate produz
from athen
representation
will
building umof resultado
collection
become
blocks de
of from
AND, OR, circuits
XOR,
1, dois
and
which bits,
a particular
known
NOT
which gates
means que
asas varia
example
flip-flop.
awell
that
computers entre
as their
the from
input
second
are A0 flip-flop
aeinput
constructed. 2.
collectionto of circuits known as a flip-flop. A fli
and output values Figure 1.2 A pictorial representation of AND, OR, XOR, and NOT gates as well as their input
isOne
a circuit
importantthat produces
step in this andirection
output value of 0 oris1,
is depicted awhich
circuit thatin
remains produces
constant an until
output
This ais value of 0 or 1, which remains constant u
XOR NOTin andthe circuit
output values Figure 1.3.
pulse
aFigure (a temporary
1.2 example
particular change
A pictorial from to
representationa 1 that
a collection returns
of AND, pulse
to 0)
OR, XOR,known
of circuits from(a
and NOTas temporary
another
gates change
circuit
as well as their
a flip-flop. to
causes a 1itthat returns to 0) from another circuit cau
input
A flip-flop
! to shift
Aand
is
AND
to the
output values
a circuit other value. In other words,
that produces an output value of 0 or 1, which theOR to shift to the other value. In other words,
output
inputs will flip or flop
outputs
ANDremains constant until between twoa figura the 25 output will flip or flop betwee
OR
! values under
Inputs control of external
pulse (a temporary change to a 1 that returns Output stimuli. As long
HS values
Inputs
to as
0) under
both
from control
inputs
another in
Output of
the
circuit external
circuit
causes in it half-adder
stimuli. As e respetiva
long as both inputs in the circ
! Figure 1.3
to shift AND remain
Inputs 0, the
to the other value.Output output (whether
In other words, the 0
A
or Figure
1)
Inputs will
B
1.3
not remain
HS
change.
OR will flip orOutput
output 0,
Cout
the
However,
flop between output tem- (whether 0
two tabela deInputs orverdade not change. However
1) will
! porarily placing
values under Inputs a 1 on the
control Output upper input will 0 porarily
force
of external stimuli. As long Inputs the Inputs
0 placing
output
as both Output to0 bea 11, on
whereas
inputs in the circuit in
Output
0the upper tem- input will force the output to be Output
1, whereas
! Let
porarily
of
B
the
us consider
Inputs Inputs
placing
circuit in
0 a
0Figure
this claim
Output
0 1 on the C in
Output more detail. Without
0 upper input will force the0outputInputs
1.3,
out
1 suppose that the upper of the
Let
Inputs
Inputs us
knowing
10circuit
input is
consider
Output the this
current
1 be 1, Output
to
in
01 Figure
changed to
claim
Output
whereas tem-
1.3,
1 while
in
output
suppose
more
the that
detail.
the
Without
upper
knowing
Inputs
input is
Output
the
changed
current o
to 1 whi
!
1
porarily placing 0 0a 1 on0the lower input will force the
1 0 1
1 0 0output0to be 0. 0
lowerLet input remains 0 (Figure 1.4a). This will lower
cause input
the outputremains
0 0 of the 0 (Figure
0OR gate1.4a). to This will cause0 0the output of the OR g
! 0 1 0 0 1 0
us consider1 1 this 0claim in more detail.1 Without1 knowing 1 the current output
00 1 10 0 1 1 inputs to the
be 1, regardless 1 0of theOutput
Inputs 0other input to this gate.be In 1, regardless
1turn,
0 both
Inputs of
1 inputs the
Output toother
the input
AND to this gate. In turn, both
of the circuit 1in1Figure 11.3, suppose that the upper1input
gate
lower
duced
will
by
nowremains
input
the
be 1, since
0 0
NOT gate
0 0
the other
(Figure
whenever the
!
input
1.4a). This
lower
thisgate
towill
input
gatewill
cause
ducedof
1
isthe
theby 0
is changed
now
already
output
the0
flip-flop
1 0
1 be11,(the
1 1 ofsince
NOT is0
to01 while the
the
gate
at
thegate
output
1 OR
whenever
0). The
other
pro-
out-
to input to this gate
the lower input
1 0
of the
1
1 1is already
1
flip-flop
1 (the outpu
is at 0). Th
Para
be somar 0operandos
1, regardless 1of the other 0 cominput mais que gate.
to this um In bitturn, temos
0 both
1 que
inputs assegurar
1 will to the AND a
put
transferncia of
gate will the AND
de transportes gate
now 1be01, since will then
(carries)
0the other become
entreinput 1,
vrioswhich
to bits.put of
means the
Paraistal,
this gate AND
that the gate
0 necessitamos
1already second
1 (the then
input
outputde um become
to
pro- 1, which means that the second inp
1
somadosduced by
XORthe
multi-bit, 1 1 gatewhenever
NOT
construdo 1 the lower NOT
custa de somadores input
completosof the1(em 1 inglsis
flip-flop at 0).
1full The out- somadores completos
adders).
! Figure
put of1.2 the ANDA pictorial
gaterepresentation
will then become of AND, 1,OR,which
XOR,Figure
and
means 1.2
NOT XOR A pictorial
gates
that as
thewell representation
as theirinput
second input to of AND, OR, NOTXOR, and NOT gates as well as their i
! AND
and output
XOR values NOT AND
OR OR
! AND
Inputs
Inputs 0 0 0 Output
Output
OR Inputs
Inputs
0
Inputs 1
Inputs
Output
Output
OutputOutput
Inputs
Inputs
Output
Output
! B
0 1
1 0
1
1
1 00 0
0 1
1 0
0
1
1
0
1
1
0
Inputs 1 1 0 Output Inputs COutput
out
Inputs
Inputs Output
Output InputsInputs
Inputs 1 OutputOutput
1Output 0 Inputs Output
0 0
0 porta
0 lgica XOR0 0 0
0 .
0 (exclusive-or), pelo que representada pelo smbolo 0 0 01 0 0 0 0
5 A porta que forma a sada HS uma
00 11
Inputs 01
Output 0 11 0 1Output
Inputs 10 0 0 1 1
11 00 01 1 0 1 0 1 0 1 0 1
101 101 100 10 10 1 1 10 1 1 1 1
0 1 0 0 1 1
1 0 0 1 0 1
1 1 1 1 1 1
INTRODUO AOS SISTEMAS DIGITAIS 34
Este circuito somador tem as seguintes equaes:
!
! Cout = A. B + A. Cin + B. Cin equao 45
! S = A B Cin equaes de sada de um
! somador completo
Dois operandos binrios de n bits podem ser somados com uma cascata de n
somadores completos cada um dos quais um bit do resultado. A esta cascata de
somadores completos damos o nome de ripple adder. A figura abaixo representa um ripple adder
ripple arder de quatro bits. O bit de transporte para o bit menos significativo (c0)
iniciado com o valor 0, e o bit de transporte (sada) para o seguinte somador est
conectado ao bit de transporte (entrada), do bit de seguinte significado.
!
!
! X3 Y3 X2 Y2 X1 Y1 X0 Y0 figura 27
! ripple adder
! X Y
C3
X Y
C2
X Y
C1
X Y
!
! S S S S
!
! S3 S2 S1 S0
0 0 1 1 1
A B
0 1 0 0 1
S 1 0 0 1 1
1 0 1 1 0
D
1 1 0 0 0
1 1 1 1 1
!
As equaes de sada so as seguintes:
! equao 46
! BOUT = AB + ABIN + BBIN equaes de sada de um
! D = A B BIN subtrator completo
!
!
35 INTRODUO AOS SISTEMAS DIGITAIS
Um somador completo pode realizar a operao de subtrao a - b, fazendo o
clculo de a + 1sc(b) + 1 (isto dado que -b = 1sc(b) + 1).
! equao 47
! COUT = AB + AC IN + BC IN operaes de subtrao por
! S = A B C IN um somador completo
! BOUT = ( A + B ) ( A + BIN ) ( B + BIN ) = AB + ABIN + BBIN
!D= A B BIN
!
Tambm podemos criar a operao de subtrao em cascata. Para tal, com um
ripple adder, basta fornecer as entradas A e B e o bit de transporte no bit menos
significativo com o valor 1.
!
Somadores carry-lookahead
A equao lgica para um bit de soma i de um somador binrio pode ser
simplesmente expressa por: equao 48
! Si = Ai Bi Ci expresso lgica para um bit
! Ci+1 = Ai Bi + Ai Ci + Bi Ci de soma i de um somador
! binrio
gerado
Na fase i gerado um carry se para alguma combinao de Ai e Bi produzido
Ci+1=1, independentemente das entradas a0, , ai-1, b0, , bi-1 e c0 . Denominemos g
como o sinal de gerao de carry. Assim,
! equao 49
! gi = Ai Bi expresso da gerao
!
Tambm na fase i propagado um carry se produzido Ci+1=1 na presena de propagado
tal combinao de entradas a0, , ai-1, b0, , bi-1 e c0 que causam ci=1. Denominemos
p como o sinal de propagao de carry. Assim,
! equao 50
! pi = Ai + Bi expresso da propagao
!
Por substituio, temos que:
! equao 51
! Ci+1 = gi + pi ci expresso final por
! substituio
Isto , uma fase produz um transporte (carry) se gera um transporte ou se
propaga um carry e o bit de transporte tem valor atual 1. De forma a eliminar um
provvel transporte iterativo ns expandimos o termo ci para cada fase i e
multiplicamo-lo para obter uma expresso AND-OR de segundo nvel. Usando esta
tcnica, podemos obter as seguintes quatro fases de adio:
! equao 52
! C1 = g0 + p0 c0 expresso das quatro fases
! C2 = g1 + p1c1 = g1 + p1 (g0 + p0 c0 ) = g1 + p1g0 + p1 p0 c0 de adio
! C 3 = g2 + p2 c2 = g2 + p2 (g1 + p1g0 + p1 p0 c0 ) = g2 + p2 g1 + p2 p1g0 + p2 p1 p0 c0
! C 4 = g3 + p3c3 = g3 + p3 (g2 + p2 g1 + p2 p1g0 + p2 p1 p0 c0 ) =
! = g3 + p3 g2 + p3 p2 g1 + p3 p2 p1g0 + p3 p2 p1 p0 c0
!
INTRODUO AOS SISTEMAS DIGITAIS 36
Somadores BCD
Se somarmos dois dgitos BCD (e carry) podemos obter uma soma que varia
entre 0 e 19. Vejamos a seguinte tabela:
0 0 0000 0 0000
1 0 0001 0 0001
2 0 0010 0 0010
3 0 0011 0 0011
4 0 0100 0 0100
5 0 0101 0 0101
6 0 0110 0 0110
7 0 0111 0 0111
8 0 1000 0 1000
9 0 1001 0 1001
10 0 1010 1 0000
11 0 1011 1 0001
12 0 1100 1 0010
13 0 1101 1 0011
14 0 1110 1 0100
15 0 1111 1 0101
16 1 0000 1 0110
17 1 0001 1 0111
18 1 0010 1 1000
19 1 0011 1 1001
Como podemos ver, no caso da notao binria, a partir do nmero 16, existe
carry, pelo que, para quatro bits, se compararmos com o cdigo BCD temos que somar
a quantidade 6 a partir do dgito 9 (exclusiv), de forma a fornecer correo perante o
clculo.
!
!
!
37 INTRODUO AOS SISTEMAS DIGITAIS
Unidade aritmtica e lgica (ALU)
Uma unidade aritmtica e lgica um dispositivo combinatrio que executa unidade aritmtica e lgica
qualquer operao aritmtica ou lgica (de um conjunto predefinido), sobre um par de
operandos de n bits. A operao a executar especificada com entradas de seleo de
funo.
0 0 0 1 F = A AND B - 1 + CIN F = A OR B
0 0 1 0 F = A AND B - 1 + CIN F = A OR B
0 1 0 0 F = A + (A OR B) + CIN F = A AND B
0 1 0 1 F = A AND B + (A OR B) + CIN F = B
0 1 1 0 F = A - B - 1 + CIN F = A XOR B
0 1 1 1 F = A OR B + CIN F = A OR B
1 0 0 0 F = A + (A OR B) + CIN F = A AND B
1 0 0 1 F = A + B + CIN F = A XOR B
1 0 1 1 F = A OR B + CIN F = A OR B
1 1 0 0 F = A + A + CIN F = 0000
1 1 1 1 F = A + CIN F=A
! S3
!
M A=B
CIN
! A0
B0
F0
!
A1 F1
B1
A2
! F2
B2
!
A3
B3 ! F3
INTRODUO AOS SISTEMAS DIGITAIS 38
Multiplicao de nmeros binrios
Para estudarmos a multiplicao de nmeros binrios devemos subdividir esta
seco em duas partes: multiplicao de nmeros sem sinal e multiplicao de nmeros
com sinal. Comecemos pela primeira.
Numa multiplicao de nmeros binrios sem sinal, os processos de
multiplicao obedecem s mesmas regras bsicas existentes no sistema decimal.
Vejamos o seguinte exemplo:
! figura 30
! 12 13 = 156 multiplicao binria sem
sinal
1 1 0 1 multiplicando
1 1 0 1 multiplicador
1 1 0 1
! 0 0 0 0
produtos
1 1 0 0 parciais
+ 1 1 0 0
1 0 0 1 1 1 0 0
!
Na multiplicao com sinal deve-se, a cada passo, fazer a extenso do sinal. Se
o multiplicador for negativo, a ltima cpia do multiplicando deve ser negada. Assim,
por exemplo:
figura 31
! 5 3 = 15 ! 5 3 = +15
! multiplicao binria com
sinal (2 exemplos)
1 0 1 1 1 0 1 1
1 1 0 1 1 1 0 1
0 0 0 0 0 0 0 0 0 0
1 0 0 1 1 1 1 0 1 1
1 1 1 0 1 1 1 1 1 0 1 1
! 1 1 0 1 1 ! 0 0 0 0 0
1 1 1 0 0 0 1 1 1 1 1 0 1 1
0 0 0 0 0 1 1 0 1 1
1 1 1 1 0 0 0 1 1 1 1 0 0 1 1 1
0 0 0 0 0 0 0 1 0 1
1 1 1 1 0 0 0 1 0 0 0 0 1 1 1 1
39 INTRODUO AOS SISTEMAS DIGITAIS
8. Sistemas Sequenciais
Como pudemos estudar na primeira unidade (ver Ambiente digital), existem
dois tipos genricos de circuitos: circuitos combinatrios e circuitos sequenciais.
Estudados os circuitos combinatrios, passamos agora para os sequenciais, com uma
abordagem algo semelhante com a dada at ao momento, embora o ambiente com que
trabalhamos agora, mude em grande parte.
!
Lgica sequencial versus lgica combinatria
Atrs foi referido que um sistema combinatrio um sistema que faz
corresponder diretamente uma entrada simblica xn a uma sada simblica ym, tal como
podemos ver na figura abaixo.
figura 32
um sistema combinatrio
x1 y1
X= Y=f(x) Y =
xn ym
figura 33
um sistema sequencial
X Y=f(x)t Y
!
!
Estruturas elementares de memria
Havendo feedback existe salvaguarda de informao por dados intervalos de
tempo at um evento como uma perturbao do sistema, o que pode provocar a
alterao do valor lgico atual.
A memria mais simples que se pode criar ou desenhar so inversores em
cascata, os quais constituem uma clula de memria esttica.
!
! figura 34
! 1
clula de memria esttica
! 0
INTRODUO AOS SISTEMAS DIGITAIS 40
Com este tipo de memria encontramo-nos com um grande problema: ento
como que escrevemos informao? Uma possvel soluo a quebra seletiva da
realimentao, instalando interruptores.
! figura 34
! quebra seletiva do feedback
! /LD
!
!
! A Z
!
Geralmente, a soluo mais apresentada um outro circuito, outro desenho:
um bi-estvel. Pela sua fcil aplicao e desenho, o bi-estvel uma forma muito usual bi-estvel
de apresentao da cascata de inversores.
!
! figura 34
! Vin1 Vout1
Q circuito bi-estvel
!
shown in Figure 1.2. Note that the AND, OR, XOR, and NOT gates are
!
ed by distinctively shaped symbols, with the input values entering on
!
and the output exiting on the other. Q_L
provide !
the building blocks from which Vin2
shown in Figure 1.2. Note that the AND, OR, XOR, and NOT gates arecomputers Vout2
are constructed.
ortant
ted bystep
ar example
in this direction
distinctively
from
and the output exiting a
shapedissymbols,
collection
depictedwith
of circuits
in thethe
known
circuit
as
!
inputinvalues
a
Figureentering
flip-flop.
1.3. Thison
A flip-flop
is
Em on the other.
regime estvel, a varivel Q designa-se como varivel de estado de
st provide
that produces
the an output valuefrom
elemento de memria. Sewhich
building blocks of 0 or 1, which remainsare
computers
atribuirmos
constant until a
valores constructed.
aleatrios para o arranque de uma
emporary change
ortant stepsimulao, to a
in this direction 1 that returns
is depicted to 0)
inquefrom
theocircuitanother circuit
in Figure causes
1.3. This it
is
the other value. In iremos
other constatar
words, the output willcircuito
flip or apresenta
flop between doistwo estados possveis e que os
ar example from a collection of circuits known as a flip-flop. A flip-flop
nder alterna num intervalo de tempo especfico. Mas entre os dois estados possveis,
t thatcontrol
produces of external
an output stimuli.
value of As0 long
or 1, as bothremains
which inputs in the circuit
constant untilina
remain 0,transio,
3emporary the output
change to adamos thatoreturns
1(whether nome de
0 or to1)0)meta-estabilidade,
will
fromnotanother
change.circuit dado
However, que
causestem-it um estado instvel da meta-estabilidade
placing a 1 mquina,
on the upperdesregulado,
input will na
forcemaior
the parte
output
the other value. In other words, the output will flip or flop between two das
to be vezes.
1, Quando
whereas tem- uma mquina se encontra
placing a 1 neste
on the ponto,
lower isto
input significa
will force que
the o estado
output
nder control of external stimuli. As long as both inputs in the circuit in to seguinte
be 0. imprevisvel e que depende de
s3 consider this claim
estmulos in more
aleatrios detail.
como Without
o rudo knowing
eltrico.
remain 0, the output (whether 0 or 1) will not change. However, tem- the current output
cuit in Figure
placing
ut remains
!
a 1 on 1.3,
placing a 1 Latch 0
suppose
the upper
(Figure 1.4a).
thatwill
input
This
the force
upperthe
will cause
input
output
the
is changed
to be 1, to
output of
1 whiletem-
whereas
the OR gate
the
to
on the lowerSR input will force the output to be 0.
ardless of the other input to this gate. In turn,
s consider this claim in more detail. Without knowing the current outputboth inputs to the AND
nowin
cuit beFigure
1, since 1.3,the other vimos
suppose
Como input
that theto this
upper gate is already
input
anteriormente, uma1 (the
isa changed to output
cascata de pro-
1 while the
inversores demos o nome de
the NOT gate
put remainsmemria. whenever
0 (FigureMais 1.4a).the lower input of
This will causeothe the flip-flop is
outputexemplo at 0).
of the OR Thegateout-
tode uma static latch. Uma
especificamente, primeiro trata-se latch
eardless
AND gate
of the will theninput become 1, which means that the second input to
latchother um circuito to this gate.
que In
permiteturn,que both inputs
dados to the
sejam AND
guardados e que hajam vrias
now be 1, transies
since the other durante inputumtodadothis intervalo
gate is already
de tempo.1 (the output pro-
theA pictorial
NOT gate representation
whenever of AND,
the OR, input
lower XOR, and
of NOT gates as well
the flip-flop is atas0).
their
The input
out-
values Existem vrios tipos de latches. Uma latch SR um circuito sequencial, numa latch SR
e AND gate will then become 1, which means that the second input to
cascata de portas lgicas NOR (portas OR com inversores). O diagrama lgico de uma
2 A pictoriallatch
D SR o seguinte:
representation of AND, OR, XOR, ORand NOT gates as well as their input
values figura 35
R
uts Output Inputs Output Q diagrama lgico de uma
D OR
latch SR
Q
1
bloco lgico de uma latch SR
1
R NOT
! S R Q QN
latch SR
! L L last Q last QN
!
!
L H L H
! H L H L
!
Se simularmos S = R = H podemos constatar que os complementos de Q
igualam-se, o que impossvel (Q = Q), pelo que na tabela se encontra a notao
not used.
De forma a concretizar a anlise de um sistema sequencial como este, hbito,
e til, fazer um diagrama de estados. Neste caso, e de acordo com a tabela de diagrama de estados
transies em cima, podemos criar o seguinte diagrama de estados:
!
!
!
SR = L L, L H
SR = H L
SR = L L, H L figura 37
! Q Q
! SR = H H L L SR = H H
!
! SR = L H SR = L L, H H SR = H L
! SR = L L
! Q Q
! H H
INTRODUO AOS SISTEMAS DIGITAIS 42
Mas este diagrama de estados contm um estado que est indicado como not
used. Quando tal acontece, podemos ocult-lo, dado que num diagrama mais real, s
se a mquina se iniciasse nesse estado que tal poderia existir. Assim, no h mal
nenhum em apresentar um diagrama como o seguinte:
!
! SR = L L, L H SR = L L, H L figura 38
! Q Q
SR = H L
Q Q diagrama de estados de uma
! L H SR = L H H L latch SR sem not used
! SR = H H
SR = H L
!
SR = L H
!
Q Q
L L
!
SR = H H SR = H H
SR = L L SR = L L
!
! DO NOT COPY
Nota! Note-se
HOWbem que a As
CLOSE figura contm
mentioned um
in the
other).sequencial
retorno
previous note,ambguo
minimum
In any case, the um circuito
ao may
an S-R latch estado L-H
go into
que vive
delay between
theou
negating
H-L. state ifnota
metastable
S and R are negated simultaneously. Often, but not always, a commercial latchs
IS CLOSE?
Como um circuito
specifications define simultaneously (e.g., S and R negated within 20 ns of each
de S realimentao
and R for them to be
DO NOT COPY
(feedback), a evoluo do sistema ao longo do tempo um aspeto
considered nonsimultaneous is closely related to the minimum importante a
pulse width specifi-
considerar. Assim, existem certos parmetros temporais, entre os quais, tempos de parmetros temporais
cation. Both specifications are measures of how long it takes for the latchs feedback
loop to stabilize during a change of state.
propagao e largura mnima de pulso. Vejamos a seguinte imagem.
figura 39
R
S
DO NOT COPY(1)
diagrama temporal de uma
latch SR
DO NOT COPY
(2)
DO NOT COPY
grandeza
be builtfrom
do nanossegundo,
NAND gates as shown importante saber In
in Figure 7-9(a). que existem
TTL and CMOSatrasos
logicnestes sistemas.
Os families,
tempos S-R de latches are useddiferem
propagao much more deoften than S-R latches
equipamento parabecause
equipamento,
NAND tal como o
gatesdearepropagao
tempo preferred over highgates.
deNOR para low pode ser diferente da de low para high. Com
As shown by the function table, Figure 7-9(b), operation of the S-R latch is
umasimilar
latch toSR uma transio low para high em S pode causar uma transio igual em
that of the S-R , with two major differences. First, S and R are active
DO NOT COPY
Q, olow,
queso provoca
the latch um tempoitsdeprevious
remembers propagao prprio,
state when S = Rtal como
= 1; a figura nos indica. De
the active-low
forma semelhante, uma transio de low para high em R pode
inputs are clearly indicated in the symbols in (c). Second, when both S and R arecausar uma transio de
highasserted
para low em Q, comboth
simultaneously, o tempo de propagao
latch outputs go to 1, notexpresso porS-R
0 as in the tpHL(RQ)
latch., como se pode
averiguar
Except na segunda
for these transio
differences, na figura.
operation of the S-R is the same as the S-R , includ-
ing timing and metastability considerations.
DO NOT COPY
A largura mnima de pulso uma especificao que usualmente dada para as largura mnima de pulso
entradas
Figure S 7-9
e R S-R
da latch. Tal
latch: (a) como
circuit se pode
design using ver
NANDnagates;
figura
(b)acima,
functionatable;
latch(c)pode ir para
logic symbol.
um meta-estado e permanecer assim durante algum tempo, aleatrio, se um pulso mais
pequeno
(a) S_L que a largura mnima de pulso tpw(min) (b) for aplicada QN
S_L R_L Q
em S ou (c)em R. A latch
Q
pode ir orpara
S
meta-estado sempre que tal situao 0ocorrer.
!
DO NOT COPY
S Q
0 1 1
0 1 1 0 R Q
43
the current
uppose that the upper input is changed to 1 whilepro-
other input to this gate is already 1 (the output the
never theThis
lower input of the
the flip-flop is the
at 0). The out-
re 1.4a). will causeINTRODUO
output of ORAOSgate SISTEMAS DIGITAIS
to
reninput
become 1, which
to this gate. In means
turn, that
boththe second
inputs input
to the ANDto
e other input NANDto thistalgate
comois already
podemos 1 (the output
ver na figurapro-
seguinte, tal como a tua tabela de estados de
tation of
never theAND, OR, input
lower XOR, and
transio. of NOT gates as well
the flip-flop
Podemos assim veratas
is their
0).
que Theinput
out- muitas semelhanas entre uma latch SR por
existem
en becomeNORs 1, whiche umameans
latchthat
SRthe
comsecond
NANDs. input to
OR
tation of AND, OR, XOR, and NOT gates as well as their input figura 40
inputs outputs
latch SR com portas NAND
S_L
utput Inputs Output Q
S_L R_L Q QN
e respetiva tabela de
OR
transio
e22
0 0 1 1
Chapter 1 Data Storage
0 1 1 0
Output Inputs Inputs Output Output QN
R_L
m, as shown in Figure 1.2.0 Note form, as shown in Figure 1.2.
that the AND, OR, XOR, Noteand that NOT
1the AND, 0 OR, XOR,
gates are
0 and1 NOT gates are
e 0
represented 0by distinctively shaped symbols, with the input values entering on
resented by distinctively shaped symbols, with the input values1 entering 1 on
22
! 0 1 last Q last QN
Chapter 1 Data Storage one side andother. 1the output exiting on the other.
e side and the output exiting 1 0on theOutput
Inputs
m, Gates
as shown
eresented
important
!
provide in the
bystep
Figure building
inPrimeiro,
1.2.
One0
this direction
Gates
1blocks
1 Note
0
that
important
is
1
provide
1from
0
the
depicted
step
the building
which
AND,in this
in the
OR,computers blocks
XOR, and
direction
circuit
from
areNOT
is depicted
invalues
Figure
which computers are constructed.
constructed.
gates
1.3.
in the
Thison
arecircuit in Figure 1.3. This is
distinctively form,
shapedS_L
a particular
0 1
as shown
e R_L
symbols,
example
in Figure
esto
with
1circuits from em
the1.2. Note
lgica
input that
active-low,the
a collection of circuits known
AND,
entering logo aislatch
OR, XOR, and NOT
as arecorda
flip-flop. o seu gates are
A flip-flop
articular
e side and the example from
output a
exitingcollection
represented
0on thethat
of by
other. known
distinctively as a
shaped flip-flop.
symbols, A flip-flop
with the input values entering on
estado passado is 1aquando
circuit S_L = R_L an
1 produces = output
1; as value entradas of 0 active-low
or 1, whichesto remains claramente
constant until a
circuit that
Gates provide produces an
the building output
one side
1 1blocks value
and of
the 0 or
output1, which
exiting remains
on the constant
other. until a
indicadas na representao
pulse (a temporary 1from
em bloco which
change computers
lgico, to aque 1 that are
se segue. constructed.
returns to 0) from another circuit causes it
eseimportant !
(a temporary step change
in NOT to a Gates
this direction 1 that is returns
provide
depicted to
the
in0)thefrom
building
to shift to the other value. In other words, the
another
circuit blocks
in circuit
Figurefrom 1.3.causes
which
This is
output
itcomputers are constructed.
will flip or flop between two
hift to the
!
other value.
articular example from avalues InOneother
collection words,
important
under
the
step
of circuits output
in
control known
this will flip
direction
of external
or flop
is between
depicted
flip-flop.
as a stimuli. AsAlong
in two
the
flip-flop circuit in Figure 1.3. This
as both inputs in the circuit
is
figura
in 41
ues under
!
control of
circuit that produces anFigureexternal
aoutput1.3 stimuli.
particular value remain
As
example
of 0 orlong
0, 1,
as
from
the
both
which a
output
inputs
collection
remains
S
in
of
Q constant
(whether
the
circuitscircuit
0 or 1)
known
until in as a flip-flop.
willa not change. However, bloco
A flip-flop
tem- lgico de uma latch SR
ure
se (a1.3
Output
arily
hift toplacing !
remain 0,change
temporary
a 1 on
the
NOT
output
Inputs
the In
is
to
porarily
upper
(whether
aacircuit
1 that
input
that
returns
placing
0produces
a
will force
or to
Output
1
1)0)
on
will
the
annot
from output
upper
the output
change.
another value
input
a 1tothat
to Rflip orbeflop
Q 1,
However,
of 0 or
circuit
will
whereas
1,tem-
causes
force
which
the
tem-
it
output
remains constant until a
to be 1, whereas tem-portas NAND
com
arily placing !
the other
a 1
value.
on
ues under control of external the
pulse
to
other
porarily
lowershift
Let
(awords,
input
to
temporary
placingthe
stimuli.thewill
us consider
force
other
As long
change
a 1output
on thewill
the
value.
lower
output
thisasclaim
In other
bothin to
input
inputs be
words,
more in
returns
will
0.
between
the
to 0)
force the
output
the circuit
detail. Without
from another circuit causes
two output to be 0.
will flip or flop between
inknowing the current output two
it
Let1.3
us consider
remain 0,this Segundo,
claim inquando
values moreunder ambos
detail.
control S_L
Without of eknowing
R_L
external so thealterados
stimuli. current
As long emas simultneo
output both inputsambos in the as circuit in
ure
Output the
Inputs ofInputs
output the(whether
circuitOutput 0Figure
or
inOutput 1) will
1.3, not
supposechange. thatHowever,
the uppertem- input is changed to 1 while the
he circuit in Figure
sadas vo 1.3,
arily placing a 1 on the upper suppose
Figure
para 1, e
inputthat
1.3 no the
remain paraupper
0, the
0, input
output
como is changed
(whether
acontecia to
na 01 while
or
latch1) the
will
SR. not
change.
exceo However,
destas tem-
lower input will
01.4a). remains
1
force 0the output
(Figure to beThis
1.4a). 1, whereas
will cause tem-the output of the OR gate to
er input remains 0
diferenas, (Figure
arily placing a 1 on the lower a porarily
operao This
placing
desta
input will will
a
latch1 cause
on the the
igual upper
output
da input of
latch the
will
SR, OR
force gate
the
incluindo tooutput
situaesto be 1,
de whereas
meta- tem-
be 11, regardless 0 force of thethe output
other input to be to 0.this gate. In turn, both inputs to the AND
1,Letregardless of the
thisother
estabilidade
us consider claim input
e porarily
tempos.
in will
more to this
placing
detail. gate.
a Without
1 on Inthe turn,lowerbothinput
knowing inputs
the will toforce
current the AND the output to be 0.
Inputs
gate Output
now be 1, since the other input to thisoutput gate is already 1 (the output pro-
ehewill
ed by
now
the
wer input remains
!be
NOT
1, since
gate
the
circuit in Figure 1.3, suppose
whenever
0 (Figure of
other
the
0
Let
duced bythat
1.4a).
input
us
the
circuit
of theThis
lower
1
to
consider
thethe NOT
in
this
upper
input
Figure
will
gate
this
cause of
1.3,
is
claim
gate input
whenever
the
will the
already
in more
is changed
flip-flop
suppose
thenoutput
1 (the
is
that
detail.
the lower
at
of thethe
output
0).
whilepro-
Without
to 1 input
The
upper
OR gate
the
of
out-
input
knowing the current output
the flip-flop is at 0). The out-
to is changed to 1 while the
of the AND
Latch
gate
SR
will
com put1enable
then
lower become
input
AND0 which
1,
remains
gate
0 means
(Figure that
become
1.4a). the
1, which
second
This will input
means
cause to the
that the second input to
output of the OR gate to
1, regardless of the other input to this gate. In turn, both inputs to the AND
e will now be 1, since be 1, regardless of the other input to this gate. In turn, both inputs to the AND
Umathe other
latch
Figure SR input
1.2 to thislatch
ouA pictorial
uma gate SRis already
representation sensvel 1 (the
of AND, soutput
OR, entradas
XOR, pro-
and NOTS egatesR, assempre.
well as No
their input
ure 1.2
ced by the NOT A pictorial gate
representation
gateewhenever will
of now
AND,
thevalues
lower be
OR, 1,
XOR,since
input of and the
NOT
the other
gates input
as
flip-flop is well to
as this
their
at valores gate
input
0). The out- is already 1 (the output pro-
entanto, comoand output
forma de facilitar a alternncia dos das entradas, podemos
output
of thevalues
AND gate will then duced becomeby the1,NOT which gatemeanswhenever that the the lower
secondinput input of tothe flip-flop is at 0). The out-
adicionar um put enable of the C. AND gate will then become 1, which means that the second input to
AND OR
ure AND
1.2 A pictorial representation of AND, OR, XOR,ORand NOT gates as well as their input
output values Figure 1.2 A pictorial representation of AND, OR, XOR, and NOT gates as well as their input
figura 42
S
and output values
Inputs Output Inputs Output
Inputs Output Inputs Output Q diagrama lgico de uma
AND OR
AND OR latch SR com enable
C
Inputs Output Inputs Output
Inputs Inputs OutputOutput Inputs Inputs Output Output QN
Inputs 0 0 0 Output 0 Output Inputs 0 0
0 0 0 R
0 1 0 0 0 0 0 1 1
0 1 0 1 0 0 0 1 1 1 0 1
Inputs
1 0 Output
0 1 1 1 Inputs
1 0 Output
1 1 1 1
1Latch
1 D1 Inputs Output
1 1 1
Inputs Output
0 0 0 0 0 0
0 1 0 0 0 0 1 0 0 0
As0 latches SR so teis
0 1 em termos
0 1 0 de controlo
1 de dadas aplicaes. Assim,
0 1 ns
1 0 0 1 1
1controlamos
1 1 atravs XOR
do valor
1 que
0 atribumos
0 1 1 s variveis R e S.
1 NOT
1 0 1
XOR
1 1pgina 1
A figura seguinte (na NOT seguinte) apresenta uma latch 1D.1O seu diagrama
1 latch D
lgico passvel de ser reconhecido a partir de uma latch SR com enable, com apenas
um inversor adicionado de forma a gerar Output
Inputs S e R atravs de DInputs
(entrada com o nome D
Output
Inputs Output Inputs Output
XOR de dados - data em ingls). Isto elimina
NOT o problema que tnhamos em latches SR, onde
XOR NOT
S e R podiam ser alterados em simultneo. A varivel de controlo de entrada de uma
latch D denominada de Inputs
C, mas tambm Inputs
Output pode ter os nomes de ENABLE, Output
CLK e G.
Inputs Inputs Output Output Inputs Inputs Output
Output
Inputs 0 0 0 Output Inputs 0 1 Output
0 0 0 0 1 1 0 1 1 0
0 1 1 1 0 1 1 0
Inputs
1 0 Output
1 1 1 0 Inputs Output
Inputs Output Inputs Output
1 1 0
0 0 0 0 1
be 1,Let
regardless of the
us consider thisother
claim input
porarily
in will
more to this
placing gate.
detail. Inthe
a Without
1 on turn, bothinput
lower
knowing inputs
the will toforce
current the AND
the output to be 0.
gate now be 1, since the other input to thisoutput
gate is already 1 (the output pro-
gate
of thewill nowin
circuit beFigure
1, since
1.3,the other
supposeLet usinput
that to this
consider
the upper gate
this is already
claim
input is 1 (the
inchanged
more output
detail.
to 1 Without
while pro-
the knowing the current output
duced by the NOT gate whenever the lower input of the flip-flop is at 0). The out-
44
duced by the NOT gate
lower input remains 0 (Figurewhenever
of the the
circuit
1.4a). lower
This in input
Figure
will of the
1.3,
cause the flip-flop
suppose
output is
that
of at
the
the 0). The
upper
OR gateout-
input
to is changed to 1 while the
put of the AND gate will then become 1, which means that the second input to
put of the AND gate will then become 1, which 0means
(Figure that the
1.4a). second
This will input
be 1, regardless of the other input to this gate. In turn, both inputs to the AND output of the OR gate to
lower input remains cause to
the
gate will now be 1, since the beother
1, regardless
input to of
thisthe other
gate INTRODUO
input to
is already this output
1 (the gate. Inpro- AOSboth
turn, SISTEMAS
inputs to theDIGITAIS
AND
Figure 1.2 A pictorial representation of AND, OR, XOR, and NOT gates as well as their input
Figure
duced 1.2
by theA pictorial
NOT gate gate
representation
whenever will
of
the now
AND, be 1, since
OR, input
lower XOR, and the
of NOT other input
gates as well
the flip-flop to
is atas0).this
their
The gate
input
out- is already 1 (the output pro-
and output values
and A lgica
put output
of thevaluesdeste componenteduced active-low,
by the NOT pelo
gate que tambm
whenever
AND gate will then become 1, which means that the second input to the tem
loweruma largura
input of themnima de
flip-flop is at 0). The out-
pulso, como requisito de putalternncia.
of the AND gate will then become 1, which means that the second input to
AND OR
Figure AND
1.2 A pictorial representation of AND, OR, XOR,ORand NOT gates as well as their input
and output values Figure 1.2 A pictorial representation of AND, OR, XOR, and NOT gates as well figura
as their input
43
D
and output values
Inputs Output Inputs Output
Inputs Output Inputs Output Q diagrama lgico de uma
AND OR
AND OR latch D
C
Inputs Output Inputs Output
Inputs Inputs OutputOutput Inputs Inputs Output Output QN
Inputs 0 0 0 Output 0 Output Inputs 0 0
0 0 0 0 1 0 0Section
0 7.2 0 Latches and Flip-Flops
0 1 441 1
0 1 0 1 0 0 0 1 1 1 0 1
DO NOT COPY
Inputs
1 0 Output
0 1 1 1 Inputs
1 0 Output
1 1 1
D
Inputs Output Inputs 1
Output
A 1representao
1 1 de bloco lgico de um
Q componente
1 1 1desta espcie a seguinte:
! 0 0 0
0 0
0 0C D Q 0 QN
0 0 1 0 0Q
! C 0 1 0
0 1 0
1 0 01 1 D
0 1
0
1 figura 44
! 1 0 0
1 0 D 0
Q
1 01 1 11 0 C
1 0 Q
1
DO NOT COPY
1 1 1 QN 1 10 x last 1 bloco lgico de uma
! XOR Q last QN NOT
1 1 1 1 1 1
XOR C NOTQ latch D
! (a)
DO NOT
NOT COPY
COPY
Inputs
D Output Inputs Output
DO
XOR
D Um exemplo de comportamento de XOR
NOTuma
Q latch D est dada na figura seguinte. NOT
C D Q QN
Quando C alterado, a sada Q segue D. Nesta situao, o latch diz-se aberto e o
C C
Inputs Output 1 0 0 1 D
InputsQ
Output
caminho de
Inputs Inputs
D at Q transparente;
Output Output o circuito
Inputs Inputs
tambm
1 1
Output
1 chamado
0
Output
deC transparent
Q
DO NOT
NOT COPY
COPY
latch por esta razo em particular. Inputs Quando
0 0 o QN
C Output
0 est 0negado,
x last Q olast
latch Inputs
QN fecha; a0 sada Q1 Output
Q
DO
0 0 0 0 1 1 0 1 1 0
fixa(a)o seu ltimo valor e enquanto C permanece negado (b) no h alterao (c) em resposta a
Figure07-131 Functional 1 behavior of a D1latch
0 for various 1
1 inputs. 0
D. Figure Inputs
1 7-12
0 DOutput
1 (a) circuit design 1using
latch: 1 0 Inputs
gates; Output
(b) function table; (c) logic symbol.
Inputs NAND Output Inputs Output
single D1(data)
1 input.0This eliminates the troublesome situation in S-R latches, figura 45
DO NOT
NOT COPY
COPY
0 0 0 0 1
where
D S and R may be asserted simultaneously.0 0 The control
0 input of a D latch, 0 1 diagrama temporal de uma
0 1 1 1 0
DO
labeled C 0 1 , CLK, or1 G, and is active low in 1 0
1 in0 (c), is sometimes
1 named ENABLE
latch D
C
some D-latch 1 0 1
1 1 designs.0
An example of a D latchs functional 1 1behavior 0 is given in Figure 7-13.
Q
When the C input is asserted, the Q output follows the D input. In this situation,
the
Figure
input
adjacentes
longer
DO NOT
DO
ent; theDe
NOT COPY
wherechanges
figura,
COPY
latch is7-13
said toFunctional
forma
circuit
singleis Dnegated,
ao input.
(data)
S and sinais
para
be openbehavior
mais
is often
the latch
componente.
Rinmay
response
be
que
and the path
to D, as
asserted
of a D
detalhada,
called
Quatro
eliminates
from
a transparent
Thiscloses; the
latch
a latch
input
D for
seguinte
output
theQtroublesome
long as C remains
simultaneously.
se propagam the D das
The
to Q output
various
retains
diferentes
entradas
inputs.is transpar-
for thisfigura
reason.incorpora
When the C os transparent
its lastinvalue
tempos
situation
negated.
controlC input
e Dof7-14.
and
a Dsada
tempos latch
de atraso
no so mostrados na
de latches,
S-R atraso
latch, Q. Por exemplo, nas
DO NOT
NOT COPY
COPY
More
labeled C indetailed
(c), is timing behavior
sometimes namedof ENABLE latch is shown
, CLK , or G,inandFigure
is active lowFour
in
transies (1)designs.
e (4) a latch inicialmente fechada
propagate efrom a entrada
the C or DD o oposto da sada
DO
different delay
some D-latch parameters are shown for signals that
Q.input
Portanto,
to Q quando
Antheexampleoutput.of aFor
DCexample,
alterafunctional
latchs oat seu valor
transitions 1para
behavior 1the
andis 4givena latch
latch isabre-se
7-13. e a sada Q muda
initially
in Figure
aps
Wheno atraso
the C inputtpLH(CQ) ou tpHL(CQ)
is asserted, .
the Q output follows the D input. In this situation,
Figure
the latch7-14
is saidTiming parameters for a D latch.D
to be open and the path from input to Q output is transpar-
D
C
DO NOT COPY
ent; the circuit is often called a transparent latch for this reason. When the C transparent latch
DO NOT COPY
input is negated, the latch closes; the Q output retains its last value and no
longer changes in response to D, as long as C remains negated.
More detailed timing behavior of the D latch is shown in Figure 7-14. Four
figura 46
diagrama temporal de uma
latch D (em detalhe)
DO NOT COPY
different delay parameters are shown for signals that propagate from the C or D
(1)
input to the Q output. For(2)
example,(3)at transitions 1 (4) and 4(5)the latch is initially
Q
DO NOT COPY
Figure 7-14 Timing parameters for a D latch.
DO NOT COPY
D tpHL(DQ) tpHL(CQ) thold
tpLH(CQ) tpLH(DQ) tpLH(DQ) tsetup
Copyright
C 1999 by John F. Wakerly Copying Prohibited
Embora(1)a latch (2)D elimine
(3)
o problema
(4)
da
(5)
latch SR de S = R = 1, ela no
elimina o problema da meta-estabilidade. Tal como presente na figura acima, h uma
Q
DO NOT COPY
zona sombreada (a terceira) onde a entrada D no deve mudar o seu valor, dado que
deve respeitar os tempos de setup - tempo mnimo antes do clock, dentro do qual as
tpLH(CQ)
tpHL(DQ) tpHL(CQ)
tpLH(DQ) tpLH(DQ)
thold
tsetup
tempo de setup
!
C D Q QN
latch D
! 0 x last Q last QN
! 1 0 0 1
! 1 1 1 0
!
Flip-ops
Nas seces anteriores referimos sempre latches, como circuitos sequenciais.
Mais que as latches, os flip-flops so o prximo e ltimo exemplo de circuitos
sequenciais que vamos aprender nesta disciplina. Mas qual a diferena entre ambos?
Os latches so sistemas que analisam as suas entradas continuamente e que mudam as
suas sadas em qualquer instante, independentemente de qualquer sinal de relgio
(clock). J os flip-flops so sistemas sequenciais que analisam, normalmente, as suas flip-flops
entradas e que mudam as suas sadas apenas em instantes determinados por um sinal
de relgio.
!
Flip-op D edge-triggered
Um flip-flop D edge-triggered combina um par de latches D, tal como flip-flop D edge-triggered
mostrado na figura seguinte, de forma a criar um circuito que copia a sua entrada D e
muda as duas sadas Q e QN apenas quando h uma transio low para high no clock
(edge-triggered). O primeiro latch denominado de master. Este latch sempre aberto master
enquanto CLK 0. Quando a entrada de relgio CLK muda o seu valor para 1, a latch
master fechado e a sua sada transferida para a segunda latch, denominada de
slave. A latch slave est aberta enquanto o CLK est com valor 1, mas muda apenas slave
no incio deste intervalo, porque a master est fechada e incapacitada de mudar at ao
resto do intervalo.
!
! figura 47
! C C Q QN
um flip-flop D edge-triggered
CLK
!
A representao em bloco lgico a seguinte:
!
! figura 48
! D Q
bloco lgico de um
! CLK Q
flip-flop D edge-triggered
!
O tringulo na entrada CLK, no flip-flop D edge-triggered, indica que existe
comportamento edge-triggered, ou seja, que ele reage transio low para high e
INTRODUO AOS SISTEMAS DIGITAIS 46
denominado de dynamic-input indicator (em portugus, indicador de entrada
dinmica). A figura seguinte mostra o comportamento funcional deste flip-flop num
diagrama temporal. Note-se que na figura o sinal QM corresponde sada da latch
master. Notemos tambm que a varivel QM muda apenas quando CLK est a 0.
Quando CLK muda para 1, o valor atual de QM muda para Q, e QM permanece
assegurado em relao a uma possvel mudana at que 7.2
Section o CLK retorne
Latches a 0.
and Flip-Flops 443 Section 7.2 Latches and Flip-Flops 443
D
D
CLK
CLK
QM
DO NOT COPY
COPY figura 49
diagrama temporal de um
flip-flop D edge-triggered
DO NOT COPY
QM
QN
QN
Q
Q
COPY
DO NOT COPY
Figure 7-16 Functional behavior of a positive-edge-triggered D flip-flop.
COPY
Figure 7-16 Functional behavior of a positive-edge-triggered D flip-flop.
A figura acima mostra o comportamento do flip-flop, ao longo do tempo, mais
Like a D latch, the edge-triggered D flip-flop has a setup and hold time
a pormenor.
window a D Todos
Likeduring latch,
whichthe theosD tempos
edge-triggered
inputs must de not atraso
flip-flopThis
D change. sowindow
has a medidos
setupoccurs aaround
and hold partir
time do incio de uma
transio
window
the triggeringlow edge
during para
which high
of the
CLK do isCLK,
D, inputs
and must
indicatednotdado
change.queThis
by shaded esse in oFigure
window
color nico
occurs acontecimento
around
7-17. If que causa
DO NOT COPY
the triggering edgetimesof CLKare, not
andmet, is indicated by shaded color in Figurego to7-17.
a sta-If
COPY
umathemudana
setup and hold de estado de sada. the flip-flop output will usually
the
ble,setup
though andunpredictable,
hold times are not or 1met, the flip-flop output will usually go to will
a sta-
ble, though como uma 00latch
Tal unpredictable, orstate
state.
D, In
1 state. um
In
some cases,
someflip-flop however, the output
D edge-triggered
cases,0however, willtambm tem os seus
oscillate or go to a metastable halfway between and 1, as the output
shown at the
tempos
oscillate deor go
second-to-last setupclock etick
hold,
in thedurante
to a metastable state
figure. halfway
If theos flip-flop
quais as
between 0 and
goes suas
into entradas
1, the
as shown
metastable no devem mudar. Ao
at the
tempo
state, de
second-to-last setup e tode
clock tickhold,
in the juntos,
on itsIfdamos
figure. the only oafter
nome
flip-flop goes deintojanela de estabilidade.
the metastable Esta janela janela de estabilidade
DO NOT
NOT COPY
it will return a stable state own a probabilistic delay, as
DO COPY
state, it willinreturn
explained to a stable It state on itsbeown onlyinto
after a probabilistic delay, as
ocorre, neste\secref{metest}.
caso, algures canentre
also aforced
transio a stable
de state by applying
estados low para high do clock,
explained in \secref{metest}.
another triggering clock edge It withcana also
D inputbe forced into the
that meets a stable
setup-state
andby applying
hold-time
devidamente
another
requirements, indicado
triggering clockatedge
as shown na figura
with
the last a D seguinte.
clock input
tick inthat Se no
themeets
figure. houver
the setup- and consistncia
hold-time entre tempos de
setup eAhold,
requirements, o shown
as flip-flop at the
negative-edge-triggered muito
lastDclockprovavelmente
tick simply
flip-flop in the figure. ir the
inverts para clockuminput,estadoso imprevisvel: 0 ou 1.
negative-edge-triggered
DO NOT
NOT COPY
Emthatalguns
all casos,takes
the action no place
A negative-edge-triggered entanto, afalling
sadasimply
onDtheflip-flop vaiofoscilar
edge CLK_L;the
inverts ou entra
by clock
convention, num
input, flip-flop
aso estado meta-estvel,
Dnegative-edge-triggered
DO COPY
falling-edge
that all triggertakes
the action is considered
placena onto thebefalling
active low. edge The flip-flops
CLK_L; byfunction table a D flip-flop
como podemos constatar penltima reaof sombreada convention,
da figura. Se o flip-flop entrar
and logic symbol
falling-edge triggerareisshown in Figure
considered to be7-18.
active low. The flip-flops function table
emandmeta-estabilidade,
Some
logic D flip-flops
symbol are shown eleinasynchronous
have retornar
Figure 7-18.um inputsestado
that mayestvel
be used por to forcesi the
prprio, aps um
asynchronous inputsatraso
probabilstico.
flip-flop
Some Tambm
to aDparticular
flip-flops havepode
state independent ser forado
asynchronous of the CLKa
inputs mudar
and
that be para
D inputs.
may These
used toum estado
inputs,
force estvel, aplicando
the preset
asynchronous inputs
DO NOT
NOT COPY
typically
outro
flip-flop tolabeled
relgio comPRefeito
a particular (preset) and CLR (clear),
state triggering-edge,
independent of the CLK behave
com andumalike the set
entrada
D inputs. andDinputs,
These reset
que vaiclear de encontro com
preset
DO
ostypically
COPY
temposlabeled de setup PR e(preset)
hold, and como CLR (clear), behaveno
representados likeltimo
the setsombreado
and reset clear da figura.
Figure 7-17 Timing behavior of a positive-edge-triggered D flip-flop.
Figure 7-17 Timing behavior of a positive-edge-triggered D flip-flop.
figura 50
DO NOT COPY
D
diagrama temporal de um
DO NOT COPY
D
Q
DO
Q
NOT COPY
DO NOT COPY tpLH(CQ) tpHL(CQ)
thold
tsetup
thold
tpLH(CQ)
Copyright 1999 tpHL(CQ)
by John F. Wakerly tsetup
Copying Prohibited
Os flip-flops
Copyright podem
1999 by John estar
ligados, assim, em
F. Wakerly cascata,
Copying pelo que constituem um
Prohibited
bloco lgico importante em lgica sequencial: o registo de deslocamento (shift register). registo de deslocamento
Uma grande vantagem desta lgica o facto do funcionamento ser viabilizado por uma
correta articulao dos parmetros temporais, o que perfaz atrasos de propagao que
excedem largamente os tempos de hold, o que garante que o andar seguinte guarde o
valor (por muito que temporariamente) corrente antes que este seja substitudo por um
novo valor.
Existem muitos outros flip-flops, sendo os mais interessantes para o estudo, os
flip-flops JK e T (toogle).
47 INTRODUO AOS SISTEMAS DIGITAIS
Caracterizao analtica
De forma a fazermos uma caracterizao analtica de um sistema sequencial, caraterizao analtica
um dos passos essenciais a escrita e clculo da equao caraterstica. equao caraterstica
Tomando o estado seguinte como funo booleana do estado presente e das
entradas de excitao de uma latch/flip-flop, conseguimos chegar respetiva equao
caraterstica. Vejamos dois exemplos a partir das tabelas de transio:
!
!
! figura 51
!
S
equaes caratersticas a
! Q 00 01 11 10 Q 0 1
partir das tabelas de
! 0 transio num K-map
! 0
0 0 x 1 0 1
! 1 1 0 x 1 1 0 1
!
!
R
!
! Q + = S + QR Q+ = D
!
Para cada latch/flip-flop importa saber que estmulos devem ser aplicados
para induzir uma determinada mudana de estado. A partir dos diagramas de estado,
podemos construir as tabelas de excitao. tabelas de excitao
!
! tabela 14
! Q SR D
! 00 0X 0
tabela de excitao
!
! 01 10 1
! 10 01 0
! 11 X0 1
!
Em suma, a seguinte tabela carateriza alguns dos comportamentos de alguns
latches/flip-flops:
figura 52
DO NOT COPY
bloco combinatrio F memrias lgica de sada G
Next-state Logic F State Memory Output Logic G
sistema sequencial sncrono
output
sada
a analisar
input
entrada MAX
excitao
excitation
DO NOT COPY
EN
EN
D0 Q0
D Q
EN
CLK Q
DO NOT COPY
Q0
Q0
D1 Q1
D Q
DO NOT COPY
CLK Q
Q1
Q1
CLK
DO NOT COPY clock signal
sinal de relgio
current state
estado atual
DO NOT COPY
excitation
excitation equation
the current state of the machine. We have named the signals on the correspond-
ing D inputs D0 and D1. These signals provide the excitation for the D flip-flops
at each clock tick. Logic equations that express the excitation signals as func-
tions of the current state and input are called excitation equations and can be
derived from the circuit diagram:
49 INTRODUO AOS SISTEMAS DIGITAIS
Ento, como tnhamos no nosso esquema metdico, a primeira etapa de
preparao de valores e equaes, logo comecemos por traduzir as equaes de
excitao, caratersticas, de transio e de sada.
! equao 53
equaes de excitao:! D0 = Q0 . EN '+ Q0 '. EN
equaes de excitao
! D1 = Q1 . EN '+ Q1 '.Q0 . EN + Q1 .Q0 '. EN
!
equaes caratersticas: ! Q0 * = D0 equao 54
! Q1 * = D1 equaes caratersticas
! equao 55
equaes de transio: ! Q0 * = Q0 . EN '+ Q0 '. EN
equaes de transio
! Q1 * = Q1 . EN '+ Q1 '.Q0 . EN + Q1 .Q0 '. EN
!
equao de sada: ! MAX = Q1Q0 EN equao 56
! equao de sada
Se repararmos bem, as equaes de excitao correspondem s do bloco
combinatrio F e as equaes caratersticas aos flip-flops usados (memrias).
A segunda etapa serve para gerar uma pr-anlise atravs de tabelas, entre as
quais as de transies, estados e de estados/sadas.
!
! tabela 15
! EN EN EN
tabela de transies
! Q1 Q0 0 1 S 0 1 S 0 1
! 00 00 01 A A B A A, 0 B, 0
tabela 16
! tabela de estados
!
01 01 10 B B C B B, 0 C, 0
tabela 17
! 10 10 11 C C D C C, 0 D, 0
tabela de estados/sadas
! 11 11 00 D D A D D, 0 A, 1
!
! tabela de transies tabela de estados tabela de estados/sadas
!
A terceira e ltima etapa completa a anlise, atravs do desenho de um
diagrama de estados.
!
! figura 53
! EN = 0 EN = 0
diagrama de estados
! (MAX = 0)
EN = 1
(MAX = 0)
! A B
!
(MAX = 0)
!
! EN = 1 EN = 1
! (MAX = 1) (MAX = 0)
!
!
! EN = 1
! D C
!
(MAX = 0)
EN = 0 EN = 0
! (MAX = 0) (MAX = 0)
Let us consider this claim in more detail. Without knowing the cur
of the circuit in Figure 1.3, suppose that the upper input is changed to
50
lower input remains 0 (Figure 1.4a). This will cause the output of the
be 1, regardless of the other input to this gate. In turn, both inputs
INTRODUO
gate will nowAOS SISTEMAS
be 1, since DIGITAIS
the other input to this gate is already 1 (the
duced by the NOT gate whenever the lower input of the flip-flop is at
Faamos agora uma pequena variao do exemplo put of anterior.
the AND gateParawilltal,then become 1, which means that the seco
consideremos o mesmo circuito com uma pequena alterao: MAX agora passa a
MAXS (por questes de distino dos casos); MAXS agoraFigure 1.2 com
s conta Q0 e representation
A pictorial Q1, e of AND, OR, XOR, and NOT gates as well a
no com
456 EN. Vejamos
Chapter o esquema.
7 Sequential Logic Design Principles and output values
figura 54
DO NOT COPY
bloco combinatrio F memrias lgica de sada G
Next-state Logic F AND
State Memory Output Logic G OR
re-anlise do sistema
output
sada
anterior (modificado)
input
entrada
excitao
excitation
Inputs Output
MAX
MAXS Inputs O
DO NOT COPY
EN
EN
D0 Q0
D Q
EN
CLK Q
Inputs Output Inputs Output
0 0 0 0 0 0
DO NOT COPY
Q0 0 1 0 0 1 1
1 0 0 1 0 1
Q0 1 1 1 1 1 1
D1 Q1
D Q
DO NOT COPY
CLK Q
Q1
XOR NOT
Q1
DO NOT COPY
Inputs Output Inputs Ou
clock signal
sinal de relgio
current state
estado atual
CLK
! Inputs D flip-flops.
Figure 7-38 Clocked synchronous state machine using positive-edge-triggered Output Inputs Output
! 1 0signals as1func-
at each clock tick. Logic equations that express the excitation
1 1 and can 0 be
! excitation equation
EN = 0
tions of the current state and input are called excitation equations
EN = 0
figura 55
!
DO NOT COPY
derived from the circuit diagram:
diagrama de estados
1 EN + Q0 EN
= =Q0
! A D0 EN B
D1 = Q1 EN + Q1 Q0 EN(MAXS
+ Q1= 0) Q0 EN
! (MAXS = 0)
! By convention, the next value of a state variable after a clock tick is denot-
ed by appending a star to the state-variable name, for example, Q0 or Q1.
DO NOT
!
COPY
* suffix
Using the characteristic equation of D flip-flops, QEN ==D1, we can describe the
! EN = 1
next-state function of the example machine with equations for the next value of
! the state variables:
! Q0 = D0
DO
!
NOT COPY
Q1 = D1
! D EN = 1 C
Substituting the excitation equations for D0 and D1 , we can write
!
(MAXS = 0)
Q0 = Q0 EN + Q0 EN
(MAXS = 1)
! EN = 0 Q1 = Q1 EN + Q1 Q0 EN + Q1 Q0 EN
EN = 0
! Copyright 1999 by John F. Wakerly Copying Prohibited
!
! EN tabela 18
! S 0 1 MAXS
tabela de estados/sadas
!
!
A A B 0
! B B C 0
! C C D 0
! D D A 1
! S*
51 INTRODUO AOS SISTEMAS DIGITAIS
Mas que diferenas estruturais existem entre este ltimo exemplo e o anterior?
No primeiro caso a sada como depende diretamente da entrada pode alterar-se de
forma assncrona. J no segundo caso como a dependncia apenas relativa ao estado
a sada varia de forma sncrona com o clock.
!
Mquinas de Mealy e de Moore
Esta pequena (grande) diferena no comportamento das sadas desta ltima
constatao, permite-nos ilustrar, na prtica, dois modelos de Mquinas de Estado
Finitos (MEF): o modelo de Mealy e o modelo de Moore. O modelo ou mquina de modelo de Mealy, modelo de
Mealy tem sadas que podem ter comportamento assncrono com o clock porque tm Moore
dependncia combinatria com as entradas.
! equao 57
! yi = f [ xn1 ,..., x0 ,Qm1 ,...,Q0 ] equao geral de uma
! mquina de Mealy
Por outro lado, a mquina de Moore tem sadas que tm um comportamento
sncrono com relgio porque dependem exclusivamente das variveis de estado.
! equao 58
! yi = f [Qm1 ,...,Q0 ] equao geral de uma
! mquina de Moore
Vejamos, em esquema, o conceito da mquina de Mealy.
!
! sadas dependem da entrada
figura 56
! esquema de funcionamento
! ! ! de uma mquina de Mealy
! transio de estado
registo do estado gerao da sada
!
entradas excitao estado sadas
lgica combinatria estruturas da lgica combinatria
F memria G
!
!
!
!
! clock
!
Vejamos tambm, em esquema, o conceito da mquina de Moore.
!
!
! transio de estado
!
registo do estado
!
gerao da sada figura 57
! entradas
excitao estado sadas esquema de funcionamento
!
lgica combinatria estruturas da lgica combinatria
F memria G
de uma mquina de Moore
!
!
!
!
! clock
0 0 1 0 1 0
0 1 0 0 1 1
0 1 1 1 0 0
1 0 0 1 0 1
1 0 1 1 1 0
1 1 0 1 1 1
1 1 1 0 0 0
!
Chapter 1 Data Storage
Vejamos agora um exemplo com flip-flops do tipo D. A tabela de excitaes seria algo
deste gnero.
form, as shown in Figure 1.2. Note that the AND, OR, XOR, and NOT gates are
! represented by distinctively shaped symbols, with the input values entering on
one side and the output exiting on the other.
Gates provide
Q2 the
Q1 building
Q0 blocks
Q2+ from
Q1+ which Q0+ computers
D2 D1 are constructed.
D0 tabela 20
One important step in this direction is depicted in the circuit in Figure 1.3. This is tabela de excitaes
22 example
a particular 0 Chapter0 1 Data Storage
from a 0collection0 0
of circuits 1
known0as a flip-flop.
0 1
A flip-flop
is a circuit that0 produces
0 an 1output 0value of 1 0 or 1,0 which0 remains 1 constant 0 until a
pulse (a temporary change to a 1 that returns to 0) from another circuit causes it
to shift to the other
0 value.
1 In0 otherform,
words,as
0 1theshown
output
1 in Figure
will0 flip or11.2.
flop Note
between
1 thattwothe AND, OR, XOR, and NOT gates are
values under 0control1of external represented
stimuli. As by distinctively
long0 as both inputs shaped
in the symbols,
circuit in with the input values entering on
1 1 0 1 0 0
one side and the output exiting
Figure 1.3 remain 0, the output (whether 0 or 1) will not change. However, tem- on the other.
porarily placing1 a 1 on 0 the upper
0 input
1 Gates provide
will0 force the
1the output
1 building
to be 1blockstem-
0 1, whereas from which computers are constructed.
porarily placing1
a 1 on
0
the lower
1
input
One
1
will1
force
important 0
the output
step in
1
to
this be
1
0.
direction 0 is depicted in the circuit in Figure 1.3. This is
Let us consider this claim in more detail. Without
a particular example knowing
from the current output
a collection of circuits known as a flip-flop. A flip-flop
of the circuit in
1 Figure 1 1.3, suppose
0
is1that the1 upper
a circuit 1 input1is changed
that produces an 1 to 11 while
output valuetheof 0 or 1, which remains constant until a
lower input remains 0 (Figure 1.4a). This will cause the output of the OR gate to
1 1 1 pulse
0 (a0 temporary
0 change
0 0 to a 1 0 that returns to 0) from another circuit causes it
! be 1, regardless of the other input to this gate. In turn, both inputs to the AND
gate will now be 1, since the othertoinput
duced by the NOT
As equaes de gate whenever
excitao so asthe
shifttotothis
values
thegate
other value. In
is already other
1 (the words,
output pro-the output will flip or flop between two
lower input of the flip-flop is at 0). The out-As long as both inputs in the circuit in
under
seguintes:
control of external stimuli.
!! put of the AND gate will then become Figure1,1.3 whichremain
means 0, that
the the
outputsecond (whether
input to0 or 1) will not change. However, tem-
porarily placing a 1 on the upper input will force the output to be 1, whereas tem-
! and output values
Q1 representation porarily
Figure 1.2 A pictorial of AND, OR,placingQ1 aNOT
XOR, and 1 on the
gates aslower input
well as their
!
input figurato59be 0.
willQ1force the output
Let us consider this claim in more detail. Without knowing equaesthe
decurrent
excitao via
output
Q2
Q1Q0 00 01 11 10 Q2
of00 01 11in Figure
the circuit
Q1Q0 10 00 01
1.3, suppose that 11 10 input is changed to 1 while the
the upper K-map
Q2
Q1Q0
k
0 1
AND
0 0 1 0 lower0 input
1 0
OR
remains 1 !!
0 (Figure
0 01.4a).
0 This1 will0 cause the output of the OR gate to
be 1, regardless of the other input to this gate. In turn, both inputs to the AND
1 1 Inputs
0 0 1 1 gate
Output 0 will
1 now be 1,
0Inputs
!
1 since 1the other input
1Output
1 0to this
1 gate is already 1 (the output pro-
duced by the NOT gate whenever the lower input of the flip-flop is at 0). The out-
!!
Q0 Q0 Q0
put of the AND gate will then become 1, which means that the second input to
Inputs Output Inputs Output
D0 = Q00=0Q0 10 D1 =1.2Q1
Figure A pictorial
0D2 = Q2 Q1.Q0
Q0 0 0representation of AND, OR, XOR, and NOT gates as well as their input
0 1 0 and output values 0 1 1
and output values
Figure 1.2 A pictorial representation of AND, OR, XO
put
duced
gate
be
lower
of
and output values
Figure 1.2 A pictorial representation of AND, OR, XO
put of Inputs
duced by the NOT gate whenever the lower in
gate will
be 1, regardless of the other input to this gate
lower input remains 0 (Figure 1.4a). This will
of the circuit in Figure 1.3, suppose that the up
1 1
of the
1
Let us consider this claim in more detail. W
will
XOR
AND
Inputs 1 1
XOR
Inputs 1 1
AND
by
Vejamos a implementao:
the AND gate will then
!!
under
to the other
placing
temporary
now control
now be 1, since the other input to th
the
figura 60
AND agate
remainschange
Inputs
Inputs
Inputs
Inputs
!!
1 0
0 1
0 0
1 0
0 1
0 0
1
1
0
0
1 1
0 1
0 0
NOT
be 1, since
5V
of the
1 onwill
gate
!!
value.
0 (Figure
Output
Output
Output
Output
of external
other
whenever
0
1
1
0
1
0
0
0
0
1
1
0
1
0
0
0
Q0 Q1 Q2
the other
In other
C C0 0 C
upper
suppose
0 0 0
Output
Output
0
Output
to a1.4a).
Output
input words,
CLKInputs Output
0 1 Inputs
0 Output
0 1 1
become
become 1, whi
1 thatThis
1 0 0 1 0 1
input will
stimuli.
the
0 0 0 1 1 0 1 1 1 1
input to
1
to this the
that
0 1 1 1 0
lower
returns
1, whi
1 0 1
the
Asthi
will
1 1 0
gateo
for
or
lo
o
INTRODUO AOS SISTEMAS DIGITAIS 54
Sequncias de contagem no standard
Os contadores tambm podem efetuar contagens no completas ou irregulares.
Vejamos um contador mdulo 5.
!
! figura 61
!
! 110
!
Se passarmos isto para uma tabela de excitaes, obtemos o seguinte.
!
Q2 Q1 Q0 Q2+ Q1+ Q0+ tabela 21
0 0 0 0 1 0
tabela de excitaes
0 0 1 x x x
0 1 0 0 1 1
0 1 1 1 0 1
1 0 0 x x x
1 0 1 1 1 0
1 1 0 0 0 0
1 1 1 x x x
!
As equaes de excitao so as seguintes:
! equao 62
! D2 = Q0 ! D1 = Q1+ Q0Q2 ! D0 = Q2Q1
! equaes de excitao
Self-starting
No arranque de um contador (power-up) ele pode assumir qualquer estado,
mesmo algum que no est includo no diagrama de estados desejvel. Mas o que que
acontece se o sistema cair num estado no includo no diagrama inicial? desejvel
que qualquer que seja o estado inicial ao fim de um qualquer nmero finito de
contagens o contador entre no diagrama de estados previsto. Um sistema com esta
capacidade diz-se um sistema com self-starting. Vejamos este exemplo: self-starting
!
! figura 62
! 000 010 011 101
exemplo de sistema com
! self-starting
! 110
!
!
! 100 111 010
!
Neste exemplo prova-se, a posteriori, que o sistema goza de self-starting.
!
!
!
55 INTRODUO AOS SISTEMAS DIGITAIS
Contadores MSI
Os contadores MSI so blocos sequenciais de contagem com complexidade contadores MSI
mdia. As principais vantagens da sua utilizao so a sua versatilidade, a capacidade
de programao paralela, ter um clear sncrono ou assncrono, conter modos de hold e
obter flags de fim de contagem. Os dois componentes MSI em estudo so os 74x161
e o 74x163. Estes contadores tm um processo de contagem muito prprio.
O contador componente 74x163 tem um modo de contagem normal, com um
aviso de fim de contagem.
!
Registos de deslocamento
Um registo de deslocamento um registo de n bits com preparao para registo de deslocamento
deslocar dados guardados em uma posio a cada pulso de relgio. A figura abaixo
mostra a estrutura de um registo do tipo serial-in-serial-out. A entrada serial, SERIN,
especifica um novo bit a ser deslocado para uma sada a cada pulso do relgio. Este bit
aparece ento, na sada do nosso sistema, SEROUT, depois de n pulsos de relgio, e
perde-se um pulso depois. Assim, um registo serial-in-serial-out de n bits pode ser
usado para atrasar um sinal n pulsos de relgio.
!
! SERIN D Q 1Q
figura 63
registo serial-in-serial-out
!
! CLOCK CLK
!
! D Q 2Q
!
! CLK
!
!
!
! D Q SEROUT
! CLK
!
!
As famlias tradicionais de lgicas MSI fornecem entre muitos outros, registos
de deslocamento de 4 e 8 bits. Estas partes MSI so usadas muito raramente, nos dias
que correm, porque qualquer outro tipo de registo de deslocamento pode ser fornecido
atravs de PLD ou FPGA (assuntos a abordar na disciplina de Laboratrio de
Sistemas Digitais (a1s2)). No entanto, ser-nos- til olhar para uma parte MSI, de
forma a obter uma ideia sobre a complexidade de um registo de deslocamento e do seu
detalhe interno.
O componente 74x194 um registo MSI de 4 bits, bidirecional, do tipo
parallel-in-parallel-out. O seu diagrama lgico est expresso na figura seguinte (da
pgina seguinte). O componente da figura anterior era unidirecional porque fazia
deslocamento num e num s sentido. O 74x194 um componente bidirecional porque o
seu contedo pode ser deslocado em qualquer uma de duas direes, dependendo da
entrada. As duas direes tm os nomes de esquerda (left) e direita (right), mesmo
que o esquema possa no estar desenhado dessa forma. Neste componente em
especfico, esquerda significa na direo de QD para QA, e direita significa na direo
de QA para QD.
INTRODUO AOS SISTEMAS DIGITAIS 56
figura 64
registo
parallel-in-parallel-out
! tabela de verdade do
!
funo S1 S2 QA* QB* QC* QD*
componente 74x194
! hold 0 0 QA QB QC QD
!
!
shift left 1 0 QB QC QD LIN
! load 1 1 A B C D
!
Note-se que a entrada LIN (left-in) est concetualmente localizada na parte
direita do chip, mas a entrada serial para deslocamentos para a esquerda. Isto
tambm se aplica entrada RIN.
O componente 74x194 tambm chamado, muitas vezes, de registo de
deslocamento universal porque pode ser usado para funcionar como muitos outros registo de deslocamento
registo a ele inferiores. universal
Outros registos de deslocamento so os de contadores, como os contadores com
feedback em anel e o de Johnson (tambm conhecido como twisted ring). anel, Johnson, twisted ring
E assim termina o programa de Introduo aos Sistemas Digitais. Para
continuar a estudar, no seguimento deste documento vem uma de duas disciplinas.
Dependendo do percurso curricular, possvel escolher entre os apontamentos de
Arquitetura de Sistemas Operativos ou Laboratrio de Sistemas Digitais, ambos do
primeiro ano, segundo semestre (a1s2).
!
INTRODUO AOS SISTEMAS DIGITAIS 58
Ambiente Digital!
Analgico versus Digital .........................................................................................................2
lgebra de Boole ....................................................................................................................3
Portas lgicas e flip-flops ........................................................................................................4
Cdigos!
BCD (Binary Coded Decimal) ...............................................................................................13
Cdigo AIKEN e Excess-3 (XS3) ..........................................................................................14
Cdigo de Gray ....................................................................................................................14
Deteo de erros em sistemas digitais.................................................................................15
Cdigos CRC ........................................................................................................................16
lgebra de Boole!
Postulados ............................................................................................................................16
Valores, Operadores e Expresses ......................................................................................17
Dualidade ..............................................................................................................................17
Teoremas ...............................................................................................................................18
Operadores compostos ........................................................................................................18
Funes booleanas ...............................................................................................................19
Formas cannicas .................................................................................................................20
Blocos Combinatrios!
Lgica de Polaridade ............................................................................................................29
Descodificadores (decoders) ...............................................................................................29
Codificadores (encoder) .......................................................................................................30
Multiplexers e demultiplexers ...............................................................................................31
Buffers 3-state .......................................................................................................................32
Circuitos Aritmticos!
Circuitos somadores .............................................................................................................33
Somadores carry-lookahead .................................................................................................35
Somadores BCD ...................................................................................................................36
Unidade aritmtica e lgica (ALU) .......................................................................................37
Multiplicao de nmeros binrios .......................................................................................38
59 INTRODUO AOS SISTEMAS DIGITAIS
Sistemas Sequenciais!
Lgica sequencial versus lgica combinatria ....................................................................39
Estruturas elementares de memria .....................................................................................39
Latch SR ................................................................................................................................40
Latch SR com portas NAND .................................................................................................42
Latch SR com enable ............................................................................................................43
Latch D ..................................................................................................................................43
Flip-flops ...............................................................................................................................45
Flip-flop D edge-triggered ....................................................................................................45
Caracterizao analtica .......................................................................................................47
Blocos sequenciais!
Contadores............................................................................................................................52
Sequncias de contagem no standard...............................................................................54
Self-starting ...........................................................................................................................54
Contadores MSI ....................................................................................................................55
Registos de deslocamento ...................................................................................................55
2 edio. O contedo deste documento foi escrito, em grande parte, por Rui Lopes, tendo-se baseado, em grande parte, e at copiado, dos apontamentos disponibilizados pela
professora Augusto Marques Ferreira da Silva, regente da disciplina de Introduo aos Sistemas Digitais, da Universidade de Aveiro, no ano letivo de 2013/2014. Algumas imagens
provm da mesma fonte, que a principal deste texto. Digital Design: principies and practices, WAKERLY, John F., Pearson Prentice Hall, 2006, 4 edio; Digital Circuits and
Microprocessors, TAUB, Herbert. McGrawHill, Singapura,1985; Introduction to Digital Logic Design,HAYES, John P..Addison-Wesley, Michigan, 1993. Fundamentals of Logic
Design, ROTH, Charles H. Jr.. Cengage Learning. Minnesota, 2010. Todas estas obras foram consultadas entre 16 de setembro de 2013 e 30 de janeiro de 2014. Rui Lopes 2014
Copyright: Pela Creative Commons, no permitida a cpia e a venda deste documento. Qualquer fraude ser punida. Respeite os autores e as suas marcas. Original - This work is
licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/
by-nc-nd/4.0/deed.en_US.