Guest User

Untitled

a guest
Mar 12th, 2013
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. add swap r!=0 && 15 15-r result
  2. 0 0 0 0 a-b
  3. 0 0 0 1 15-(a-b), 15+b-a
  4.  
  5. 0 0 1 0 (a>b) && 15
  6. 0 0 1 1 (a<=b) && 15
  7.  
  8. 0 1 0 0 b-a
  9. 0 1 0 1 15-(b-a), 15+a-b
  10.  
  11. 0 1 1 0 (a>b) && 15
  12. 0 1 1 1 (a>=b) && 15
  13.  
  14. short
  15. 1 0 0 0 a+b
  16. 1 0 0 1 15-(a+b), 15-a-b
  17.  
  18. 1 0 1 0 (a||b) && 15
  19. 1 0 1 1 (!a && !b) && 15
  20.  
  21. 1 1 0 0 max(a,b)
  22. 1 1 0 1 15-max(a,b), min(15-a,15-b)
  23.  
  24. 1 1 1 0 (b||a) && 15
  25. 1 1 1 1 (!b && !a) && 15
  26.  
  27. The first bit of the instruction controls whether to add or subtract. The
  28. second bit controls whether to short/swap the two inputs. The third bit, if
  29. active, takes the sum/difference produced by the adder/subtractor and sets
  30. output to full power if it isn't zero. The fourth bit activates the analog
  31. inverter.
  32.  
  33. When in subtract mode, the "swap" bit will swap inputs A and B. When in add
  34. mode, the "swap" bit will actually short inputs A and B together, meaning that
  35. both A and B will be equal to max(A,B).
Advertisement
Add Comment
Please, Sign In to add comment