Skip to content

thrasosc/GalDraw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GalDraw

Galois LFSR Diagram Generator

A Python script to generate visual diagrams of Galois Linear Feedback Shift Registers (LFSRs) using LaTeX/TikZ.

Overview

This tool generates clear, professional-looking diagrams of Galois LFSRs, which are a specific type of Linear Feedback Shift Register where the feedback taps are XORed with the output bit before being fed into the next register. Each LFSR implementation has its own advantages:

  • Galois is more parallel, Fibonacci more serial
  • Galois reveals finite field operation, Fibonacci recursion in sequence

Features

  • Generate Galois LFSR diagrams in multiple formats (PDF, PNG, EPS)
  • Customize tap positions and initial values
  • Show/hide register values and names
  • High-quality vector output using LaTeX/TikZ

Dependencies

  • Python 3.x
  • LaTeX installation with TikZ package
  • ImageMagick (for PNG output)
  • pdftops (for EPS output)

Usage

Basic usage with default values (4-bit LFSR with taps 1001 and initial values 1111):

python3 galdraw.py

Customize tap positions and initial values:

python3 galdraw.py --taps 110101 --init-values 100001

Generate multiple output formats:

python3 galdraw.py --format all

Command Line Options

Option Description
--taps Tap sequence as a binary string (default: 1001)
--init-values Initial values as a binary string (default: 1111)
--hide-values Hide values inside the LFSR boxes
--hide-names Hide box names under the LFSR boxes
--format Output format: pdf (default), png, eps, or all
--output-dir Directory to save output files (default: current directory)

Example Outputs

4-bit Galois LFSR

python3 galdraw.py --taps 1001 --init-values 1101

4-bit Galois LFSR

8-bit Galois LFSR

python3 galdraw.py --taps 10111001 --init-values 11001011

8-bit Galois LFSR

8-bit Galois LFSR with hidden values and names

python3 galdraw.py --taps 10111001 --init-values 11001011 --hide-values --hide-names

8-bit Galois LFSR

Credits

This project is a modified version of the LFSR-Automatic-Draw tool, adapted to focus on Galois LFSRs.

About

Generate Galois LFSR diagrams using LaTeX/TikZ

Resources

License

Stars

Watchers

Forks

Languages