Professional Documents
Culture Documents
04 Logic Gates
04 Logic Gates
04 Logic Gates
Or is a plus
0+0 = 0
0+1 = 1
1+0 = 1
1+1 = 1
And is multiplication
0*0 = 0
0*1 = 0
1*0 = 0
1*1 = 1
F(x,y)
x+y
(x+y)y
y
__
Answer: (x+y)y
Or (xy)y
x
xy
xy
y
___
__
Answer: xy
Or (xy) xy
x+y
x+y
(x+y)x
x y (x + y)(xy)
x+y
xy
xy
0
(x+y)(xy)
xy
10
211= 128 + 64 + 16 + 2 + 1
= 27 + 26 + 24 + 21 + 20
= 1*27 + 1*26 + 0*25 + 1*24 + 0*23 + 0*22 +
1*21 + 1*20
= 11010011 in binary
11
12
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
15
The half-adder
Sum = x XOR y
Carry = x AND y
Carry Sum
16
0
1
1
0
0
0 0
1 0
1 0
17
x y c carry sum
1 1 1
1 1 0
1 0 1
1 0 0
0 1 1
0 1 0
0 0 1
0 0 0
0
18
x y c s1 c1 carry sum
1 1 1 0 1
1 1 0 0 1
1 0 1 1 0
1 0 0 1 0
0 1 1 1 0
0 1 0 1 0
0 0 1 0 0
0 0 0 0 0
s1
c1
19
20
...
21
22
23
Flip-flops
Consider the following circuit:
24
Memory
A flip-flop holds a single bit of memory
The bit flip-flops between the two NAND
gates
Hexadecimal
A numerical
from 0-15
range
26
From
ThinkGeek
(http://www.thinkgeek.com)
27
Also from
ThinkGeek
(http://www.thinkgeek.com)
28
DEADBEEF
Many IBM machines would fill allocated
(but uninitialized) memory with the hexadecimal pattern 0xDEADBEEF
Decimal -21524111
See http://www.jargon.net/jargonfile/d/DEADBEEF.html
0xDEAD = 57005
Now add one to that...
30