designing a digital system

Thread Starter

digitalize

Joined Apr 15, 2015
9
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.

Thanks In Advance.
 

Papabravo

Joined Feb 24, 2006
21,159
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?
 

tshuck

Joined Oct 18, 2012
3,534
[...]
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.[...]
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?
 

Thread Starter

digitalize

Joined Apr 15, 2015
9
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?
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:

WBahn

Joined Mar 31, 2012
29,979
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.

Thanks In Advance.
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?
 

WBahn

Joined Mar 31, 2012
29,979
9*9=81 = 0b1010001

\(log_2{81}\approx 6.34 \rightarrow 7 bits\)
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.
 

Thread Starter

digitalize

Joined Apr 15, 2015
9
I'll answer your question with another question: what happens when your inputs are 0b1010 and 0b0101, decimal 10 and 5, respectively?
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..?
 

tshuck

Joined Oct 18, 2012
3,534
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?
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.
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..?
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:

tshuck

Joined Oct 18, 2012
3,534
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.
I'm not sure how a BCD system is implied, should the question require it, it should be specified explicitly.
 

WBahn

Joined Mar 31, 2012
29,979
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.

Thanks In Advance.
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.
 

WBahn

Joined Mar 31, 2012
29,979
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.
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.
 

WBahn

Joined Mar 31, 2012
29,979
I'm not sure how a BCD system is implied, should the question require it, it should be specified explicitly.
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).
 

tshuck

Joined Oct 18, 2012
3,534
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.
I was reaponding to post # 12:
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..?
 

Thread Starter

digitalize

Joined Apr 15, 2015
9
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.
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?
 

WBahn

Joined Mar 31, 2012
29,979
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?
That seems like probably the most reasonable interpretation, given the limited information.
 
Top