how to display 0-30 sum in 7segment

Thread Starter

fhrozbite

Joined Feb 4, 2008
3
nid help guys.. in using 4bit full adder i dont have any problem but it displaying the output thats the problem comes out... in displaying a max sum of 9 only i can do but when the exceeds to 9 example 10 and above i cant do now... another problem is when im in subtraction mode i cant show the negative sign if the answer is negative...waht should i do... thnx for any reply...
 

Papabravo

Joined Feb 24, 2006
21,225
How do you get 0-30 from a 4-bit adder. As an unsigned number you can represent 0-15. As a signed number you can represent +7 to -8.

You can display the result in a number of ways but the easiest would be a lookup table, also known as a ROM. I think you need at least four inputs and a minimum of 14 outputs.

Another way to do it is to write boolean equations for each segment of the two displays and implement those equations in a PLD.

You could also use a medium pin count microcontroller to read the output of the adder and display the required digits.
 

beenthere

Joined Apr 20, 2004
15,819
Whether in hex or decimal, it takes two 7 segment displays to show two digits. Seven segments are not too clear showing hex - it takes a certain display driver to get the a - f numerals.

Consider using an LED as the negative number indicator.
 

Thread Starter

fhrozbite

Joined Feb 4, 2008
3
my prof ask me to make a 4bit full adder that can displays 0-30 sum and -15 to 15 difference... i used dip switches for the input...
 

hgmjr

Joined Jan 28, 2005
9,027
but how can i display the negative sign if the answer is negative??
You could obtain one of those LEDs that has the shape of negative sign and mount that in the appropriate mechanical location so that it serves the purpose of a negative sign.

similar to this example.

hgmjr
 

adrian.dmc

Joined Feb 22, 2007
53
When subtracting if you are using a 4bit adder than the carry will be the sign: 0 - positive; 1 - negative. To this can be achieved with a 4bit adder you first need to "invert" (two's complement) one of the operands.
 

Papabravo

Joined Feb 24, 2006
21,225
my prof ask me to make a 4bit full adder that can displays 0-30 sum and -15 to 15 difference... i used dip switches for the input...
It takes 5 bits to display numbers in the range [-16..+15]. The fifth bit is the Carry Out from bit 4 of the adder. Listen carefully because you seem confused.

5 bits can represent the unsigned numbers in the range [0..31]
5 bits can represent the signed numbers in the range [-16..+15]

The range of signed numbers is not symmetrical with respect to zero, but there are 16 negative numbers and 16 non-negative numbers. The total number of representable numbers must be a power of 2. For five bits this is 2^5 = 32 numbers. For all the negative numbers the Carry Out will be a 1.

A single 7-segment display can represent a minus sign by turning on segment g only. Also, they make displays that can do +, - and the digit 1 for a total of four segments.
 

RiJoRI

Joined Aug 15, 2007
536
FWIW, there are 7-segment latching LEDs that can decode hex. If I remember, HP made them.

Again, one LED display can show ONLY one character at a time.

--Rich
 
Top