I am working on a 74181 project which is supposed to perform logical and arithmetical operations. What is the best way to output the arithmetical operations result: using a 7 segment display (in decimal form) or in binary form (1 LED for each output bit).

Given that the output value will vary from 0 to 9, is using 7 segment display a good idea? Or better said, is it correct.

To understand my question better, how are the outputs from arithmetic operations meant to be treated; as binary or decimal?

Click to expand...

Why do you say the output will vary from 0 to 9? Are you limiting the input values so that the output never exceeds 9? Is the circuit going to perform BCD logic?

If the output is intended for the average person to read, then typically a decimal output is displayed, but that requires the conversion of the usual binary number into decimal (BCD) format, which is not a simple process.

If you are just wanting to observe the output to see that it is working, then you can use a hexadecimal digit display for each 4-bits.

This is the part I don't get. Are the arithmetical operations performed on 2 binary numbers or 2 decimal numbers coded as binary?

Click to expand...

Since each of the inputs going into your circuit can only be a 0 or a 1, it can't be working on a decimal representation. So it has to be working with a binary representation. The question is, what binary representation is used? The common ones are unsigned binary, signed binary using two's compement, or binary-coded decimal (BCD).

The 74181 uses 1's complement to perform subtraction, but I'm not sure (have never used it) whether external I/O is in 1's complement or 2's complement. It is NOT in BCD.

If you are going to use the 74181 in a project, you need to first learn and understand what the 74181 does.

........................
So does anyone have an idea how the output can be showed on 7-segment screens?

Click to expand...

If you want the output in decimal, then you will need to do a binary to BCD conversion, which is not trivial to do. If 4-bit Hex output (0-9, A,b,C,d,E,F) is satisfactory, then you can generate that with a 7-segment display such as shown here.

Well I have to say that I posted here to have the things cleared up a bit exactly because I don't know exactly how this IC works in arithmetic mode. And thanks for the explanation.

So does anyone have an idea how the output can be showed on 7-segment screens?

Thanks.

Click to expand...

There are lots of ways to display it (well, perhaps not "lots", but certainly several). The two big options are displaying it in decimal or displaying it in hex. If you display it in decimal you have to convert your binary output to BCD. If you display it in hex, then you have to be able to generate the encodings for the alphabetic hex digits, which a 7447 doesn't do, but something like a MC14495 does. But we have no idea which way(s) is(are) appropriate for your project because we don't know anything about your project other than you are using a 74181 and are outputting the results of arithmetic operations. Who is going to be looking at the display? Will they know how to interpret a hex display? Can your arithmetic operations result in negative values? Will the person looking at the display know how to interpret the hex encoding of a negative value?

The output is binary, but the problem is that it's max value is 1111, which would be 15 in decimal. And I need a way to show that decimal value on two 7-segment screens. The output can have negative values too.

The output is binary, but the problem is that it's max value is 1111, which would be 15 in decimal. And I need a way to show that decimal value on two 7-segment screens. The output can have negative values too.

Thank's.

Click to expand...

Now you are describing a signed BCD display involving three indicators, one for the sign, one for the tens digit, and one for the ones digit.

If you have four bits and can have negative values, then you can't have a max value of 15. You have a total of 16 values you can represent and you must allocate them between positive and negative values. If you use two' complement, then this would be -8 to +7.

Before you can talk about displaying the result, you must be clear on how the values you want to display will be represented. So take a step back and get that settled first.

If the intent is to have something that looks and, to some degree anyway, sounds like like an old radio, sure. But if the intend is to understand old radios, not so much. Which would be more likely to be the intent of the problem here?

Now you are describing a signed BCD display involving three indicators, one for the sign, one for the tens digit, and one for the ones digit.

If you have four bits and can have negative values, then you can't have a max value of 15. You have a total of 16 values you can represent and you must allocate them between positive and negative values. If you use two' complement, then this would be -8 to +7.

Before you can talk about displaying the result, you must be clear on how the values you want to display will be represented. So take a step back and get that settled first.

Click to expand...

At this point I am kinda confused. Can you take a look at the 74181 datasheet for me? (I know that is works with negative values too, but thought that its max value is 15, which possibly is not).

As for the output, I want to have it in decimal form on multiple 7-segments displays. For example: if you input 4-6 (0100 - 0111), then the output should be -2 on the displays.

At this point I am kinda confused. Can you take a look at the 74181 datasheet for me? (I know that is works with negative values too, but thought that its max value is 15, which possibly is not).

As for the output, I want to have it in decimal form on multiple 7-segments displays. For example: if you input 4-6 (0100 - 0111), then the output should be -2 on the displays.

Thanks!

Click to expand...

You can interpret the inputs and outputs as either signed or unsigned, but you can't do both at the same time. For instant, if you input 4-6, what is the output (what are the four bits). If you do 7+7, what is the output?