thats exactly what it is the maximum number is 14, 7+7 we only had one week to do it so we are keeping it simple. so what i was thinking was i have to program another 7 segment to have a constant - when num2 is larger than num1 during subtraction but thats where i get stuck i dont know what i have to do for it to do the subtraction correctly... u get what im saying?
wrong it's (-8) +(-8) or (-8) - (8), which are both -16 or do you mean to restrict the 2's comp inputs numbers to 1001 (i.e. -7)?
How are you showing negative results? Assuming you want signed outputs from the 7-seg.
If you use a 7-seg with only the - (middle segment) lit then you'll have to have three 7-segs not four.
i.e. sign, 10's digit, 1's digit.
I figure the decoder should be one decoder for all three 7-segs (or it can still use three different ones, up to you) that use the same case logic to assign the 7-seg encoding for each digit and sign.
e.g.
Code VHDL - [expand] |
1
2
3
4
5
6
7
8
9
10
11
| case result is
when "00000" => -- +00
sign <= "1111111";
tens <= "1000000";
ones <= "1000000";
-- ...
when "10000" => -- -16
sign <= "0111111";
tens <= "1111001";
ones <= "0000010";
end case; |
- - - Updated - - -
I just realized you may have had four 7-segs for performing multiplication... (-16) * (16) will give you -256 (i.e. four 7-segs)
- - - Updated - - -
If you are going to support multiplication you'll want to have case statements for each digit (one case will be too big), so you'll need to do a binary to bcd conversions first...
https://www.eng.utah.edu/~nmcdonal/Tutorials/BCDTutorial/BCDConversion.html
then use that and a single bcd to 7-seg deccoder, which you'll instantiate 3 times.