a few fundamental concepts in digital electronics
TRANSCRIPT
1
Flavors of ElectronicsAn exploration of a few simple ideas
P Joy Prabhakaranhttps://www.linkedin.com/profile/view?id=22548506&trk=hp-identity-name
2
Electronics: What does it do for us?
• Compute• Store• Communicate• Sense• Control• Interact with humans
3
Binary numbers
Decimal numbers– Base 10– 10 symbols: 0 to 9– 576 = 5 x 102 + 7 x 101 + 6 x 100
Binary numbers– Base 2– 2 symbols: 0 & 1– 101 = 1 x 22 + 0 x 21 + 1 x 20 = ? In decimal
4
Compute: How?• Logic
NOT, OR, AND, XOR• Numeric Comparison
=, >, <• Arithmetic
ADD, SUB, MULT, DIV
Can all these be built using the switches shown here?
Many of the ideas here are probably derived from Shannon’s work referred to at: http://en.wikipedia.org/wiki/A_Symbolic_Analysis_of_Relay_and_Switching_Circuits
5
The NOT gateA few notations:
5V, 1, ON, TRUE are all used in a near synonymous manner.The switch is “pressed” when the Input is 1.If the connection to 5V is not present, the output is at 0. Also referred to as OFF or FALSE at times.
With that out of the way let us explore what the NOT logic is and if we can implement it using these switches.
I/P O/P1 00 1
6
AND
What should an “AND” implementation do?
How can this be built using our switches?
A B O/P
0 0 0
0 1 0
1 0 0
1 1 1
7
OR
What should an “OR” implementation do?
How can this be built using our switches?
A B O/P
0 0 0
0 1 1
1 0 1
1 1 1
8
XOR
What should an “XOR” implementation do?
How can this be built using our switches?
A B O/P
0 0 0
0 1 1
1 0 1
1 1 0
11
Checking for equalityWhat does the following do?
O/P =
A B O/P
0 0 1
0 1 0
1 0 0
1 1 1
Build a circuit to check equality of two 2-bit numbers A1A0 and B1B0
O/P =
What if we use an XNOR?
12
Comparing two numbers
A = B
)A > B
Let us work out the truth table for A > B.How would you implement A < B.
Logic to compare two 2 bit numbers
13
Addition: One bit half adderA one bit half adder:
What is the truth table for S and Cout?
Two inputs (A, B) and two outputs ( S, Cout)Addition operation
A B S Cout
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
What is the logic for S and Cout?
14
One bit full adderA one bit full adder:
What is the truth table for S and Cout?
Three inputs (A, B, C) and two outputs (S, Cout)Addition operation
A B C S Cout
0 0 0 0 0
0 1 0 1 0
1 0 0 1 0
1 1 0 0 1
0 0 1 1 0
0 1 1 0 1
1 0 1 0 1
1 1 1 1 1
… and the logic S and Cout?
• S is true if only one input is true or if all three are true.
• Cout is true if any two inputs are true.
16
Latches & Flip Flops• Latches & Flip flops are built using basic gates and
can store data.• They can be level triggered or edge triggered.• They are an intrinsic part of storage, counters etc.
S R CLK D Q0 1 X X 1 01 0 X X 0 10 0 X X Unstable1 1 ↑ 1 1 01 1 ↑ 0 0 11 1 ↓ X No change1 1 ― X No change
The D flip flop
18
What would this circuit do• R is made zero and then kept high throughout. After this, a clock is applied.• What will the output be each time the clock goes high from low.
R Clk
0 X 0 0 0 0
1 ↑ 0 0 0 1
1 ↑ 0 0 1 1
1 ↑ 0 1 1 1
1 ↑ 1 1 1 1
19
… and what about this?
R Clk0 X 0 0 0 01 ↑ 0 0 0 11 ↑ 0 0 1 11 ↑ 0 1 1 11 ↑ 1 1 1 11 ↑ 1 1 1 01 ↑ 1 1 0 01 ↑ 1 0 0 01 ↑ 0 0 0 0
23
Optical storage
http://www.britannica.com/EBchecked/media/106454/On-optical-discs-such-as-compact-discs-and-digital-videodiscs?topicId=430490
24
A conceptual exploration of addressable and programmable storage with no moving parts
What is O/P in relation with A1?
Assuming only one of A1 and A2 can be 1 at any time, what is the relationship between A1 and A2 in the two schematics on the right
Any ideas on how all this could lead to a memory device?
25
...conceptual exploration of memory
Discuss how the schematic can become the basic idea behind devices like RAMs, EPROMs, EEPROMs etc with Ai becoming the addressing mechanism
26
Communicate: How?
Send a signal from the source to the destination.• Challenges– How does one “send a signal”?
• Transmitter• Conceptually, what should a transmitter look like?
– How does one receive a signal?• Receiver• Conceptually, what should a receiver look like?
– How does the signal go from the sender to the receiver?• Transmission channel and medium.
27
Sense: How?
• Sensors are used to sense. A sensor is a transducer.• A sensor (transducer) converts a physical
parameter into some other physical parameter that can be used to sense the former. Example: A thermometer
• In electronics and automated systems, the physical parameter is typically converted to a voltage or current for this can be easily measured.
28
Physics behind a few common sensors• Resistive sensors.
– Uses the fact that resistance of certain materials vary with physical parameters. Eg: Resistive temperature detectors, Strain gauges.
• Photoelectric sensors– Uses the fact that a measurable current is generated in a photo
diode when exposed to light. Eg: Used in light sensors
• Thermocouples– Uses the fact that Any junction of dissimilar metals will produce
an electric potential related to temperature. Eg: Temp sensors used in Steel industry, water heaters etc.
• Piezo electric sensors– Uses the fact that electric charge accumulates in certain solid
materials (such as crystals, certain biological matter such as bone, DNA and some proteins) in response to applied mechanical stress. Eg: Early use as a submarine sonar by responding to the sonar echo.
29
A few basic concepts from analog communication
• Wavelength• Frequency• Period• Amplitude• Low pass, high
pass, band pass signals
30
Switching to the digital domain
• Sampling• Quantization• Quantization error• Types of quantization• Nyquist
36
Ideas in Information Theory and compression
• Is all information created equal? Did you tell me anything if you told me that the Sun rose in the east today?
• What is ASCII code? Compare with a Variable Length Code (VLC)?
• What if monochrome image is to be coded with each pixel being a 0 or a 1 (like in Fax)? Does any possibility to compress come to mind?
37
…ideas in compression contd.
• Eliminating “unnecessary” and less important information.
• Using the probability distribution of symbols to arrive at a more efficient code.
• Regenerating parts of the data from other parts of the data and a difference component.
• Dictionary coding.