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

StackOverflow https://stackoverflow.com/questions/18892938

문제

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.

도움이 되었습니까?

해결책

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?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top