# Forum: FPGA, VHDL & Verilog Simple calculator with FPGA

 Author: Hosein Poorhoseini (Guest) Posted on: 2014-08-13 06:02

Rate this post
 0 ▲ useful ▼ not useful
Dear Experts, I'm a student and have a FPGA project that should be
implement a simple calculator with FPGA. I'm beginner and I don'n know
please help me that how can I implement it.

 Author: Christian B. (casandro) Posted on: 2014-08-13 07:00

Rate this post
 0 ▲ useful ▼ not useful
The Sinclair Scientific runs on typical calculator hardware which is a
bit simpler than more general purpose microcontrollers. I's recently
been reverse engineered.

Essentially that's implementing a 4 bit Microcomputer and programming it
as a calculator.

If you want points for originality, you could implement an electronic
version of a mechanical calculator. That involves having one or more
"registers" which are essentially counters. One architecture would be
one main register, which is also displayed at all times, as well as one
that holds your input value. Make it so you can add the input number to
your display register, but sending a series of impulses to it.
For example if you want to add 1337, you send
7 impulses to the 10^0 digit of your display counter,
3 impulses to the 10^1 digit of your display counter,
3 impulses to the 10^2 digit of your display counter and
1 impulse  to the 10^3 digit of your display counter.

If you add a possibility to shift those lines, you can also easily make
it able to multiply things. That way you can add the 10^0 digit of the
input register to the 10^5 digit of the display counter, giving you a
multiplication of 10^5.
So multiplying 1234 times 5678 is fairly simple:
You enter 5678 into your input register and make sure your display
register is zero.
digit.
digits.
digits.

What you get is:
0000
+    5678
+    5678
+    5678
+    5678
+   56780
+   56780
+   56780
+  567800
+  567800
+ 5678000
===========
whatever

It's like on a Curta.
Youtube-Video "Amazing Old Calculator (Curta) - Numberphile"

 Author: Lothar M. (lkmiller) (Moderator) Posted on: 2014-08-13 09:58

Rate this post
 0 ▲ useful ▼ not useful
Hosein Poorhoseini wrote:
> that should be implement a simple calculator with FPGA
What experience do you have with FPGA? Did you do the flashing led? Did
you do simple IO? Did you control a 7-segment display? What input device
do you have? Where do you display the numbers?

I think the purpose of YOUR project and the intention of your teacher is
that you learn how to use FPGA, not that you learn how to find some code
somewhere and copy some code and present it as yours. Am I right?

: Edited by Moderator
 Author: Gorgonzola (Guest) Posted on: 2014-08-14 23:07

Rate this post
 0 ▲ useful ▼ not useful
Seems one of those useless projects, were things are implemented in an
FPGA which should be better done in software. Students should learn to
solve hardware issues with FPGAs in the first place, because we have
enough "FPGA experts" thinking in software clouds only, because they
were beginning with software thinking.

Otherways poor Lothar et. all. will be overwhelmed by beginner's
questions one time.

 Author: Hosein Poorhoseini (Guest) Posted on: 2014-08-16 15:23

Rate this post
 0 ▲ useful ▼ not useful
Thanks for your reply.
I have a teacher that no helped me and we haven't lab in our university.
I searching and reading some documents but can't simulate it in Quartos
software. I know some VHDL code. but I don't know about select chip
model or create board for simulate.

 Author: Lothar M. (lkmiller) (Moderator) Posted on: 2014-08-16 17:39

Rate this post
 0 ▲ useful ▼ not useful
Hosein Poorhoseini wrote:
> but can't simulate it in Quartos software.
So start fixing this. Get the simulator running an just implement a
simple counter and simulate it. Don't even try to start with "the big

> but I don't know about select chip model or create board for simulate.
You can select the hardware yourself? Or ist there a hardware platform
at school (e.g. a devboard)? If so: which one?

• $formula (LaTeX syntax)$