Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS/COE 0447 Jarrett Billingsley

Similar presentations


Presentation on theme: "CS/COE 0447 Jarrett Billingsley"— Presentation transcript:

1 CS/COE 0447 Jarrett Billingsley
Gates and Wires CS/COE 0447 Jarrett Billingsley

2 Class announcements well hello again CS447

3 What's electricity? (this section is just for fun)
CS447

4 p+ In your orbit here's an electron. it has a negative charge.
here's a proton. it has a positive charge. here's an electron. it has a negative charge. p+ e- it kinda goes around the proton in an orbit* protons sit still while electrons can move around. CS447 *narrator: that was not true.

5 p+ e- p+ e- Opposites attract… two of the same charge repel.
here's electricity. here it is. opposite charges attract. p+ e- but protons are kinda stuck, so… - the repulsion of electrons is a powerful force - it's like a little spring - and when you have quintillions of these little springs in one place… you can do some fun stuff CS447

6 Lots of fish electrons in the sea
here's a solid piece of metal. the atoms are in a fixed structure… but some of the electrons are free to move around. right now, the charges are balanced: same number of positive and negative. let's knock it out of whack. CS447

7 Two moles is company, three's a crowd
let's shove more electrons in… packing more electrons in leads to two things: 1. this metal is now negatively charged 2. the electrons are now closer together meaning they're less happy noo - negative charge: e > p - positive charge: e < p aaa CS447

8 Carousel of unhappiness
wire Carousel of unhappiness wire if we shove some down a wire… and then give them a (difficult) way out… we'd like to get off mister bones wild ride and then have something which will squeeze them back together again… well now you have electricity. - a battery uses an electrochemical reaction to squeeze electrons together - but there are many ways to do that. CS447

9 voltage measures electron unhappiness.
Watch em go voltage measures electron unhappiness. current measures how many electrons per second are moving past a point. low low high high and that's electricity. CS447

10 Gates CS447

11 Transistors input control output
a transistor is like a little valve, or switch the input, output, and control are all single bits the bits are represented as voltages (maybe 3.3V = 1, 0V = 0) it connects its input to its output if control is a 1. input output control now just put 3 billion of them together! who said EE was hard? - ;)))))))))))))))))))) - I mean, everything is just some combination of protons, neutrons, and electrons… just put them together right. GOSH. CS447

12 Gates we can combine transistors in interesting ways to make gates a gate implements one of the basic boolean logic functions let's start with the simplest: the NOT gate Y is the output A is the input A Y this little bubble means "NOT" A Q - why do we use Y?? Y, indeed…. ;)))))))))))))))) - ok it's really called a "buffer" but it's used for Real World reasons (amplifying and delaying signals). without the bubble you get a nothing-gate. CS447

13 AND, OR, and… XOR? A B Y 1 A B Y 1 A B Y 1 A Y B A Y B A Y B
we know about AND and OR, but what's XOR? A Y B AND gate A Y B OR gate A Y B XOR gate A B Y 1 A B Y 1 A B Y 1 eXclusive OR means "one or the other, but NOT BOTH." CS447

14 Simplifying gates with constant inputs
you should never have a gate with a constant input. these cases always give 0 or 1. A 1 A 1 A A these cases do nothing. A A ¬A 1 and this case is just doing NOT. CS447

15 If you give an electrical engineer a NAND gate…
if you stick a NOT gate after an AND gate, you get a NAND gate this kind of gate has a cool property: it's universal you can do any boolean logic operation with NAND gates that means you can build an entire computer with NANDs but this isn't how real circuits are designed, at least anymore digital logic courses use them cause NAND gate chips are cheap but in Logisim, we have infinite gates for free :D use the kind of gate you need for the situation at hand - ok there are some low-level reasons why NAND is preferred in some cases but all the literature I can find seems to say that modern circuit design just uses "whatever is needed" in most cases - there are also NOR gates and XNOR gates which you can guess what they are CS447

16 Bubbles and more very often you want to NOT one (or more) inputs to a gate but drawing the NOT gate gets tiring so we can use this as shorthand. you can also have more than 2 inputs to a gate. this does "A & B & C" or, more tersely, ABC - logisim lets you do these things too. CS447

17 Wires CS447

18 and then hook them together.
What's a wire? A wire connects things together. say you wanna do AB + C so we need an AND gate… A B and then hook them together. C and an OR gate… CS447

19 you have… a different bug.
Logisim's wire colors Logisim colors wires according to their kind and state. green wires are 1-bit. blue wires are carrying X. red wires mean "error." orange wires mean a size mismatch. 1 8 1 X is weird. it's neither 1 nor 0. maybe avoid these. you have a bug. you have… a different bug. - grey wires are unconnected to anything… just delete em. CS447

20 It's getting chilly… bundle up
if we want to, say, NOT a 32-bit value, we can draw it like: 32 it's a lot nicer than drawing 32 wires with 32 NOT gates Logisim calls these wire bundles and colors them black it doesn't draw the slashes and numbers though… orange wires happen when you have two things of different bit widths connected together. it's like a type error. CS447

21 Pull n peel splitters are how we convert between bundles and individual wires. a splitter lets us split up wire bundles… …or bundle wires back together. 4 4 we could do weird stuff in the middle. CS447

22 What causes errors? usually, it's this.
you cannot connect two outputs together with a wire. what if one gate outputs 1 and the other outputs 0? IRL this would cause the value to be "indeterminate" - unfortunately, Logisim doesn't simulate the release of Magic Smoke or your gates would blow up. that's more exciting. CS447

23 the little circle means these wires are connected together.
But this is totally OK you can connect one wire to as many inputs as you want. the little circle means these wires are connected together. CS447

24 Tunnel time a tunnel lets you connect wires across distances.
one one the name of the tunnel is what's important. any tunnels of the same name are "virtually" connected. one and you can have as many copies as you like. CS447


Download ppt "CS/COE 0447 Jarrett Billingsley"

Similar presentations


Ads by Google