Debian Codegraph @

examples/tlvds.v

raw
1 /* Using an oscilloscope you can see on pins tlvds_p and tlvds_n the signal with changing polarity.
2 * You can also use a 100 Ohm resistor and two LEDs connected in opposite directions between these pins.
3 */
4 module top (
5 input clk,
6 output tlvds_p,
7 output tlvds_n,
8 input key_i
9 );
10
11 wire key = key_i ^ `INV_BTN;
12 reg [24:0] ctr_q;
13 wire [24:0] ctr_d;
14 wire i_tick;
15
16 // Sequential code (flip-flop)
17 always @(posedge clk)
18 ctr_q <= ctr_d;
19
20 // Combinational code (boolean logic)
21 assign ctr_d = ctr_q + 1'b1;
22 assign i_tick = |ctr_q[24:23];
23
24 /*
25 TLVDS_TBUF diff_buf(
26 .OEN(~key),
27 .O(tlvds_p),
28 .OB(tlvds_n),
29 .I(i_tick)
30 );
31 */
32 TLVDS_OBUF diff_buf(
33 .O(tlvds_p),
34 .OB(tlvds_n),
35 .I(i_tick)
36 );
37
38 endmodule
39