# create a binary 2^k matrix based on 3 conditions, essentially the truth table
noflevels <- rep(2, 3)
createMatrix(noflevels)
# its 3^k matrix, where all the prime implicants are, where "-1" means a minimised literal
createMatrix(noflevels + 1) - 1
# this is essentially the same structure as the more familiar
# (N.B. there is also a "raw" argument)
allExpressions(noflevels)
# or even more familiar, with all possible PIs arranged
allExpressions(noflevels, arrange = TRUE)
# create a truth table matrix based on 3 conditions where the second has three levels
# the matrix has 2*3*2 = prod(c(2, 3, 2)) = 12 rows
noflevels <- c(2, 3, 2)
createMatrix(noflevels)
# its prod(k) matrix, the generalised version of the 3^k matrix
# which has prod(noflevels + 1) rows
createMatrix(noflevels + 1) - 1
Run the code above in your browser using DataLab