I think I have the right answer but it says it's wrong

Thread Starter

Steven Jang

Joined Jul 25, 2016
8
Bob is 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). When both input and output are expressed in binary, 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)? Enter your answer in the format of (1,3,2) or simply 1, 3, 2.

I put 4, 7, 6 because since the integers are 0-9 and 2^4=16 then that means the integer has to have 4 bits and for the output, the max is 81, so it is 2^7 so 7 bits and for the don't cares, there are 6 of them because we only need integers 0-9 but we have 4 bits so 10-15 don't matter so there are 6 don't cares for input at least. Sow wtf is wrong with my answer

ANSWERS APPRECIATED
 

WBahn

Joined Mar 31, 2012
32,970
How many bits does it take to represent all of the possible input values (for one of the inputs) if that input is a t2-digit decimal integer?

How many bits are required to represent the largest possible product of two 2-digit decimal integers?
 

Thread Starter

Steven Jang

Joined Jul 25, 2016
8
How many bits does it take to represent all of the possible input values (for one of the inputs) if that input is a t2-digit decimal integer?

How many bits are required to represent the largest possible product of two 2-digit decimal integers?
but the inputs are only single digit decimal integers
 

WBahn

Joined Mar 31, 2012
32,970
but the inputs are only single digit decimal integers
Ah, you are correct. I misread it.

So I agree that (assuming the two input digits share no bits), that you need 8 input bits and 7 output bits.

You are significantly underestimating you number of don't care states. Break each digit into two sets -- 10 cares and 6 don't cares. Now keep in mind that you only care if BOTH digits are cares. How many combinations is this? How many total combinations are there for two 4-bit values?
 

Thread Starter

Steven Jang

Joined Jul 25, 2016
8
Ah, you are correct. I misread it.

So I agree that (assuming the two input digits share no bits), that you need 8 input bits and 7 output bits.

You are significantly underestimating you number of don't care states. Break each digit into two sets -- 10 cares and 6 don't cares. Now keep in mind that you only care if BOTH digits are cares. How many combinations is this? How many total combinations are there for two 4-bit values?
so since if just one of the inputs are don't cares that means the entire input is don't care. So would there be 150 don't care inputs?
 

Thread Starter

Steven Jang

Joined Jul 25, 2016
8
Ah, you are correct. I misread it.

So I agree that (assuming the two input digits share no bits), that you need 8 input bits and 7 output bits.

You are significantly underestimating you number of don't care states. Break each digit into two sets -- 10 cares and 6 don't cares. Now keep in mind that you only care if BOTH digits are cares. How many combinations is this? How many total combinations are there for two 4-bit values?
156?
 

MrAl

Joined Jun 17, 2014
13,726
Hi,

Are you saying that you can input two digits, each from 0 to 9, and need to know the max number of bits of the output?
 

jpanhalt

Joined Jan 18, 2008
11,087
I get a smaller number of "don't care" entries, but my focus is on the word "combinations," which ignores the order of selection. Thus, the entries of E*3 and 3*E count as only one combination.

There are, of course, 6 "don't care" entries that make a combination with any other entry a don't care combination. So the number of don't care entries is >6 and less than 156... How many entries can be made for other entry of the pair?

John

Edit: Is 0*F a "don't care" combination? Obviously, the "F" should make it don't care, but the zero will give a correct BCD answer, as will other values for the other entry. While that ambiguity may exist and not be resolved in the question statement, I would consider it is a don't care combination, as one character violates the rules for BCD entry.
 
Last edited:

WBahn

Joined Mar 31, 2012
32,970
I get a smaller number of "don't care" entries, but my focus is on the word "combinations," which ignores the order of selection. Thus, the entries of E*3 and 3*E count as only one combination.

There are, of course, 6 "don't care" entries that make a combination with any other entry a don't care combination. So the number of don't care entries is >6 and less than 156... How many entries can be made for other entry of the pair?

John

Edit: Is 0*F a "don't care" combination? Obviously, the "F" should make it don't care, but the zero will give a correct BCD answer, as will other values for the other entry. While that ambiguity may exist and not be resolved in the question statement, I would consider it is a don't care combination, as one character violates the rules for BCD entry.
I would see E*3 and 3*E as two different combinations, though I understand what you are saying. Part of my reasoning is that the question leads to the treatment of the two four-bit inputs as a single eight-bit pattern, and 11100011 is a different input combination than 00111110. Also, there is no requirement for E*3 to produce the same output as 3*E, so it seems unreasonable to treat them as a single entry when that is the case.

I also agree that 0*F is a "don't care". First, a "don't care" input combination isn't one that yields an incorrect output, but rather one in which we simply don't care if the resulting output is correct or not. Second, there is no requirement for 0*F to actually result in an output of 0 -- if the logic minimization results in it giving a different result, then that is perfectly acceptable. An interesting follow-on question once the student has implemented their logic would be to ask how many of the "don't care" input patterns could produce correct output patterns and how many of them actually do.
 

jpanhalt

Joined Jan 18, 2008
11,087
I got 96 (6*16) combinations. That is binary A-F = 6 entries that make any other entry "don't care." And, there are 16 other possible 4-bit entries (0 -F).

John
 

WBahn

Joined Mar 31, 2012
32,970
If we are counting each possible distinct input combination independently (making 3*E distinct from e*3) then there are a couple of way of counting them up.

First, there are 256 possible combinations (a total of 8-bits of input). Of those, there are 100 legal combinations (mapping to two single-digit inputs) making the remaining 156 input combinations illegal.

Second, for the first four bits there are 6 illegal combinations and, for each of them, there are 16 possible combinations of the other four bits, making 96 illegal combinations just from that. However, for the remaining 10 legal combinations of the first for bits, there are 6 illegal combinations of the remaining four bits making an additional 60 illegal combinations, for a total of 156 combinations.

Third, break each set for four bits into 10 legal and 6 illegal combinations. You then have

6x6 = 36 combinations in which both digits are illegal
10x6 = 60 combinations in which only the second digit is illegal
6x10 = 60 combinations in which only the first digit is illegal

total = 156 combinations in which at least one digit is illegal.
 

MrAl

Joined Jun 17, 2014
13,726
Hi,

That sounds reasonable.

If you have 7 bits that is 0 to 127, 128 possibilities only 100 are used, the 8th bit adds 128 possibilities that are unused, so that's 128+28=156 unused combinations.
 
Top