5 bit binary input, 4 bit binary output
Answers
Hello
What I usually use are matrices. E.G. let me use a smaller example: imagine you have 2 inputs and 3 outputs. you can create a doble vector variable:
matrix: ARRAY[0..1] OF ARRAY[0..1] OF INT;
So, if your inputs are D1 and D2, and thery are BOOL, first, you convert them to INT. if the INT versions are D1_INT and D2_INT, you can access all elements on matrix using:
OUTPUT := matrix[D1_INT][D2_INT];
obviously, you need to give initial values to the matrix variable according to the desired OUTPUT values for each input combination
Best Regards
What I usually use are matrices. E.G. let me use a smaller example: imagine you have 2 inputs and 3 outputs. you can create a doble vector variable:
matrix: ARRAY[0..1] OF ARRAY[0..1] OF INT;
So, if your inputs are D1 and D2, and thery are BOOL, first, you convert them to INT. if the INT versions are D1_INT and D2_INT, you can access all elements on matrix using:
OUTPUT := matrix[D1_INT][D2_INT];
obviously, you need to give initial values to the matrix variable according to the desired OUTPUT values for each input combination
Best Regards
Add new comment