6

enter image description here

When I read it, I think a \$2\$-digit BCD number is something between \$0\$ and \$99\$ in decimal. So, for example, \$0100 1001\$ is a \$2\$-digit BCD number and decimal equivalent of it is \$49\$ in my opinion.

However, this question confused me. I want to interpret \$A_0\$ or \$A_1\$ as a \$4\$ binary digits, representing a decimal number(BCD). And the circuit will add two \$2\$-digit binary numbers then. However, in such a scenario, I would expect to see an output labeling either as \$S_0\$ and \$S_1\$, which will also correspond to \$4\$ binary digits, but will represent BCD. Or, I would expect to see \$S_0\$ to \$S_7\$, each representing one binary digit.

In short, I am stuck in this question. Either I have some misunderstandings about wording, or I just don't get it.

I would appreciate if someone explains what this question wants to tell.

NAND
  • 498
  • 4
  • 20
muyustan
  • 2,046
  • 20
  • 54
  • 1
    A0, B0 and S0 are probably 4 bits wide – jsotola Apr 02 '20 at 00:47
  • @jsotola hmm, so, I now think as follows, do you agree? if ADDITION : "S0, S1 and S2 will represent the addition result, S3 will output 0" if SUBT : if COMPLEMENT : "S0 will be 9's complement of A0 and S1 will be 9's complemet of A1 and S2 will be 9's complement of B0 and S3 will be 9's complement of B1" – muyustan Apr 02 '20 at 00:52

3 Answers3

4

The idea here is that you can treat a BCD digit as a single entity. Look at the components you have:

  • 1-digit adder
  • Multiplexer (presumably for BCD digits)
  • 9's complement unit

All of these use full BCD digits for their inputs and outputs, so you don't have to think about the individual bits. \$C\$ and \$ADD\$ are binary, but they never combine with the BCD signals -- they would only be used for the multiplexer selection signals.

So your circuit's inputs are:

  • \$C\$, a binary signal
  • \$ADD\$, a binary signal
  • \$A\$, a two-digit BCD number with digits \$A_0\$ and \$A_1\$
  • \$B\$, a two-digit BCD number with digits \$B_0\$ and \$B_1\$

And the outputs are:

  • \$S\$, a collection of four BCD digits, which could be either:
    • A single number that represents the sum or difference of the inputs, with digits \$S_0\$ through \$S_4\$.
    • Two numbers which represent the complements of the two inputs, with \$S_1S_0 = \mathrm{complement}(A_1A_0)\$ and \$S_3S_2 = \mathrm{complement}(B_1B_0)\$.
Adam Haun
  • 21,331
  • 4
  • 50
  • 91
3

One 2-digit BCD number is 8-bit wide and is made from

  • High nibble = \$A_1\$ and

  • Low nibble = \$A_0\$

Each nibble consists of 4 bits.
So e.g. \$A_1 = 1000, A_0 = 0110\$ gives \$A = 86\$ in BCD.

Similarly \$B = B1 + B0\$.

\$S\$ is \$16\$ bits
\$= S_3 S_2 S_1 S_0\$ \$= 4 \times 4\$-bit digits

So e.g. \$S_4 S_3 S_2 S_1= 0001 \space 0010 \space 0100\space 1000 \$,

Gives \$S = 0001001001001000 = 1248\$ in BCD.

Russell McMahon
  • 147,325
  • 18
  • 210
  • 386
3

The instructor wants a \$4\$ digit output from two \$2\$-digit inputs. Each digit, of course, is \$4\$ bits.

It's not entirely clear, but it looks to me like he or she expects the outputs \$S_3..S_0\$ to output the \$9\$'s complement of \$B_1 B_0 A_1 A_0\$ when \$C = 1\$ So if the two numbers are \$A = 02\$ and \$B = 12\$ then \$S = 8797\$ when \$C = 1\$.

For addition you'd expect \$S_3\$ to remain \$0\$, and \$S_2\$ to be \$0\$ or \$1\$.

If \$A = 10\$ and \$B = 1\$ then it should be \$0009\$.

If \$A = 1\$ and \$B = 10\$ then I think it should be \$9991\$.

NAND
  • 498
  • 4
  • 20
Spehro Pefhany
  • 376,485
  • 21
  • 320
  • 842
  • well, thanks for the answer. Everything makes sense, except the A=1 and B=10 part, subtraction is not clear in my head also. While saying 9991, are you taking 9's compliment with 4 digits? Can you ellaborate a little bit ? – muyustan Apr 02 '20 at 02:00
  • Yes, extending the 2 digit number with two leading zeros before taking the complement. – Spehro Pefhany Apr 02 '20 at 02:01
  • For subtracting, I am planning to just take 9's comp. of each BCD digit, and then add `A0 + complement of B0` direct sum to `S0` and `Cout1` to second BCD adder, and add `A1 + comp of B1` there. Then, direct sum to `S1` and `Cout2` to `S2` while leaving `S3` as logic 0. Do you think it would work? – muyustan Apr 02 '20 at 02:05
  • 1
    well, it turned out that your 9991 was correct, it is sad that I did not get it that time(it was 6:00 am in my time zone) and did it as 9091 instead of 9991. – muyustan Apr 02 '20 at 11:19