Cross-Clock Domain Interface Conversion Circuit

Source: Internet
Author: User
1 module handshake (2 input clka, wra_n, da, clkb, RST, 3 Output Reg [7:0] DB, 4 output Reg wrb_n 5); 6 7 Reg ACK, temp, req1; 8 Reg [7:0] data; 9 always @ (posedge clka or negedge RST) 10 if (! RST) 11 Data <= 8'd0; 12 else if (! Wra_n) 13 Data <= {data [], da}; // data <= {da, data []}; 14 always @ (posedge clkb or negedge RST) 15 if (! RST) 16 begin17 req1 <= 1 'b1; 18 temp <= 1 'b1; 19 end20 else 21 begin22 temp <= wra_n; 23 req1 <= temp; 24 end25 assign wra_n_rising = temp &&(~ Req1); // capture the rising edge of wra_n to enable wrb_n to have a clock cycle of 26 always @ (posedge clkb or negedge RST) 27 if (wra_n_rising) 28 begin29 wrb_n <= 1 'b1; 30 dB <= data; 31 end32 else33 begin34 wrb_n <= 1 'b0; 35 dB <= 8' hxx; 36 end37 endmodule

Requirement: complete two time-domain interface conversion circuits.

Explanation: String Conversion:Data <= {data [], da}; (input starting from D7 and moving left) Data <= {da, data [7]} (input starting from D0, shift right continuously)

 Capture the rising edge of the write signal and convert it to the B-domain enabling signal simultaneously output with the data.

Cross-Clock Domain Interface Conversion Circuit

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.