0

Design a combinational circuit that accepts a 4-bit number and generates a 3-bit binary number output that approximates the square root of the number. For example, if the square root is 3.5 or larger, give a result of 4. If the square root is < 3.5 and ≥ 2.5, give a result of 3.

Does my truth table on input goes this way? (I'm using A, B, C, D for my inputs)

    INPUTS        OUTPUTS   Decimal - Square Root Value
  __________    __________  ____________________________
  A  B  C  D    W  X  Y  Z    
  0  0  0  0    0  0  0  0     0 - 0
  0  0  0  1    0  0  0  1     1 - 1
  0  0  1  0    0  0  0  1     2 - 1.14
  0  0  1  1    0  0  1  0     3 - 1.73
  0  1  0  0    0  0  1  0     4 - 2
  0  1  0  1    0  0  1  0     5 - 2.23
  0  1  1  0    0  0  1  0     6 - 2.44
  0  1  1  1    0  0  1  1     7 - 2.64
  1  0  0  0    0  0  1  1     8 - 2.82
  1  0  0  1    0  0  1  1     9 - 3
  1  0  1  0    0  0  1  1    10 - 3.16
  1  0  1  1    0  0  1  1    11 - 3.31
  1  1  0  0    0  0  1  1    12 - 3.46
  1  1  0  1    0  1  0  0    13 - 3.60
  1  1  1  0    0  1  0  0    14 - 3.74
  1  1  1  1    0  1  0  0    15 - 3.87

I'm having trouble generating the output table with "generates a 3-bit binary number output that approximates the square root of the number" Can someone help me with the outputs? Thank you.

DrakaSAN
  • 7,673
  • 7
  • 52
  • 94
JustAStudent
  • 99
  • 1
  • 5
  • 10

1 Answers1

1

Translate your input as decimal, get square root for each of them, and translate them in binary?

Exemple: 0000 => 0 Square root of 0 is 0 0 => 0000

So you have

A|B|C|D||W|X|Y|Z

0 0 0 0||0 0 0 0

And do the rest of your homework this way?

DrakaSAN
  • 7,673
  • 7
  • 52
  • 94
  • So what if square root of 5 is 2.23? Does it mean it's the binary value of 2? And what if it's square root of 15 = 3.87? Does it mean the binary value of 4 or 3? @DrakaSAN – JustAStudent Sep 19 '13 at 13:44
  • 2
    You answered it in your question. "For example, if the square root is 3.5 or larger, give a result of 4. If the square root is < 3.5 and ≥ 2.5, give a result of 3." – DrakaSAN Sep 19 '13 at 13:46
  • I've answered everything @DrakaSAN. I edited my question. Am I doing the right thing? – JustAStudent Sep 19 '13 at 13:47
  • Put decimal value, square root and pow of the row 3,4,7,8,13 and 14, so I can check without loosing too much time – DrakaSAN Sep 19 '13 at 13:49
  • Yup, it s that, out of curiosity, in which degree are you for that kind of homework?. – DrakaSAN Sep 19 '13 at 13:55
  • So is my truth table now correct? @DrakaSAN? Computer Science. Freshman. – JustAStudent Sep 19 '13 at 13:57
  • I think it is correct yes, you ll see it get more interesting when starting to code 'for real'. Don t forget to accept the answer to close the question, and good luck ; ) – DrakaSAN Sep 19 '13 at 13:58
  • Yay! Thank you very much. Accepted it already. Thanks again. @DrakaSAN – JustAStudent Sep 19 '13 at 13:58