No more secrets Part 4: Encode and Decode...

Da raspibo.
Jump to navigation Jump to search

Actually it is the reverse way round, let us decode first and encode then.

A decoder

A decoder is a circuit having n input lines and 2^n (2 elevated to the n-th power) output lines.

Each output is true for a specific configuration of the input.

We will implement a 2/4 decoder, i.e. a decoder having 2 inputs and four outputs.

This is its truth table:

IN1 IN0 OUT0 OUT1 OUT2 OUT3
0   0   1    0    0    0
0   1   0    1    0    0
1   0   0    0    1    0
1   1   0    0    0    1

The circuit to implement the decoder is the following: ...figure missing...


And this is the table you can use to set up the jumpers on your breadboard:

IN0->BBEI
IN1->AAGI
A->CE
B->CG
C->DD
D->out0
E->FF
F->out1
G->HH
H->out2
I->JJ
J->out3

To test this circuit, connect a led on each output line. Initially the led on out0 is on, the others off. In fact out0 is 1 when the input configration is 0,0. Now connect in0, in1 or both to the positive line. These configuration should turn on the leds at out1, out2 and out3, respectively, one at at a time.

A priority Encoder