Code Monkey home page Code Monkey logo

booth-multiplication's Introduction

DOCUMENTATION::

Author:

    Abhimanyu Gupta (https://github.com/0deadLock0/)
        
    https://github.com/0deadLock0/Booth-Multiplication/

Functionality:

  • Multiply two Decimal numbers (base 10) in their binary forms using Booth's Method of Multiplication

Purpose:

  • Booth Implementation Project for CSE112-Computer Organization at IIIT Delhi

Reference:


INPUT/OUTPUT FORMAT

Input:

  • Enter two Decimal Numbers in seprate lines, without any base and all.

Output:

  • The product of two numbers in their decimal form.

PROGRAM FLOW

  • Two decimal numbers are inputed from the user.

  • They are then passed to boothMultiply(int,int) function.

  • The function first converts the two inputs into their binary equivalents using toBinary(int,int) method.

  • toBinary(int,int) method first get the number of bits required by the binary numbers using the getBinNumLength(int,int).

  • Then implementing the procedure for converting Decimal to Binary numbers with the help of get2sComplement(binaryNumber) it converts the two user inputs into their binary form.

  • After following the desired pre-requisites it multiply the numbers using the Booth's method as stated in reference mentioned in the Brief.

  • The method takes help of binaryAdd(binaryAdd,binaryAdd) method to perform the desired operations when needed.

  • At last the function returns the decimal value, the product of two user inputs.

ASSUMPTIONS IN THE FLOW:

The two user inputs are just Integers and don't have any Floating number part in them.


ERROR HANDLING

  • Incase of invalid user input the program terminates in accordance with the python's inbuilt error handling mechanism

INSTRUCTIONS TO RUN

Language and Version Support:

  • The program has been completely written in Python 3.8.1.

Method 1: Using command prompt or terminal

Run the cmd/termial in the folder where code file -"code.py" is present.

Enter "python code.py" (without quotes)

Enter two numbers in decimal format (base 10) in two separate lines.

Method 2: Using IDE

Compile and run the python code.

Enter two numbers in decimal format (base 10) in two separate lines.

booth-multiplication's People

Contributors

0deadlock0 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.