Skip to content

A Python tool for Binary ↔ Gray Code conversion using bitwise XOR. Helps reduce errors in digital systems, encoders, and communication protocols. Efficient, lightweight, and well-documented for easy use in projects.

Notifications You must be signed in to change notification settings

Muawiya-contact/Binary-Gray-Code-Converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Binary-Gray-Code-Converter

A simple Python script to convert Binary to Gray Code and vice versa. Gray Code is widely used in digital systems to minimize errors in sensors, encoders, and error correction.

🚀 Features

  • Convert Binary to Gray Code.
  • Convert Gray Code back to Binary.
  • Clean and efficient implementation.

🔧 Usage

from binary_to_gray import binary_to_gray, gray_to_binary

binary = "1011"
gray = binary_to_gray(binary)
binary_back = gray_to_binary(gray)

print(f"Binary: {binary}, Gray Code: {gray}, Back to Binary: {binary_back}")

About

A Python tool for Binary ↔ Gray Code conversion using bitwise XOR. Helps reduce errors in digital systems, encoders, and communication protocols. Efficient, lightweight, and well-documented for easy use in projects.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages