I'm new to VHDL and I want to learn as with examples. I want to build a 16,24 or 32 bit counter for quadrature encoder signals (ie A,B signals). Can someone help me how to create following functionality in VHDL ?
Inputs are (1,2) A, B = A,B quadrature signals (from encoder) ( 3) IDX = Index (from encoder) ( 4) RST = Reset (Low->Reset counter) ( 5) S/P = Serial/Parallel output select (High->Serial output, Low->Parallel output) (6,7) A1,A0 = Output byte selector A1,A0 ([A1,A0] --> [0,0] ->Counter byte0 output, [0,1]->Counter byte1, [1,0]->Counter byte 2, [1,1]->Counter byte3) ( 8) OE = Output Enable (Low->Enabled, High ->High state output) ( 9) SCLK = Serial out clock (If S/P is high (ie serial out selected) then Low to High transition output one bit of the counter value starting from LSB to MSB)
Outputs are (1,2,3,4,5,6,7,8) D0..D7 = Counter value output (A1,A0 selects which byte will be output) (1) = Serial output (if serial output selected on S/P )