Advertisement
captmicro

langsic_example.txt

Jul 29th, 2012
312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 0.97 KB | None | 0 0
  1. /*
  2. INITIAL IMAGE DIRECTION/ROTATION/WHATEVER ITS CALLED
  3.  
  4. --(w0)--|-----\
  5. --(w1)--| NAND |o--(w0)
  6. --(wN)--|-----/
  7.  
  8. keywords (cant use these as variable names):
  9.     begin, basic, signal, sim_scale, sim_pos,
  10.     sim_hook, if, else, end, high, low, is,
  11.     input, output
  12.  
  13. signal <name> : <type> where type is:
  14.     *** if only name is given no diode is inserted * **
  15.     input: diode allowing current to flow to item
  16.     output: diode allowing current to flow out of item
  17.  
  18. sim_scale <mm> where mm is:
  19.     the relation of one unit to mm (default 10mm, or 1cm)
  20. */
  21.  
  22. begin basic NPN
  23.     signal base;
  24.     signal clct;
  25.     signal emit;
  26.    
  27.     sim_scale 10
  28.     sim_pos base 0,1 1,1
  29.     sim_pos clct 2,2 1,1
  30.     sim_pos emit 2,0 1,1
  31.    
  32.     sim_hook tick
  33.         if high(base)
  34.             emit is clct;
  35.         else
  36.             emit is low;
  37.         end
  38.     end
  39. end
  40.  
  41. being basic NAND_2
  42.     signal in0;
  43.     signal in1;
  44.     signal out0;
  45.    
  46.     sim_hook tick
  47.         out0 is high;
  48.         if high(in0)
  49.             if high(in1) // in1 & in2
  50.                 out0 is low;
  51.             end
  52.         end
  53.     end
  54. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement