I want to make an excess-3 adder and an excess-3 subtractor using two 4-bit binary adder (the inputs are already in excess-3) and then show the results in excess-3 on a seven segment. For example, 2+7=9 we have 0101+1010=1100(after subtracting 3 cause excess-3 + excess-3= excess-6) or for subtracting 1-8=-7 we have 0001-1011= -1010 (I should use another seven segment to show the negative) but I have trouble showing 1100 and 1010 with two seven segments. I know I should use 2 seven segments when I have 7,8 or 9 in the result but I don't know how to do that.
Like when I add 9 to 9 which is 1100 in excess-3 I get 1 in carry and 1011, how can I show this as 21(18 in excess-3) on the seven segments?
2 Answers
I add 9 to 9 which is 1100 in excess-3. I get 1 in carry and 1011, how can I show this [usefully] on the seven segments?
Displaying a conventional digit would blur any distinction in coding.
Hex and octal are even worse, sharing many symbols with digits of a base 10 representation but a different meaning.
I suggest mounting the 7-segement displays sideways to create a bit-wise display in the now vertical segments a, d, and g - 6 bits for two devices.
The sum of any two decimal digits is a single decimal digit (4 bits of excess-3), plus possibly a carry. That carry in excess-3 needs another 3 bits for a total of 7, but there are only 6. The two lower significant bits for the carry are identical for 0 (LHH) and 1 (HLL):
I suggest to display bit 0 of the carry digit with segment g of the more significant 7-segment display device, with the interpretation bit 0 and 1.
One could light the decimal point for error: bits 0 & 1 don't agree. (A pity it isn't next to segment \$g\$ - light \$b\$&\$c\$ or \$e\$&\$f\$ instead?)
- 1,794
- 1
- 7
- 20
You will need some extra circuitry if you want to drive 7-segements display with binary data. You can start by looking on how to use chips such as 74LS47 or 74LS48 (BCD to 7-segments decoder), then you'll need to find how to drive your two 7-displays together, one for the tens and the other for the units.
You can look over there : https://www.electronics-tutorials.ws/combination/comb_6.html, it can be a good start for what you intend to achieve.
- 1
- 1
21(18 in exess-3)it is not useful to consider values outside 0-9 as excess-3. $18_{dec}$ is $4B_{hex}$ in excess-3. – greybeard Jan 06 '23 at 20:09