Professional Documents
Culture Documents
Computer Organization
Fall 2013
Boolean Algebra
and
Digital Logic Gates
1
Boolean algebra
Just like Boolean logic!
Well call propositions variables
Well still use names like p, q, r, s, etc.
But variables can only have values 1 or 0
instead of True / False
2
<3>
Boolean algebra
The negation operation is written as a
horizontal bar above the variable name or above
the value
_
0_ = 1
1=0
Boolean algebra
Logical Or is a plus sign +
0+0 = 0
0+1 = 1
1+0 = 1
1+1 = 1
Boolean algebra
Logical And is multiplication sign *
0*0 = 0
0*1 = 0
1*0 = 0
1*1 = 1
AB Y
0 0 0
0 1 0
1 0 0
1 1 1
OR
AB Y
0 0 0
0 1 1
1 0 1
1 1 1
NOT
A Y
0 1
1 0
Some Laws of
Boolean Algebra
Commutative laws: a+b = b+a, ab = ba =b*a
Distributive laws: a+(bc) = (a+b)(a+c),
a(b+c) = ab+ac
Identity laws: a+0 = a, a*1 = a
Complement laws: a+ = 1, a* = 0
<8>
Boolean algebra
and Boolean Logic
___
F(x,y)
And
x
y
xy
Or
x
y
x+y
Nand
x
y
xy
Nor
x
y
x+y
Xor
x
y
xy
x
y
z
x
y
z
xyz
x+y+z
10
x
y
x+y
(x+y)y
__
Answer: (x+y)y
Or (xy)y
11
xy
xy
___
__
Answer: xy
Or (xy) xy
12
x
y
x+y
13
x
y
x+y
x+y
(x+y)x
14
x y (x + y)(xy)
x
y
x+y
xy
xy
(x+y)(xy)
xy
15
1. Identity
A* 1=A
A* 0= 0
A+1=1
A+0=A
2. Complement
A+ = 1
A*=0
Distributivity Law
A(B+C) = AB + AC
A+BC = (A+B)(A+C)
A
B
C
A
B
A
C
A
B
C
A
B
A
C
16
Associativity
(A+B) + C = A + (B+C)
C
A
B
A
B
C
(AB)C = A(BC)
C
A
B
A
B
C
DeMorgans Law
(A+B) = A B
(AB) = A + B
AC + AB + B C
= AC + BC
17
DeMorgans Law
Y = AB = A + B
Y=A+B=A B
A
B
A
B
A
B
A
B
1-<18>
Bubble Pushing
Pushing bubbles backward (from the
output) or forward (from the inputs)
changes the body of the gate from AND to
OR or vice versa.
Pushing a bubble from the output back to
the inputs puts bubbles on all gate inputs.
A
B
A
B
A
B
Y
<19>
0+0 = 0
0+1 = 1
1+0 = 1
1+1 = 10
x
0
0
1
1
y
0
1
0
1
Carry Sum
0
0
0
1
0
1
1
0
Carry is x AND y
Sum is x XOR y
The circuit to compute this is called a half-adder
20
Half Adder
Truth Table
x
Sum
y
Carry
carry
sum
0
0
1
1
0
1
0
1
0
0
0
1
0
1
1
0
21
The half-adder
Sum = x XOR y
Carry = x AND y
x
y
x
y
Sum
Carry
Carry Sum
Sum
Carry
22
0
1
1
0
0
0 0
1 0
1 0
23
x y c carry sum
1 1 1 1
1
1 1 0 1
0
1 0 1
1 0 0
0 1 1
1
0
1
0
1
0
0 1 0
0 0 1
0 0 0
0
0
0
1
1
0
24
x y c s1 c1 carry sum
c
x
y
s1
X
HA
HA
S
S
1
1
1
1
0
0
0
0
1
1
0
0
1
1
0
0
1
0
1
0
1
0
1
0
0
0
1
1
1
1
0
0
1
1
0
0
0
0
0
0
1
1
1
0
1
0
0
0
1
0
0
1
0
1
1
0
C
C
c1
c
25
HA
s0
C
C
FA
s1
X
Y
FA
s2
X
Y
FA
X
Y
...
x0
y0
x1
y1
x2
y2
x3
y3
s3
c
27
29
Flip-flops
Consider the following circuit:
30
Memory
A flip-flop holds a single bit of memory
The bit flip-flops between the two NAND
gates