Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Designing a calculator using ALU

Status
Not open for further replies.

frankie123

Newbie level 4
Joined
Sep 13, 2010
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,318
i need help on design a simple calculator using ALU....(newbie in digital system).

The question is:
Design a digital system that can function as a simple calculator which has at least functions
of addition, subtraction, multiplication and division.

Is there anyone can guide me or help me on this???
So far i can only do the addition and subtraction....
 

VHDL has multiplication and divide functions for signed/unsigned numbers. Its as simple as writing the following code:

op <= a * b;
op <= a / b;
 

VHDL is easy..but i need to design it in form of logic gates....(using altera quartus II)
i can design the addition and subtraction part with adder and mux..
however the multiplication and devision are really make me headache...
 

Are you using the graphical editor?
then use the LPM library from the mega wizard for multiplier and divider and make all the data paths the same length,
 

If this is an assignment, I suspect they are looking for you to do the division/multiplication using the addition/subtraction. eg, write a simple state machine that does long division, and one that does shift-add multiplication.
 

ya.It is an assignment. I don't know how to do long division and shift-add multiplication using the + and - operation part, can teach me?

---------- Post added at 10:15 AM ---------- Previous post was at 10:14 AM ----------

https://www.edaboard.com/threads/63898/
i found this thread..but not quite understand it. Can explain for me?
 

long division:
divide 1000 by 11:
1100
1000 Result = 0

0110
1000 Result = 01

0011
0010 Result = 010

Thus 8 = 2*3 + 2.

Multiplication is similar:
11 * 101 =
11
11 + 0
11 + 1100

These are usually taught as multi-cycle algorithms.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top