Skip to content

C-based security system simulation that converts sensor data to binary using parity checks and calculates a decimal security code.

License

Notifications You must be signed in to change notification settings

ShotsMan2/Sensor-Parity-Security-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Sensor Parity Security System

This project is a C-based simulation of a Security Sensor Processor. It reads raw integer data from a sensor array, encodes it into a binary sequence based on parity (Odd/Even), and decodes it into a decimal Security Code.

⚙️ Algorithm Logic

The system processes the data in 3 stages:

  1. Data Acquisition:
    • Input Array: [6, 14, 43, 53, 64, 32, 24]
  2. Parity Transformation (Encoding):
    • Iterates through the array.
    • Even Numbers: Converted to 0
    • Odd Numbers: Converted to 1
    • Result: 0011000 (Binary Sequence)
  3. Decoding (Security Code Calculation):
    • The binary sequence is converted to a decimal integer.
    • Calculation: $0 \cdot 2^6 + 0 \cdot 2^5 + 1 \cdot 2^4 + 1 \cdot 2^3 + 0 \cdot 2^2 + 0 \cdot 2^1 + 0 \cdot 2^0$
    • Result: 24

🚀 Build & Run

To compile and run the project (requires math library):

gcc main.c -o security_system -lm
./security_system

About

C-based security system simulation that converts sensor data to binary using parity checks and calculates a decimal security code.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages