# designing a digital system

Discussion in 'Homework Help' started by digitalize, Apr 15, 2015.

1. ### digitalize Thread Starter New Member

Apr 15, 2015
9
0
Hello,

I'm working on a homework problem that involves designing a digital system to implement the multiplication table. When two single-digit integers (0-9), e.g. 4 and 7, are entered, the system will output their product (28 in this case). The system should have x bits as input, y bits as output, and z input combinations as don't care conditions. What are the values of (x, y, z)?
So, I've figure out how that my x=8 and y=7, but where I'm stumped is the don't care. How shall I go about solving for z.

2. ### Papabravo Expert

Feb 24, 2006
10,338
1,850
How about z = 0? Not every problem has don't cares.
Alternatively, if you use four bits to represent 0-9 you have 6 input combinations that are invalid.
How do you want to treat the invalid input combinations?

3. ### tshuck Well-Known Member

Oct 18, 2012
3,531
675
You are using two four-bit inputs, but how many bits are used? What happens when 0b1010 is multiplied by 0b0101? How many combinations are there using numbers that are not valid inputs, but can still be represented with 4-bit numbers?

4. ### digitalize Thread Starter New Member

Apr 15, 2015
9
0
Since the max number 81, then any combination where both 4 bit numbers are above 9 are not valid inputs. Correct?

So that should equal 42 non valid combinations?

Last edited: Apr 15, 2015
5. ### tshuck Well-Known Member

Oct 18, 2012
3,531
675
I'll answer your question with another question: what happens when your inputs are 0b1010 and 0b0101, decimal 10 and 5, respectively?

6. ### WBahn Moderator

Mar 31, 2012
18,079
4,917
How are you going to represent the result of 9 x 9 using only 7 output bits?

If you have 8 input bits, how many possible input combinations are there?

How many of those combinations are meaningful?

How many possible combinations are there when multiplying one single-digit integer by another single digit integer?

7. ### WBahn Moderator

Mar 31, 2012
18,079
4,917
Does it matter?

8. ### tshuck Well-Known Member

Oct 18, 2012
3,531
675
Yes, we are multiplying two 4-bit numbers ranging from 0-9...

9. ### tshuck Well-Known Member

Oct 18, 2012
3,531
675
9*9=81 = 0b1010001

$log_2{81}\approx 6.34 \rightarrow 7 bits$

Last edited: Apr 15, 2015
10. ### WBahn Moderator

Mar 31, 2012
18,079
4,917
So how does the result of multiplying 10 by 5 matter when 10 is a disallowed input?

The behavior is unspecified, if not outright undefined.

11. ### WBahn Moderator

Mar 31, 2012
18,079
4,917
The use of two single digit inputs that are in the range 0-9 implies a BCD system. But, yes, if you are specifying that the output is straight binary despite the input being implicitly BCD, then 7 bits for the output is sufficient.

12. ### digitalize Thread Starter New Member

Apr 15, 2015
9
0
If I'm understanding your question, you multiply 10 by 5 and with a decimal result of 50 that equals a binary result of 110010.
Where are you going with this..?

13. ### tshuck Well-Known Member

Oct 18, 2012
3,531
675
You said don't cares exist "where both 4 bit numbers are above 9", however, an input of 10 is an invalid input, meaning the input combination is a don't care - it is beyond the defined behavior of the design. It is not just when both are above 9.

Last edited: Apr 15, 2015
14. ### tshuck Well-Known Member

Oct 18, 2012
3,531
675
I'm not sure how a BCD system is implied, should the question require it, it should be specified explicitly.

15. ### WBahn Moderator

Mar 31, 2012
18,079
4,917
One thing that is missing -- and that has shown up in the discussion so far -- is that the answer is dependent on the representation of the various pieces. In particular, how are the output values represented? Straight binary or BCD being the two most obvious and reasonable choices. But if you really wanted to compress the output into as few bits as possible, you could simply enumerate all of the possible answers of the multiplication of two single decimal digit integers, of which there are only 37. So you COULD get by with only 6 bits in the output, of which 27 of the 64 patterns are not used. Similarly, you only need 100 input combinations which can be satisfied with just 7 bits if you encode them adequately.

16. ### WBahn Moderator

Mar 31, 2012
18,079
4,917
The OP set the limits on the defined behavior: "When two single-digit integers (0-9), e.g. 4 and 7, are entered, the system will output their product (28 in this case)."

Multiplying 10 x 5 violates the system description.

Your question about multiplying 10x5 in Post #3 predates the TS's incorrect conclusion in trying to answer that question in Post #4.

17. ### WBahn Moderator

Mar 31, 2012
18,079
4,917
By limiting the input values to single decimal values, it can be considered as implying a BCD-based system. I'm not saying that this is absolutely the case, by any means. In a problem without any context, what one reader takes as implied usually depends on the first context that pops into their mind. For instance, for a description as basic as this, the context that might well pop into someone's mind is a system in which the user enters the two digits and the result is displayed on two 7-segment displays. Now, there is nothing in the description that requires or directly implies this, but if that is the first context that pops into you mind you are very likely infer that the output is intended to be BCD. But if the first context that pops into your mind involves producing a value that is then sent on to a more complicated system, then you are very likely to infer that the output in intended to be straight binary. There may well be contexts that pop into someone's mind that would require that they allow for the possibility of negative values at some point down the road and so they would gravitate toward 2's comp (or, less likely, some other signed representation).

18. ### tshuck Well-Known Member

Oct 18, 2012
3,531
675
I was reaponding to post # 12:

19. ### digitalize Thread Starter New Member

Apr 15, 2015
9
0
So having 100 input combinations would satisfy the 10x10 numeric places (0-9). and if we have two four bit inputs, 2^4 = 16, then two four bit inputs would equal 256. Out of those 256 combinations, 156 are considered don't cares?

20. ### WBahn Moderator

Mar 31, 2012
18,079
4,917
That seems like probably the most reasonable interpretation, given the limited information.