Escolar Documentos
Profissional Documentos
Cultura Documentos
Subtrator e Somador
BCD
Subtrator de 4 bits
Soma
de nmeros binrios:
INPUT
VCC
XOR
INPUT
VCC
Cin
XOR
OUTPUT
INPUT
VCC
AND2
10
AND2
A[3..0]
VCC
INPUT
OR2
OUTPUT
12
B3
B
Cout
OUTPUT
Overflow
somador1bit
Cin
S3
Cout
A3
B2
3
A2
B
A
S
Cin
S2
Cout
somador1bit
A1
B
A
Cin
somador1bit
Cout
S1
A
S
somador1bit
Cin
S0
GND
A0
B0
VCC
INPUT
B1
11
B[3..0]
OUTPUT
S[3..0]
Monitoria Sistemas Digitais 2007.1 {fbla, rgo, jpmk, thfp, fcm} at cin.ufpe.br
Cout
Subtrator de 4 bits
Subtrao
de nmeros binrios:
Monitoria Sistemas Digitais 2007.1 {fbla, rgo, jpmk, thfp, fcm} at cin.ufpe.br
Subtrator de 4-bits
Nmeros de 4 bits
em Complemento a 2
Monitoria Sistemas Digitais 2007.1 {fbla, rgo, jpmk, thfp, fcm} at cin.ufpe.br
Subtrator de 4 bits
Com
nmeros em complemento a 2, a
subtrao pode ser representada como uma
soma:
A B = A + (- B)
Dessa
Subtrao:
Transformar B em B;
Somar
A e B
Monitoria
Sistemas Digitais 2007.1 {fbla, rgo, jpmk, thfp, fcm} at cin.ufpe.br
Subtrator de 4 bits
Lembrando
B3
B
Cout
OUTPUT
Overflow
somador1bit
Cin
S3
Cout
A3
B2
B
A
S
somador1bit
Cin
S2
Cout
A2
B1
B
A
S
Cin
S1
Cout
somador1bit
1
B
A
S
somador1bit
S0
GND
Cin
VCC
INPUT
A0
B[3..0]
VCC
INPUT
A1
A[3..0]
B0
OUTPUT
S[3..0]
s inverter B!
Crie
~B
Seletor
Seletor
Sada Sada
1
0
1 1
1 1
1
B 0XOR
Seletor!!
1
Monitoria Sistemas Digitais 2007.1 {fbla, rgo, jpmk, thfp, fcm} at cin.ufpe.br
Monitoria Sistemas Digitais 2007.1 {fbla, rgo, jpmk, thfp, fcm} at cin.ufpe.br
Analizando a soma de
A[3] com B[3]...
A[3]
B[3]
Cin
Cout
Cout
00
Overflow
=
Cin
XOR
Cout
1
0
0
1
00
0
00
11
00
11
11
11
Monitoria Sistemas Digitais 2007.1 {fbla, rgo, jpmk, thfp, fcm} at cin.ufpe.br
Monitoria Sistemas Digitais 2007.1 {fbla, rgo, jpmk, thfp, fcm} at cin.ufpe.br
Adicionar 1...
Monitoria Sistemas Digitais 2007.1 {fbla, rgo, jpmk, thfp, fcm} at cin.ufpe.br
Calcular overflow
Monitoria Sistemas Digitais 2007.1 {fbla, rgo, jpmk, thfp, fcm} at cin.ufpe.br
atividade:
Somador BCD
Binrio (8 bits)
BCD
10
00001010
0001 0000
21
00010101
0010 0001
102
01100110
Monitoria Sistemas Digitais 2007.1 {fbla, rgo, jpmk, thfp, fcm} at cin.ufpe.br
Somador BCD
So
5: 0101
6: 0110
7: 0111
8: 1000
9: 1001
Monitoria Sistemas Digitais 2007.1 {fbla, rgo, jpmk, thfp, fcm} at cin.ufpe.br
Somador BCD
A representao
Monitoria Sistemas Digitais 2007.1 {fbla, rgo, jpmk, thfp, fcm} at cin.ufpe.br
Somador BCD
Para
Mas
Subtraindo
Somador BCD
Como
Ento
R 10 = R + (- 10) = R + (10110)
Como
10 = R + 0110
Monitoria Sistemas Digitais 2007.1 {fbla, rgo, jpmk, thfp, fcm} at cin.ufpe.br
Somador BCD
E
Analizando
11xx
1x1x
1xxxx (9 + 7 = 16 | 1001 + 0111 = 10000)
Monitoria Sistemas Digitais 2007.1 {fbla, rgo, jpmk, thfp, fcm} at cin.ufpe.br
forma incremental...
Monitoria Sistemas Digitais 2007.1 {fbla, rgo, jpmk, thfp, fcm} at cin.ufpe.br
forma incremental...
Monitoria Sistemas Digitais 2007.1 {fbla, rgo, jpmk, thfp, fcm} at cin.ufpe.br
forma incremental...
Monitoria Sistemas Digitais 2007.1 {fbla, rgo, jpmk, thfp, fcm} at cin.ufpe.br
atividade:
de leitura
http://www.cin.ufpe.br/~if675/arquivos/aulas/2003-2/unidade1/aula07.pdf
Monitoria Sistemas Digitais 2007.1 {fbla, rgo, jpmk, thfp, fcm} at cin.ufpe.br
Sistemas Digitais
Subtrator e Somador
BCD