A terminal-based HDL (Hardware Description Language) puzzle simulator inspired by MHRD. This minimal CLI tool parses a small HDL format and prints truth tables for combinational circuits.
- Parses a minimal HDL format with inputs, outputs, parts (gates), and wires
- Supports basic gates: NOT, AND, OR, XOR, NAND, NOR
- Simulates combinational circuits and generates truth tables
- Ready for Debian/Ubuntu packaging and distribution via apt
mkdir -p build
cd build
cmake ..
makeOr using g++ directly:
mkdir -p build
g++ -std=c++17 -O2 -pipe -o build/minlab src/minlab.cppCompiling and uploading
cd /home/newang/git/cpp_mhrd sudo dpkg -i ../minlab_1.0.0-1_amd64.deb sudo apt-get install -f # Fix any dependency issues if needed minlab # Test it
not- NOT gate (1 input:in, 1 output:out)and- AND gate (2 inputs:in1,in2, 1 output:out)or- OR gate (2 inputs:in1,in2, 1 output:out)xor- XOR gate (2 inputs:in1,in2, 1 output:out)nand- NAND gate (2 inputs:in1,in2, 1 output:out)nor- NOR gate (2 inputs:in1,in2, 1 output:out)
sudo apt-get update
sudo apt-get install -y build-essential debhelper cmake devscriptsdpkg-buildpackage -us -ucThis will create a .deb file in the parent directory:
../minlab_0.1.0-1_*.deb
sudo dpkg -i ../minlab_0.1.0-1_*.debAfter installation, you can run:
minlab /usr/share/minlab/examples/not.hdlSee PPA_QUICK_START.md for a condensed guide.
See DEPLOYMENT.md for comprehensive deployment instructions.
# Build package
./scripts/build-package.sh 1.0.0-1
# Upload to PPA
./scripts/upload-ppa.sh YOUR_USERNAME/PPA_NAME 1.0.0-1~ppa1
# Users install
sudo add-apt-repository ppa:YOUR_USERNAME/PPA_NAME
sudo apt-get update
sudo apt-get install minlabminlab/
├── src/
│ └── minlab.cpp # Main C++ source
├── examples/
│ └── not.hdl # Example HDL file
├── debian/
│ ├── control # Package metadata
│ ├── rules # Build rules
│ ├── changelog # Version history
│ ├── install # Installation rules
│ └── source/
│ └── format # Source format
├── CMakeLists.txt # CMake build configuration
└── README.md # This file