J
john jakson
Guest
Allan Herriman <allan.herriman.hates.spam@ctam.com.au.invalid> wrote in message news:<9hv8c0l660vlsg9iukfv51fbhlr30cp26a@4ax.com>...
Naw, I think that might be just a little tough for the OP, but if you
were doing millions of em, it would certainly be the way.
Another way might be to use handelc and work at a more abstract way
with a C behavioural model. Either way would allow the architecture to
grow and support trigs etc.
regards
johnjakson_usa_com
On 7 Jun 2004 07:21:48 -0700, johnjakson@yahoo.com (john jakson)
wrote:
"davidbarby" <danyangqu@suou.waseda.jp> wrote in message news:<6eb3db6ca7f5485d9d696440776471c6@localhost.talkaboutprogramming.com>...
Hi,
I am a new student majoring in LSI. Now I have to design a calculator
using verilog. It is the homework of a course.
I am looking for some reference code about it as I have very little
experience to program in Verilog. I would be very appreciated with your
help.
BTW, the functions I have to realize include Add, Subtract, Multiply,
Division, N!, C, Shift, MC, MS, MR, M+, M-.
Thank you...
Although you did not say real/floating point I would forget about
verilog real as that will lead you into endless complexity and
potentially dead end.
You did not not include dec pt key in your list, if its not there then
its all integer. If its implied (see spec/tutor), then you are still
dealing with integer but with an exponent for simple floating point.
As far as I know, pocket calculators don't do floating point by
converting the input to IEEE anyway. They do digit by digit
arithmetic. The dec pt is just a separate little state bit that tracks
where .. well you know how to do it on paper right.
Wish I had this sort of asignment in school too, but HDL didn't really
exist back then, only TTL.
We had a similar assignment, but we had to make it work in TTL.
Think in terms of FSMs. You can collect the key strokes into buffers
or regs. If the key is a digit, push down. If its an operator then do
that operator on whats in the buff. It up to you to make it work
though.
Why not do what real calculators do?
Design a small 4 or 8 bit microcontroller and code it in Verilog.
Write the calculator application in assembly language.
Regards,
Allan.
Naw, I think that might be just a little tough for the OP, but if you
were doing millions of em, it would certainly be the way.
Another way might be to use handelc and work at a more abstract way
with a C behavioural model. Either way would allow the architecture to
grow and support trigs etc.
regards
johnjakson_usa_com