Question: I am having a hard time with a C++ project I have, I can not understand the division algorithm. Please help in as simple a

I am having a hard time with a C++ project I have, I can not understand the division algorithm. Please help in as simple a way as possible following these algorithms.

Write a C/C++ program to perform unsigned binary multiplication and division. The algorithms implemented should be the ones discussed in class (version 3). Your program should prompt the user for the mode of operation (mult or div) and then prompt for two operands. The operands will be entered as integers in base 10. The program needs to convert the operands to binary to perform the operations. You may assume the converted operands and the result will fit into a 32-bit register. For output, your program should display the contents of each register at every step of the computation. The contents of the registers should be displayed in binary and should be formatted for readibility. The program does not need to perform any overflow checking.

Here are the algorithms he included.

I am having a hard time with a C++ project I have,

Division Example Version 3 0 010 VISO subtract 32-bit ALU shift eft dividend quotient remainder 0 0 0 0 0 1 1 0 shift 0 0 0 0 1 1 0 1 0 110 rem neg, so ent bit sub 1 1 0 0 0 0 restore remainder shift 0 0 0 1 0 0 sub 1 1 1 1 11 rem neg, so ent b J 0 000 0 0 0 1 restore remainder 0 0 shift 0 0 1 1 0 0 0 sub 0 0 0 1 0 0 (001 rem pos, so ent bit 1 shift 0 0 1 0 0 0 1 0 0 101 rem poss, so ent bit 1 sub 0 0 0 0 3 with 0 remainder Multiplier Version 3 0 1 1 0 -6 Multiplicand 32 bits 32-bit ALU Shift Right Product (Multiplier) Write 64 bits 0 0 0 0 0 1 add 0 1 1 0 0 1 0 1 shift 0 0 1 1 0 0 10 no add) 0 0 1 1 0 0 1 0 shift 0 0 0 1 0 0 add 0 1 1 1 1 0 0 shift 0 0 1 1 1100 (no add) 001 1 1 100 shift 0 0 0 1 11 10 30 Control

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!