top | item 34147322

(no title)

avianes | 3 years ago

You could do unary encoding in a parallel register (and conversely binary encoding using a serial bit stream).

The essence of unary encoding is that the number is encoded by the number of bits set to 1 in the word, and not the position of the 1s in the word (as binary do). e.g. using unary you can encode integer number 3 as: "00000111".

But in the paper, they encode real numbers between 0 and 1 using unary and not integer numbers. Using unary, real number are represented as the ratio of the number of bits set to the total number of bits in the word. e.g. the word "00000111" will encode 3/8.

Also, they use rate-coded unary number, meaning that they do not require to stack the 1's at the beginning of the word. 1's a randomly placed within the word.

This allow you to implement stochastic multiplier using a bitwise AND. [1]

e.g. 4/8 could be encoded as "01011001"

2/8 could be encoded as "10010000"

and you can compute the product 4/8 * 2/8 using a bitwise AND of the two word:

"01011001" AND "10010000" = "00010000"

"00010000" encode 1/8 (and 4/8 * 2/8 = 1/8).

Using a serial bit stream rather than a parallel register allow to use a single AND gate.

[1]: https://en.wikipedia.org/wiki/Stochastic_computing

discuss

order

No comments yet.