I want to generate decoder Boolean expression if I have a truth table for encoder. What is the procedure? The encoder encodes, input which is 4 bit to 5 bit. How can I used these 5 bits and get the 4 bits back.
Following is the truth table:
Let's say your inputs are written as a (4x4) matrix, X:
Code:
X =
0 0 0 0
0 0 0 1
0 0 1 0
0 0 1 1
and your outputs are a (4x5) matrix Y:
Code:
Y =
0 0 0 0 0
0 0 1 0 0
0 0 0 0 1
0 0 1 0 1
We want to find some (4x5) "encoding" matrix, Z, such that:
Code:
X*Z = Y
One solution (with minimum Frobenius norm) is to take the Moore-Penrose pseudoinverse of X, so that Z=X+Y (where + denotes pseudoinverse). In this case, we get:
Code:
Z =
0 0 0 0 0
0 0 0 0 0
0 0 0 0 1
0 0 1 0 0
So, to encode X, we compute Y = X*Z. To decode Y, we compute X = Y*ZT (where T denotes matrix transpose).