Q: Write a program in C++ to demonstrate booth's multiplication algorithm for 8 bit numbers.
Code:-
Framework:- QT 5.5.1
Language:- C++
Operating System:- Linux 64 bit(Ubuntu 14.04 LTS)
Code:-
Framework:- QT 5.5.1
Language:- C++
Operating System:- Linux 64 bit(Ubuntu 14.04 LTS)
Pre-requisites
- Knowledge of Bitwise operators
- How integers are stored in computer memory?
- How character are stored in computer memory?
- Knowledge of Booths multiplication algorithm
- Basic knowledge of ASCII chart
- Basic knowledge of String Operations
Boothcore
- Most of the work or code has been written in the MainWindow.
- A class called boothcore has been created for a few operations. It is mostly used decimal to binary array conversions.
- It is a rather unnecessary class. Some code of this class is not used at all. However it cannot be removed completely as I wrote a few core functions here.
- This has been rather poor coding on my part. But I believe you are using this code only for reference, so I wont be correcting. The main reason behind this is my LAZINESS though. :-P
8 bit Integer
- A 8 bit Integer has been simulated by me by anding it with 255.
- However a much more elegant way exists using header file <stdint.h>
- I faced a few compiling difficulties with C standards, and felt that it simulating this data type would be must easier(though inefficient).
No comments:
Post a Comment