Final OK Chapter-2
Final OK Chapter-2
Decoder
Encoder
MUX
Decoder
Accepts a value and decodes it
Output corresponds to value of n
inputs
Consists of:
Inputs (n)
Outputs (2n , numbered from 0 2n - 1)
Selectors / Enable (active high or active
low)
The truth table of 2-to-4
Decoder
2-to-4 Decoder
2-to-4 Decoder
The truth table of 3-to-8
Decoder (Remaining values in truth table will be
Zeroes)
A2 A1 A0 D0 D1 D2 D3 D4 D5 D6 D7
0 0 0 1 0 0 0 0 0 0 0
0 0 1 0 1 0 0 0 0 0 0
0 1 0 0 0 1 0 0 0 0 0
0 1 1 0 0 0 1 0 0 0 0
1 0 0 0 0 0 0 1 0 0 0
1 0 1 0 0 0 0 0 1 0 0
1 1 0 0 0 0 0 0 0 1 0
1 1 1 0 0 0 0 0 0 0 1
3-to-8 Decoder
3-to-8 Decoder with
Enable
Decoder Expansion
Decoder expansion
Combine two or more small decoders
output lines
Encoders
4 to 1 line
multiplexer
S1 S0 F
2n MUX to 1
0 0 I0
n for this MUX is 2 0 1 I1
This means 2 1 0 I2
selection lines s0 1 1 I3
and s1
Multiplexer (MUX)
Consists of:
Inputs (multiple) = 2n
Output (single)
Selectors (# depends on # of inputs) = n
Enable (active high or active low)
Multiplexers versus
decoders
• A Multiplexer uses n binary select bits to choose from a
maximum of 2n unique input lines.
I2
I1
I0
S1
S0
2-to-4 Decoder
4-to-1 Multiplexer
Note that the multiplexer has an extra OR gate. A1 and A0 are the two inputs
in decoder. There are four inputs plus two selecs in multiplexer.
Binary Counter (example of sequential circuit): A register that
goes through a predetermined sequence of states upon the
application of input pulses is called a counter. They may occur
at uniform intervals of time. They are used for counting no. of
occurrences of an event A counter that follows the binary
number sequence is called a binary counter. There are two
types of counters: Binary up counter and Binary down counter.
2-bit binary up counter generates values iteratively in
ascending order e.g.
00
01
10
11
27
What good are registers?
• Flip-flops are limited because they can store only one bit
28
A basic register
• Basic registers are easy to build. We can store multiple bits just by putting a bunch of flip-flops
together!
29
Adding a parallel load operation
• Tranfer of new information into a registe ris referred to as loading a register
• The input D3-D0 is copied to the output Q3-Q0 on every clock cycle
• How can we store the current value for more than one cycle?
• Let’s add a load input signal LD to the register
– If LD = 0, the register keeps its current contents
– If LD = 1, the register stores a new value, taken from inputs D 3-D0
LD Q(t+1)
0 Q(t)
1 D3-D0
30
Types of ROM
•PROM - Programmable Read Only Memory:
Creating ROM chips totally from scratch is time-consuming and very expensive in small quantities. For this reason, developers created a type of ROM known
as programmable read-only memory (PROM). Blank PROM chips can be bought inexpensively and coded by the user with a programmer. PROM chips have a
grid of columns and rows just as ordinary ROMs do. It can be programmed using electrical fuses
In EEPROMs:
•The chip does not have to removed to be rewritten.
•The entire chip does not have to be completely erased to change a specific portion of it.
•Changing the contents does not require additional dedicated equipment.