Skip to content

About

A menu-driven C++ terminal application for number system conversion (bases 2–36), bitwise operations, bit rotations, and bit manipulation. Built with C++17 to strengthen number representation and DSA fundamentals.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

🔢 Number System & Bitwise Operations Toolkit

A menu-driven C++ terminal application for number system conversions and bitwise operations. This project combines number representation, bit manipulation, and object-oriented programming concepts in one command-line tool.

Developed by Abhishek Kumar (@abhisheksinghcode)

🚀 Features

🔄 Number System Conversion

Convert non-negative integers between different number systems.

  • Decimal to Binary
  • Binary to Decimal
  • Decimal to Octal
  • Decimal to Hexadecimal
  • Hexadecimal to Decimal
  • Binary to Octal
  • Octal to Binary
  • Binary to Hexadecimal
  • Hexadecimal to Binary
  • Octal to Hexadecimal
  • General base conversion between bases 2 and 36

⚙️ Bitwise Operations

Operation Operator
Bitwise AND &
Bitwise OR `
Bitwise XOR ^
Bitwise NOT ~
Bitwise NAND ~(a & b)
Bitwise NOR `~(a
Bitwise XNOR ~(a ^ b)
Bitwise Implication `(~a)
Left Shift <<
Right Shift >>
Left Rotation Bit rotation
Right Rotation Bit rotation

🧩 Bit Manipulation

  • Set a bit at a specified position
  • Clear a bit at a specified position
  • Toggle a bit at a specified position
  • Check whether a bit is set
  • Count the number of set bits
  • Isolate the lowest set bit
  • Remove the lowest set bit
  • Check whether a number is a power of two
  • Clear the lowest K bits
  • Compare the most significant bits of two values

🛠️ Technologies Used

  • Language: C++
  • Standard: C++17
  • Interface: Command-Line Interface (CLI)
  • Compiler: GCC / MinGW-w64
  • Libraries: C++ Standard Library

📋 Prerequisites

Before running the application, install:

  • A C++ compiler that supports C++17
  • GCC or MinGW-w64 on Windows
  • A terminal or command prompt

📥 Installation and Setup

1. Clone the repository

Replace YOUR_REPOSITORY_NAME with your actual GitHub repository name.

git clone https://github.com/abhisheksinghcode/YOUR_REPOSITORY_NAME.git

2. Navigate to the project directory

cd YOUR_REPOSITORY_NAME

3. Compile the source code

Assuming your source file is named main.cpp:

g++ -std=c++17 -Wall -Wextra -pedantic main.cpp -o main

4. Run the application

Windows:

.\main.exe

Linux / macOS:

./main

💻 Application Menu

===== NUMBER SYSTEM TOOLKIT =====
1. Number System Conversion
2. Basic Bitwise Operations
3. Bit Manipulation Operations
0. Exit

Enter choice:

Select a menu option to access the corresponding features. Choose 0 in a submenu to return to the main menu.

🧪 Examples

Example 1: Decimal to Binary

Input: 25
Output: 11001

Example 2: Decimal to Hexadecimal

Input: 255
Output: FF

Example 3: Binary to Octal

Input: 11001
Output: 31

Example 4: Bitwise AND

Input: 12 10

12 in binary: 1100
10 in binary: 1010

1100 & 1010 = 1000

Output: 8

Example 5: Count Set Bits

Input: 15

Binary: 1111
Set bits: 4

📁 Project Structure

number-system-toolkit/
├── main.cpp       # Application source code
├── README.md      # Project documentation
├── LICENSE        # Optional license file
└── .gitignore     # Optional Git ignore rules

🎯 Learning Objectives

This project helps strengthen understanding of:

  • Number systems and base conversion algorithms
  • Binary representation of integers
  • Bitwise operators in C++
  • Bit masking and bit manipulation
  • Classes, objects, and encapsulation
  • Menu-driven programming and switch statements
  • Input validation and integer overflow handling
  • Practical applications of bitwise operations in DSA

⚠️ Limitations

  • Number system conversions support non-negative integers.
  • Base conversion supports bases from 2 to 36.
  • Bitwise operations use unsigned 32-bit integers.
  • Fractional numbers and arbitrary-precision integers are not supported.
  • Invalid digits and conversion overflow should be rejected.

🔮 Future Improvements

  • Support negative numbers and fractional conversions
  • Add two's complement representation
  • Implement arithmetic operations using bitwise operators
  • Add automated unit tests
  • Improve terminal formatting and error handling
  • Separate the application into header and implementation files

👨‍💻 Author

Abhishek Kumar

🤝 Contributing

Contributions, suggestions, and bug reports are welcome.

  1. Fork this repository.
  2. Create a new branch.
  3. Implement your changes.
  4. Test your code.
  5. Submit a pull request.

📄 License

This project is available under the MIT License if distributed with an MIT LICENSE file.


If you find this project useful for learning C++ or bitwise operations, consider giving the repository a ⭐ star!

About

A menu-driven C++ terminal application for number system conversion (bases 2–36), bitwise operations, bit rotations, and bit manipulation. Built with C++17 to strengthen number representation and DSA fundamentals.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages