8 bit calculator out of TTL
ohVaNiLLaGoRiLLa
Posts: 33
I previously posted a topic about using a micro controller instead of constructing an 8 bit calculator out of TTL. Plenty of people had ideas about this calculator. So i was wondering what is the best way to build an 8 bit calculator out of ttl logic chips? I can use programmable logic chips also such as the GAL16V8 and the GAL22V10. This calculator just has to add and subtract!
For input I was going to use a dip switch.
From the input the number will go to the first register and the first register will always be displayed on the calculator display consisting of three 7 segment leds.
the first register will be some 74273 that works as a register so when its clocked it will hold the number. The number in this register will move to the second register when the second number is entered.
For the second register I was going to use a programmable logic chip, gal22v10, and program it so that if one of the pins is high it will store the 2s compliment of the number being put into it and if its low it will just store the number.
Then the two numbers will go to three 4bit adders connected together. The reason for 3 adder is because 2s compliment only goes up to 127 with 8 bits. Then the answer will be put in the first register which is always being displayed.
programming that gal22v10 with a table of 2s compliments and just regular binary numbers is going to be ridiculously time consuming and I am not even sure if it could hold two such large tables.
Have any ideas on how to improve this? or any other approaches that would possibly be less time consuming? This is the simplest way I can think to do it. I mean simple as least chips possible.
One issue is doing the calculations in binary and then converting it to bcd to use the ttl chip 74 whatever that does bcd to 7 segment. Im not quite sure how to get the number stored in the first register to be displayed on the three 7 segments i have... For example if the first register contains the number 45, which is 00101101 in binary, how do i make the display 0 on the first 7 segment and 4 then 5 on the others?
For input I was going to use a dip switch.
From the input the number will go to the first register and the first register will always be displayed on the calculator display consisting of three 7 segment leds.
the first register will be some 74273 that works as a register so when its clocked it will hold the number. The number in this register will move to the second register when the second number is entered.
For the second register I was going to use a programmable logic chip, gal22v10, and program it so that if one of the pins is high it will store the 2s compliment of the number being put into it and if its low it will just store the number.
Then the two numbers will go to three 4bit adders connected together. The reason for 3 adder is because 2s compliment only goes up to 127 with 8 bits. Then the answer will be put in the first register which is always being displayed.
programming that gal22v10 with a table of 2s compliments and just regular binary numbers is going to be ridiculously time consuming and I am not even sure if it could hold two such large tables.
Have any ideas on how to improve this? or any other approaches that would possibly be less time consuming? This is the simplest way I can think to do it. I mean simple as least chips possible.
One issue is doing the calculations in binary and then converting it to bcd to use the ttl chip 74 whatever that does bcd to 7 segment. Im not quite sure how to get the number stored in the first register to be displayed on the three 7 segments i have... For example if the first register contains the number 45, which is 00101101 in binary, how do i make the display 0 on the first 7 segment and 4 then 5 on the others?
Comments
First thing to do is to make sure you have or can get the chips you need, as well as the programmer if one is needed. These two have been discontinued.
Second thing is to make sure the chips you select are acceptable to your instructor.
The chips you use to do the arithmetic are critical to the design of the rest of the circuitry. The 74181 was specifically designed to simplify doing binary math functions. It can do the conversion to 2's complement internally for subtraction. Take a good look at the data sheet logic diagram and the functions it can perform. Post a schematic of the adder you are going to use if you ask for more help.
The first four bits of a binary number cannot go directly to the BCD driver. Those bits could be anything from 0000 to 1111 and values from 1010 to 1111 are not valid BCD numbers. The simplest way to convert binary to BCD is to use a table in a 1K x 4 (or larger) eeprom and a 2 bit counter. Displaying hex would be the simplest.
You have not mentioned speed, which likely only has to be 'faster than someone can set the switches' ?
That gives a nice way to avoid wide combinatorial paths, by using counters. - the classic Serial Adder/Subtractor !!
Side step that problem too, by working in BCD
(I've even sidestepped BCD, and built an Up/Down counter in a 22V10, as a direct 7 segment state machine; from memory it included Ripple Blanking too... )
All PLDs can (ideally) have the same code and you preload both operand, set direction for Add/Subtract, and then Go.
Go clocks down one number set, whilst INC, or DEC of the other, until Zero. Result is A+B or A-B
A 3 digit BCD (or 7Seg) counter would give an answer in 10us max.
Edit : In the dusty archives, I found the code, and I see it used a Reset pin, and had 4 unused IP.
A quick check shows that can flip to a Parallel Load, and 4 PL values, and it still fits in a ATF22V10 (compiled. not tested).
The chip budget looks like one SPLD per Thumbwheel+7Seg, (as many as you want), plus one to handle Sign, and Go/Stop Add/Sub
Also the book is a complete presentation of TTL logic. You can either do this with BCD or with Hexadecimal or both. It all depends on what you desire in terms of a grade.
The text is "Digital Fundamentals: 7th Edition"
Since you have to create the following:
10 key input
LED output
and a maths processor
It seems that you would do best with a good reference. Use a 4x4 matrix key pad for your additional functions of +, -. and =.