Você está na página 1de 23

Digital Logic Circuits

Sources
Lecture Notes
Introduction to Electronics, D Cory, J Freidberg, MIT
Digital Logic Part 1, Part 2, Part 3
http://www.mit.edu:8001/courses/6.071/lectures/L21.pdf
http://www.mit.edu:8001/courses/6.071/lectures/L22.pdf
http://www.mit.edu:8001/courses/6.071/lectures/L23.pdf

Technical Information Sciences 1, B. Blatter, Swiss Federal Institute of


Technology

Books
Building Scientific Apparatus, John H Moore, Christopher C. Davis, Michael A
Coplan, Perseus Books.

WEB
www.play-hookey.com
http://www.ee.surrey.ac.uk/Projects/Labview/gatesfunc/
Boolean Postulates

0⋅0 = 0 0+0 = 0
1 ⋅1 = 1 1+ 0 = 1
1⋅ 0 = 0 1= 0
1+ 0 = 1 0 =1
1+1 = 1
Laws of Boolean Algebra
Communicative Redundance
A+ B = B + A A + A⋅ B = A
A⋅ B = B ⋅ A A + A⋅ B = A + B
Associative
( A + B) + C = A + ( B + C ) A + A⋅ B = A + B
( A ⋅ B) ⋅ C = A ⋅ ( B ⋅ C ) A ⋅ ( A + B) = A
Distributive A ⋅ ( A + B) = A ⋅ B
A ⋅ (B + C) = A ⋅ B + A ⋅ C 0+ A= A
A + ( B ⋅ C ) = ( A + B) ⋅ ( A + C ) 0⋅ A = 0
( A + B) ⋅ (C + D) = A ⋅ B + A ⋅ D + B ⋅ C + B ⋅ D 1+ A = 1
de Morgan
1⋅ A = A
A⋅ B ⋅C = A + B + C
A + B + C = A⋅ B ⋅C A+ A =1
Identities A⋅ A = 0
A+ A = A
A⋅ A = A
AB + AB = A
( A + B) ⋅ ( A + B) = A
Logic Gates & Boolean Expression

OR A+ B
AND coincide A⋅ B
Buffer A
NOT invert A
NOR not of quantity A or B A+ B , A ⋅ B (not A and not B)
NAND A⋅ B , A+ B
XOR anti coincide A⊕ B , ( A ⋅ B) + ( A ⋅ B) , ( A + B) ⋅ A ⋅ B
NXOR equivalence A⊕ B , A⋅ B + A⋅ B

NAND and NOR are universal functions and can be used to construct any of the others.

NOT NAND NOR


Logic Gates & Boolean Expression
Equivalents (1)
Logic Gate NAND Equivalent NOR Equivalent
NOT
A AA=A

AND
A AB
B AB=AB

NAND

A
OR A
AB=A+B
B
B
Equivalents (2)
Logic Gate NAND Equivalent NOR Equivalent
NOR A AB=A+B
A
A+B
B
B

XOR A

A
XNOR B
Binary Adder
Adding: Adding binary numbers is just like adding decimal numbers;
whenever the result of adding one column of numbers is greater
than one digit, a 1 is carried over to the next column to be added.
1 1
2010 = 0 0 0 1 0 1 0 0
Example: 8710 = 0 1 0 1 0 1 1 1
0 1 1 0 1 0 1 1

Subtraction: This operation is similar to decimal subtraction. The only


potential point of confusion is that when “borrowing” from one column a
102 (=210) is carried over (not just a 1) to the next column. A trick to
subtracting binary numbers is to add the 2’s compliment of the
subtracting number to the true binary representation of the number from
which it is subtracting.
+1910 = 0 0 0 1 0 0 1 1
Example: -710 = 1 1 1 1 1 0 0 1
Sum = 0 0 0 0 1 1 0 0
States of Binary Adder
Binary Adder (4 different states)
input x1,x2, carry of previous addition State
output: y, carry
01,10
Carry=0 Carry=0
00 01,10
Result=0 Result=1

00
Input
11 00
11

Carry=1 Carry=1
01,10 11
Result=0 Result=1
01,10

11
Output
Logical Expression
Input Output Min Max
x1 x2 ci y ci+1 y ci+1 y ci+1
000 00 x1+x2+ci x1+x2+ci
001 10 x1x2ci x1+x2+ci
010 10 x1x2ci x1+x2+ci
011 01 x1x2ci x1+x2+ci
100 10 x1x2ci x1+x2+ci
101 01 x1x2ci x1+x2+ci
110 01 x1x2ci x1+x2+ci
111 11 x1x2ci x1x2ci
Input
Circuit

Output
Half Adder

Alternative Representation Half-adder symbol


A0
B0 Σ0 A0 Cout A Cout
HA
Σ0 B Σ
Cout B0

These circuits add two one-bit numbers and produce one two-bit number with
a carry.
Full Adder
Full-Adder:
A1 A C full-adder symbol
HA A
Cout Cout
B1 B Σ A C
Cin FA
HA
B Σ
Cin B Σ Σ1
Full Adder Implementation

A0 Cout

B0 Σ0
Cin
4bit Adder
Now, with the half-adders and full-adders, a multi-bit adder can be
constructed:

4-bit Adder:
A3 B3 A2 B2 A1 B1 A0 B0

A3A2A1A0 A B Cin A B Cin A B Cin A B


+ B3B2 B1B0 FA FA FA HA
Σ4Σ3Σ2 Σ1Σ0 Cout Σ Cout Σ Cout Σ Cout Σ

Σ4 Σ3 Σ2 Σ1 Σ0
Adder / Subtractor

{ high adds
low subtracts

when high,
invert B input
A4 B4 A3 B3 A2 B2 A1 B1
Cin Cout Cin 2’s compliment
Add 1

Σ4 Σ3 Σ2 Σ1
least significant bit
(do not repeat)
Decoder
Y0

Y7
Encoder
Only one of the input lines is allowed to be active.
N input lines to log2(N) output lines.
Encoder Example

+5V Rpull-up
10K Negative
16
(0) 9 VCC Logic
7 8 9 (1) 8
(1) 7
(BCD) +5V 7x330Ω Common-anode +5V
LED display
74SL147 “9” 0 a
(1) 6 a
7447 b 1 b a
4 5 6 (1) 5 (0) (1) A
(1) 4 Q0 0 c 1 c f b
Q1 (1) (0) d 0 d g
(1) 3 A1 0
(1) (0) e e
1 2 3 (1) 2 Q2 A2 0 f e c
(1) (0) (1) f d
1 Q3 A3 g 0 g
0 (1) 8 dp dp
Positive
Keypad 0
Logic
(BCD)
“9”
Arithmetic Logical Units
• Shift Register (Division or Multiplication by 2)
X0 X7
f0

Y0 Y7
Example: X: 0110 0111
f=1 Division Y = 0011 0011
f=0 Multiplication Y = 1100 1110
Arithmetic Logical Units
• General ALU

A, B: input
fi: select arithmetical function
Zi: state indicator of ALU,
e.g. negative, carry,
normally transmitted into
condition code register
Arithmetic Logical Units
• Example simple ALU
Logical Unit
Selected fucntion:
f0 f1 function
0 0 A*B
0 1 A+B
1 0 not B
1 1 A+B+Ci with carry

Decoder Full Adder

Você também pode gostar