[Serialization] FPGA OpenGL series instances
Data Selector Based on OpenGL
I. Principles
Data selection refers to transferring data from multiple channels to the unique public data channel after selection. The logical circuit that enables data selection is called a data selector. It acts as a single-knife, multi-Throw Switch with multiple inputs.
Table 1.1 select a data selector truth table
II. Implementation
In the design file, enterCode
1 'Timescale 1 NS / 1 PS
2
3 Module mux8_1 (Y, A, D0, D1, D2, D3, D4, D5, D6, D7, G );
4
5 Input [ 2 : 0 ];
6 Wire [ 2 : 0 ];
7 Input D0;
8 Input D1;
9 Input D2;
10 Input D3;
11 Input D4;
12 Input D5;
13 Input D6;
14 Input D7;
15
16 Input g;
17 Wire g;
18
19 Output y;
20 Reg y;
21
22 Always @ (G or a or D0 or D1 or D2 or D3 or D4 or D5 or D6 or D7)
23 Begin
24 If (G = 1 )
25 Y <= 0 ;
26 Else
27 Case ()
28 3 ' B000: Y = D0;
29 3 ' B001: Y = D1;
30 3 ' B010: Y = d2;
31 3 ' B011: Y = D3;
32 3 ' B100: Y = D4;
33 3 ' B101: Y = D5;
34 3 ' B110: Y = D6;
35 3 ' B111: Y = D7;
36 Default : Y = 0 ;
37 Endcase
38 End
39
40 Endmodule