Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. always @(*)
  2. begin : convert
  3.  
  4. index = 0;
  5.  
  6. for (oh_index = 0; oh_index < NUM_SIGNALS; oh_index++)
  7. begin
  8. if (one_hot[oh_index])
  9. begin
  10. if (DIRECTION == "LSB0")
  11. index = index | oh_index[INDEX_WIDTH - 1:0]; // Use 'or' to avoid synthesizing priority encoder
  12. else
  13. index = index | ~oh_index[INDEX_WIDTH - 1:0];
  14. end
  15. end
  16. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement