Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Forums > Electronic Projects Design/Ideas/Reviews


Electronic Projects Design/Ideas/Reviews Are you building an electronic project or want to? Maybe you need some assistance? Come and submit your electronic questions here and let our experienced members find a solution.

Reply
 
Thread Tools Display Modes
Old 20th January 2008, 03:46 PM   (permalink)
Default Calculator Project

I am building a very simple calculator, but need help with one small area.

I have 4x4013 chips to represent a 4 bit number. When I press, for example, 3 on the number pad I want to set the 4013 chips to the correct values. That is to say:

FF...... 1 2 4 8
============
Value.. 1 1 0 0

To start with I tried to set a 4013's Q to high by wiring both the D and Clock to the switch, imagining that when I hold down the button Q will go high, but that doesn't work. I'm not sure why. Anyone got any ideas on how to achieve the setting of flip flips according to which value button i press?
matthewwren is offline   Reply With Quote
Old 20th January 2008, 04:04 PM   (permalink)
Default

I do not know what type of number pad you have so answering is a little hard.

If I wanted to get from a keypad to 4 bit number I would look at using the MM74C922 ic.
http://www.fairchildsemi.com/ds/MM/MM74C922.pdf
It has 4 outputs A,B,C,D which are Q0,1,2,3. Then the DA pin indicates that a key is pressed and data is available.

Hope this helps.
ronsimpson is offline   Reply With Quote
Old 20th January 2008, 04:47 PM   (permalink)
Default

If you are using switches, you need a separate switch for each D input, and one clock switch that connects to all 4 clock inputs. I hope you learned about switch debouncing and pullup/pulldown resistors on the other thread on this subject.
You don't need to debounce the D input switches, just the clock.
__________________
Ron

Roff is offline   Reply With Quote
Old 20th January 2008, 07:03 PM   (permalink)
Default

Thanks for your help guys. Just a couple of questions:

Roff - I want to make a keyboard input, so numbers 0-9, rather than separate switches for clock and bits. Is there no way of using the same output to pulse clock and D? Why doesn't this work?

Ronsimpson - This looks interesting. Am I right in assuming that the DA pin can act as my clock in on the 4013?
matthewwren is offline   Reply With Quote
Old 20th January 2008, 07:51 PM   (permalink)
Default

Quote:
Originally Posted by matthewwren
Thanks for your help guys. Just a couple of questions:

Roff - I want to make a keyboard input, so numbers 0-9, rather than separate switches for clock and bits. Is there no way of using the same output to pulse clock and D? Why doesn't this work?

Ronsimpson - This looks interesting. Am I right in assuming that the DA pin can act as my clock in on the 4013?
SInce data can be either a one or a zero, you would have to generate a debounced rising clock edge on either transition of the data (0-1 or 1-0). This can be done, but it requires an Exclusive OR (XOR) gate to generate the pulse, plus you still need debouncing in front of it.
The 74C922 is your best bet, and DA can, as you surmised, be used as your clock to the 4013's.
You need to know that the D input must be settled (no bouncing), plus there is a small delay required between data and clock (called setup time), in order to be able to capture data on a flipflop such as the 4013. The 74C922 takes care of this for you, as does any properly designed debounce circuit, if you were to try to do it the other way (which I don't advise).
As you can see from the 74C922 datasheet, a keypad is a matrix of switches, not 10 or 16 individual SPST switches. I wouldn't try to implement a decoder in discrete logic chips - a microcontroller could do it.
__________________
Ron


Last edited by Roff; 20th January 2008 at 07:58 PM.
Roff is offline   Reply With Quote
Old 2nd May 2008, 07:10 PM   (permalink)
Default

hi
i want to design calculator with AT89c51 micro.
pleas send for me asm code and proteus designs.
s_ha_hashemi_1107@yahoo.com
thanks.
shaham is offline   Reply With Quote
Old 2nd May 2008, 08:48 PM   (permalink)
Default

way to go
__________________
Steve
______________________
info@mister-e.org
www.mister-e.org
mister_e is offline   Reply With Quote
Old 2nd May 2008, 09:03 PM   (permalink)
Default

Quote:
Originally Posted by shaham
hi
i want to design calculator with AT89c51 micro.
pleas send for me asm code and proteus designs.
s_ha_hashemi_1107@yahoo.com
thanks.
If it's a school assignment you should at least make an effort yourself. If you need a calculator they can be found for about $1
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is offline   Reply With Quote
Old 2nd May 2008, 09:29 PM   (permalink)
Default

Quote:
Originally Posted by shaham
hi
i want to design calculator with AT89c51 micro.
pleas send for me asm code and proteus designs.
s_ha_hashemi_1107@yahoo.com
thanks.
So How Are YOU Designing It Then ????????

Your Request Should Be...

I WANT YOU TO DESIGN etc.
__________________
I think, therefore I am. Therefore I must be !!! I think ???
rmn_tech is offline   Reply With Quote
Old 3rd May 2008, 10:17 PM   (permalink)
Default

There's no point in designing a calculator these days, unless it's purely for educational purposes.

Also implementing functions like multiply, divide and square root is pretty impractical without using a microcontroller.

If I were you, I'd not just design a simple calculator or even a scientific/graphical calculator but one with handy functions and can't be bought cheaply - a calculator with a clock calander, time and date functions, plus a currency converter as well as some scientific features like operator precedence and brackets would be very handy.
__________________
I also post at the following sites:
http://www.stop-microsoft.org http://www.heated-debates.com
Screen name: Aloone_Jonez
Hero999 is online now   Reply With Quote
Old 16th May 2008, 08:38 AM   (permalink)
Default

i want the asm code and proteus disign.
TQ
shaham is offline   Reply With Quote
Old 17th May 2008, 01:56 AM   (permalink)
Default

On a slightly off topic note:
How do you calculate the square root of something, in pseudo code or anything ? Just something I've always wanted to know !
yngndrw is offline   Reply With Quote
Old 17th May 2008, 09:49 AM   (permalink)
Default calculator

i want asembly code and peroteus design for a simple calculator with micro AT89c51.(+,*,/,-)
thanks.
shaham is offline   Reply With Quote
Old 17th May 2008, 10:53 AM   (permalink)
Default

You don't seem to understand.

NO, WE WILL NOT GIVE YOU THE SOURCE CODE!

DO IT YOURSELF!
__________________
I also post at the following sites:
http://www.stop-microsoft.org http://www.heated-debates.com
Screen name: Aloone_Jonez
Hero999 is online now   Reply With Quote
Old 18th May 2008, 11:05 AM   (permalink)
Default

owned


__________________
Spency.

PIC Micro's - Your mind is the limit

PIC's and interfacing with other devices - a PIC Basic Guide @ digital-diy.net
gramo is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes




All times are GMT. The time now is 01:32 PM.


Electronic Circuits  |  Electronics Wiki
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.