Skip to content

Instantly share code, notes, and snippets.

@rizemon
rizemon / singletable.py
Created April 25, 2021 07:03
Generate State table (if given boolean equation for output and flip flop inputs)
from rich.console import Console
from rich.table import Table
from itertools import product
class InvalidInputException(Exception):
pass
def JK_flop(Q, J, K):
# Returns Q+ and Q+'
@rizemon
rizemon / column.py
Last active May 14, 2021 16:32
Reorders literals for easier comparison with output
from rich.console import Console
from rich.table import Table
import sys
from itertools import product
from math import ceil
def main():
if len(sys.argv) != 3:
print("Command: python3 column.py <literals> <minterms>")
print("e.g python3 column.py A,D,B,C 4,7,3,1")
from math import log2
from sys import argv
from rich.console import Console
from rich.table import Table
########## CHANGE THIS ###########
NWAY = 2 # 1/2/4
# Number of bytes
WORD = 4 # 4 bytes (Probably no need to change this)