Ishan_Bansal

Code for floating values

Jun 7th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.18 KB | None | 0 0
  1. a = Signal(12)
  2. # value of sqrt_2 = 1.414
  3. #migen doesn't support floating values.
  4. a = Signal(181) #181 = 1.414*128
  5.  
  6. b = Signal(12)
  7. b.eq(3)
  8.  
  9. c = Signal(12)
  10. c.eq(b*a)
  11. c.eq(c >> 7)
Add Comment
Please, Sign In to add comment