5. A non exhaustive list of semiconductors…
• Diamond
• Silicon
• Germanium
• Selenium
• Tellurium
For a more extensive list please refer to: -
http://en.wikipedia.org/wiki/List_of_semiconductor_materials
6. Atomic composition
• Lets look at the atomic composition of a couple of
these semiconductors in their pure form.
• An even number of
valence electrons (outer
shell electrons)
• 4 valence electrons in
both elements.
8. Getting your semi on…
• A lack of spare electrons in the Silicon lattice
makes it difficult for electrical current to flow.
• Electrical current flows when electrons can skip
along the material.
• This is why semiconductors are not called
conductors – they need a little helping hand.
9. Lets get doped up…
• Semiconductor ‘Doping’ is a technique where a
trace amount of a second material is added to the
semiconductor to make it less pure.
• By doing so, we can alter the electro-magnetic
properties of the semiconductor.
10. Lets get doped up…
• Arsenic has 5 valence electrons.
• Adding a trace amount of arsenic to
Silicon can have a nice side effect.
• Lets look at the atomic composition Arsenic.
12. Types of doping…
• An excess of electrons in the lattice has now made
the Silicon take on a negative charge (because
electrons are negatively charged).
• This is called N-Type Arsenic doped Silicon.
13. Types of doping…
• Doping can also be used to provide a shortage of
electrons. Any ideas on what you would use to do
this?
• Doping with Boron (which has only 3 valence
electrons) will result in positively charged Silicon.
This is called P-Type Boron doped Silicon.
15. • So we can create a nice semiconductor with Silicon
by increasing the number of free electrons – this is
great for our mundane circuitry, but what else can
we use it for?
• Lets layer the stuff…
Uses for our doped semiconductor?
16. Uses for our doped semiconductor?
• In the presented arrangement we have P-Type
Silicon (with electron holes) layered above N-Type
Silicon (with an excess of electrons).
• Lets investigate what happens if we add an
electrical current to this arrangement.
17. Negative current to N-Type Silicon
• If we connect a negative current to the side with
the N-Type Silicon…
• The incoming electrons will dislodge the electrons
in the Lattice and push them towards the P-Type
silicon to fill the holes.
• Likewise, the lack of electrons on the P side will
cause electrons to be pulled up and out the top of
the Silicon.
+
-
19. Negative current to P-Type Silicon
• What happens if we reverse the connections?
• The lack of electrons at the will pull the N-Type
spare electrons down.
• The excess electrons at the P-Type silicon will
cause the holes in the lattice to be ‘pulled’
upwards.
-
+
21. The Diode!
• We’ve just invented a Diode…
• A component that allows current to flow in
one direction only.
+
-
22. • Lets take a look if at what happens if we layer this
stuff some more!
More uses for our doped semiconductor?
23. More uses for our doped semiconductor?
• Here we have essentially created a barrier -
you can think of this as two back-to-back
diodes.
• It’s difficult to see how we could get current
to flow either way.
• However, all is not lost…
24. More uses for our doped semiconductor?
• If we apply a small amount of current to the N-
Type Silicon in the middle then we will end up
with a base flow.
• The base flow will take the charge collecting at
one end and drag through the layers.
• The overall current will be emitted at the other
end.
25. More uses for our doped semiconductor?
This stuff is pretty mental to visualise so its probably a good time
to show a simplified model using some water…
26. • We’ve just invented a P-N-P Transistor…
• An electrical component that allows current to flow in one
direction that can be switched on or off.
The Transistor!
28. Boolean Logic
• The advent of the transistor and digital electronics
was revolutionary.
• Before we investigate why – lets have a quick
refresher on Boolean logic…
29. AND
A B Q
0 0 0
0 1 0
1 0 0
1 1 1
Boolean Logic
30. OR
A B Q
0 0 0
0 1 1
1 0 1
1 1 1
Boolean logic…
31. NOR
A B Q
0 0 1
0 1 0
1 0 0
1 1 0
Boolean logic…
32. XOR
A B Q
0 0 0
0 1 1
1 0 1
1 1 0
Boolean logic…
34. NAND
A B Q
0 0 1
0 1 1
1 0 1
1 1 0
Boolean logic…
35. NAND Logic
• NAND gates can be used to create all of the other
Boolean operators…
A B Q
0 0 1
0 1 1
1 0 1
1 1 0
A Q
0 1
1 0
36. NAND Logic
• Now that we have used a NAND to make a NOT,
can make this…
A B Q
0 0 0
0 1 0
1 0 0
1 1 1
37. NAND Logic
• …and so on. Feel free to carry this on in your own
time and have a go at making the other logic gates.
A B Q
0 0 0
0 1 0
1 0 0
1 1 1
38. NAND Logic
• Why focus on the NAND operator?
• Because it’s relatively easy to make from a couple
of transistors!
A B Q
- - +
- + +
+ - +
+ + -
39. NAND Logic
• So… by using Silicon doped with Arsenic and Boron
we can now do exactly what Texas Instruments do
and create one of these bad boys…
• A 14 pin integrated circuit with 4 NAND
gates.
• 2 pins reserved for power (pins 7 and 14)
• Implemented internally using 8 NPN
transistors.
40. What can we build with a NAND gate?
• This pairing of NAND gates is
called an RS-Flipflop.
• Sending a brief pulse along S will
SET the value of Q to 1. Sending
a brief pulse along R will RESET
the value of Q to 0.
S R Q
0 0 Q
0 1 0
1 0 1
41. What can we build with a NAND gate?
• That’s correct - we’ve now just built
ourselves a 1 bit memory.
• If you stick 64 of these together on
a single CPU dye and you have a
single 64 bit register – that’s 128
transistors.
S R Q
0 0 Q
0 1 0
1 0 1
42. What else can we build with a NAND gate?
• Actually – lots of things!
43. What else can we build with a NAND gate?
• Lets imagine we’re going to take on Intel and
building a 1 bit CPU – we certainly need to have
logic inside the CPU to ADD a couple of 1 bit
numbers…
• What would the truth table look like for that?
44. What else can we build with a NAND gate?
A B R C
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
• Okay - It’s not rocket science. We have a result and
a carry bit (the overflow flag).
• How could we achieve this using NAND logic?
45. What else can we build with a NAND gate?
A B R C
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
• R looks like a simple XOR of A and B…
46. What else can we build with a NAND gate?
A B R C
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
• R looks like a simple XOR of A and B…
• C looks like a simple AND of A and B…
47. What else can we build with a NAND gate?
A B R C
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
• Combined…
48. What else can we build with a NAND gate?
A B R C
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
• And converted to NAND logic…
49. What else can we build with a NAND gate?
• With a minor tweak we can change this to include a carry in too!
• Not bad – a 1 bit adder with carryover (overflow) using only 18
transistors.
50. What else can we build with a NAND gate?
• Yikes - We could chain this stuff together to make a larger
adder!
51. Putting it all together…
• So we have created a 4 bit adder.
• And lets pretend we followed the same process to create some
4 bit subtraction logic.
• And we have created three 4 bit registers using 12 RS-Flipflops.
• And we have used a single RS-Flipflop for a carryover register.
62. The instruction set…
Op4 Op3 Op2 Op1 D0 D1 D2 D3
0 0 0 1 Set the value of Register A to D0-D3
0 0 1 0 Set the value of Register B to D0-D3
0 0 1 1 Add Register A to Register B and store the result in
Register R.
Will set Register C if an overflow occurs.
0 0 0 0 Subtract Register B from Register A and store the result in
Register R.
Will set Register C if an underflow occurs.
63. Programming the machine
The following 3 bytes of machine code show how a
CPU would add two numbers together: -
1A 26 30
0001 1010 1A Sets Register A to 10
0010 0110 26 Sets Register B to 6
0011 0000 30 Add Register A to Register B
64. Assembly language is nothing special
Is simply a set of mnemonics to make the
hexadecimal more memorable: -
LDA A 0001 1010 1A Sets Register A to 10
LDB 6 0010 0110 26 Sets Register B to 6
ADD 0011 0000 30 Add Register A to Register B
65. A modern CPU
• The program counter (PC)
– A register that contains the memory address for the
next machine code instruction to be executed.
– A number of instructions exist to alter the PC register:
JMP, JNE, JEQ, etc.
66. A modern CPU
• The stack pointer (SP)
02 LDA 3
03 PUSH PC
04 JMP 1A
.
.
.
1A LDB 4
1B POP PC