Coder Social home page Coder Social logo

memorybasedcalculator's Introduction

Calculator with Combinational Circuits

This Python program implements a versatile calculator that leverages combinational circuits for arithmetic and logic operations. It provides support for a wide range of operations, including basic arithmetic operations (+, -, *, /), bitwise operations (&, |, !), exponentiation (^), and trigonometric/exponential functions (sin, cos, tan, e, ln).

Usage

  1. Run the Python script.
  2. Enter the number of inputs (input_num) based on your operation:
    • For trigonometric/exponential functions, enter 1.
    • For other operations, enter the number of operands.
  3. Enter the operands or select previous answers using 'ans'.
  4. Choose the operation (op) based on the available options.
  5. View the result.

Combinational Circuits

The program utilizes various combinational circuit functions for basic arithmetic and logic operations:

  • ALU: Arithmetic Logic Unit that performs addition and bitwise operations.
  • mux16, not16, and16: Functions for 16-bit multiplexers, NOT gates, and AND gates.
  • or_gate: Function for an OR gate.
  • or8way: Function for an 8-way OR gate.
  • add16: Function for adding two 16-bit binary numbers.

Memory Register

The program maintains a memory register (Register1, Register2, Register3, Register4, Register5) to store the results of previous calculations.

Trigonometric and Exponential Functions

For trigonometric and exponential functions, the program utilizes the math module to perform calculations.

Continuous Operation

The program allows continuous operation, providing users with the option to enter more calculations. To exit, enter 'N' when prompted.

Explore and Experiment

Feel free to explore and use the calculator for various mathematical operations. If you encounter any issues or have suggestions for improvement, please let me know.

memorybasedcalculator's People

Contributors

pooji04 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.