Multiplication by summation of power series with negative terms

How to calculate floating point animation in Verilog? So far, I usually used shift <1024, then the floating point number becomes an integer. Then I do some operations, then → 1024 to get the drop again.

For example, 0.3545 = 2 ^ -2 + 2 ^ -4 + ...

I have a question about something else like this. I do not know where the minus (-) is:

0.46194 = 2 ^ -1 - 2 ^ -5 - 2 ^ -7 + 2 ^ -10.

I just watch it from someone. but like you, it looks like

0.46194 = 2 ^ -2 + 2 ^ -3 + 2 ^ -4 + 2 ^ -6 + 2 ^ -7 + 2 ^ -10 + .....

I don’t understand how he knows that minus is used?

How do we know when he needs a minus? Also how can I apply to verilog RTL?

UPDATE: I understand the concept of using minus in work. But is there any other way of equation or methodology to reduce the expression multiplying force 2?

UPDATE: how can we use this method in verilog? for example, I leaned in at 0.46194 = 2 ^ -1 - 2 ^ -5 - 2 ^ -7 + 2 ^ -10. then this code was also written in verilog. 0.011101101 = 'hED =' d237. So the question is, how can we apply it to an application in verilog?


UPDATE: Sir, please check this? there is a small difference result.

0.46194 = 0.011101101. I just tried this

0.011101101

0.100T10T01

= 2 ^ -1 - 2 ^ -4 + 2 ^ -5 - 2 ^ -7 + 2 ^ -9. = 0.462890625

Something other. What am I wrong?

+4
source share
2 answers

4- 2 :

Base 2: Unsigned 4 bit integer, 
2^3  2^2  2^1  2^0  
  8    4    2    1 

0111, 7. , 3 (3 ).

CSD (Canonical Signed Digit. " ". -1 , T, .

100T 8 - 1, 0111. , 1 0, , 1, 1 -1, (T).

:

00111101111
01000T1000T

, :

00111101111
0011111000T
010000T000T

, 8 8 3.

Verilog x ? verilog-floating-points-multiplication.

:

CSD. , , , 2 ^ 9 (9 ).

256  128 64 32 16 8 4 2 1
  0    1  1  1  0 1 1 0 1

128 + 64 +32 + 8 +4 +1 => 237

CSD:

256  128 64 32 16 8 4 2 1
  1    0  0  T  1 0 T 0 1

256  -32 + 16 - 4 + 1 => 237

, . 237 * 2 ^ -9 0.462890625, , . 0.46194, , , , . . , , , CSD.

+2

. , FPGA, , .

, 1 , . ( , .)

30 = 11110. 16 + 8 + 4 + 2, 32 - 2.

1- . , 16x + ... + 2x 32x - 2x.

, 1- . 2^a = 1 + ∑2^0 ... 2^(a-1), worsd ∑2^0 ... 2^a = 2^(a+1) - 1.

+3

All Articles